/**
 * =============================================
 * TEMA: BINGU Oficial
 * Fondo blanco, acentos azul (#1abcf5) y rosa (#ff1dba)
 * =============================================
 */

/* ========== FUENTES ========== */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700;800&display=swap');

/* ========== FONDO GENERAL ========== */
body {
    background: #fff;
    font-family: 'Baloo 2', cursive;
}

/* ========== CONTENEDOR PRINCIPAL ========== */
.bingo-container {
    background: white;
    border: 2px solid #e8edf2;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.04),
        0 20px 60px rgba(26,188,245,0.08),
        0 20px 60px rgba(255,29,186,0.05);
}

/* ========== TABLERO ========== */
.board {
    background: linear-gradient(145deg, #f8fbff, #fef8ff);
    border-radius: 14px;
    border: 1px solid #e8edf5;
}

/* ========== CELDAS DE NÚMEROS ========== */
.number-cell {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(18px, 3.2vw, 44px);
    font-weight: 700;
    color: #b0bec5;
    background: #f5f7fa;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.number-cell.called {
    font-size: clamp(20px, 3.6vw, 50px);
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #1abcf5, #0ea5db);
    border-color: #0ea5db;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
    box-shadow:
        0 4px 12px rgba(26,188,245,0.35),
        inset 0 1px 0 rgba(255,255,255,0.25);
}

.number-cell.called::after {
    content: ''; position: absolute;
    width: 40%; height: 20%; top: 10%; left: 15%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.3), transparent);
    border-radius: 50%; transform: rotate(-15deg);
    pointer-events: none;
}

/* Celdas alternas -> rosa */
.number-cell.called.pink-variant {
    background: linear-gradient(135deg, #ff1dba, #e6109f);
    border-color: #e6109f;
    box-shadow:
        0 4px 12px rgba(255,29,186,0.35),
        inset 0 1px 0 rgba(255,255,255,0.25);
}

/* Animación de entrada: tilt */
.number-cell.called.just-called {
    animation: cell-tilt-right 0.5s ease-out;
}
.number-cell.called.just-called.tilt-left {
    animation-name: cell-tilt-left;
}

@keyframes cell-tilt-right {
    0% { transform: rotate(0deg); }
    40% { transform: rotate(4deg); }
    70% { transform: rotate(-1.5deg); }
    100% { transform: rotate(0deg); }
}
@keyframes cell-tilt-left {
    0% { transform: rotate(0deg); }
    40% { transform: rotate(-4deg); }
    70% { transform: rotate(1.5deg); }
    100% { transform: rotate(0deg); }
}

/* ========== LOGO ========== */
.logo {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(24px, 4vw, 60px);
    font-weight: 800;
    background: linear-gradient(135deg, #1abcf5 0%, #ff1dba 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    animation: logo-float 5s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-4px); }
    75% { transform: translateY(3px); }
}

/* ========== NÚMERO ACTUAL ========== */
.current-number {
    background: white;
    border-radius: 50%;
    font-family: 'Baloo 2', cursive;
    font-size: clamp(60px, 13vw, 200px);
    font-weight: 800;
    color: #1a1a2e;
    position: relative;
    line-height: 1;
    overflow: hidden;
    text-align: center;
    transition: box-shadow 0.4s ease;
    box-shadow: 0 0 0 clamp(4px, 0.5vw, 7px) #d5d9e0;
}

.current-number.empty {
    font-size: clamp(35px, 7vw, 110px);
    color: #d0d5dd;
}

.current-number:not(.empty) {
    animation: current-number-appear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes current-number-appear {
    0% {
        transform: scale(0.85);
        box-shadow: 0 0 0 clamp(4px, 0.5vw, 7px) #1abcf5, 0 0 35px rgba(26,188,245,0.6), 0 0 35px rgba(255,29,186,0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 clamp(4px, 0.5vw, 7px) #ff1dba, 0 0 50px rgba(26,188,245,0.5), 0 0 50px rgba(255,29,186,0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 clamp(4px, 0.5vw, 7px) #d5d9e0;
    }
}

/* ========== ÚLTIMAS BOLAS ========== */
.last-numbers h3 {
    color: #9ca3af;
    font-family: 'Baloo 2', cursive;
    font-size: clamp(18px, 2.24vw, 33px);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.last-ball {
    border-radius: 50%;
    font-family: 'Baloo 2', cursive;
    font-size: clamp(20px, 3.5vw, 55px);
    font-weight: 700;
    color: #fff;
    transition: all 0.3s ease;
}

/* Alternar colores azul/rosa en bolas */
.last-ball:nth-child(odd) {
    background: linear-gradient(135deg, #1abcf5, #0ea5db);
    box-shadow: 0 4px 15px rgba(26,188,245,0.3);
}
.last-ball:nth-child(even) {
    background: linear-gradient(135deg, #ff1dba, #e6109f);
    box-shadow: 0 4px 15px rgba(255,29,186,0.3);
}

.last-ball.empty {
    background: #f5f7fa;
    color: transparent;
    box-shadow: none;
    border: 2px solid #e8ecf0;
}

.last-ball:not(.empty) {
    animation: last-ball-enter 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes last-ball-enter {
    0% { transform: scale(0.85); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* ========== ESTADÍSTICAS ========== */
.stats,
.game-info .stats {
    color: #9ca3af;
    font-family: 'Baloo 2', cursive;
    font-size: clamp(21px, 2.3vw, 34px);
}

.bingo-container.mode-90 .last-numbers h3,
.bingo-container.mode-75 .last-numbers h3 {
    font-size: clamp(20px, 2.6vw, 36px) !important;
}

.bingo-container.mode-90 .stats,
.bingo-container.mode-90 .game-info .stats,
.bingo-container.mode-75 .stats,
.bingo-container.mode-75 .game-info .stats {
    font-size: clamp(20px, 2.6vw, 36px) !important;
}

.stats span {
    background: linear-gradient(135deg, #1abcf5, #ff1dba);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* ========== ANIMACIÓN ALEATORIA (VIDA DEL TABLERO) ========== */
.number-cell.called.random-bounce {
    animation: cell-glow-pulse 2s ease-in-out;
}

@keyframes cell-glow-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.06); filter: brightness(1.1); }
}

/* ========== ESTADO FINALIZADO ========== */
.game-finished .current-number {
    animation: finish-pulse 1s infinite;
}

@keyframes finish-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 30px rgba(26,188,245,0.2), 0 8px 30px rgba(255,29,186,0.15);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 12px 40px rgba(26,188,245,0.35), 0 12px 40px rgba(255,29,186,0.25);
    }
}

.game-finished .logo {
    animation: logo-celebrate 0.5s ease-in-out infinite;
}

@keyframes logo-celebrate {
    0%, 100% { transform: rotate(-2deg) scale(1); }
    50% { transform: rotate(2deg) scale(1.05); }
}

/* ========== GAME NUMBER OVERLAY ========== */
.game-number-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    justify-content: center;
    align-items: center;
    z-index: 650;
    background: linear-gradient(135deg, #f0f8ff, #fff0f8);
}

.game-number-overlay.active {
    display: flex;
}

.game-number-container {
    width: 100vw;
    height: calc(100vw * 9 / 16);
    max-height: 100vh;
    max-width: calc(100vh * 16 / 9);
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-number-text {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 800;
    background: linear-gradient(135deg, #1abcf5, #ff1dba);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: game-number-pulse 1s ease-in-out infinite;
}

@keyframes game-number-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}
