/* === BINGO Grid Cells === */
#bingoGrid {
    min-height: 0;
}

.bingo-cell {
    aspect-ratio: auto;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.bingo-cell.cell-drawn {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.bingo-cell.cell-last {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px white, 0 4px 16px rgba(99,102,241,0.4);
    z-index: 10;
}
.dark .bingo-cell.cell-last {
    box-shadow: 0 0 0 3px #111827, 0 4px 16px rgba(99,102,241,0.6);
}

@keyframes cellPop {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}
.bingo-cell.cell-pop {
    animation: cellPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* === Last Number === */
@keyframes slideInDown {
    0% { transform: translateY(-30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
.anim-slide {
    animation: slideInDown 0.35s ease-out both;
}

/* === Winner Celebration === */
@keyframes celebrate {
    0% { transform: scale(0) rotate(-5deg); opacity: 0; }
    60% { transform: scale(1.05) rotate(1deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.anim-celebrate {
    animation: celebrate 0.5s ease-out both;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 2px; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }

/* === Offline indicator === */
@keyframes offlinePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.offline-dot {
    animation: offlinePulse 1.5s ease-in-out infinite;
}
html, body {
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* === Mobile tweaks === */
@media (max-width: 1023px) {
    #bingoGrid {
        gap: 1px;
    }

    .bingo-cell {
        border-radius: 2px;
        min-width: 0;
    }

    .bingo-cell.cell-drawn {
        box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    }

    .bingo-cell.cell-last {
        transform: scale(1.06);
        box-shadow: 0 0 0 2px white, 0 2px 10px rgba(99,102,241,0.35);
    }

    .dark .bingo-cell.cell-last {
        box-shadow: 0 0 0 2px #111827, 0 2px 10px rgba(99,102,241,0.5);
    }

    @keyframes cellPop {
        0% { transform: scale(0.3); opacity: 0; }
        50% { transform: scale(1.15); }
        100% { transform: scale(1); opacity: 1; }
    }

    #lastNumberDisplay {
        min-width: 70px;
    }
}

/* === Responsive Scaling for Large Screens & Projections === */
@media (min-width: 1024px) {
    /* Dynamic scaling for BINGO grid cell numbers based on viewport height to prevent vertical overflow.
       Removed padding completely so flexbox handles vertical centering without adding height. */
    .bingo-cell {
        font-size: clamp(0.9rem, 2.2vh, 2.2rem) !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        line-height: 1 !important;
    }

    /* Dynamic scaling for B-I-N-G-O column header letters */
    #bingoWrapper .grid-cols-5 > div {
        font-size: clamp(1.1rem, 3.2vh, 2.8rem) !important;
        line-height: 1.2;
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }

    /* Extra large sizes for the Last Number Display in the sidebar */
    #lastLetter {
        font-size: clamp(2.5rem, 12vh, 8rem) !important;
        line-height: 1;
    }
    #lastNum {
        font-size: clamp(2rem, 9vh, 6.5rem) !important;
        line-height: 1;
        margin-top: 0.5rem;
    }
    #lastNumberDisplay {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    /* Make the prize display text stand out more on big screens */
    #prizeName {
        font-size: clamp(0.9rem, 2.2vh, 1.8rem) !important;
        line-height: 1.3;
    }
}

