/* --- START OF FILE catch-ui.css --- */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    backdrop-filter: blur(2px);
}

.catch-card {
    position: relative;
    background: #202028; 
    border: 4px solid #ffffff;
    outline: 4px solid #000000;
    padding: 24px;
    width: 320px;
    text-align: center;
    color: white;
    image-rendering: pixelated; 
    font-family: 'Press Start 2P', cursive, monospace;
    font-size: 12px;
    line-height: 1.5;
    
    /* ANIMACIÓN DE ENTRADA: Cae y rebota */
    animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 12px 12px 0px rgba(0,0,0,0.5); 
    overflow: hidden; 
}

@keyframes cardEntrance {
    0% { transform: scale(0.3) translateY(-100px); opacity: 0; }
    50% { transform: scale(1.05) translateY(0); opacity: 1; }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

#rarity-text {
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0px #000; 
    position: relative;
    z-index: 2;
}

.divider {
    height: 4px;
    background: #000;
    margin: 20px 0;
    box-shadow: 0 4px 0 rgba(255,255,255,0.1);
}

#fish-name {
    font-size: 16px;
    margin: 15px 0;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 3px 3px 0px #000;
    line-height: 1.4;
    position: relative;
    z-index: 2;
}

.image-container {
    background: #000;
    border: 4px solid rgba(255,255,255,0.1); 
    border-radius: 4px;
    padding: 20px;
    margin: 15px 0;
    position: relative;
}

.image-container::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(#333 15%, transparent 16%), radial-gradient(#333 15%, transparent 16%);
    background-size: 12px 12px;
    opacity: 0.3;
    z-index: 0;
}

#fish-image {
    position: relative;
    z-index: 5;
    width: 128px;
    height: 128px;
    object-fit: contain;
    filter: drop-shadow(6px 6px 0px rgba(0,0,0,0.5));
    animation: pixelFloat 2s infinite steps(8); 
}

/* ESTILO PARA XP EN CATCH UI */
#catch-xp {
    font-size: 10px;
    color: #60a5fa; /* Azul similar a barra XP */
    text-shadow: 1px 1px 0 #000;
    margin-bottom: 10px;
    margin-top: -5px;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

@keyframes pixelFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* --- BOTÓN ANIMADO --- */

#collect-button {
    font-family: 'Press Start 2P', cursive, monospace;
    font-size: 12px;
    color: #000;
    background: #fff;
    border: none;
    padding: 18px 10px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
    transition: transform 0.1s;

    /* Sombra base del botón (efecto 3D biselado) */
    box-shadow: inset -4px -4px 0px 0px rgba(0,0,0,0.2), inset 4px 4px 0px 0px #fff, 4px 4px 0px 0px #000;
    
    /* ANIMACIÓN DEL BOTÓN: Flotación invitando al click */
    animation: btnReady 1.5s infinite ease-in-out;
}

/* Keyframes para el botón flotante */
@keyframes btnReady {
    0%, 100% { 
        transform: translateY(0);
        /* Sombra normal */
        box-shadow: inset -4px -4px 0px 0px rgba(0,0,0,0.2), inset 4px 4px 0px 0px #fff, 4px 4px 0px 0px #000;
    }
    50% { 
        transform: translateY(-4px); 
        /* La sombra negra crece hacia abajo al subir el botón */
        box-shadow: inset -4px -4px 0px 0px rgba(0,0,0,0.2), inset 4px 4px 0px 0px #fff, 4px 8px 0px 0px #000;
    }
}

#collect-button:hover {
    /* Pausamos/Quitamos la animación al hacer hover para control total */
    animation: none; 
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: inset -4px -4px 0px 0px rgba(0,0,0,0.2), inset 4px 4px 0px 0px #fff, 4px 6px 0px 0px #000;
}

#collect-button:active {
    animation: none;
    transform: translateY(2px);
    box-shadow: inset 4px 4px 0px 0px rgba(0,0,0,0.2), 0px 0px 0px 0px #000;
}

/* Efecto de brillo genérico para cartas raras+ */
.shine-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255,255,255,0.4);
    transform: rotate(25deg);
    animation: shinePass 3s infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes shinePass {
    0% { left: -60%; }
    20% { left: 150%; }
    100% { left: 150%; } 
}

/* --- RARITY THEMES & ANIMATIONS --- */

/* COMMON */
.rarity-common { 
    border-color: #94a3b8; 
}
.rarity-common #rarity-text { color: #cbd5e1; }
.rarity-common #collect-button { background: #cbd5e1; }

/* RARE */
.rarity-rare { 
    border-color: #4ade80; 
    box-shadow: 12px 12px 0px rgba(0,0,0,0.5), 0 0 0 4px rgba(74, 222, 128, 0.3);
}
.rarity-rare #rarity-text { 
    color: #4ade80; 
    animation: pulseText 2s infinite;
}
.rarity-rare #collect-button { background: #4ade80; }
.rarity-rare #fish-image {
    filter: drop-shadow(6px 6px 0px rgba(74, 222, 128, 0.4));
}

/* EPIC */
.rarity-epic { 
    border-color: #d946ef; 
    box-shadow: 12px 12px 0px rgba(0,0,0,0.5), 0 0 0 4px rgba(217, 70, 239, 0.3);
}
.rarity-epic.catch-card::after {
    content: '';
    position: absolute;
    top: -50%; left: -60%; width: 20%; height: 200%;
    background: rgba(255,255,255,0.2);
    transform: rotate(25deg);
    animation: shinePass 4s infinite linear;
}

.rarity-epic #rarity-text { color: #d946ef; text-shadow: 3px 3px 0 #4a044e; }
.rarity-epic #collect-button { background: #d946ef; color: white; text-shadow: 2px 2px 0 #000;}

/* LEGENDARY */
.rarity-legendary { 
    border-color: #fbbf24; 
    animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), legendaryShake 2s infinite; 
}

.rarity-legendary::before {
    content: '';
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    z-index: -1;
    background: linear-gradient(45deg, #fbbf24, #ef4444, #d946ef, #3b82f6, #fbbf24);
    background-size: 400%;
    animation: rainbowBorder 4s linear infinite;
    box-shadow: 12px 12px 0px rgba(0,0,0,0.5);
}

.rarity-legendary #rarity-text { 
    color: #fbbf24; 
    text-shadow: 3px 3px 0 #854d0e;
    animation: pulseText 0.5s infinite alternate; 
}

.rarity-legendary .image-container {
    background: radial-gradient(circle, #713f12 0%, #000 100%);
    overflow: hidden;
}

.rarity-legendary .image-container::after {
    content: "";
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: repeating-conic-gradient(from 0deg, rgba(251, 191, 36, 0.1) 0deg 20deg, transparent 20deg 40deg);
    animation: sunburstSpin 10s infinite linear;
    z-index: 1;
}

/* El botón legendario tiene su propia animación de pulso dorado, que sobrescribe a la genérica */
.rarity-legendary #collect-button { 
    background: #fbbf24; 
    color: #451a03;
    animation: pulseButton 1s infinite alternate;
}

/* --- ANIMATION KEYFRAMES --- */

@keyframes pulseText {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

@keyframes legendaryShake {
    0% { transform: translate(0, 0); }
    2% { transform: translate(2px, 0); }
    4% { transform: translate(-2px, 0); }
    6% { transform: translate(0, 0); }
    100% { transform: translate(0, 0); } 
}

@keyframes rainbowBorder {
    0% { background-position: 0% 50%; }
    100% { background-position: 400% 50%; }
}

@keyframes sunburstSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseButton {
    from { box-shadow: inset -4px -4px 0px 0px rgba(0,0,0,0.2), inset 4px 4px 0px 0px #fff, 0 0 10px #fbbf24; }
    to { box-shadow: inset -4px -4px 0px 0px rgba(0,0,0,0.2), inset 4px 4px 0px 0px #fff, 0 0 25px #fbbf24; }
}

/* --- Fish Catch Card Accent --- */
.catch-card:not(.rarity-legendary)::before {
    content: "FISH CATCH";
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 6px;
    border: 2px solid #00f5ff;
    background: #020617;
    color: #00f5ff;
    font-family: 'Press Start 2P', cursive;
    font-size: 7px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 #000;
}

#collect-button {
    background: linear-gradient(180deg, #22d3ee, #7c3aed) !important;
    color: #fff !important;
    border-color: #020617 !important;
}

#fish-name::after {
    content: "  -> $UNIFISH";
    color: #d946ef;
    font-size: 8px;
}
