:root {
    color-scheme: dark;
    --bg: #100e0c;
    --card: rgba(28, 24, 20, 0.94);
    --line: rgba(212, 175, 95, 0.35);
    --gold: #e4c77b;
    --gold-deep: #b8893a;
    --text: #f6f1e7;
    --muted: #b7ab9a;
    --ok: #d8f3df;
    --ok-bg: #1e3a28;
    --bad: #ffd2d2;
    --bad-bg: #4a2424;
    --good: #8fd0a4;
    --stop: #e7a0a0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(212, 175, 95, 0.16), transparent 36%),
        var(--bg);
    font-family: Outfit, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.45;
}

h1, h2, .prompt, .answer-text, .timer {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 500;
}

a { color: var(--gold); }

.top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(212, 175, 95, 0.2);
}

.brand {
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.top nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.top a {
    color: var(--text);
    text-decoration: none;
}

.top a[aria-current="page"] { color: var(--gold); }

.wrap, .gate {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 64px;
}

.gate { width: min(560px, calc(100% - 28px)); padding-top: 64px; }

.mark {
    margin: 0 0 8px;
    color: var(--gold);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

h1 { margin: 0 0 10px; font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 0.95; }
h2 { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }

.lead, .fine { color: var(--muted); }
.fine { font-size: 0.92rem; }

.flash, .banner {
    width: min(1180px, calc(100% - 28px));
    margin: 16px auto 0;
    padding: 12px 14px;
    border-radius: 12px;
}

.flash-ok, .banner { background: var(--ok-bg); color: var(--ok); }
.flash-bad { background: var(--bad-bg); color: var(--bad); }
.banner { width: auto; margin: 0 0 16px; }

.card, .hero-card, .question-card, .score-rail, .answer-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
}

.hero-card, .card, .question-card { padding: 22px; }
.card, .hero-card { margin-bottom: 18px; }

.deck {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

.q-meta, .head-actions, .actions, .inline, .console-head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.console-head { justify-content: space-between; margin-bottom: 18px; }
.console-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }

.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--gold);
    font-size: 0.82rem;
}

.pill-easy { color: var(--good); }
.pill-difficult, .pill-open_buzzer { color: #f0c7a0; }

.assigned { color: var(--gold); margin: 12px 0; }
.prompt { font-size: clamp(1.8rem, 3vw, 2.7rem); line-height: 1.15; margin: 0 0 12px; }

.timer {
    margin: 8px 0 16px;
    font-size: clamp(4.5rem, 12vw, 7rem);
    line-height: 0.85;
    font-variant-numeric: tabular-nums;
}

.timer small {
    display: block;
    margin-top: 6px;
    font-family: Outfit, sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.timer.is-running { color: var(--gold); }
.timer.is-done { color: var(--stop); }

.answer-card { padding: 16px 18px; margin: 8px 0 16px; }
.answer-text { font-size: 2rem; margin: 0 0 8px; }
.covered { color: var(--muted); margin: 0; }

.actions form, .buzz-grid form { margin: 0; }

button, .button-link {
    appearance: none;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    border-radius: 12px;
    min-height: 52px;
    padding: 10px 16px;
    font: 600 1rem Outfit, sans-serif;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button.go, .button-link { background: linear-gradient(180deg, #e7cb86, #b8893a); color: #22190d; border-color: transparent; }
button.good { background: var(--ok-bg); color: var(--good); }
button.stop { background: var(--bad-bg); color: var(--stop); }
button.large { min-height: 64px; padding-inline: 22px; font-size: 1.05rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.buzz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

button.buzz {
    width: 100%;
    min-height: 76px;
    flex-direction: column;
    background: #241c14;
}

button.buzz small { display: block; color: var(--muted); font-weight: 400; }

.score-rail { padding: 16px; }
.board { list-style: none; margin: 0; padding: 0; }
.board li {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 8px;
    align-items: baseline;
    padding: 9px 0;
    border-top: 1px solid rgba(212, 175, 95, 0.16);
}
.board li:first-child { border-top: 0; }
.board .pos { color: var(--muted); }
.board .pts { font-variant-numeric: tabular-nums; font-size: 1.25rem; }
.board .is-lead .who, .board .is-lead .pts { color: var(--gold); }
.who small { display: inline-block; margin-left: 6px; color: var(--muted); font-size: 0.75rem; }
.who small.up { color: var(--good); }
.who small.down { color: var(--stop); }

.stack { display: grid; gap: 12px; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
label { display: grid; gap: 6px; color: var(--muted); }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #14110e;
    color: var(--text);
    border-radius: 10px;
    padding: 12px;
    font: 1rem Outfit, sans-serif;
}
textarea { resize: vertical; }
fieldset { border: 1px solid rgba(212, 175, 95, 0.2); border-radius: 14px; margin: 0; }
legend { color: var(--gold); padding: 0 6px; }

.q-list, .gaps, .timeline { margin: 0; padding-left: 18px; }
.q-list { list-style: none; padding: 0; }
.q-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(212, 175, 95, 0.12); }
.q-list a { color: var(--text); text-decoration: none; }

.table-wrap { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid rgba(212, 175, 95, 0.16); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }

.fold { margin-top: 16px; border-top: 1px solid rgba(212, 175, 95, 0.2); padding-top: 10px; }
.fold summary { cursor: pointer; color: var(--gold); }
.fold-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.danger-form { margin-top: 18px; }
.rules { color: var(--muted); font-size: 0.92rem; }
.lock-line { color: var(--gold); }
.final-table { margin-top: 18px; }

@media (max-width: 860px) {
    .deck { grid-template-columns: 1fr; }
    .top { align-items: flex-start; flex-direction: column; }
}
