/* ─── Design Tokens ─────────────────────────────── */
:root {
    --bingo-navy: #0F1B2D;
    --bingo-card: #162238;
    --bingo-accent: #F5C842;
    --bingo-green: #27D98B;
    --bingo-red: #FF5757;
    --bingo-blue: #4B9FFF;
    --bingo-muted: #8899AA;
    --bingo-border: rgba(255,255,255,0.07);
    --font-display: 'Nunito', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

/* ─── Base ───────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bingo-navy);
    color: #E8EDF3;
    font-family: var(--font-body);
    min-height: 100vh;
}

/* ─── Splash ─────────────────────────────────────── */
.splash-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 1.5rem;
}

.splash-ball {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bingo-accent);
    color: var(--bingo-navy);
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }
}

/* ─── Page Layout ────────────────────────────────── */
.page-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ─── Section Header ─────────────────────────────── */
.section-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bingo-accent);
    margin-bottom: 0.5rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    margin: 0 0 1.5rem;
    color: #fff;
}

/* ─── Glass Card ─────────────────────────────────── */
.glass-card {
    background: var(--bingo-card);
    border: 1px solid var(--bingo-border);
    border-radius: 16px;
    padding: 2rem;
}

/* ─── Bingo Card Grid ────────────────────────────── */
.bingo-card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 360px;
    margin: 0 auto;
}

.bingo-header-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 360px;
    margin: 0 auto 6px;
}

.bingo-col-label {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    border-radius: 10px;
}

    .bingo-col-label.B {
        background: #3B4FE4;
        color: #fff;
    }

    .bingo-col-label.I {
        background: #E43B6A;
        color: #fff;
    }

    .bingo-col-label.N {
        background: #E4A63B;
        color: #fff;
    }

    .bingo-col-label.G {
        background: #3BE4A6;
        color: #0F1B2D;
    }

    .bingo-col-label.O {
        background: #A63BE4;
        color: #fff;
    }

.bingo-cell {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(255,255,255,0.06);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: #C8D4E3;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
    user-select: none;
}

    .bingo-cell:hover:not(.marked):not(.free) {
        border-color: var(--bingo-accent);
        color: var(--bingo-accent);
        transform: scale(1.04);
    }

    .bingo-cell.marked {
        background: var(--bingo-green);
        border-color: var(--bingo-green);
        color: #0F1B2D;
        font-weight: 900;
        animation: cellPop 0.25s ease;
    }

    .bingo-cell.free {
        background: var(--bingo-accent);
        border-color: var(--bingo-accent);
        color: var(--bingo-navy);
        font-size: 0.75rem;
        font-weight: 900;
        letter-spacing: 0.05em;
        cursor: default;
    }

    .bingo-cell.just-called {
        animation: cellGlow 0.8s ease forwards;
    }

@keyframes cellPop {
    0% {
        transform: scale(0.85);
    }

    60% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes cellGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(39,217,139,0.8);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(39,217,139,0);
    }

    100% {
        box-shadow: none;
    }
}

/* ─── Number Board ───────────────────────────────── */
.number-board {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.number-chip {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.08);
    color: var(--bingo-muted);
    transition: all 0.2s;
}

    .number-chip.drawn {
        background: var(--bingo-accent);
        border-color: var(--bingo-accent);
        color: var(--bingo-navy);
        animation: chipIn 0.3s ease;
    }

        .number-chip.drawn.latest {
            background: var(--bingo-green);
            border-color: var(--bingo-green);
            transform: scale(1.15);
        }

@keyframes chipIn {
    from {
        transform: scale(0.6);
        opacity: 0.4;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ─── Number Called Banner ───────────────────────── */
.number-called-banner {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    background: var(--bingo-card);
    border: 2px solid var(--bingo-green);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: slideIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

.number-called-ball {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bingo-accent);
    color: var(--bingo-navy);
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.number-called-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bingo-green);
    margin-bottom: 2px;
}

.number-called-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ─── BINGO Winner Overlay ───────────────────────── */
.bingo-winner-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10,18,30,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.bingo-winner-box {
    text-align: center;
    padding: 3rem 4rem;
    background: var(--bingo-card);
    border-radius: 24px;
    border: 2px solid var(--bingo-accent);
    box-shadow: 0 0 60px rgba(245,200,66,0.3);
    animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.bingo-winner-emoji {
    font-size: 5rem;
    margin-bottom: 0.5rem;
    display: block;
    animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-12px);
    }
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ─── Player Status Badge ────────────────────────── */
.player-badge-ready {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(39,217,139,0.12);
    color: var(--bingo-green);
    border: 1px solid rgba(39,217,139,0.25);
    border-radius: 99px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.player-badge-waiting {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(136,153,170,0.12);
    color: var(--bingo-muted);
    border: 1px solid rgba(136,153,170,0.2);
    border-radius: 99px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ─── Latest Number Display ──────────────────────── */
.latest-number-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.latest-ball {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bingo-accent) 0%, #E8A800 100%);
    color: var(--bingo-navy);
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(245,200,66,0.35);
    animation: ballDrop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes ballDrop {
    from {
        transform: translateY(-24px) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ─── MudBlazor Overrides ────────────────────────── */
.mud-card {
    background: var(--bingo-card) !important;
}

.mud-paper {
    background: var(--bingo-card) !important;
}

.mud-button-filled.mud-button-filled-primary {
    background: var(--bingo-accent) !important;
    color: var(--bingo-navy) !important;
    font-family: var(--font-display) !important;
    font-weight: 800 !important;
}

.mud-button-filled.mud-button-filled-success {
    background: var(--bingo-green) !important;
    color: var(--bingo-navy) !important;
}

.mud-chip.mud-chip-color-primary {
    background: rgba(245,200,66,0.15) !important;
    color: var(--bingo-accent) !important;
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 600px) {
    .bingo-cell {
        height: 52px;
        font-size: 1rem;
    }

    .bingo-col-label {
        height: 38px;
        font-size: 1.2rem;
    }

    .number-chip {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }

    .page-wrapper {
        padding: 1rem;
    }
}
