/* ==========================================================================
   NBG Arena — Design System
   Competitive intelligence · Education-first aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,600;0,9..144,700;0,9..144,800;1,9..144,600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Core palette — academic navy + growth green + achievement gold */
    --nbg-ink: #0c1222;
    --nbg-ink-soft: #151d32;
    --nbg-slate: #1e293b;
    --nbg-blue: #1e40af;
    --nbg-blue-light: #3b82f6;
    --nbg-emerald: #059669;
    --nbg-emerald-light: #10b981;
    --nbg-gold: #d97706;
    --nbg-gold-light: #fbbf24;
    --nbg-indigo: #4f46e5;
    --nbg-violet: #7c3aed;

    --nbg-success: #059669;
    --nbg-danger: #dc2626;
    --nbg-warning: #d97706;

    --nbg-bg: #f1f5f9;
    --nbg-bg-warm: #faf8f5;
    --nbg-surface: #ffffff;
    --nbg-border: rgba(15, 23, 42, 0.08);
    --nbg-border-strong: rgba(15, 23, 42, 0.12);

    --nbg-text: #0f172a;
    --nbg-text-muted: #64748b;
    --nbg-text-inverse: #f8fafc;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 20px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 60px rgba(79, 70, 229, 0.15);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--nbg-text);
    background: var(--nbg-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ---- Background patterns ---- */
.bg-pattern {
    position: relative;
    background-color: var(--nbg-bg);
}

.bg-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(5, 150, 105, 0.06) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231e293b' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.bg-pattern > * { position: relative; z-index: 1; }

/* ---- Navbar ---- */
.site-nav {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--nbg-border);
    padding: 0.75rem 0;
    transition: box-shadow var(--transition);
    overflow: visible !important;
    z-index: 1030;
}

.site-nav.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--nbg-ink) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-mark {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--nbg-indigo), var(--nbg-emerald));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.brand-accent { color: var(--nbg-emerald); }

.site-nav .nav-link {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--nbg-slate) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.site-nav .nav-link:hover {
    color: var(--nbg-indigo) !important;
    background: rgba(79, 70, 229, 0.06);
}

.site-nav .navbar-toggler {
    border-color: var(--nbg-border-strong);
}

/* ---- Buttons ---- */
.btn-nbg-primary {
    background: linear-gradient(135deg, var(--nbg-indigo) 0%, #4338ca 100%);
    color: #fff !important;
    border: none;
    font-weight: 700;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    transition: all var(--transition);
}

.btn-nbg-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
    color: #fff;
}

.btn-nbg-gold {
    background: linear-gradient(135deg, var(--nbg-gold) 0%, #b45309 100%);
    color: #fff !important;
    border: none;
    font-weight: 700;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
    transition: all var(--transition);
}

.btn-nbg-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.4);
    color: #fff;
}

.btn-nbg-outline {
    background: transparent;
    color: var(--nbg-text-inverse) !important;
    border: 2px solid rgba(255, 255, 255, 0.35);
    font-weight: 600;
    padding: 0.7rem 1.65rem;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.btn-nbg-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff !important;
}

.btn-nbg-ghost {
    background: var(--nbg-surface);
    color: var(--nbg-ink) !important;
    border: 1px solid var(--nbg-border-strong);
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.btn-nbg-ghost:hover {
    border-color: var(--nbg-indigo);
    color: var(--nbg-indigo) !important;
    box-shadow: var(--shadow-sm);
}

/* ---- Hero ---- */
.hero-section {
    position: relative;
    background: linear-gradient(145deg, var(--nbg-ink) 0%, #1a2744 40%, #1e3a5f 100%);
    color: var(--nbg-text-inverse);
    padding: 5rem 0 6rem;
    min-height: 88vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(79, 70, 229, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--nbg-bg), transparent);
    pointer-events: none;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    padding: 0.4rem 1rem 0.4rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--nbg-emerald-light);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.hero-section h1 {
    font-size: clamp(2.25rem, 5.5vw, 3.75rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.hero-section h1 .highlight {
    background: linear-gradient(135deg, var(--nbg-gold-light), var(--nbg-emerald-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section .lead {
    font-size: 1.2rem;
    opacity: 0.85;
    max-width: 520px;
    font-weight: 400;
}

.hero-visual {
    position: relative;
    height: 380px;
}

.hero-card-float {
    position: absolute;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    backdrop-filter: blur(12px);
    animation: float 6s ease-in-out infinite;
}

.hero-card-float:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; }
.hero-card-float:nth-child(2) { top: 35%; right: 0; animation-delay: -2s; }
.hero-card-float:nth-child(3) { bottom: 10%; left: 15%; animation-delay: -4s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.hero-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.hero-card-icon.stem { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.hero-card-icon.math { background: linear-gradient(135deg, #059669, #047857); }
.hero-card-icon.trophy { background: linear-gradient(135deg, #d97706, #b45309); }

.stat-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    backdrop-filter: blur(8px);
    transition: transform var(--transition);
}

.stat-card:hover { transform: translateY(-4px); }

.stat-card .number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--nbg-gold-light), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card small {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
}

/* ---- Sections ---- */
.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--nbg-emerald);
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin-bottom: 1rem;
}

.feature-card {
    background: var(--nbg-surface);
    border: 1px solid var(--nbg-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--nbg-indigo), var(--nbg-emerald));
    opacity: 0;
    transition: opacity var(--transition);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-card:hover::before { opacity: 1; }

.feature-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.feature-icon-wrap.purple { background: rgba(79, 70, 229, 0.1); }
.feature-icon-wrap.green { background: rgba(5, 150, 105, 0.1); }
.feature-icon-wrap.gold { background: rgba(217, 119, 6, 0.1); }

.feature-card h4 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--nbg-text-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* ---- How it works ---- */
.steps-row {
    counter-reset: step;
}

.step-card {
    text-align: center;
    padding: 1.5rem;
    position: relative;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nbg-indigo), var(--nbg-violet));
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.step-card h5 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
}

.step-card p {
    color: var(--nbg-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* ---- CTA band ---- */
.cta-band {
    background: linear-gradient(135deg, var(--nbg-indigo) 0%, #3730a3 50%, var(--nbg-emerald) 100%);
    color: #fff;
    padding: 4rem 0;
    border-radius: var(--radius-xl);
    margin: 0 1rem;
    position: relative;
    overflow: hidden;
}

.cta-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---- Leaderboard ---- */
.leaderboard-wrap {
    background: var(--nbg-surface);
    border: 1px solid var(--nbg-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.leaderboard-table {
    margin: 0;
    width: 100%;
}

.leaderboard-table thead th {
    background: var(--nbg-ink);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1rem 1.25rem;
    border: none;
}

.leaderboard-table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--nbg-border);
}

.leaderboard-table tbody tr:last-child td { border-bottom: none; }

.leaderboard-table tbody tr {
    transition: background var(--transition);
}

.leaderboard-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.03);
}

.leaderboard-table tbody tr.rank-gold {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.08), transparent);
}

.leaderboard-table tbody tr.rank-silver {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.08), transparent);
}

.leaderboard-table tbody tr.rank-bronze {
    background: linear-gradient(90deg, rgba(180, 83, 9, 0.06), transparent);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.95rem;
}

.rank-badge.gold { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; }
.rank-badge.silver { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #1e293b; }
.rank-badge.bronze { background: linear-gradient(135deg, #d97706, #92400e); color: #fff; }
.rank-badge.default { background: var(--nbg-bg); color: var(--nbg-slate); font-weight: 700; }

.rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(5, 150, 105, 0.08));
    color: var(--nbg-indigo);
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.9rem;
}

.player-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.player-name { font-weight: 700; color: var(--nbg-ink); }
.player-meta { font-size: 0.8rem; color: var(--nbg-text-muted); }

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--nbg-indigo), var(--nbg-emerald));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.avatar-placeholder.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 0.8rem; }
.avatar-placeholder.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 1rem; }

.ui-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.rating-mark,
.rating-pill .ui-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.hero-trust-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.hero-trust-icon { width: 1rem; height: 1rem; }

.live-dot-inline,
.nav-live-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.nav-mega-icon-svg,
.nav-drawer-card-icon-svg,
.nav-drawer-arrow-svg,
.nav-menu-icon,
.nav-drawer-close-icon,
.hero-enter-cta-icon,
.hero-enter-cta-arrow,
.rankings-hub-card-icon,
.records-pending-icon-svg,
.subview-card-icon-svg,
.stage-placeholder-icon-svg,
.finals-status-icon-svg,
.feature-icon-svg,
.stem-pillar-icon-svg,
.finals-step-icon-svg,
.age-bracket-card-icon-svg {
    width: 1.35rem;
    height: 1.35rem;
}

.feature-icon-wrap .feature-icon-svg,
.stem-pillar-icon .stem-pillar-icon-svg,
.finals-step-icon .finals-step-icon-svg {
    width: 1.75rem;
    height: 1.75rem;
}

.stage-placeholder-icon .stage-placeholder-icon-svg {
    width: 2.5rem;
    height: 2.5rem;
    color: rgba(255, 255, 255, 0.85);
}

.records-pending-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--nbg-indigo);
}

.auth-card-icon .auth-card-icon-svg,
.stats-empty-icon-svg,
.pool-meta-icon-svg,
.picker-select-icon-svg,
.institution-card-icon-svg,
.state-chip-flag-svg,
.hof-sovereign-crown-svg,
.hof-badge-icon-svg,
.hof-laureate-icon-svg,
.hof-placement-icon-svg,
.arena-subnav-icon-svg,
.game-start-icon-svg,
.game-meta-icon-svg,
.lifeline-icon-svg {
    width: 1.35rem;
    height: 1.35rem;
}

.auth-card-icon .auth-card-icon-svg {
    width: 2rem;
    height: 2rem;
}

.game-start-icon .game-start-icon-svg {
    width: 3rem;
    height: 3rem;
}

.stats-empty-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.stats-empty-icon-svg {
    width: 3rem;
    height: 3rem;
    color: rgba(255, 255, 255, 0.45);
}

.auth-trust span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.auth-trust-icon-svg {
    width: 1rem;
    height: 1rem;
}

.pool-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.user-avatar-img {
    object-fit: cover;
    padding: 0;
    border-radius: inherit;
}

.user-avatar-img.avatar-placeholder,
.user-avatar-img.avatar-placeholder.sm,
.user-avatar-img.avatar-placeholder.lg {
    border-radius: 12px;
}

.user-avatar-img.avatar-placeholder.sm { border-radius: 10px; }
.user-avatar-img.avatar-placeholder.lg { border-radius: 14px; }
.user-avatar-img.profile-avatar { border-radius: 20px; }

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.profile-avatar-actions { flex: 1; min-width: 0; }

.arena-nav-avatar.user-avatar-img,
.arena-nav-avatar.avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

/* ---- Page headers ---- */
.page-header {
    background: linear-gradient(135deg, var(--nbg-ink) 0%, #1e3a5f 100%);
    color: #fff;
    padding: 3.5rem 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--nbg-indigo), var(--nbg-emerald), var(--nbg-gold));
}

.page-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.page-header p {
    opacity: 0.8;
    margin: 0;
    font-size: 1.05rem;
}

.page-content {
    padding: 3rem 0 4rem;
}

/* ---- Auth pages ---- */
.auth-page {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: stretch;
}

.auth-brand-panel {
    flex: 1;
    background: linear-gradient(160deg, var(--nbg-ink) 0%, #1a2744 50%, #1e3a5f 100%);
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 70%, rgba(79, 70, 229, 0.25), transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(5, 150, 105, 0.2), transparent 50%);
}

.auth-brand-panel > * { position: relative; z-index: 1; }

.auth-brand-panel h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.auth-brand-panel p {
    opacity: 0.85;
    font-size: 1.05rem;
    max-width: 380px;
}

.auth-features {
    margin-top: 2rem;
    list-style: none;
    padding: 0;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.auth-features li::before {
    content: '✓';
    width: 24px;
    height: 24px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--nbg-emerald-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--nbg-bg-warm);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--nbg-surface);
    border: 1px solid var(--nbg-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-card .subtitle {
    color: var(--nbg-text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.form-control, .form-select {
    border: 1px solid var(--nbg-border-strong);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    font-weight: 500;
    transition: all var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--nbg-indigo);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--nbg-slate);
}

/* ---- Arena ---- */
.arena-body {
    background: var(--nbg-ink);
    color: var(--nbg-text-inverse);
    min-height: 100vh;
}

.arena-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 50% 0%, rgba(79, 70, 229, 0.12), transparent),
        radial-gradient(ellipse 40% 30% at 80% 80%, rgba(5, 150, 105, 0.08), transparent);
    pointer-events: none;
}

.arena-nav {
    background: rgba(12, 18, 34, 0.9) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding: 0.65rem 0;
}

.arena-nav .nav-link {
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7) !important;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem !important;
    transition: all var(--transition);
}

.arena-nav .nav-link:hover,
.arena-nav .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
}

.arena-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 0.35rem 1rem 0.35rem 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.arena-main { position: relative; z-index: 1; }

/* ---- Game UI ---- */
.game-container { max-width: 640px; margin: 0 auto; }

.question-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(8px);
}

.game-start-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--nbg-indigo), var(--nbg-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.4);
}

.game-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.game-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.game-meta-item strong { color: #fff; }

.game-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.game-progress-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.timer-display {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--nbg-gold-light);
}

.timer-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 1.75rem;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--nbg-emerald-light), var(--nbg-gold-light));
    border-radius: 100px;
    transition: width 0.1s linear;
}

.timer-fill.danger {
    background: linear-gradient(90deg, var(--nbg-danger), #f87171);
}

.question-text {
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1.45;
    margin-bottom: 1.75rem;
    color: #fff;
}

.option-btn {
    width: 100%;
    text-align: left;
    padding: 1rem 1.25rem;
    margin-bottom: 0.65rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--nbg-indigo);
    background: rgba(79, 70, 229, 0.15);
    transform: translateX(4px);
}

.option-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.option-btn.selected {
    border-color: var(--nbg-indigo);
    background: rgba(79, 70, 229, 0.2);
}

.option-btn.correct {
    border-color: var(--nbg-emerald-light);
    background: rgba(16, 185, 129, 0.2);
}

.option-btn.correct .option-letter { background: var(--nbg-emerald); }

.option-btn.wrong {
    border-color: var(--nbg-danger);
    background: rgba(220, 38, 38, 0.2);
}

.option-btn.wrong .option-letter { background: var(--nbg-danger); }

/* ---- Results ---- */
.results-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
}

.results-trophy {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce-in 0.6s ease;
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.results-grid .result-box.span-2 {
    grid-column: span 2;
}

.result-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.result-box .value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
}

.result-box .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

.rating-change.positive { color: var(--nbg-emerald-light); }
.rating-change.negative { color: #f87171; }

/* ---- Dashboard cards ---- */
.dashboard-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
}

.dashboard-card.highlight {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(5, 150, 105, 0.1));
    border-color: rgba(79, 70, 229, 0.25);
}

/* ---- Phase 2: Season banner + mode cards ---- */
.season-banner {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(79, 70, 229, 0.12));
    border: 1px solid rgba(217, 119, 6, 0.25);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}

.season-banner-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--nbg-gold-light);
}

.season-banner-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
}

.season-banner-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

.energy-meter-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.35rem;
}

.energy-meter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-width: 220px;
    margin-bottom: 0.35rem;
}

.energy-pip {
    width: 8px;
    height: 14px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
}

.energy-pip.full {
    background: linear-gradient(180deg, var(--nbg-gold-light), var(--nbg-gold));
    box-shadow: 0 0 6px rgba(217, 119, 6, 0.4);
}

.energy-meter-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--nbg-gold-light);
}

.mode-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mode-card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.mode-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.mode-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    flex-grow: 1;
}

.mode-card-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.mode-card-list li {
    padding: 0.25rem 0 0.25rem 1.25rem;
    position: relative;
}

.mode-card-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--nbg-emerald-light);
    font-weight: 700;
}

.mode-ranked {
    border-color: rgba(217, 119, 6, 0.3);
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.06), rgba(255, 255, 255, 0.02));
}

.mode-practice {
    border-color: rgba(255, 255, 255, 0.12);
}

.mode-daily {
    border-color: rgba(217, 119, 6, 0.45);
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.1), rgba(255, 255, 255, 0.02));
}

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

.achievement-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.achievement-card.unlocked {
    border-color: rgba(217, 119, 6, 0.35);
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.08), rgba(255, 255, 255, 0.02));
}

.achievement-card.locked {
    opacity: 0.55;
    filter: grayscale(0.4);
}

.achievement-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.achievement-body h5 {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.achievement-body p {
    color: rgba(255, 255, 255, 0.55);
}

.achievement-date {
    font-size: 0.7rem;
    color: var(--nbg-gold-light);
    margin-top: 0.5rem;
    font-weight: 700;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mini-stat {
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.mini-stat .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.5);
}

.mini-stat .value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid rgba(79, 70, 229, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ---- Admin ---- */
.admin-body { background: var(--nbg-bg); }

.admin-nav {
    background: var(--nbg-ink) !important;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, var(--nbg-indigo), var(--nbg-emerald)) 1;
}

.admin-stat {
    background: var(--nbg-surface);
    border: 1px solid var(--nbg-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.admin-stat:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.admin-stat h3 {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, var(--nbg-indigo), var(--nbg-emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-stat small {
    color: var(--nbg-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--nbg-ink);
    color: rgba(255, 255, 255, 0.7);
    padding: 3rem 0 2rem;
    margin-top: 0;
}

.site-footer .footer-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color var(--transition);
}

.site-footer a:hover { color: var(--nbg-emerald-light); }

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li { margin-bottom: 0.5rem; }

.footer-nav-label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
}

.footer-season-note {
    color: rgba(255, 255, 255, 0.45);
}

.footer-nav-grid .footer-links li {
    margin-bottom: 0.45rem;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.08);
    margin: 2rem 0 1.5rem;
}

/* ---- Alerts ---- */
.alert {
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
}

/* ---- Animations ---- */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- FAQ accordion ---- */
.accordion-item {
    border: 1px solid var(--nbg-border);
    border-radius: var(--radius-md) !important;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.accordion-button {
    font-weight: 700;
    font-family: var(--font-body);
    padding: 1.25rem 1.5rem;
}

.accordion-button:not(.collapsed) {
    background: rgba(79, 70, 229, 0.06);
    color: var(--nbg-indigo);
}

/* ---- Champions placeholder ---- */
.champions-hero {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--nbg-surface);
    border: 1px solid var(--nbg-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.champions-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nbg-gold-light), var(--nbg-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 12px 40px rgba(217, 119, 6, 0.3);
}

/* ---- Hall of Fame (Phase 4) ---- */
.champions-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e3a5f 100%);
}

.champions-page { padding: 3rem 0; }

.featured-champion {
    position: relative;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(79, 70, 229, 0.12));
    border: 2px solid rgba(217, 119, 6, 0.35);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    overflow: hidden;
}

.featured-champion-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(217, 119, 6, 0.2), transparent 70%);
    pointer-events: none;
}

.featured-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--nbg-gold);
}

.featured-name {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin: 0.25rem 0;
}

.featured-meta { color: rgba(255, 255, 255, 0.55); }

.featured-citation { font-style: italic; color: rgba(255, 255, 255, 0.7); max-width: 540px; }

.featured-crown { font-size: 5rem; line-height: 1; filter: drop-shadow(0 0 30px rgba(217, 119, 6, 0.5)); }

.featured-username { color: var(--nbg-gold-light); font-weight: 700; margin-top: 0.5rem; }

.hof-card {
    background: var(--nbg-surface);
    border: 1px solid var(--nbg-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 100%;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hof-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.hof-card.placement-1 { border-color: rgba(217, 119, 6, 0.4); background: linear-gradient(180deg, rgba(217, 119, 6, 0.06), var(--nbg-surface)); }

.hof-card-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

.hof-card-placement {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nbg-gold);
}

.hof-card-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0.35rem 0;
}

.hof-card-meta { font-size: 0.85rem; color: var(--nbg-text-muted); }

.hof-card-institution { font-size: 0.8rem; color: var(--nbg-indigo); font-weight: 600; margin-top: 0.25rem; }

.hof-card-rating { margin-top: 0.75rem; }

.hof-card-citation { font-size: 0.85rem; color: var(--nbg-text-muted); margin: 0.75rem 0 0; font-style: italic; }

.hof-card-date { font-size: 0.7rem; color: var(--nbg-text-muted); margin-top: 1rem; }

.institution-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--nbg-surface);
    border: 1px solid var(--nbg-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    height: 100%;
}

.institution-pill:hover, .institution-pill.active {
    border-color: var(--nbg-indigo);
    box-shadow: var(--shadow-sm);
    color: inherit;
}

.institution-pill .inst-name { font-size: 0.8rem; font-weight: 700; text-align: center; margin-bottom: 0.35rem; }

.institution-pill .inst-stat { font-size: 0.75rem; color: var(--nbg-indigo); font-weight: 800; }

/* ---- Mobile leaderboard cards ---- */
.leaderboard-mobile-card {
    background: var(--nbg-surface);
    border: 1px solid var(--nbg-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.leaderboard-mobile-card.rank-gold { border-left: 4px solid var(--nbg-gold-light); }
.leaderboard-mobile-card.rank-silver { border-left: 4px solid #94a3b8; }
.leaderboard-mobile-card.rank-bronze { border-left: 4px solid var(--nbg-gold); }

.leaderboard-mobile-card .lb-info { flex: 1; min-width: 0; }

.leaderboard-mobile-card .lb-stats {
    text-align: right;
    flex-shrink: 0;
}

.leaderboard-scroll-hint { display: none; }

/* ---- Responsive ---- */

/* Base: prevent horizontal overflow on all devices */
html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

img, video, svg {
    max-width: 100%;
    height: auto;
}

/* Touch-friendly: remove hover transforms on touch devices */
@media (hover: none) and (pointer: coarse) {
    .option-btn:hover:not(:disabled) { transform: none; }
    .feature-card:hover { transform: none; }
    .admin-stat:hover { transform: none; }
    .stat-card:hover { transform: none; }
}

/* Minimum touch target size (WCAG 2.5.5) */
.btn, .nav-link, .option-btn, .navbar-toggler {
    min-height: 44px;
}

.option-btn {
    display: flex;
    align-items: center;
}

/* Safe area support for notched phones */
.site-nav,
.arena-nav,
.admin-nav,
.site-footer,
.auth-form-panel,
.arena-main,
.page-content .container {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.site-footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
}

/* ---- Tablet and below (≤991px) ---- */
@media (max-width: 991.98px) {
    .auth-brand-panel { display: none; }

    .auth-page { min-height: calc(100vh - 72px); }
    .auth-form-panel { padding: 1.5rem 1rem; align-items: flex-start; padding-top: 2rem; }

    .hero-visual { display: none; }

    /* Public navbar mobile menu */
    .site-nav .navbar-collapse {
        padding: 0.75rem 0 1rem;
        border-top: 1px solid var(--nbg-border);
        margin-top: 0.5rem;
    }

    .site-nav .navbar-nav .nav-link {
        padding: 0.65rem 0.75rem !important;
    }

    .site-nav .navbar-nav.align-items-lg-center {
        padding-top: 0.5rem;
        border-top: 1px solid var(--nbg-border);
        margin-top: 0.5rem;
    }

    .site-nav .btn-nbg-primary {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 0.25rem;
        text-align: center;
    }

    /* Arena navbar mobile */
    .arena-nav .navbar-collapse {
        padding: 0.75rem 0 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 0.5rem;
    }

    .arena-nav .navbar-nav .nav-link {
        padding: 0.65rem 0.75rem !important;
    }

    .arena-nav .navbar-nav:last-child {
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 0.5rem;
    }

    .arena-user-badge {
        width: 100%;
        justify-content: flex-start;
        margin: 0.25rem 0;
    }

    /* Admin navbar mobile */
    .admin-nav .navbar-collapse {
        padding: 0.75rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 0.5rem;
    }

    .admin-nav .admin-nav-link {
        display: block;
        padding: 0.65rem 0.75rem !important;
        border-radius: var(--radius-sm);
    }

    .admin-nav .admin-nav-link:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .page-header { padding: 2.5rem 0; }
    .page-content { padding: 2rem 0 3rem; }

    .dashboard-card { padding: 1.5rem; }
}

/* ---- Small tablets and large phones (≤767px) ---- */
@media (max-width: 767.98px) {
    .hero-section {
        padding: 3rem 0 3.5rem;
        min-height: auto;
    }

    .hero-section h1 { font-size: clamp(1.85rem, 7vw, 2.5rem); }

    .hero-section .lead { font-size: 1.05rem; }

    .section-title { font-size: 1.65rem; }

    .cta-band {
        border-radius: var(--radius-lg);
        margin: 0;
        padding: 3rem 1.5rem;
    }

    .cta-band h2 { font-size: 1.5rem; }

    .results-grid { grid-template-columns: repeat(2, 1fr); }

    .results-grid .result-box.span-2 { grid-column: span 2; }

    .champions-hero { padding: 2.5rem 1.25rem; }

    .feature-card { padding: 1.5rem; }

    .step-card { padding: 1rem 0.5rem; }

    .admin-stat h3 { font-size: 1.75rem; }

    /* Leaderboard: horizontal scroll with hint */
    .leaderboard-scroll-hint {
        display: block;
        font-size: 0.75rem;
        color: var(--nbg-text-muted);
        text-align: center;
        padding: 0.5rem;
        background: var(--nbg-bg);
        border-bottom: 1px solid var(--nbg-border);
    }

    .leaderboard-wrap .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }

    .leaderboard-table { min-width: 540px; }

    .site-footer { padding: 2rem 0 1.5rem; }
    .site-footer .row.align-items-start { text-align: left; }
    .site-footer .footer-nav-grid { text-align: left; }
    .site-footer .col-lg-3:first-child { text-align: center; }
    .site-footer .footer-brand { margin-top: 0; }
}

/* ---- Phones (≤575px) ---- */
@media (max-width: 575.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .navbar-brand {
        font-size: 1.15rem;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .hero-badge {
        font-size: 0.78rem;
        padding: 0.35rem 0.85rem 0.35rem 0.45rem;
    }

    .stat-card { padding: 1rem 0.75rem; }
    .stat-card .number { font-size: 1.35rem; }

    .question-card { padding: 1.25rem; }

    .auth-card { padding: 1.5rem; border-radius: var(--radius-md); }

    .auth-card h2 { font-size: 1.35rem; }

    /* Game UI */
    .game-container { padding: 0; }

    .game-start-icon {
        width: 64px;
        height: 64px;
        font-size: 1.75rem;
        border-radius: 16px;
    }

    .game-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .question-text {
        font-size: 1.1rem;
        margin-bottom: 1.25rem;
    }

    .option-btn {
        min-height: 52px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        gap: 0.65rem;
    }

    .option-letter {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .timer-display { font-size: 1.25rem; }

    .game-progress-label { font-size: 0.75rem; }

    .results-card { padding: 1.5rem 1rem; border-radius: var(--radius-lg); }

    .results-trophy { font-size: 3rem; }

    .result-box .value { font-size: 1.5rem; }

    .results-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
        margin: 1.5rem 0;
    }

    .result-box { padding: 0.85rem; }

    /* Arena dashboard */
    .dashboard-card { padding: 1.25rem; }

    .dashboard-card.highlight .d-flex {
        flex-direction: column;
        text-align: center;
    }

    .dashboard-card.highlight .game-start-icon {
        margin: 0 auto 1rem !important;
    }

    .stat-grid { gap: 0.65rem; }

    .mini-stat { padding: 0.85rem; }

    .mini-stat .value { font-size: 1.25rem; }

    .arena-main.container {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }

    /* Leaderboard compact */
    .leaderboard-table thead th,
    .leaderboard-table tbody td {
        padding: 0.75rem 0.65rem;
        font-size: 0.85rem;
    }

    .leaderboard-table thead th:nth-child(4),
    .leaderboard-table tbody td:nth-child(4) {
        display: none;
    }

    .player-name { font-size: 0.9rem; }

    .player-meta {
        font-size: 0.72rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .rank-badge {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .rating-pill {
        font-size: 0.8rem;
        padding: 0.25rem 0.6rem;
    }

    .arena-user-badge .username-text {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .avatar-placeholder { width: 36px; height: 36px; font-size: 0.85rem; }

    .page-header h1 { font-size: 1.65rem; }

    .accordion-button { padding: 1rem 1.15rem; font-size: 0.95rem; }

    /* Admin tables scroll */
    .admin-table-wrap {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }

    .admin-table-wrap .table { min-width: 600px; font-size: 0.85rem; }

    .admin-quick-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
    }
}

/* ---- Very small phones (≤380px) ---- */
@media (max-width: 380px) {
    .hero-section h1 { font-size: 1.65rem; }

    .leaderboard-table thead th:nth-child(5),
    .leaderboard-table tbody td:nth-child(5) {
        display: none;
    }

    .results-grid { grid-template-columns: 1fr; }

    .results-grid .result-box.span-2 { grid-column: span 1; }
}

/* ---- Large screens (≥1400px) ---- */
@media (min-width: 1400px) {
    .hero-section { min-height: 85vh; }

    .game-container { max-width: 680px; }
}

/* Utility: hide scroll hint on desktop */
@media (max-width: 767.98px) {
    .leaderboard-scroll-hint { display: block; }
}

/* Flash messages container spacing on mobile */
@media (max-width: 575.98px) {
    main > .alert,
    .arena-main > .alert,
    .admin-body main > .alert {
        margin: 0.75rem 1rem 0;
        border-radius: var(--radius-md);
    }
}

/* Live nav indicator (shown when a broadcast is active) */
.nav-live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    display: inline-block;
    margin-left: 4px;
    vertical-align: middle;
    animation: live-pulse-dot 1.2s ease infinite;
}

@keyframes live-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

@media (prefers-reduced-motion: reduce) {
    .nav-live-dot { animation: none; }
}
