:root {
    color-scheme: dark;
    --panel: #121826;
    --panelTwo: #172235;
    --line: #26364f;
    --text: #eff5ff;
    --muted: #9fb1ca;
    --accent: #36d399;
    --danger: #ff6b6b;
    --gold: #ffd166;
}

body {
    min-height: 100vh;
    margin: 0;
    background: #08111f;
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid var(--line);
    background: rgba(8, 17, 31, 0.92);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-weight: 800;
    letter-spacing: 0;
    font-size: 1.15rem;
}

.layout {
    width: min(1220px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 2rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.room-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.room-row:last-child {
    border-bottom: 0;
}

.muted {
    color: var(--muted);
}

.ball {
    width: min(42vw, 170px);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: clamp(2rem, 9vw, 4.3rem);
    font-weight: 900;
    color: #07111f;
    background: radial-gradient(circle at 32% 28%, #ffffff 0 11%, var(--gold) 12% 56%, #ef8f00 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.game-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.bingo-card {
    background: var(--panelTwo);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
}

.bingo-headers,
.bingo-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
}

.bingo-headers span {
    text-align: center;
    font-weight: 900;
    color: var(--gold);
}

.cell {
    aspect-ratio: 1;
    border: 1px solid #3a4f71;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #0d1727;
    color: var(--text);
    font-weight: 800;
    min-width: 0;
}

.cell.marked {
    background: var(--accent);
    color: #03120d;
    border-color: var(--accent);
}

.cell.free {
    background: var(--gold);
    color: #1b1300;
}

.chat-list {
    height: 260px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
    background: #0d1727;
}

.chat-item {
    margin-bottom: 0.5rem;
}

.status-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    color: var(--muted);
    white-space: nowrap;
}

@media (max-width: 880px) {
    .game-grid,
    .room-row {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
