/* ============================================================
   TinyTrivia — EPIC skin v1 (2026-09-09)
   Loaded LAST on every page. Overrides style/game/arena/account.
   Direction: cinematic ember & gold, vintage-poster framing to
   match the engraved category / mode artwork. Cinzel display.
   ============================================================ */

/* ─── Display font: Cinzel (variable) self-hosted.
   Aliased as "Orbitron" so every legacy rule picks it up. ─── */
@font-face {
    font-family: 'Cinzel';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('/assets/fonts/cinzel-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Orbitron';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('/assets/fonts/cinzel-latin.woff2') format('woff2');
}

/* ─── Tokens ─── */
:root {
    --font-display: 'Cinzel', 'Orbitron', Georgia, serif;
    --font-body: 'Chakra Petch', 'Rajdhani', sans-serif;

    --ember: #FF6B35;
    --ember-deep: #E8452B;
    --gold: #F5B84A;
    --gold-light: #FFD98A;
    --gold-dim: rgba(245, 184, 74, 0.45);

    --ink-0: #06070B;
    --ink-1: #0B0C13;
    --ink-2: #12131C;
    --ink-3: #191B27;
    --ink-4: #222436;

    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.14);
    --line-gold: rgba(245, 184, 74, 0.32);

    --text-hi: #F3EFE8;
    --text-mid: rgba(243, 239, 232, 0.72);
    --text-low: rgba(243, 239, 232, 0.45);

    --grad-ember: linear-gradient(135deg, #FF8A3D 0%, #FF5A2E 55%, #E8342B 100%);
    --grad-gold: linear-gradient(135deg, #FFE39A 0%, #F5B84A 45%, #D98A1F 100%);
    --grad-frame: linear-gradient(160deg, rgba(245,184,74,0.55), rgba(255,107,53,0.18) 40%, rgba(255,255,255,0.06) 70%, rgba(245,184,74,0.35));

    --glow-ember: 0 0 0 1px rgba(255,107,53,0.35), 0 10px 40px rgba(255,107,53,0.25);
    --shadow-card: 0 14px 40px rgba(0, 0, 0, 0.45);
    --r-card: 18px;

    /* remap legacy vars */
    --bg: var(--ink-1);
    --bg-secondary: var(--ink-2);
    --bg-card: rgba(255, 255, 255, 0.035);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-elevated: rgba(255, 255, 255, 0.05);
    --bg-header: rgba(11, 12, 19, 0.88);
    --card-bg: var(--ink-2);
    --sidebar-bg: var(--ink-0);
    --border: var(--line);
    --border-medium: var(--line-strong);
    --text: var(--text-hi);
    --text-primary: var(--text-hi);
    --text-secondary: var(--text-mid);
    --text-muted: var(--text-low);
    --accent: var(--ember);
    --accent-hover: var(--ember-deep);
    --accent-gradient: var(--grad-ember);
    --xp-color: var(--gold);
}

/* ─── Page ground ─── */
html { background: var(--ink-1); }
body {
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(255, 107, 53, 0.16), transparent 60%),
        radial-gradient(900px 500px at 5% 110%, rgba(245, 184, 74, 0.08), transparent 60%),
        var(--ink-1);
    color: var(--text-hi);
}
body::before {
    background:
        radial-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.35));
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.35));
}
.main-content,
.game-modes, .hosts, .categories, .quests-badges, .footer { background: transparent; }

::selection { background: rgba(255, 107, 53, 0.45); color: #fff; }

/* ─── Type ─── */
h1, h2, h3, .section-title, .sidebar-logo, .footer-brand h3 {
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}
.section-label {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    font-family: var(--font-display);
    font-size: 12px; font-weight: 700; letter-spacing: 0.32em;
    color: var(--gold);
    margin-bottom: 12px;
}
.section-label::before, .section-label::after {
    content: ''; width: 46px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim));
}
.section-label::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }

.section-title {
    font-size: clamp(26px, 3.4vw, 40px);
    font-weight: 900;
    color: var(--text-hi);
    text-shadow: 0 2px 30px rgba(255, 107, 53, 0.25);
    margin-bottom: 36px;
}

/* ============================================================
   NAVIGATION — one nav. Sidebar on desktop, top bar on mobile.
   ============================================================ */
.tt-topbar { display: none; }

.sidebar {
    width: 260px;
    background:
        linear-gradient(180deg, rgba(255,107,53,0.08), transparent 220px),
        var(--ink-0);
    border-right: 1px solid var(--line);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.35);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding-right: 16px; }
.sidebar-head .sidebar-theme-toggle {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
    border: 1px solid var(--line-gold); background: rgba(245,184,74,0.06);
    font-size: 18px; line-height: 1; color: var(--gold-light);
}
.sidebar-head .sidebar-theme-toggle:hover { border-color: var(--gold); background: rgba(245,184,74,0.14); transform: scale(1.06); }
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 12px 18px 22px;
    font-family: var(--font-body);
    font-size: 19px; font-weight: 700; letter-spacing: 0.04em;
    color: var(--text-hi);
}
.sidebar-logo img {
    height: 34px !important; width: 34px !important;
    border-radius: 9px !important; margin: 0 !important; vertical-align: middle !important;
    box-shadow: 0 0 0 1px rgba(255,107,53,0.35), 0 6px 18px rgba(255,107,53,0.35);
}
.sidebar-logo span { color: var(--ember); }
.sidebar-section { border-top: 1px solid rgba(255,255,255,0.04); padding: 3px 0; }
.sidebar-heading { padding-top: 10px; }
.sidebar-heading {
    font-family: var(--font-display);
    font-size: 10px; font-weight: 700; letter-spacing: 0.3em;
    color: var(--gold-dim);
    padding: 14px 24px 6px;
}
.sidebar-item {
    position: relative;
    margin: 1px 10px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    color: var(--text-mid);
    transition: color .15s, background .15s, transform .15s;
}
.sidebar-item:hover { color: var(--text-hi); background: rgba(255,255,255,0.045); transform: translateX(2px); }
.sidebar-item.active {
    color: var(--text-hi);
    background: linear-gradient(90deg, rgba(255,107,53,0.22), rgba(255,107,53,0.04));
    border-right: 0;
    box-shadow: inset 0 0 0 1px rgba(255,107,53,0.25);
}
.sidebar-item.active::before {
    content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 3px; background: var(--grad-ember);
    box-shadow: 0 0 12px rgba(255,107,53,0.8);
}
.sidebar-item.active .si-icon { color: var(--ember); }
.sidebar-user { padding: 12px 12px; }
.sidebar-user-badge { padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.sidebar-user-avatar { background: var(--grad-ember); border: 0; color: #fff; box-shadow: 0 4px 14px rgba(255,107,53,0.4); }
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 14px 22px 18px; margin-top: auto; }
.sidebar-theme-toggle { border-radius: 10px; }

/* Content offset (sidebar fixed 260) */
.main-content { margin-left: 260px; }

/* Score / streak floating HUD (gameplay) */
.game-score-float {
    top: 14px; right: 18px; z-index: 260;
    gap: 8px;
}
.game-score-float:empty { display: none; }
.header-score, .header-streak {
    font-family: var(--font-display);
    font-size: 15px; font-weight: 800;
    color: var(--text-hi);
    padding: 8px 14px; border-radius: 999px;
    background: rgba(11,12,19,0.85);
    border: 1px solid var(--line-gold);
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
}
.header-score { color: var(--gold-light); }
.header-score.sd-survived { color: #FF5A5A; border-color: rgba(255,90,90,0.4); }

/* Timer bar — fixed at the very top of the content column */
.timer-bar-container {
    position: fixed; top: 0; left: 260px; right: 0; z-index: 255;
    height: 6px; background: rgba(255,255,255,0.06);
}
.timer-bar {
    background: var(--grad-gold);
    box-shadow: 0 0 14px rgba(245,184,74,0.7);
    border-radius: 0 4px 4px 0;
}
.timer-bar.urgent { background: linear-gradient(90deg, #FF5A5A, #E8342B); box-shadow: 0 0 16px rgba(255,90,90,0.8); }

/* ============================================================
   HOME — HERO
   ============================================================ */
.hero {
    height: auto; min-height: 620px;
    background: var(--ink-0);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.hero-bg-img { opacity: 0.55; }
.hero-overlay {
    background:
        linear-gradient(90deg, rgba(6,7,11,0.96) 0%, rgba(6,7,11,0.85) 42%, rgba(6,7,11,0.25) 100%),
        linear-gradient(180deg, rgba(6,7,11,0.1) 0%, rgba(6,7,11,0.0) 60%, rgba(11,12,19,1) 100%);
}
.hero-inner {
    align-items: center;
    min-height: 620px;
    max-width: 1180px;
    padding: 48px 40px 40px;
    gap: 24px;
}
.hero-text { flex: 1 1 520px; padding: 0; order: 1; }
.hero-kicker {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--font-display);
    font-size: 12px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--gold);
    padding: 8px 14px 8px 10px;
    border: 1px solid var(--line-gold);
    border-radius: 999px;
    background: rgba(245,184,74,0.06);
    margin-bottom: 22px;
}
.hero-kicker::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 12px var(--ember); }
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(38px, 5.2vw, 72px);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: 0.01em;
    color: var(--text-hi);
    text-shadow: 0 4px 40px rgba(0,0,0,0.6);
    margin-bottom: 22px;
}
.hero h1 em {
    font-style: normal;
    background: var(--grad-gold);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 18px rgba(245,184,74,0.35));
}
.hero-sub {
    font-size: 17px; line-height: 1.6; color: var(--text-mid);
    max-width: 520px; margin-bottom: 30px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 34px; }
.hero-start-btn, .btn-primary, .arena-start-btn, .host-select-btn, .arena-mode-play-btn {
    font-family: var(--font-display);
    font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
    background: var(--grad-ember);
    color: #fff;
    border: 0; border-radius: 14px;
    box-shadow: 0 10px 30px rgba(255,90,46,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
    transition: transform .15s, box-shadow .2s, filter .2s;
}
.hero-start-btn { padding: 18px 44px; font-size: 16px; }
.hero-start-btn:hover, .btn-primary:hover, .arena-start-btn:hover, .host-select-btn:hover, .arena-mode-play-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 16px 40px rgba(255,90,46,0.45), inset 0 1px 0 rgba(255,255,255,0.3);
    background: var(--grad-ember);
    color: #fff;
}
.hero-alt-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 17px 26px;
    font-family: var(--font-display); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 13px;
    color: var(--gold-light);
    border: 1px solid var(--line-gold); border-radius: 14px;
    background: rgba(245,184,74,0.05);
    transition: background .2s, border-color .2s, transform .15s;
}
.hero-alt-btn:hover { background: rgba(245,184,74,0.12); border-color: var(--gold); transform: translateY(-2px); }

.hero-stats {
    display: flex; flex-wrap: wrap; gap: 10px 28px;
    font-size: 13px; color: var(--text-low); margin: 0;
}
.hero-stat { display: flex; flex-direction: column; gap: 2px; min-width: 96px; }
.hero-stat b {
    font-family: var(--font-display);
    font-size: 24px; font-weight: 800; color: var(--text-hi); line-height: 1;
}
.hero-stat span { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-low); }
.hero-stat .loading-dots span { width: 6px; height: 6px; }

.hero-erik {
    order: 2; flex: 0 0 auto;
    margin: 0;
    position: relative;
    filter: none;
}
.hero-erik img {
    height: 560px; width: 560px; max-width: 46vw; object-fit: cover;
    border-radius: 0;
    filter: saturate(1.05) contrast(1.05);
    -webkit-mask-image: radial-gradient(ellipse 62% 66% at 50% 48%, #000 45%, transparent 82%);
    mask-image: radial-gradient(ellipse 62% 66% at 50% 48%, #000 45%, transparent 82%);
}
.hero-erik::after {
    content: ''; position: absolute; inset: 12% 8%;
    background: radial-gradient(circle, rgba(255,107,53,0.28), transparent 62%);
    z-index: -1; filter: blur(30px);
}

/* ============================================================
   HOME — SECTIONS + CARDS
   ============================================================ */
.game-modes, .hosts, .categories, .quests-badges { padding: 72px 0; }
.hosts { position: relative; }
.hosts::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(900px 400px at 50% 0%, rgba(245,184,74,0.07), transparent 70%);
}

/* Poster frame — gradient border via padding-box trick */
.mode-card, .cat-card, .host-card, .qb-panel, .arena-mode-card, .arena-settings-inline,
.question-card, .grade-section, .breakdown-card, .results-card, .stat-card, .ml-status, .ml-settings {
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box;
    border: 1px solid transparent;
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
}

.modes-grid { gap: 22px; }
.mode-card { transition: transform .25s ease, box-shadow .25s ease; }
.mode-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-card), var(--glow-ember); border-color: transparent; }
.mode-card-img { transition: transform .5s ease; }
.mode-card:hover .mode-card-img { transform: scale(1.04); }
.mode-card-info { padding: 16px 18px 18px; position: relative; }
.mode-card-info::before {
    content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.mode-card-info h3 { font-family: var(--font-display); font-size: 16px; font-weight: 800; color: var(--text-hi); margin-bottom: 4px; }
.mode-card-info p { font-size: 13px; color: var(--text-low); }

/* Hosts */
.hosts-grid { gap: 28px; }
.host-card { padding: 28px 24px 26px; background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box; }
.host-card::before { height: 3px; }
.host-video {
    width: 200px; height: 340px; border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transition: transform .3s;
}
.host-card:hover .host-video { transform: scale(1.02); }
.host-card h3 { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.host-card h3::after {
    content: attr(data-sub); display: block;
    font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--text-low); margin-top: 4px;
}
.host-card.sarcastic h3::after { color: #FF8A8A; }
.host-card.neutral h3::after { color: #A5A8FF; }
.host-card.positive h3::after { color: var(--gold-light); }
.host-actions { margin-top: 14px; }
.host-play-btn { border-radius: 12px; padding: 10px 20px; }
.host-select-btn { padding: 10px 26px; font-size: 12px; border-radius: 12px; }

/* Category posters (home + /categories) */
.categories-grid { gap: 18px; }
.cat-card { border-radius: 14px; transition: transform .25s, box-shadow .25s; }
.cat-card:hover, .cat-card.open { transform: translateY(-5px); box-shadow: var(--shadow-card), var(--glow-ember); border-color: transparent; }
.cat-card img { border-radius: 13px 13px 0 0; }
.cat-card-label { font-family: var(--font-display); font-size: 12px; font-weight: 700; padding: 11px 8px; color: var(--text-hi); }
.cat-expand { border-radius: 16px; background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box; border: 1px solid transparent; }
.cat-expand-label { font-family: var(--font-display); color: var(--gold); }
.cat-pill { border-radius: 999px; }
.cat-pill:hover { border-color: var(--gold); color: var(--gold-light); background: rgba(245,184,74,0.08); }
.cat-pill span { color: var(--gold); }

/* Quests & badges */
.qb-panel { padding: 26px; }
.qb-title { font-family: var(--font-display); font-size: 17px; font-weight: 800; }
.quest-xp { font-family: var(--font-display); color: var(--gold); }
.quest-fill { background: var(--grad-gold); }
.badge-circle { border-color: var(--line-gold); box-shadow: 0 0 18px rgba(245,184,74,0.15), inset 0 0 8px rgba(0,0,0,0.4); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { padding: 56px 0 28px; border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgba(0,0,0,0.35)); }
.footer-brand h3 { font-family: var(--font-body); font-size: 20px; font-weight: 700; letter-spacing: 0.04em; }
.footer-col h4 { font-family: var(--font-display); color: var(--gold-dim); letter-spacing: 0.28em; }
.footer-col a { color: var(--text-low); }
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom { color: var(--text-low); }

/* ============================================================
   PLAY / ARENA
   ============================================================ */
.game-main { margin-left: 260px; min-height: 100vh; }
#gameMain { max-width: none; margin: 0 0 0 260px; padding: 28px 36px 48px; }
.arena-page, .mode-landing-screen, .competitions-screen, .comp-screen { max-width: 1160px; margin: 0 auto; }
.arena-page { padding: 8px 0 80px; }
.arena-page .section-label { justify-content: center; font-size: 12px; }
.arena-page .section-title { text-align: center; font-size: clamp(26px, 3vw, 36px); font-weight: 900; margin-bottom: 30px; }

.arena-modes-grid { gap: 22px; }
.arena-mode-card { border-radius: var(--r-card); transition: transform .25s, box-shadow .25s; }
.arena-mode-card:hover, .arena-mode-card.mode-highlighted { transform: translateY(-5px); box-shadow: var(--shadow-card), var(--glow-ember); border-color: transparent; }
.arena-mode-img { height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.arena-mode-body { padding: 18px 20px 20px; }
.arena-mode-name { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: 0.04em; text-transform: none; }
.arena-mode-desc { color: var(--text-mid); font-size: 14.5px; }
.arena-mode-erik {
    background: rgba(245,184,74,0.06);
    border-left: 3px solid var(--gold);
    color: var(--text-mid);
    border-radius: 0 10px 10px 0;
}
.arena-mode-play-btn { border-radius: 12px; padding: 12px 16px; font-size: 12px; }
.arena-mode-video-btn { border-radius: 12px; border-color: var(--line-strong); }

/* filter tabs */
.arena-filter-tabs { justify-content: center; }
.arena-filter-tab { border-radius: 999px; padding: 9px 20px; letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px; }
.arena-filter-tab.active { background: var(--grad-ember); border-color: transparent; box-shadow: 0 6px 18px rgba(255,90,46,0.35); }

/* category posters in arena: portrait art with caption */
.arena-cat-grid { grid-template-columns: repeat(6, 1fr); gap: 16px; }
.arena-cat-card {
    aspect-ratio: auto;
    display: flex; flex-direction: column;
    border-radius: 14px;
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box;
    border: 1px solid transparent;
    box-shadow: var(--shadow-card);
    transition: transform .25s, box-shadow .25s;
}
.arena-cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card), var(--glow-ember); }
.arena-cat-card.selected { box-shadow: var(--shadow-card), 0 0 0 2px var(--ember), 0 10px 40px rgba(255,107,53,0.35); }
.arena-cat-card img { aspect-ratio: 3 / 4; height: auto; flex: 0 0 auto; }
.arena-cat-name {
    position: static;
    background: none; text-shadow: none;
    font-family: var(--font-display);
    font-size: 11.5px; font-weight: 700;
    color: var(--text-hi);
    padding: 10px 8px 11px;
    line-height: 1.25;
}
.arena-cat-count {
    top: 8px; right: 8px;
    background: rgba(6,7,11,0.8);
    color: var(--gold-light);
    border: 1px solid var(--line-gold);
    font-family: var(--font-body);
    font-size: 10.5px; padding: 3px 8px;
    backdrop-filter: blur(6px);
}
.arena-cat-expand { border-radius: 16px; background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box; border: 1px solid transparent; }
.arena-cat-expand-label { font-family: var(--font-display); color: var(--gold); font-size: 14px; }
.arena-cat-pill { border-radius: 999px; }
.arena-cat-pill.selected { background: var(--grad-ember); border-color: transparent; }

/* settings */
.arena-settings-section { margin-top: 48px; }
.arena-settings-inline { padding: 32px; gap: 28px 40px; }
.arena-setting-label { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.24em; color: var(--gold-light); }
.arena-setting-label::after { background: var(--grad-gold); width: 30px; }
.arena-pill {
    border-radius: 999px; padding: 9px 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line-strong);
}
.arena-pill.active { background: var(--grad-ember); border-color: transparent; box-shadow: 0 6px 18px rgba(255,90,46,0.35); color: #fff; }
.arena-pill:hover:not(.active) { border-color: var(--gold); color: var(--gold-light); }
/* host pills get avatars */
.arena-setting-pills[data-setting="host"] .arena-pill { display: inline-flex; align-items: center; gap: 9px; padding: 6px 16px 6px 6px; }
.arena-setting-pills[data-setting="host"] .arena-pill::before {
    content: ''; width: 30px; height: 30px; border-radius: 50%;
    background-size: cover; background-position: center top;
    border: 2px solid rgba(255,255,255,0.35);
}
.arena-setting-pills[data-setting="host"] .arena-pill[data-value="sarcastic"]::before { background-image: url('/assets/images/hosts/thumbs/viking.png'); }
.arena-setting-pills[data-setting="host"] .arena-pill[data-value="neutral"]::before { background-image: url('/assets/images/hosts/thumbs/professor.png'); }
.arena-setting-pills[data-setting="host"] .arena-pill[data-value="positive"]::before { background-image: url('/assets/images/hosts/thumbs/cheerleader.png'); }
.arena-setting-pills[data-setting="host"] .arena-pill[data-value="sarcastic"]::after { content: ' · The Roaster'; color: inherit; opacity: 0.65; font-weight: 400; }
.arena-setting-pills[data-setting="host"] .arena-pill[data-value="neutral"]::after { content: ' · The Professor'; color: inherit; opacity: 0.65; font-weight: 400; }
.arena-setting-pills[data-setting="host"] .arena-pill[data-value="positive"]::after { content: ' · The Cheerleader'; color: inherit; opacity: 0.65; font-weight: 400; }

.arena-start-area { margin-top: 28px; gap: 14px; }
.arena-start-area .arena-start-btn { padding: 18px 56px; font-size: 15px; border-radius: 14px; }
.arena-challenge-btn-inline { font-family: var(--font-display); border-radius: 14px; border-color: var(--line-gold); color: var(--gold-light); }
.arena-challenge-btn-inline:hover { background: rgba(245,184,74,0.12); color: var(--gold-light); }

/* ============================================================
   GAMEPLAY — the stage
   ============================================================ */
body:has(.gameplay-screen) #tt-footer { display: none; }
.gameplay-screen { max-width: 820px; margin: 0 auto; padding-top: 10px; }

.progress-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 18px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
}
.progress-row > span { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--gold-light); white-space: nowrap; }
.progress-bar-wrap { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.07); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--grad-gold); box-shadow: 0 0 12px rgba(245,184,74,0.6); transition: width .4s ease; border-radius: 4px; }

.host-bubble {
    display: flex; align-items: center; gap: 14px;
    max-width: none;
    padding: 12px 18px 12px 12px;
    margin: 0 0 18px;
    border-radius: 18px 18px 18px 6px;
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, linear-gradient(135deg, rgba(255,107,53,0.6), rgba(255,255,255,0.06)) border-box;
    border: 1px solid transparent;
    font-size: 15.5px; line-height: 1.5; color: var(--text-hi);
    box-shadow: var(--shadow-card);
}
.host-bubble-avatar {
    width: 54px !important; height: 54px !important; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 2px solid var(--ember);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.2), 0 6px 16px rgba(0,0,0,0.5);
}

.question-card { padding: 34px 32px 30px; max-width: none; border-radius: 22px; }
.question-category {
    display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
    font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 18px;
}
.question-text { font-size: clamp(20px, 2.2vw, 26px); font-weight: 600; line-height: 1.45; }

.answers-grid { max-width: none; gap: 12px; counter-reset: ans; }
.answer-btn {
    counter-increment: ans;
    gap: 14px;
    min-height: 66px;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 16.5px;
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04)) border-box;
    border: 1px solid transparent;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    transition: transform .15s, box-shadow .2s, background .2s;
}
.answer-btn::before {
    content: counter(ans, upper-alpha);
    flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 14px;
    color: var(--gold-light);
    background: rgba(245,184,74,0.1);
    border: 1px solid var(--line-gold);
}
.answer-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    background: linear-gradient(var(--ink-3), var(--ink-3)) padding-box, linear-gradient(135deg, var(--gold), var(--ember)) border-box;
    box-shadow: 0 12px 30px rgba(255,107,53,0.25);
}
.answer-btn.correct {
    background: linear-gradient(rgba(34,197,94,0.14), rgba(34,197,94,0.14)) padding-box, linear-gradient(135deg, #34D399, #22C55E) border-box;
    color: #86EFAC; box-shadow: 0 0 30px rgba(34,197,94,0.35);
}
.answer-btn.correct::before { color: #052e16; background: #22C55E; border-color: #22C55E; }
.answer-btn.wrong {
    background: linear-gradient(rgba(239,68,68,0.14), rgba(239,68,68,0.14)) padding-box, linear-gradient(135deg, #F87171, #DC2626) border-box;
    color: #FCA5A5; box-shadow: 0 0 30px rgba(239,68,68,0.3);
}
.answer-btn.wrong::before { color: #450a0a; background: #EF4444; border-color: #EF4444; }
.answer-btn.reveal-correct { opacity: 1; background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, linear-gradient(135deg, #34D399, #22C55E) border-box; }
.answer-btn.reveal-correct::before { color: #052e16; background: #22C55E; }
.tf-btn::before { display: none; }
.tf-btn { justify-content: center; }

.powerup-bar { margin-bottom: 18px; }
.powerup-btn { border-radius: 999px; }
.endless-quit { text-align: center; margin-top: 22px; }
.quit-btn { padding: 10px 20px; border-radius: 999px; background: transparent; border: 1px solid var(--line-strong); color: var(--text-mid); font-family: var(--font-body); font-weight: 600; }
.sd-banner, .rewind-banner { border-radius: 999px; font-family: var(--font-display); }

.point-float { font-family: var(--font-display); color: var(--gold-light); text-shadow: 0 0 24px var(--gold); }

/* ============================================================
   RESULTS
   ============================================================ */
.results-screen { max-width: 720px; padding: 10px 0 60px; }
.grade-section { padding: 40px 24px 32px; border-radius: 22px; position: relative; overflow: hidden; }
.grade-section::before {
    content: ''; position: absolute; inset: -40% -20% auto; height: 120%;
    background: radial-gradient(circle at 50% 40%, rgba(245,184,74,0.18), transparent 55%);
    pointer-events: none;
}
.grade-badge { width: 118px; height: 118px; background: var(--ink-0) !important; border-width: 3px; box-shadow: 0 0 0 6px rgba(255,255,255,0.03), 0 0 40px currentColor; position: relative; }
.grade-letter { font-family: var(--font-display); font-size: 52px; }
.score-counter { font-family: var(--font-display); font-size: 44px; color: var(--gold-light); }
.score-label { letter-spacing: 0.3em; }
.results-card, .breakdown-card { padding: 22px 24px; margin-bottom: 16px; }
.card-title { font-family: var(--font-display); font-size: 15px; font-weight: 800; letter-spacing: 0.06em; color: var(--text-hi); }
.breakdown-item { border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); padding: 14px 8px; }
.breakdown-item .breakdown-value { font-family: var(--font-display); font-size: 24px; }
.xp-earned, .xp-levelup { font-family: var(--font-display); color: var(--gold-light); }

.results-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.results-actions .btn, .results-actions button, .results-actions a {
    font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.08em;
    padding: 14px 24px; border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(255,255,255,0.04);
    color: var(--text-hi);
    cursor: pointer;
    transition: transform .15s, background .2s, border-color .2s;
    text-decoration: none;
}
.results-actions .btn:hover, .results-actions button:hover, .results-actions a:hover { transform: translateY(-2px); border-color: var(--gold); background: rgba(245,184,74,0.08); }
.results-actions .btn-primary { background: var(--grad-ember); border-color: transparent; color: #fff; }
.results-actions .btn-primary:hover { background: var(--grad-ember); }

/* ============================================================
   MODE LANDING (styles are JS-injected — win with #gameMain)
   ============================================================ */
#gameMain .mode-landing-screen { padding: 8px 0 40px; }
#gameMain .ml-hero-bg { left: 0; right: 0; top: -40px; height: 520px; border-radius: 0 0 40px 40px; }
#gameMain .ml-header { margin-bottom: 26px; }
#gameMain .ml-back { border-radius: 999px; background: rgba(6,7,11,0.6); backdrop-filter: blur(6px); }
#gameMain .ml-kicker { font-family: var(--font-display); color: var(--gold); letter-spacing: 0.34em; }
#gameMain .ml-header h1 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 46px); font-weight: 900; letter-spacing: 0.04em; text-transform: none; }
#gameMain .ml-split-left { flex-basis: 340px; max-width: 340px; }
#gameMain .ml-video-wrap { border-radius: 20px; }
#gameMain .ml-info-host, #gameMain .ml-example-label, #gameMain .ml-settings-title, #gameMain .ml-setting-label { font-family: var(--font-display); }
#gameMain .ml-desc { font-size: 21px; }
#gameMain .ml-status, #gameMain .ml-settings { border-radius: var(--r-card); }
#gameMain .ml-play-btn, #gameMain .ml-start-btn { font-family: var(--font-display); border-radius: 16px; letter-spacing: 0.3em; }
#gameMain .ml-toggle { border-radius: 999px; }
#gameMain .ml-toggle.active { background: var(--grad-ember); color: #fff; border-color: transparent; }
#gameMain .ml-host-opt { border-radius: 14px; }
#gameMain .ml-host-opt.active { border-color: var(--gold); background: rgba(245,184,74,0.08); }

/* ============================================================
   ACCOUNT
   ============================================================ */
.account-main { margin-left: 260px; max-width: none; padding: 28px 36px 60px; }
.account-screen { max-width: 960px; margin: 0 auto; }
.profile-header { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 0 22px; }
.profile-avatar, .profile-avatar-placeholder { width: 112px; height: 112px; font-family: var(--font-display); }
.profile-avatar-placeholder { background: var(--grad-ember); box-shadow: 0 10px 30px rgba(255,90,46,0.4); }
.profile-name { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.profile-level { font-family: var(--font-display); color: var(--gold); letter-spacing: 0.2em; font-size: 12px; text-transform: uppercase; margin-top: 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { padding: 20px 12px; text-align: center; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--gold-light); }
.stat-label { font-size: 11px; letter-spacing: 0.16em; color: var(--text-low); }
.account-main .section-title { font-family: var(--font-display); font-size: 14px; letter-spacing: 0.22em; color: var(--gold); text-align: left; margin-bottom: 14px; }
.account-main .section-title::before, .account-main .section-title::after { display: none; }
.account-main .card, .account-main .profile-section, .account-main .settings-card, .account-main .prefs-card {
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box;
    border: 1px solid transparent; border-radius: var(--r-card); box-shadow: var(--shadow-card);
}

/* Profile: Appearance (dark / light) */
.pref-theme-section { margin-top: 26px; }
.pref-tts-section { margin-top: 22px; }
.pref-theme-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pref-theme-seg { display: inline-flex; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid var(--line-strong); }
.pref-theme-btn {
    padding: 8px 18px; border-radius: 999px; border: 0; cursor: pointer;
    background: transparent; color: var(--text-mid);
    font-family: var(--font-body); font-weight: 700; font-size: 13px;
    transition: background .2s, color .2s;
}
.pref-theme-btn:hover { color: var(--text-hi); }
.pref-theme-btn.active { background: var(--grad-ember); color: #fff; box-shadow: 0 6px 18px rgba(255,90,46,0.35); }
[data-theme="light"] .pref-theme-seg { background: rgba(0,0,0,0.04); }

/* Badge wall (badges.js renders .badge-grid, which had no rule) */
.badges-header { margin-bottom: 22px; }
.badges-progress { max-width: 420px; }
.badges-count { display: block; font-family: var(--font-display); color: var(--gold-light); margin-bottom: 8px; }
.badges-bar-track { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.07); overflow: hidden; }
.badges-bar-fill { height: 100%; background: var(--grad-gold); }
.badge-category-section { margin-bottom: 30px; }
.badge-category-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.badge-category-header h3 { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.14em; color: var(--gold); }
.badge-category-count { font-size: 12px; color: var(--text-low); letter-spacing: 0.1em; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.badge-card {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 18px 12px 16px; border-radius: 16px;
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box;
    border: 1px solid transparent; box-shadow: var(--shadow-card);
    transition: transform .2s, box-shadow .2s;
}
.badge-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card), var(--glow-ember); }
.badge-card.badge-earned { border-color: transparent; box-shadow: var(--shadow-card), 0 0 0 1px rgba(245,184,74,0.35), 0 0 26px rgba(245,184,74,0.15); }
.badge-card.badge-locked { opacity: 0.55; }
.badge-icon { width: 72px; height: 72px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 34px; background: rgba(255,255,255,0.04); overflow: hidden; }
.badge-info { text-align: center; }
.badge-name { font-family: var(--font-display); font-size: 13px; font-weight: 800; color: var(--text-hi); margin-bottom: 4px; }
.badge-description { font-size: 12px; line-height: 1.4; color: var(--text-mid); }
.badge-rarity { font-family: var(--font-display); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; margin-top: 6px; }
.badge-earned-date { font-size: 11px; color: var(--text-low); margin-top: 4px; }

/* Leaderboard rows: leaderboard.js renders .leaderboard-list/.lb-entry, account.css only styled .lb-list/.lb-row */
.leaderboard-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); margin-bottom: 18px; }
.leaderboard-tabs .lb-tab { flex: none; border-radius: 999px; padding: 8px 16px; }
.leaderboard-tabs .lb-tab.active { background: var(--grad-ember); color: #fff; box-shadow: 0 6px 18px rgba(255,90,46,0.35); }
.leaderboard-list { display: flex; flex-direction: column; gap: 8px; }
.lb-entry {
    display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px;
    padding: 12px 16px; border-radius: 14px;
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04)) border-box;
    border: 1px solid transparent; box-shadow: 0 8px 22px rgba(0,0,0,0.3);
    transition: transform .15s, box-shadow .2s;
}
.lb-entry:hover { transform: translateX(3px); }
.lb-entry.lb-self { background: linear-gradient(rgba(255,107,53,0.1), rgba(255,107,53,0.1)) padding-box, linear-gradient(135deg, var(--ember), var(--gold)) border-box; }
.lb-entry.lb-top3 { background: linear-gradient(var(--ink-3), var(--ink-3)) padding-box, var(--grad-frame) border-box; }
.lb-entry .lb-rank { min-width: 0; font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--text-low); text-align: center; }
.lb-entry .lb-rank.gold, .lb-entry .lb-rank.silver, .lb-entry .lb-rank.bronze { font-size: 24px; }
.lb-player { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 15px; color: #fff;
    background: var(--grad-ember); box-shadow: 0 4px 12px rgba(255,90,46,0.35);
}
.lb-player-info { display: flex; flex-direction: column; min-width: 0; }
.lb-name { font-weight: 700; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-player-title { font-size: 12px; color: var(--text-low); }
.lb-stats { display: flex; flex-direction: column; align-items: flex-end; }
.lb-score { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--gold-light); line-height: 1.1; }
.lb-detail { font-size: 11px; color: var(--text-low); letter-spacing: 0.06em; }

/* Recent XP rows (profile.js .xp-entry had no rule) */
.recent-xp-list { display: flex; flex-direction: column; }
.xp-entry { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.xp-entry:last-child { border-bottom: 0; }
.xp-entry-reason { color: var(--text-mid); }
.xp-entry-amount { font-family: var(--font-display); font-weight: 800; color: var(--gold-light); }
.xp-entry-time { font-size: 12px; color: var(--text-low); min-width: 64px; text-align: right; }

/* Cosmetics preview header */
.cosmetics-preview { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin: 4px 0 22px; border-radius: var(--r-card);
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box; border: 1px solid transparent; box-shadow: var(--shadow-card); }
.preview-avatar { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 22px; color: #fff; background: var(--grad-ember); box-shadow: 0 6px 18px rgba(255,90,46,0.4); }
.preview-name { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--text-hi); }
.preview-title { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.preview-title:empty::before { content: 'No title equipped'; color: var(--text-low); letter-spacing: 0.06em; text-transform: none; }
.cosmetics-section-header { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 12px; }
.cosmetics-section-header h3 { font-family: var(--font-display); color: var(--gold); letter-spacing: 0.14em; font-size: 16px; }
.cosmetics-count { font-size: 12px; color: var(--text-low); }

/* ── Stats dashboard (stats.js v7) ── */
.stats-screen { padding: 0 0 30px; }
.st-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stats-title { font-family: var(--font-display); font-size: 30px; font-weight: 900; color: var(--text-hi); margin: 0 0 4px; }
.stats-subtitle { color: var(--text-low); font-size: 13px; margin: 0; }
.st-play-btn { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px;
    padding: 12px 20px; border-radius: 12px; background: var(--grad-ember); color: #fff; box-shadow: 0 8px 22px rgba(255,90,46,0.35); }
.st-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.st-tile { position: relative; padding: 20px 20px 18px; border-radius: var(--r-card); min-height: 150px; display: flex; flex-direction: column; justify-content: center;
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box; border: 1px solid transparent; box-shadow: var(--shadow-card); }
.st-tile-label { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-low); margin-bottom: 8px; }
.st-tile-value { font-family: var(--font-display); font-size: 34px; font-weight: 900; color: var(--text-hi); line-height: 1; }
.st-tile-foot { font-size: 12px; color: var(--text-low); margin-top: 10px; }
.st-gold { color: var(--gold-light); } .st-ember { color: #FF8A3D; }
.st-tile-ring { align-items: center; text-align: center; padding-top: 16px; }
.st-ring { display: block; }
.st-ring-center { position: absolute; top: 16px; left: 0; right: 0; height: 118px; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.st-ring-center b { font-family: var(--font-display); font-size: 26px; color: #4ADE80; line-height: 1; }
.st-ring-center span { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-low); margin-top: 4px; }
.st-tile-ring .st-tile-foot { margin-top: 6px; }
.st-grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-bottom: 14px; }
.st-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.st-card { padding: 18px 20px 16px; border-radius: var(--r-card); margin-bottom: 14px; min-width: 0;
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box; border: 1px solid transparent; box-shadow: var(--shadow-card); }
.st-grid-2 .st-card, .st-grid-3 .st-card { margin-bottom: 0; }
.st-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.st-card-head h3 { font-family: var(--font-display); font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin: 0; }
.st-card-head span { font-size: 12px; color: var(--text-low); text-align: right; }
.st-card-head-sub { margin-top: 18px; }
.st-empty { color: var(--text-low); font-size: 13px; padding: 12px 0; }
.st-spark { width: 100%; height: 150px; display: block; }
.st-spark-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-low); margin-top: 4px; }
.st-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 11px; color: var(--text-low); }
.st-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.st-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; }
.st-bar-fill { height: 100%; border-radius: 4px; transition: width .6s ease; }
.st-week { display: flex; flex-direction: column; gap: 10px; }
.st-week-row { display: grid; grid-template-columns: 110px 1fr 56px; gap: 12px; align-items: center; }
.st-week-label { font-size: 13px; color: var(--text-mid); }
.st-week-bars { display: flex; flex-direction: column; gap: 4px; }
.st-week-bar { display: flex; align-items: center; gap: 8px; }
.st-week-bar b { font-family: var(--font-display); font-size: 12px; min-width: 46px; text-align: right; color: var(--text-hi); }
.st-week-bar b.st-dim { color: var(--text-low); }
.st-week-tag { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-low); width: 28px; }
.st-week-delta { font-family: var(--font-display); font-size: 12px; text-align: center; padding: 4px 6px; border-radius: 999px; }
.st-week-delta.up { color: #4ADE80; background: rgba(34,197,94,0.12); }
.st-week-delta.down { color: #F87171; background: rgba(239,68,68,0.12); }
.st-week-delta.same { color: var(--text-low); }
.st-stack { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,0.06); }
.st-stack-seg { height: 100%; }
.st-stack-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; font-size: 12px; color: var(--text-mid); }
.st-stack-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.st-stack-legend b { font-family: var(--font-display); color: var(--text-hi); margin-right: 3px; }
.st-stack-legend span { color: var(--text-low); margin-left: 4px; }
.st-minirow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.st-minirow div { display: flex; flex-direction: column; gap: 2px; }
.st-minirow span { font-size: 11px; color: var(--text-low); }
.st-minirow b { font-family: var(--font-display); font-size: 16px; color: var(--text-hi); }
.st-grades { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; height: 170px; align-items: end; }
.st-grade-col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.st-grade-track { flex: 1; width: 100%; max-width: 40px; display: flex; align-items: flex-end; background: rgba(255,255,255,0.05); border-radius: 8px; overflow: hidden; }
.st-grade-fill { width: 100%; border-radius: 8px 8px 0 0; min-height: 3px; transition: height .6s ease; }
.st-grade-letter { font-family: var(--font-display); font-weight: 900; font-size: 15px; margin-top: 8px; }
.st-grade-count { font-size: 11px; color: var(--text-low); }
.st-cats { display: flex; flex-direction: column; gap: 10px; }
.st-cat { display: grid; grid-template-columns: 42px 1fr 80px; gap: 12px; align-items: center; }
.st-cat-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: rgba(255,255,255,0.04); border: 1px solid; }
.st-cat-body { min-width: 0; }
.st-cat-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 5px; }
.st-cat-top b { color: var(--text-hi); }
.st-cat-top span { color: var(--text-low); font-size: 12px; white-space: nowrap; }
.st-cat-bars { display: flex; align-items: center; gap: 10px; }
.st-cat-bars em { font-style: normal; font-family: var(--font-display); font-size: 13px; min-width: 42px; text-align: right; }
.st-cat-games { display: flex; align-items: center; }
.st-modes, .st-hosts { display: flex; flex-direction: column; gap: 10px; }
.st-mode { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.st-mode:last-child { border-bottom: 0; }
.st-mode-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.04); font-size: 18px; }
.st-mode div { display: flex; flex-direction: column; }
.st-mode b { font-size: 13px; color: var(--text-hi); }
.st-mode span { font-size: 12px; color: var(--text-low); }
.st-host { display: flex; align-items: center; gap: 12px; }
.st-host img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid; flex-shrink: 0; }
.st-host-body { flex: 1; min-width: 0; }
.st-host-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.st-host-top b { color: var(--text-hi); } .st-host-top span { color: var(--text-low); font-size: 12px; }
.st-host-body .st-bar { margin-bottom: 4px; }
.st-host-body em { font-style: normal; font-size: 11px; color: var(--text-low); }
.st-daily { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.st-daily div { padding: 12px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); display: flex; flex-direction: column; }
.st-daily b { font-family: var(--font-display); font-size: 22px; color: var(--gold-light); line-height: 1; }
.st-daily span { font-size: 11px; color: var(--text-low); margin-top: 4px; }
.st-activity { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 70px; align-items: end; }
.st-act-day { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.st-act-bar { width: 100%; border-radius: 4px 4px 2px 2px; background: var(--grad-gold); }
.st-act-day span { font-size: 9px; color: var(--text-low); margin-top: 4px; }
@media (max-width: 1100px) { .st-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .st-hero { grid-template-columns: repeat(2, 1fr); } .st-grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .st-grid-3 { grid-template-columns: 1fr; } .st-week-row { grid-template-columns: 90px 1fr 48px; } .st-cat { grid-template-columns: 38px 1fr; } .st-cat-games { display: none; } .st-stack-legend, .st-minirow { grid-template-columns: 1fr; } }

/* ── Achievements: trophy tracks (achievements.js v8) ── */
.achievements-screen { padding: 0 0 30px; }
.ach-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.achievements-title { font-family: var(--font-display); font-size: 30px; font-weight: 900; color: var(--text-hi); margin: 0 0 4px; }
.achievements-subtitle { color: var(--text-low); font-size: 13px; margin: 0; }
.ach-head-progress { flex: 0 1 380px; }
.ach-head-track { height: 10px; border-radius: 5px; background: rgba(255,255,255,0.07); overflow: hidden; }
.ach-head-fill { height: 100%; background: var(--grad-gold); box-shadow: 0 0 14px rgba(245,184,74,0.6); }
.ach-head-tiers { display: flex; gap: 14px; margin-top: 8px; font-size: 11px; color: var(--text-low); letter-spacing: 0.08em; }
.ach-tier-dot i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: var(--coin-b); border: 1px solid var(--coin-a); }

/* coin palettes */
.ach-bronze  { --coin-a: #E8B27A; --coin-b: #A3612B; --coin-c: #5B3416; --coin-glow: rgba(205,127,50,0.55); }
.ach-silver  { --coin-a: #F4F6FA; --coin-b: #B9C0CC; --coin-c: #6E7683; --coin-glow: rgba(200,210,225,0.55); }
.ach-gold    { --coin-a: #FFF0B3; --coin-b: #F5B84A; --coin-c: #9A6208; --coin-glow: rgba(245,184,74,0.65); }
.ach-diamond { --coin-a: #FFFFFF; --coin-b: #9FD8FF; --coin-c: #3E7FB8; --coin-glow: rgba(140,210,255,0.7); }

.ach-medal { position: relative; width: 104px; height: 104px; flex-shrink: 0; }
.ach-coin {
    width: 100%; height: 100%; border-radius: 50%; padding: 7px;
    background: conic-gradient(from 210deg, var(--coin-a), var(--coin-b) 25%, var(--coin-c) 50%, var(--coin-b) 75%, var(--coin-a));
    box-shadow: 0 10px 24px rgba(0,0,0,0.55), 0 0 26px var(--coin-glow), inset 0 1px 1px rgba(255,255,255,0.6);
}
.ach-coin-inner {
    width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
    background: radial-gradient(circle at 50% 40%, #182038, #0a0f1f 70%);
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.5), inset 0 6px 14px rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center; font-size: 34px;
}
.ach-coin-inner img { width: 118%; height: 118%; object-fit: cover; mix-blend-mode: screen; filter: saturate(1.15) contrast(1.05); }
.is-earned .ach-medal::after {
    content: ''; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, var(--coin-glow), transparent 68%); z-index: -1; filter: blur(6px);
}
.ach-medal.is-locked .ach-coin { filter: grayscale(1) brightness(0.55); box-shadow: 0 8px 18px rgba(0,0,0,0.5); }
.ach-medal.is-locked .ach-coin-inner img { opacity: 0.55; }
.ach-lock { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: #1b1d2b; border: 1px solid var(--line-strong);
    display: flex; align-items: center; justify-content: center; font-size: 14px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }

.ach-next { padding: 18px 20px 16px; margin-bottom: 22px; border-radius: var(--r-card);
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad-frame) border-box; border: 1px solid transparent; box-shadow: var(--shadow-card); }
.ach-next-title { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.ach-next-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ach-next-card { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.ach-next-card .ach-medal { width: 72px; height: 72px; }
.ach-next-card .ach-coin { padding: 5px; } .ach-next-card .ach-lock { width: 22px; height: 22px; font-size: 11px; }
.ach-next-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ach-next-body b { color: var(--text-hi); font-size: 14px; }
.ach-next-body span { color: var(--text-low); font-size: 12px; }
.ach-next-body em { font-style: normal; font-family: var(--font-display); font-size: 12px; color: var(--gold-light); }
.ach-bar { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.07); overflow: hidden; margin-top: 6px; }
.ach-bar-fill { height: 100%; border-radius: 4px; background: var(--grad-ember); box-shadow: 0 0 10px rgba(255,107,53,0.6); }

.ach-track { margin-bottom: 26px; }
.ach-track-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ach-track-head h2 { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.12em; color: var(--text-hi); margin: 0; }
.ach-track-head span { font-size: 12px; color: var(--text-low); }
.ach-track-count { font-family: var(--font-display); font-size: 13px; color: var(--gold); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.ach-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 20px 14px 16px; border-radius: 18px;
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, linear-gradient(160deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04)) border-box;
    border: 1px solid transparent; box-shadow: var(--shadow-card); transition: transform .2s, box-shadow .2s; }
.ach-card:hover { transform: translateY(-4px); }
.ach-card.is-earned { background: linear-gradient(var(--ink-3), var(--ink-2)) padding-box, linear-gradient(160deg, var(--coin-b), rgba(255,255,255,0.05) 60%, var(--coin-b)) border-box; }
.ach-card.is-earned:hover { box-shadow: var(--shadow-card), 0 0 30px var(--coin-glow); }
.ach-card.is-locked { opacity: 0.8; }
.ach-name { font-family: var(--font-display); font-size: 13px; font-weight: 800; color: var(--text-hi); margin-top: 4px; }
.ach-desc { font-size: 12px; line-height: 1.4; color: var(--text-mid); min-height: 34px; }
.ach-earned { font-size: 11px; color: var(--coin-b); letter-spacing: 0.06em; }
.ach-card .ach-bar { width: 100%; }
.ach-prog { font-family: var(--font-display); font-size: 12px; color: var(--gold-light); }
.ach-prog-muted { color: var(--text-low); font-family: var(--font-body); font-size: 11px; letter-spacing: 0.06em; }
.ach-recent { margin-top: 6px; }
.ach-recent-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ach-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; font-size: 12px; color: var(--text-hi);
    background: rgba(255,255,255,0.04); border: 1px solid var(--coin-b); }
.ach-chip i { font-style: normal; color: var(--text-low); font-size: 11px; }
@media (max-width: 900px) { .ach-next-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ach-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .ach-medal { width: 84px; height: 84px; } .ach-card { padding: 14px 10px 12px; } .ach-head-progress { flex-basis: 100%; } }

/* Weekly League screen (leagues.js) */
.league-hero {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    padding: 22px 24px; margin-bottom: 16px; border-radius: var(--r-card);
    background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, linear-gradient(135deg, var(--league-color, #CD7F32), rgba(255,255,255,0.06)) border-box;
    border: 1px solid transparent; box-shadow: var(--shadow-card);
}
.league-hero-icon { font-size: 40px; line-height: 1; }
.league-hero-text { flex: 1; min-width: 200px; }
.league-hero-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--league-color, var(--gold)); }
.league-hero-meta { font-size: 13px; color: var(--text-low); margin-top: 4px; }
.league-hero-you { display: flex; flex-direction: column; align-items: flex-end; }
.league-you-rank { font-family: var(--font-display); font-size: 30px; font-weight: 900; color: var(--gold-light); line-height: 1; }
.league-you-label { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-low); }
.league-you-score { font-size: 13px; color: var(--text-mid); margin-top: 4px; }
.league-divisions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.league-divisions .league-div-chip { border-radius: 999px; padding: 6px 14px; font-size: 12px; }
.lb-entry.league-promo { box-shadow: inset 3px 0 0 #22C55E; }
.lb-entry.league-relegate { box-shadow: inset 3px 0 0 #EF4444; }
.lb-entry { border-radius: 14px; }

/* ============================================================
   KNOWLEDGE + static pages: nothing structural, type only
   ============================================================ */
.knowledge-hero h1, .culture-name, .article-title { font-family: var(--font-display); }

/* ============================================================
   LOADING
   ============================================================ */
.loading-dots span { background: var(--gold); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .arena-cat-grid { grid-template-columns: repeat(5, 1fr); }
    .hero-erik img { height: 480px; width: 480px; }
}
@media (max-width: 1024px) {
    .arena-cat-grid { grid-template-columns: repeat(4, 1fr); }
    .hero-erik img { height: 420px; width: 420px; }
}
@media (max-width: 900px) {
    .hero-inner { flex-direction: column; text-align: center; padding: 36px 20px 0; min-height: 0; }
    .hero-text { order: 1; }
    .hero-erik { order: 2; margin-top: -10px; }
    .hero-erik img { max-width: 90vw; height: 380px; width: 380px; }
    .hero-cta, .hero-stats { justify-content: center; }
    .hero-sub { margin-left: auto; margin-right: auto; }
}
@media (max-width: 768px) {
    .tt-topbar { display: block; }
    .tt-topbar-inner { margin-left: 0; }
    .tt-topbar-logo { font-family: var(--font-body); }
    .sidebar { display: none; }
    .main-content, .game-main, #gameMain, .account-main { margin-left: 0; }
    #gameMain, .account-main { padding: 18px 14px 90px; }
    .timer-bar-container { left: 0; top: 52px; }
    .hero { min-height: 0; }
    .hero-inner { padding-top: 28px; }
    .hero-kicker { font-size: 10px; letter-spacing: 0.22em; padding: 7px 12px 7px 9px; margin-bottom: 16px; }
    .hero h1 { font-size: clamp(32px, 9vw, 44px); }
    .hero-sub { font-size: 15px; margin-bottom: 22px; }
    .hero-cta { margin-bottom: 26px; }
    .hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; }
    .hero-stat { min-width: 0; align-items: center; }
    .hero-stat b { font-size: 19px; }
    .hero-stat span { font-size: 10px; letter-spacing: 0.08em; }
    .hero-erik { margin-top: -30px; }
    .hero-erik img { height: 330px; width: 330px; }
    .game-score-float { top: auto; bottom: 84px; right: 12px; }
    .section-title { font-size: 26px; margin-bottom: 26px; }
    .game-modes, .hosts, .categories, .quests-badges { padding: 48px 0; }
    .host-video { width: 180px; height: 300px; }
    .arena-cat-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .arena-settings-inline { padding: 22px 18px; }
    .arena-setting-pills[data-setting="host"] .arena-pill::after { display: none; }
    .question-card { padding: 26px 20px 22px; }
    .answer-btn { min-height: 60px; font-size: 15.5px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .mobile-tabs { background: rgba(6,7,11,0.95); backdrop-filter: blur(10px); border-top-color: var(--line-strong); }
    .mtab.active { color: var(--gold-light); }
}
@media (max-width: 480px) {
    .arena-cat-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-erik img { height: 300px; width: 300px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .hero-cta { flex-direction: column; }
    .hero-start-btn, .hero-alt-btn { width: 100%; text-align: center; justify-content: center; }
}

/* ============================================================
   LIGHT THEME — parchment. Keeps the toggle usable.
   ============================================================ */
[data-theme="light"] {
    --ink-0: #F2EBDF;
    --ink-1: #F8F3EA;
    --ink-2: #FFFFFF;
    --ink-3: #F3EDE2;
    --ink-4: #E9E1D2;
    --line: rgba(60, 40, 10, 0.1);
    --line-strong: rgba(60, 40, 10, 0.2);
    --line-gold: rgba(200, 140, 30, 0.45);
    --text-hi: #1E1710;
    --text-mid: rgba(30, 23, 16, 0.75);
    --text-low: rgba(30, 23, 16, 0.5);
    --gold: #B8781A;
    --gold-light: #A56A12;
    --gold-dim: rgba(184, 120, 26, 0.5);
    --shadow-card: 0 10px 30px rgba(60, 40, 10, 0.12);
    --bg-card: rgba(0, 0, 0, 0.02);
    --bg-card-hover: rgba(0, 0, 0, 0.05);
    --bg-elevated: rgba(0, 0, 0, 0.04);
    --bg-header: rgba(248, 243, 234, 0.9);
}
[data-theme="light"] body {
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(255, 107, 53, 0.12), transparent 60%),
        var(--ink-1);
}
[data-theme="light"] .sidebar { background: var(--ink-0); box-shadow: none; }
[data-theme="light"] .sidebar-logo, [data-theme="light"] .sidebar-item.active, [data-theme="light"] .sidebar-user-name { color: var(--text-hi); }
[data-theme="light"] .sidebar-item { color: var(--text-mid); }
[data-theme="light"] .hero { background: var(--ink-0); }
[data-theme="light"] .hero-overlay {
    background: linear-gradient(90deg, rgba(242,235,223,0.97) 0%, rgba(242,235,223,0.85) 45%, rgba(242,235,223,0.3) 100%);
}
[data-theme="light"] .hero h1, [data-theme="light"] .section-title, [data-theme="light"] .mode-card-info h3,
[data-theme="light"] .host-card h3, [data-theme="light"] .cat-card-label, [data-theme="light"] .qb-title,
[data-theme="light"] .arena-cat-name, [data-theme="light"] .arena-mode-name, [data-theme="light"] .footer-brand h3 { color: var(--text-hi); text-shadow: none; }
[data-theme="light"] .hero-stat b { color: var(--text-hi); }
[data-theme="light"] .hero-alt-btn { color: var(--gold-light); }
[data-theme="light"] .answer-btn, [data-theme="light"] .host-bubble, [data-theme="light"] .question-card { color: var(--text-hi); }
[data-theme="light"] .header-score, [data-theme="light"] .header-streak { background: rgba(255,255,255,0.9); color: var(--text-hi); }
[data-theme="light"] .mobile-tabs { background: rgba(255,255,255,0.95); }
[data-theme="light"] .footer { background: linear-gradient(180deg, transparent, rgba(60,40,10,0.05)); }
[data-theme="light"] .footer-col a, [data-theme="light"] .footer-brand p, [data-theme="light"] .footer-bottom { color: var(--text-low); }
[data-theme="light"] .arena-pill, [data-theme="light"] .arena-filter-tab, [data-theme="light"] .cat-pill, [data-theme="light"] .arena-cat-pill { color: var(--text-mid); background: rgba(0,0,0,0.03); }
[data-theme="light"] .arena-pill.active, [data-theme="light"] .arena-filter-tab.active, [data-theme="light"] .arena-cat-pill.selected,
[data-theme="light"] .cat-pill.selected { background: var(--grad-ember); color: #fff; border-color: transparent; }
[data-theme="light"] .arena-setting-pills[data-setting="host"] .arena-pill::after { color: inherit; opacity: 0.65; }
[data-theme="light"] .hero-erik img { mix-blend-mode: multiply; }
