/* ============================================================================
   SudokuKudos - Stylesheet
   Modern gaming UI: dark-first glassmorphism with blue/purple/gold accents,
   full light-theme override, and a mobile-first responsive layout.
   ============================================================================ */

/* ---------------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------------- */
:root {
    --color-bg: #0b0e1a;
    --color-bg-alt: #11162a;
    --color-surface: rgba(255, 255, 255, 0.06);
    --color-surface-strong: rgba(255, 255, 255, 0.1);
    --color-border: rgba(255, 255, 255, 0.12);
    --color-text: #eef0fa;
    --color-text-muted: #9aa0c0;

    --color-blue: #5b8cff;
    --color-blue-dark: #3d63d1;
    --color-purple: #9b6bff;
    --color-purple-dark: #7648d6;
    --color-gold: #ffcf5c;
    --color-gold-dark: #e0a92e;
    --color-green: #4fd18b;
    --color-red: #ff6b6b;

    --gradient-primary: linear-gradient(135deg, var(--color-blue), var(--color-purple));
    --gradient-gold: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 20px 40px rgba(91, 140, 255, 0.15);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-fast: 150ms ease;
    --transition-medium: 300ms ease;
}

:root[data-theme="light"] {
    --color-bg: #f3f5fc;
    --color-bg-alt: #e9ecf9;
    --color-surface: rgba(255, 255, 255, 0.65);
    --color-surface-strong: rgba(255, 255, 255, 0.85);
    --color-border: rgba(20, 24, 50, 0.1);
    --color-text: #171a2b;
    --color-text-muted: #565c7d;
    --shadow-soft: 0 10px 30px rgba(20, 24, 60, 0.1);
    --shadow-glow: 0 0 0 1px rgba(20, 24, 60, 0.05), 0 20px 40px rgba(91, 140, 255, 0.12);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --color-bg: #f3f5fc;
        --color-bg-alt: #e9ecf9;
        --color-surface: rgba(255, 255, 255, 0.65);
        --color-surface-strong: rgba(255, 255, 255, 0.85);
        --color-border: rgba(20, 24, 50, 0.1);
        --color-text: #171a2b;
        --color-text-muted: #565c7d;
        --shadow-soft: 0 10px 30px rgba(20, 24, 60, 0.1);
        --shadow-glow: 0 0 0 1px rgba(20, 24, 60, 0.05), 0 20px 40px rgba(91, 140, 255, 0.12);
    }
}

/* ---------------------------------------------------------------------
   Reset & base
   --------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { height: 100%; background: var(--color-bg); }
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at 15% 0%, rgba(155, 107, 255, 0.18), transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(91, 140, 255, 0.16), transparent 45%),
        var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--color-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
.muted { color: var(--color-text-muted); }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.accent { background: var(--gradient-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------------------------------------------------------------
   Layout shell
   --------------------------------------------------------------------- */
.app-shell { min-height: 100%; display: flex; flex-direction: column; }
.site-main { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 24px 20px 60px; }
.glass-panel {
    background: var(--color-surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}
.panel { padding: 24px; }

/* ---------------------------------------------------------------------
   Header / nav
   --------------------------------------------------------------------- */
.site-header {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: space-between;
    margin: 16px 20px 0;
    padding: 14px 24px;
    position: sticky;
    top: 16px;
    z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 800; color: var(--color-text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; object-fit: contain; border-radius: 50%; }
.site-nav { display: flex; gap: 20px; flex: 1; justify-content: center; }
.site-nav a { color: var(--color-text-muted); font-weight: 600; }
.site-nav a:hover { color: var(--color-text); text-decoration: none; }
.nav-toggle {
    display: none;
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    width: 38px; height: 38px;
    font-size: 1.1rem; line-height: 1;
    cursor: pointer;
    color: var(--color-text);
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; background: var(--color-surface-strong); padding: 6px 12px; border-radius: 999px; }
.user-kudos { color: var(--color-gold); font-weight: 700; }
.user-profile-link { display: flex; align-items: center; gap: 6px; color: var(--color-text); font-weight: 700; }
.user-profile-link:hover { text-decoration: none; color: var(--color-blue); }
.user-avatar { font-size: 1.1rem; line-height: 1; }
.theme-toggle {
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    width: 38px; height: 38px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--color-text);
}
.announcement-banner {
    max-width: 1200px; margin: 12px auto 0; padding: 10px 20px;
    background: var(--gradient-primary); color: #fff; border-radius: var(--radius-md);
    font-weight: 600; text-align: center;
}
.announcement-banner.active-session-banner { background: var(--gradient-gold); color: #3a2b00; }
.announcement-banner.active-session-banner a { color: inherit; text-decoration: underline; font-weight: 800; }

/* ---------------------------------------------------------------------
   Buttons & forms
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: var(--radius-sm);
    padding: 10px 18px; font-size: 0.95rem; font-weight: 700;
    cursor: pointer; transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
    color: #fff; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--gradient-primary); box-shadow: 0 8px 20px rgba(91, 140, 255, 0.35); }
.btn-secondary { background: var(--color-surface-strong); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-success { background: linear-gradient(135deg, var(--color-green), #2fa66c); }
.btn-danger { background: linear-gradient(135deg, var(--color-red), #c0392b); }
.btn-ghost { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-ghost.btn-danger { color: var(--color-red); border-color: rgba(255, 107, 107, 0.4); background: transparent; }
.btn-lg { padding: 16px 28px; font-size: 1.1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; }
.btn-block { width: 100%; }

form label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.9rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
    width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--color-border); background: var(--color-bg-alt); color: var(--color-text);
    font-size: 1rem; font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--color-blue); outline-offset: 1px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 14px; }
.checkbox-label input { width: auto; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.admin-reason-input { width: 140px; padding: 4px 8px; font-size: 0.8rem; }
.admin-search { margin: 12px 0; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; }
.alert-error { background: rgba(255, 107, 107, 0.15); color: var(--color-red); border: 1px solid rgba(255, 107, 107, 0.35); }
.alert-success { background: rgba(79, 209, 139, 0.15); color: var(--color-green); border: 1px solid rgba(79, 209, 139, 0.35); }
.form-error { color: var(--color-red); font-weight: 600; margin-top: 8px; }

/* ---------------------------------------------------------------------
   Hero / homepage
   --------------------------------------------------------------------- */
.hero { text-align: center; padding: 56px 24px; margin-bottom: 24px; }
.hero-logo { width: 240px; height: 240px; object-fit: contain; }
.hero-title { font-size: 3rem; font-weight: 900; }
.hero-tagline { font-size: 1.15rem; color: var(--color-text-muted); max-width: 560px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-hint { margin-top: 22px; color: var(--color-text-muted); }

.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-huge { font-size: 2.6rem; font-weight: 900; background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 6px 0; }
.link-more { display: inline-block; margin-top: 12px; font-weight: 700; }

/* ---------------------------------------------------------------------
   Tables & lists
   --------------------------------------------------------------------- */
.mini-table, .data-table { width: 100%; border-collapse: collapse; }
.mini-table th, .data-table th { text-align: left; color: var(--color-text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--color-border); }
.mini-table td, .data-table td { padding: 10px; border-bottom: 1px solid var(--color-border); }
.table-scroll { overflow-x: auto; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.mini-list li:last-child { border-bottom: none; }
.panel-header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.sort-tabs a { padding: 6px 14px; border-radius: 999px; background: var(--color-surface-strong); margin-left: 6px; }
.sort-tabs a.active { background: var(--gradient-primary); color: #fff; }
.content-panel h2 { margin-top: 1.6em; color: var(--color-purple); }

/* ---------------------------------------------------------------------
   Badges
   --------------------------------------------------------------------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: var(--color-surface-strong); }
.badge-host { background: var(--gradient-gold); color: #3a2b00; }
.badge-ready { color: var(--color-text-muted); }
.badge-ready.is-ready { background: rgba(79, 209, 139, 0.2); color: var(--color-green); }
.badge-danger { background: rgba(255, 107, 107, 0.2); color: var(--color-red); }

/* ---------------------------------------------------------------------
   Modals
   --------------------------------------------------------------------- */
.modal {
    position: fixed; inset: 0; background: rgba(5, 7, 15, 0.6);
    display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal[hidden] { display: none; }
.modal-content { position: relative; padding: 32px; max-width: 460px; width: 100%; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--color-text-muted); font-size: 1.4rem; cursor: pointer; }
.modal-content-lg { max-width: 560px; }
.lobby-code-form { margin-top: 6px; }
.lobby-code-form input { flex: 1; }
.lobby-search-input { margin: 12px 0; }
.lobby-browse-list { max-height: 320px; overflow-y: auto; }
.lobby-row {
    display: flex; align-items: center; gap: 8px;
    background: var(--color-surface-strong);
    padding: 10px 12px; margin-bottom: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border-bottom: none;
    transition: background var(--transition-fast);
}
.lobby-row:last-child { margin-bottom: 0; }
.lobby-row:hover { background: rgba(91, 140, 255, 0.15); }
.lobby-row-code { min-width: 62px; font-weight: 800; letter-spacing: 0.05em; color: var(--color-blue); }
.lobby-row .badge { font-weight: 700; white-space: nowrap; }
.lobby-row .badge-ready.is-ready { background: var(--color-green); color: #06341f; }
.lobby-row .badge-danger { background: var(--color-red); color: #3d0d0d; }

/* ---------------------------------------------------------------------
   Auth pages
   --------------------------------------------------------------------- */
.auth-panel { max-width: 420px; margin: 40px auto; padding: 36px; }
.auth-links { margin-top: 20px; text-align: center; color: var(--color-text-muted); }
.auth-form button[type="submit"] { margin-top: 18px; }

/* ---------------------------------------------------------------------
   Lobby
   --------------------------------------------------------------------- */
.lobby-shell { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.lobby-main { padding: 28px; position: relative; }
.lobby-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.lobby-code { color: var(--color-gold); letter-spacing: 0.08em; }
.player-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.player-row { display: flex; align-items: center; gap: 10px; background: var(--color-surface-strong); padding: 10px 14px; border-radius: var(--radius-sm); flex-wrap: wrap; }
.player-name { font-weight: 700; flex: 1; min-width: 100px; }
.conn-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-green); }
.conn-dot.disconnected { background: var(--color-red); }
.player-ping { font-size: 0.8rem; color: var(--color-text-muted); min-width: 40px; text-align: right; }
.player-host-controls { display: flex; gap: 6px; }
.lobby-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.countdown-overlay {
    position: absolute; inset: 0; background: rgba(5, 7, 15, 0.75);
    display: flex; align-items: center; justify-content: center; border-radius: var(--radius-lg);
    z-index: 10;
}
.countdown-overlay[hidden] { display: none; }
#countdown-number { font-size: 6rem; font-weight: 900; background: var(--gradient-gold); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pulse 1s ease infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.lobby-chat, .chat-panel { display: flex; flex-direction: column; padding: 20px; max-height: 560px; }
.chat-log { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; max-height: 400px; }
.chat-msg { font-size: 0.9rem; }
.chat-msg.system { color: var(--color-text-muted); font-style: italic; }
.chat-form { display: flex; gap: 8px; margin-top: 12px; }
.chat-form input { flex: 1; }

/* ---------------------------------------------------------------------
   Game screen
   --------------------------------------------------------------------- */
.game-topbar { display: flex; gap: 24px; padding: 16px 24px; margin-bottom: 20px; flex-wrap: wrap; justify-content: space-around; }
.game-stat { display: flex; flex-direction: column; align-items: center; }
.stat-label { font-size: 0.75rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.4rem; font-weight: 800; }
.game-body { display: grid; grid-template-columns: minmax(0, 640px) 1fr; gap: 24px; align-items: start; }
.game-board-column { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.game-sidebar { display: flex; flex-direction: column; gap: 20px; }

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    width: 100%;
    max-width: 560px;
    aspect-ratio: 1 / 1;
    background: var(--color-surface-strong);
    border: 3px solid var(--color-text);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}
.sudoku-cell {
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(0.9rem, 2.6vw, 1.4rem); font-weight: 700;
    border: 1px solid var(--color-border);
    background: transparent;
    cursor: pointer;
    position: relative;
    color: var(--color-text);
    user-select: none;
}
.sudoku-cell.given { color: var(--color-text-muted); cursor: default; background: rgba(255, 255, 255, 0.03); }
.sudoku-cell.selected { background: rgba(91, 140, 255, 0.4); box-shadow: inset 0 0 0 2px var(--color-blue); z-index: 1; }
.sudoku-cell.peer { background: rgba(91, 140, 255, 0.08); }
.sudoku-cell.correct-flash { animation: flash-correct 500ms ease; }
.sudoku-cell.error-flash { animation: flash-error 500ms ease; }
@keyframes flash-correct { 0% { background: rgba(79, 209, 139, 0.5); } 100% { background: transparent; } }
@keyframes flash-error { 0% { background: rgba(255, 107, 107, 0.5); } 100% { background: transparent; } }
.sudoku-cell:nth-child(3n) { border-right: 2px solid var(--color-text); }
.sudoku-cell:nth-child(9n) { border-right: 1px solid var(--color-border); }
.sudoku-row-thick { border-bottom: 2px solid var(--color-text) !important; }
.sudoku-cell .notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; height: 100%; font-size: 0.55rem; font-weight: 500; color: var(--color-text-muted); }
.sudoku-cell .notes-grid span { display: flex; align-items: center; justify-content: center; }

.number-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; max-width: 560px; }
.num-btn {
    padding: 14px 0; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
    background: var(--color-surface-strong); color: var(--color-text); font-size: 1.1rem; font-weight: 700; cursor: pointer;
}
.num-btn:hover { background: var(--gradient-primary); color: #fff; }
.num-erase { font-size: 1.3rem; }
.board-toolbar { display: flex; gap: 10px; }
.board-toolbar .btn.is-active { background: var(--gradient-primary); color: #fff; }

.live-rankings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.live-rankings li { display: flex; align-items: center; gap: 10px; background: var(--color-surface-strong); padding: 10px 12px; border-radius: var(--radius-sm); }
.rank-position { font-weight: 900; width: 24px; color: var(--color-gold); }
.rank-name { flex: 1; font-weight: 700; }
.rank-progress-bar { width: 90px; height: 8px; border-radius: 4px; background: var(--color-bg-alt); overflow: hidden; }
.rank-progress-fill { display: block; height: 100%; background: var(--gradient-primary); transition: width var(--transition-medium); }
.rank-kudos { color: var(--color-gold); font-weight: 700; font-size: 0.85rem; }
.mini-silhouette { display: grid; grid-template-columns: repeat(9, 1fr); width: 36px; height: 36px; gap: 1px; }
.mini-silhouette span { background: var(--color-bg-alt); border-radius: 1px; }
.mini-silhouette span.filled { background: var(--color-blue); }

/* ---------------------------------------------------------------------
   Profile
   --------------------------------------------------------------------- */
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.profile-avatar-display {
    display: flex; align-items: center; justify-content: center;
    width: 76px; height: 76px; flex-shrink: 0;
    font-size: 2.6rem; border-radius: 50%;
    background: var(--color-surface-strong); border: 1px solid var(--color-border);
}
.profile-header h1 { margin-bottom: 4px; }
.profile-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; margin-top: 20px; }
.profile-avatar-panel { grid-row: span 2; }
.avatar-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 14px 0 18px; }
.avatar-option {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1 / 1; border-radius: var(--radius-sm);
    background: var(--color-surface-strong); border: 2px solid transparent;
    font-size: 1.4rem; cursor: pointer; transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.avatar-option:hover { transform: translateY(-1px); }
.avatar-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.avatar-option.is-selected,
.avatar-option:has(input:checked) { border-color: var(--color-blue); background: rgba(91, 140, 255, 0.18); }

/* ---------------------------------------------------------------------
   Admin
   --------------------------------------------------------------------- */
.admin-tabs { display: flex; gap: 6px; padding: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-tabs a { padding: 8px 16px; border-radius: var(--radius-sm); color: var(--color-text-muted); font-weight: 700; }
.admin-tabs a.active { background: var(--gradient-primary); color: #fff; }
.admin-content { padding: 28px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 20px 0; }
.stat-card { background: var(--color-surface-strong); border-radius: var(--radius-md); padding: 18px; text-align: center; }
.stat-card .stat-value { display: block; font-size: 1.6rem; font-weight: 900; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 0.78rem; color: var(--color-text-muted); text-transform: uppercase; }

/* ---------------------------------------------------------------------
   Toasts
   --------------------------------------------------------------------- */
.toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 2000; }
.toast {
    background: var(--color-surface-strong); backdrop-filter: blur(12px); border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); padding: 12px 18px; box-shadow: var(--shadow-soft);
    animation: toast-in 200ms ease; max-width: 320px; font-weight: 600;
}
.toast.toast-success { border-color: rgba(79, 209, 139, 0.5); }
.toast.toast-error { border-color: rgba(255, 107, 107, 0.5); }
.toast.toast-kudos { border-color: rgba(255, 207, 92, 0.6); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .game-body { grid-template-columns: 1fr; }
    .lobby-shell { grid-template-columns: 1fr; }
    .home-grid { grid-template-columns: 1fr 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-avatar-panel { grid-row: auto; }
}

@media (max-width: 720px) {
    .site-header { flex-wrap: wrap; margin: 10px; padding: 10px 14px; gap: 8px 12px; }
    .brand { font-size: 1.1rem; gap: 8px; }
    .brand-mark { width: 28px; height: 28px; }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .header-actions { order: 1; width: 100%; justify-content: flex-end; }
    .site-nav {
        display: none;
        order: 2; width: 100%;
        flex-direction: column; gap: 2px;
        padding-top: 10px; margin-top: 4px;
        border-top: 1px solid var(--color-border);
    }
    .site-nav.is-open { display: flex; }
    .site-nav a { padding: 10px 6px; }
    .hero-title { font-size: 2.2rem; }
    .home-grid { grid-template-columns: 1fr; }
    .game-topbar { justify-content: flex-start; gap: 16px; }
    .number-pad { grid-template-columns: repeat(5, 1fr); }
    .site-main { padding: 16px 12px 40px; }
    .admin-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .modal { padding: 12px; }
    .modal-content { padding: 20px; }
    .lobby-row { gap: 6px; padding: 10px; }
    .lobby-row-code { min-width: 0; font-size: 0.9rem; }
    .lobby-row .badge { font-size: 0.68rem; padding: 3px 8px; }
}
