/*
 * The Pub Quiz — stylesheet.
 *
 * Dark, warm and brassy: bottle-green baize, brass gold, cream chalk. Built to
 * read from across a room on a telly as well as from a phone in the host's hand.
 * Sections: tokens, base, topbar, controls, setup, stage, marking, leaderboard,
 * interval, tie-break, results, overlay, print, responsive.
 */

/* ---------- tokens ---------- */

:root {
    --bg: #0d100d;
    --bg-deep: #080a08;
    --surface: #161b16;
    --surface-2: #1c221c;
    --surface-hover: #232a23;
    --border: #2b332b;
    --border-bright: #3d493d;

    --text: #ece7d8;
    --text-muted: #9aa094;
    /* The dimmest tier still has to clear 4.5:1 on --surface-hover, the lightest
       surface it ever sits on. */
    --text-dim: #90978c;

    --gold: #c4a24e;
    --gold-bright: #e0bd6a;
    --gold-dim: rgba(196, 162, 78, 0.16);
    --green: #4a9e6e;
    --red: #c45e4e;
    --blue: #5b8fd6;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);

    --stage-max: 1100px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

/* ---------- base ---------- */

/* 100%, not 16px: everything below is sized in rem, so the reader's own browser
   font-size setting has to be the one that wins. */
html { font-size: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background:
        radial-gradient(1200px 700px at 50% -10%, rgba(74, 158, 110, 0.10), transparent 60%),
        radial-gradient(900px 600px at 90% 110%, rgba(196, 162, 78, 0.08), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    padding-top: 3.5rem;
}

/* faint baize weave, keeps the flat dark from looking like a void */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    background-image:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.011) 0 2px, transparent 2px 4px),
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 4px);
}

.app {
    position: relative;
    z-index: 1;
    max-width: var(--stage-max);
    margin: 0 auto;
    padding: 1.5rem 1.25rem 5rem;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.accent { color: var(--gold); }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.empty { color: var(--text-muted); text-align: center; padding: 2rem; }
.hint { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.6rem; }
.row { display: flex; align-items: center; gap: 0.6rem; }
.row.wrap, .wrap { flex-wrap: wrap; }

::selection { background: var(--gold); color: #10130f; }

:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- topbar ---------- */

.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3.5rem;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1rem;
    background: rgba(10, 13, 10, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }

.brand {
    display: inline-flex; align-items: center; gap: 0.55rem;
    background: none; border: 0; cursor: pointer; color: var(--text);
    font-family: inherit; padding: 0.3rem 0.4rem; border-radius: var(--radius-sm);
}
.brand:hover { background: var(--surface); }

.brand-mark {
    display: grid; place-items: center;
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(140deg, var(--gold-bright), var(--gold));
    color: #10130f;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.05rem;
    box-shadow: 0 2px 10px rgba(196, 162, 78, 0.35);
}

.brand-name { font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }

.topbar-position {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-left: 0.75rem;
    margin-left: 0.35rem;
    border-left: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-btn {
    display: grid; place-items: center;
    width: 36px; height: 36px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s var(--ease);
}
/* Muted is signalled by colour alone: dimming with opacity put the one state the
   host needs to catch from across the room below the 3:1 non-text minimum. */
.tool-btn.is-off { color: var(--red); }
.tool-btn:hover, .tool-btn.is-off:hover { background: var(--surface); color: var(--text); border-color: var(--border); }

.speaking-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gold);
    opacity: 0;
    transition: opacity 0.2s;
    margin-right: 0.2rem;
}
body.is-speaking .speaking-dot { opacity: 1; animation: pulse-dot 1s infinite; }

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(196, 162, 78, 0.6); }
    50% { transform: scale(1.25); box-shadow: 0 0 0 6px rgba(196, 162, 78, 0); }
}

/* ---------- controls ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    border: 1px solid var(--border-bright);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s, box-shadow 0.15s;
    user-select: none;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(160deg, var(--gold-bright), var(--gold));
    border-color: var(--gold);
    color: #10130f;
    box-shadow: 0 6px 20px rgba(196, 162, 78, 0.24);
}
.btn-primary:hover { background: linear-gradient(160deg, #eecd7d, var(--gold-bright)); border-color: var(--gold-bright); }

.btn-large { padding: 0.85rem 1.6rem; font-size: 1.02rem; border-radius: 12px; }
.btn-small { padding: 0.42rem 0.75rem; font-size: 0.82rem; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { color: var(--red); border-color: rgba(196, 94, 78, 0.5); }
.btn-danger:hover { background: rgba(196, 94, 78, 0.12); border-color: var(--red); }

.icon-btn {
    display: grid; place-items: center;
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); border-color: var(--gold); }
.icon-btn:disabled { opacity: 0.25; cursor: default; }

.input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.input-number { width: 5.5rem; text-align: center; font-family: var(--font-mono); }

select.input { cursor: pointer; }

.chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.22rem 0.62rem;
    border: 1px solid var(--border-bright);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.chip-small { font-size: 0.65rem; padding: 0.12rem 0.45rem; }
.chip-topic { text-transform: none; letter-spacing: 0; color: var(--text); }
.chip-easy { color: var(--green); border-color: rgba(74, 158, 110, 0.4); }
.chip-medium { color: var(--gold); border-color: rgba(196, 162, 78, 0.4); }
.chip-hard { color: var(--red); border-color: rgba(196, 94, 78, 0.4); }

.chip-worth {
    margin-left: 0.35rem;
    padding-left: 0.35rem;
    border-left: 1px solid currentColor;
    opacity: 0.75;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.pips { display: inline-flex; gap: 2px; }
.pip { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.22; }
.pip.is-on { opacity: 1; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

/* ---------- setup ---------- */

.hero { text-align: center; padding: 2.5rem 0 2rem; }

.hero-badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--gold);
    border-radius: 999px;
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.6rem, 8vw, 4.6rem);
    letter-spacing: -0.03em;
    line-height: 1;
}
.hero-title .accent {
    background: linear-gradient(140deg, var(--gold-bright), var(--gold) 60%, #a5813a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    max-width: 40rem;
    margin: 1rem auto 0;
    color: var(--text-muted);
    font-size: 1.02rem;
}
.hero-pack { margin-top: 0.6rem; color: var(--text-dim); font-size: 0.88rem; }

.banner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    background: var(--gold-dim);
}

.setup-step { margin-bottom: 1.25rem; overflow: hidden; }

.step-head {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 1rem 1.35rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}
.step-head h2 { font-size: 1.05rem; font-weight: 700; flex: 1; }
.step-number {
    display: grid; place-items: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--gold-dim);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
}
.step-icon { color: var(--text-dim); display: grid; place-items: center; }
.step-body { padding: 1.35rem; }

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

.pack-card {
    text-align: left;
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}
.pack-card:hover { border-color: var(--border-bright); background: var(--surface-hover); transform: translateY(-2px); }
.pack-card.is-selected { border-color: var(--gold); background: var(--gold-dim); box-shadow: 0 0 0 1px var(--gold); }
.pack-card-top { display: flex; align-items: center; gap: 0.5rem; }
.pack-card h3 { font-size: 1.02rem; font-weight: 700; }
.pack-desc { color: var(--text-muted); font-size: 0.86rem; margin-top: 0.35rem; }
.pack-stats {
    display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem;
    margin-top: 0.7rem;
    font-size: 0.76rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}
.pack-stats .verified { color: var(--green); }
.pack-meta { display: flex; gap: 0.8rem; margin-top: 0.4rem; font-size: 0.72rem; color: var(--text-dim); }

.pack-tools { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.paste-details { margin-top: 0.75rem; }
.paste-details summary { cursor: pointer; color: var(--text-muted); font-size: 0.85rem; }
.json-paste {
    width: 100%; margin: 0.6rem 0;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    resize: vertical;
}
.import-status { margin-top: 0.6rem; font-size: 0.85rem; color: var(--text-muted); }
.import-status.is-error { color: var(--red); }

.round-list { display: grid; gap: 0.4rem; }
.round-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    transition: all 0.15s;
}
/* An off round is still read — it is what the host judges before ticking it back
   on — so the state rides on the border and the decorative icon, not on the text. */
.round-row.is-on { border-style: solid; border-color: var(--border-bright); }
.round-row:not(.is-on) .round-icon { opacity: 0.5; }
.round-main { display: flex; align-items: center; gap: 0.7rem; flex: 1; cursor: pointer; min-width: 0; }
.round-icon { font-size: 1.15rem; }
.round-name { font-weight: 600; flex: 1; }
.round-count { color: var(--text-dim); font-size: 0.8rem; font-family: var(--font-mono); }
.round-move { display: flex; gap: 0.25rem; }

input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--gold);
    cursor: pointer;
    flex-shrink: 0;
}

.team-list { display: grid; gap: 0.5rem; margin-bottom: 0.9rem; }
.team-row { display: flex; align-items: center; gap: 0.6rem; }
.team-swatch {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
}
.team-name { flex: 1; }

.settings-panel { display: grid; gap: 1.5rem; }
.settings-group { }
.settings-title {
    font-size: 0.74rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.13em; color: var(--gold); margin-bottom: 0.8rem;
    padding-bottom: 0.4rem; border-bottom: 1px solid var(--border);
}
.settings-body { display: grid; gap: 0.7rem; }

.switch-row { display: flex; align-items: center; gap: 0.7rem; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch {
    position: relative;
    width: 42px; height: 24px; flex-shrink: 0;
    border-radius: 999px;
    background: var(--surface-hover);
    border: 1px solid var(--border-bright);
    transition: all 0.18s var(--ease);
}
.switch::after {
    content: '';
    position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: all 0.18s var(--ease);
}
.switch-row input:checked + .switch { background: var(--gold-dim); border-color: var(--gold); }
.switch-row input:checked + .switch::after { transform: translateX(18px); background: var(--gold); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.switch-label { display: flex; flex-direction: column; font-size: 0.92rem; }
.switch-label small { color: var(--text-dim); font-size: 0.78rem; line-height: 1.4; }

.checkline { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.3rem; }
.mini-check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: var(--text-muted); cursor: pointer; }
.mini-check input { width: 15px; height: 15px; }

.slider-row, .number-row, .field { display: flex; align-items: center; gap: 0.8rem; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--gold); min-width: 80px; }
.slider-label { min-width: 9rem; font-size: 0.88rem; color: var(--text-muted); }
.slider-label small { color: var(--text-dim); }
.slider-value { min-width: 3.2rem; text-align: right; font-family: var(--font-mono); font-size: 0.82rem; color: var(--gold); }
.field select { flex: 1; }
.sound-test { margin-top: 0.4rem; gap: 0.4rem; }

.weight-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.weight-field { display: flex; align-items: center; gap: 0.4rem; }
.weight-label { font-size: 0.85rem; color: var(--text-muted); min-width: 3.6rem; }
.weight-field .input-number { width: 4.4rem; }

.start-bar {
    position: sticky; bottom: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding: 1.1rem 1.35rem;
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    background: rgba(22, 27, 22, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}
.start-summary { font-size: 0.92rem; color: var(--text-muted); }
.start-summary strong { color: var(--text); }

/* ---------- stage (round intro, question, interval, tie-break) ---------- */

.stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 3.5rem - 4rem);
    text-align: center;
    gap: 1.5rem;
}

.stage-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    width: 100%;
}

.round-chip {
    display: inline-flex; align-items: center; gap: 0.55rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-bright);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.82rem;
}
.round-chip-icon { font-size: 1rem; }
.round-chip-name { font-weight: 600; }
.round-chip-count { color: var(--text-dim); }

.round-chip-standalone {
    display: inline-block; margin-bottom: 0.5rem;
    color: var(--text-muted); font-size: 0.9rem; font-weight: 600;
}

.dots { display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-bright); transition: all 0.25s var(--ease); }
.dot.is-done { background: var(--gold); opacity: 0.55; }
.dot.is-now { background: var(--gold-bright); transform: scale(1.4); box-shadow: 0 0 10px rgba(196, 162, 78, 0.6); }

/* round intro */

.round-intro-inner { animation: rise 0.5s var(--ease) both; }
.round-number {
    font-family: var(--font-mono);
    font-size: 0.85rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 0.8rem;
}
.round-glyph { font-size: clamp(3.5rem, 12vw, 6rem); line-height: 1; margin-bottom: 0.6rem; }
.round-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.4rem, 9vw, 5rem);
    letter-spacing: -0.03em;
}
.round-blurb {
    max-width: 44rem; margin: 1rem auto 0;
    color: var(--text-muted); font-size: clamp(1rem, 2.2vw, 1.2rem);
    font-style: italic;
}
.round-facts {
    display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap;
    margin-top: 1.5rem;
    font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-dim);
}
.round-facts span::before { content: '· '; color: var(--border-bright); }
.round-facts span:first-child::before { content: none; }

/* question */

.question-stage { justify-content: center; padding: 1rem 0 2rem; }

.question-card {
    width: 100%;
    padding: clamp(1.5rem, 4vw, 3rem);
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(170deg, var(--surface), var(--bg-deep));
    box-shadow: var(--shadow);
    animation: rise 0.4s var(--ease) both;
}

.question-head {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1.4rem;
}
.question-number {
    font-family: var(--font-mono); font-weight: 700;
    color: var(--gold); font-size: 0.92rem; letter-spacing: 0.08em;
}
.question-of { color: var(--text-dim); font-size: 0.82rem; font-family: var(--font-mono); }
.question-tags { display: flex; gap: 0.4rem; margin-left: auto; }

.question-text {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 4.4vw, 3rem);
    line-height: 1.22;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

/* ---- the picture round ---- */

.picture-panel {
    margin-top: 1.6rem;
    display: grid;
    gap: 0.6rem;
    justify-items: center;
    width: 100%;
}

.picture-frame {
    width: min(100%, 34rem);
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border-bright);
    border-radius: 14px;
    background: var(--bg-deep);
}

/*
 * Logos are usually flat black or one dark colour. On a dark theme they would
 * disappear, so a contained image gets a light plate to sit on — the same way
 * a brand sheet would print them.
 */
.picture-frame.is-contain {
    background: linear-gradient(180deg, #f6f3ea, #e6e1d3);
    padding: 1.75rem;
}

/* A pale mark would disappear on the cream plate, so it gets a dark one. */
.picture-frame.is-contain.plate-dark {
    background: linear-gradient(180deg, #24291f, #14170f);
    border-color: var(--border-bright);
}

.picture-frame.is-cover { padding: 0; }

.picture {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.picture-frame.is-contain .picture { object-fit: contain; }

.picture-frame.is-cover .picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.picture-frame.is-broken {
    background: var(--surface-2);
    border-style: dashed;
    border-color: var(--red);
}
.picture-frame.is-broken .picture { display: none; }

.picture-status { color: var(--red); font-size: 0.85rem; min-height: 1em; }

.picture-credit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--text-dim);
    font-size: 0.74rem;
}
.picture-credit .source-link { margin-top: 0; font-size: 0.74rem; }
.picture-tm { font-style: italic; }

body.big-screen .picture-frame { width: min(100%, 46rem); }

/* ---- the audio round ---- */

.clip-player {
    margin-top: 1.8rem;
    display: grid;
    gap: 0.85rem;
    justify-items: center;
    width: 100%;
}

.clip-stage {
    width: min(100%, 30rem);
    display: grid;
    gap: 0.9rem;
    justify-items: center;
    padding: 1.4rem 1.5rem 1.2rem;
    border: 1px solid var(--border-bright);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(196, 162, 78, 0.06), transparent);
}

.eq {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 52px;
}

.eq-bar {
    width: 7px;
    height: 10%;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    opacity: 0.35;
    transition: height 0.2s var(--ease), opacity 0.2s;
}

.eq.is-playing .eq-bar {
    opacity: 1;
    animation: eq-dance 900ms ease-in-out infinite alternate;
}

.eq.is-playing .eq-bar:nth-child(2n) { animation-duration: 700ms; }
.eq.is-playing .eq-bar:nth-child(3n) { animation-duration: 1150ms; }

@keyframes eq-dance {
    from { height: 15%; }
    to { height: 100%; }
}

.clip-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--bg-deep);
    overflow: hidden;
}

.clip-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), var(--gold-bright));
    transition: width 0.25s linear;
}

.clip-controls {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    justify-content: center;
}

.clip-status {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}
.clip-status.is-error { color: var(--red); }

.clip-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.84rem;
}

@media (prefers-reduced-motion: reduce) {
    .eq.is-playing .eq-bar { animation: none; height: 60%; }
}

.melody-player { margin-top: 1.6rem; display: grid; gap: 0.5rem; justify-items: center; }
.btn-melody {
    display: inline-flex; align-items: center; gap: 0.7rem;
    padding: 1rem 1.8rem;
    border: 1px solid var(--gold);
    border-radius: 999px;
    background: var(--gold-dim);
    color: var(--gold-bright);
    font-family: inherit; font-size: 1.05rem; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-melody:hover { background: rgba(196, 162, 78, 0.25); }
.btn-melody.is-playing { animation: throb 1.1s infinite; }
.melody-hint { color: var(--text-dim); font-size: 0.82rem; }
.melody-meta { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

@keyframes throb {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196, 162, 78, 0.5); }
    50% { box-shadow: 0 0 0 14px rgba(196, 162, 78, 0); }
}

/* timer */

.timer { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--border); stroke-width: 6; }
.ring-progress {
    fill: none;
    stroke: var(--gold);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.12s linear, stroke 0.3s;
}
.timer-text {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.timer.is-urgent .ring-progress { stroke: var(--gold-bright); }
.timer.is-urgent .timer-text { color: var(--gold-bright); }
.timer.is-critical .ring-progress { stroke: var(--red); }
.timer.is-critical .timer-text { color: var(--red); animation: throb-text 1s infinite; }
.timer.is-paused { opacity: 0.55; }
.timer-toggle {
    position: absolute; bottom: -6px; right: -6px;
    display: grid; place-items: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-bright);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
}
.timer-toggle:hover { color: var(--text); border-color: var(--gold); }

@keyframes throb-text {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.09); }
}

/* answer */

.answer-panel {
    margin-top: 2rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--border);
    animation: rise 0.45s var(--ease) both;
}
.answer-label {
    font-family: var(--font-mono); font-size: 0.76rem;
    letter-spacing: 0.28em; text-transform: uppercase;
    color: var(--text-dim); margin-bottom: 0.5rem;
}
.answer-text {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2rem, 6vw, 3.6rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--gold-bright);
    text-wrap: balance;
    text-shadow: 0 2px 30px rgba(196, 162, 78, 0.25);
}
.answer-accept { margin-top: 0.6rem; color: var(--text-muted); font-size: 0.92rem; }
.fun-fact {
    display: flex; align-items: flex-start; gap: 0.6rem;
    max-width: 46rem; margin: 1.3rem auto 0;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: left;
}
.fun-fact-icon { flex-shrink: 0; }

.source-link {
    display: inline-flex; align-items: center; gap: 0.35rem;
    margin-top: 0.9rem;
    color: var(--text-dim);
    font-size: 0.78rem;
}
.source-link:hover { color: var(--gold); }

.stage-controls {
    display: flex; align-items: center; justify-content: center; gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
    width: 100%;
}

/* ---------- answers ---------- */

.answer-list {
    list-style: none;
    max-width: 820px;
    margin: 0 auto;
    display: grid;
    gap: 0.5rem;
}

.answer-row {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    opacity: 0.45;
    transition: opacity 0.3s var(--ease), border-color 0.3s, background 0.3s;
}

.answer-row.is-revealed { opacity: 1; }

.answer-row.is-newest {
    border-color: var(--gold);
    background: var(--gold-dim);
    animation: rise 0.35s var(--ease) both;
}

.answer-num {
    flex-shrink: 0;
    width: 1.9rem;
    height: 1.9rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--bg-deep);
    border: 1px solid var(--border-bright);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.answer-row.is-revealed .answer-num { color: var(--gold); border-color: var(--gold); }

.answer-body { flex: 1; min-width: 0; }

.answer-q {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.answer-detail { margin-top: 0.35rem; }

.answer-a {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.2;
    color: var(--gold-bright);
}

.answer-alt { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.15rem; }
.answer-fact { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.4rem; font-style: italic; }
.answer-credit { color: var(--text-dim); font-size: 0.78rem; margin-top: 0.3rem; }

.answer-thumb {
    flex-shrink: 0;
    width: 84px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    background: #f2efe6;
    padding: 4px;
}

body.big-screen .answer-a { font-size: 1.8rem; }
body.big-screen .answer-q { font-size: 1.05rem; }

@media (max-width: 700px) {
    .answer-row { padding: 0.7rem 0.8rem; gap: 0.6rem; }
    .answer-a { font-size: 1.15rem; }
    .answer-thumb { width: 60px; height: 46px; }
}

/* ---------- marking ---------- */

.screen-head { text-align: center; margin: 1.5rem 0 1.75rem; }
.screen-head h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 700; }
.screen-sub { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.95rem; }

.table-wrap {
    overflow: auto;
    max-height: min(68vh, 620px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mark-table, .results-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.mark-table th, .mark-table td, .results-table th, .results-table td {
    padding: 0.55rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.mark-table thead th, .results-table thead th {
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: sticky; top: 0;
    z-index: 2;
}
.mark-table .sticky-col, .results-table .left {
    text-align: left;
    position: sticky; left: 0;
    background: var(--surface);
    z-index: 1;
    min-width: 11rem;
}
.mark-table .sticky-col { width: 15rem; max-width: 18rem; }
.mark-table thead .sticky-col { background: var(--surface-2); z-index: 3; }

.team-cell { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.team-dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex-shrink: 0; display: inline-block;
    margin-right: 0.5rem;
    vertical-align: baseline;
}
.team-cell .team-dot, .tiebreak-entry .team-dot { margin-right: 0; }
.team-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick { display: flex; gap: 0.2rem; }
.quick-btn {
    width: 22px; height: 22px; border-radius: 5px;
    border: 1px solid var(--border); background: transparent;
    color: var(--text-dim); cursor: pointer; font-size: 0.75rem; line-height: 1;
}
.quick-btn:hover { color: var(--text); border-color: var(--gold); }

.mark-cell {
    width: 34px; height: 34px;
    border: 1px solid var(--border-bright);
    border-radius: 7px;
    background: var(--bg-deep);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.12s;
}
.mark-cell:hover { border-color: var(--gold); }
.mark-cell.is-right { background: rgba(74, 158, 110, 0.22); border-color: var(--green); color: var(--green); }
.mark-cell.is-wrong { background: rgba(196, 94, 78, 0.16); border-color: var(--red); color: var(--red); }

.input-bonus { width: 3.8rem; padding: 0.3rem; }

.joker-btn {
    min-width: 3.1rem;
    padding: 0.28rem 0.45rem;
    border: 1px solid var(--border-bright);
    border-radius: 7px;
    background: var(--bg-deep);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
}
.joker-btn:hover:not(:disabled) { color: var(--gold); border-color: var(--gold); }
.joker-btn.is-played {
    background: var(--gold-dim);
    border-color: var(--gold);
    color: var(--gold-bright);
}
.joker-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.total-col { font-family: var(--font-mono); font-weight: 700; color: var(--gold); font-size: 1rem; }

.answer-key { margin-top: 1.25rem; }
.answer-key summary { cursor: pointer; color: var(--text-muted); font-size: 0.9rem; padding: 0.5rem 0; }
.key-list { margin: 0.5rem 0 0 1.25rem; display: grid; gap: 0.45rem; }
.key-list li { color: var(--text-muted); font-size: 0.88rem; }
.key-q { display: block; }
.key-a { color: var(--gold); font-weight: 600; }
.key-alt { color: var(--text-dim); font-size: 0.82rem; margin-left: 0.4rem; }

/* ---------- leaderboard ---------- */

.board { display: grid; gap: 0.6rem; max-width: 760px; margin: 0 auto; }

.board-row {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    animation: slide-in 0.45s var(--ease) both;
}
.board-row.is-leader { border-color: var(--gold); background: var(--gold-dim); }

.board-pos {
    font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
    color: var(--text-dim); min-width: 2.6rem;
}
.board-row.is-leader .board-pos { color: var(--gold); }
.board-main { flex: 1; min-width: 0; }
.board-name { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; margin-bottom: 0.4rem; }
.board-track { height: 8px; border-radius: 999px; background: var(--bg-deep); overflow: hidden; }
.board-bar { height: 100%; border-radius: 999px; transition: width 0.9s var(--ease); }

.move { font-size: 0.7rem; font-family: var(--font-mono); }
.move-up { color: var(--green); }
.move-down { color: var(--red); }

.board-score { text-align: right; min-width: 4.5rem; }
.board-total { display: block; font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; line-height: 1; }
.board-round { font-size: 0.75rem; color: var(--green); font-family: var(--font-mono); }
.board-round.is-joker { color: var(--gold-bright); font-weight: 700; }

/* ---------- interval ---------- */

.interval-inner { display: grid; gap: 0.8rem; justify-items: center; }
.interval-glyph { color: var(--gold); }
.interval-title { font-family: var(--font-display); font-size: clamp(2.4rem, 8vw, 4rem); font-weight: 900; }
.interval-sub { color: var(--text-muted); }
.interval-clock {
    font-family: var(--font-mono);
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 700;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.interval-standings { color: var(--text-dim); font-size: 0.9rem; font-family: var(--font-mono); }

/* ---------- tie-break ---------- */

.tiebreak-inner { width: 100%; max-width: 46rem; }
.tiebreak-flash {
    font-family: var(--font-mono); letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--red); font-size: 0.9rem; font-weight: 700; margin-bottom: 1rem;
    animation: flash 1.2s infinite;
}
.tiebreak-rule { color: var(--text-muted); margin-top: 1rem; }
.tiebreak-entries { display: grid; gap: 0.6rem; margin: 1.75rem 0; }
.tiebreak-entry {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.tiebreak-team { flex: 1; text-align: left; font-weight: 600; }
.tiebreak-input { width: 8rem; font-family: var(--font-mono); text-align: right; }
.tiebreak-delta { color: var(--text-dim); font-size: 0.8rem; font-family: var(--font-mono); }

@keyframes flash { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- results ---------- */

.results { padding-top: 1rem; }
.results-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 1rem;
    border: 1px solid var(--gold);
    border-radius: 999px;
    color: var(--gold);
    font-size: 0.74rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
    margin-bottom: 1rem;
}
.results-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2rem, 7vw, 4rem);
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.podium {
    display: flex; align-items: flex-end; justify-content: center; gap: 0.8rem;
    margin: 2.5rem auto 2rem;
    max-width: 640px;
}
.podium-slot { flex: 1; max-width: 190px; text-align: center; animation: rise 0.6s var(--ease) both; }
.podium-slot.podium-1 { animation-delay: 0.15s; }
.podium-slot.podium-2 { animation-delay: 0.05s; }
.podium-slot.podium-3 { animation-delay: 0.25s; }
.podium-name {
    font-weight: 700; margin-bottom: 0.6rem; font-size: 0.95rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.podium-block {
    display: grid; place-content: center; gap: 0.2rem;
    border-radius: 12px 12px 0 0;
    color: #10130f;
    box-shadow: var(--shadow);
}
.podium-1 .podium-block { height: 190px; }
.podium-2 .podium-block { height: 140px; }
.podium-3 .podium-block { height: 110px; }
.podium-pos { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; opacity: 0.75; }
.podium-score { font-family: var(--font-display); font-weight: 900; font-size: 2.2rem; line-height: 1; }

.results-table .is-winner { background: var(--gold-dim); }
.results-table .is-winner td { color: var(--gold-bright); font-weight: 600; }
.results-table .pos { font-family: var(--font-mono); color: var(--text-dim); }
.results-table .total { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }
.results-table .is-joker { color: var(--gold-bright); font-weight: 700; }

/* ---------- overlay ---------- */

.overlay-root { position: fixed; inset: 0; z-index: 60; }
.overlay-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); }
.overlay-panel {
    position: relative;
    max-width: 520px;
    max-height: 85vh;
    margin: 6vh auto 0;
    display: flex; flex-direction: column;
    border: 1px solid var(--border-bright);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: rise 0.25s var(--ease) both;
    overflow: hidden;
}
.overlay-panel.is-wide { max-width: 720px; }
.overlay-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.overlay-head h2 { font-size: 1.05rem; }
.overlay-body { padding: 1.25rem; overflow-y: auto; }

.shortcuts table { width: 100%; border-collapse: collapse; }
.shortcuts td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text-muted); }
.shortcuts td:first-child { width: 8rem; }
kbd {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--border-bright);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--bg-deep);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}
.print-choices p { color: var(--text-muted); margin-bottom: 1rem; }

/* ---------- canvas + misc ---------- */

.confetti-canvas {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 50;
}

.noscript { max-width: 40rem; margin: 20vh auto; text-align: center; padding: 2rem; }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
@keyframes slide-in {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: none; }
}

/* ---------- big screen mode ---------- */

body.big-screen { --stage-max: 1500px; }
body.big-screen .question-text { font-size: clamp(2.2rem, 6vw, 4.6rem); }
body.big-screen .answer-text { font-size: clamp(2.6rem, 8vw, 5.4rem); }
body.big-screen .round-title { font-size: clamp(3rem, 11vw, 7rem); }
body.big-screen .timer { width: 160px; height: 160px; }
body.big-screen .timer-text { font-size: 2.3rem; }
body.big-screen .board-row { padding: 1.15rem 1.4rem; font-size: 1.15rem; }
body.big-screen .board-total { font-size: 2.1rem; }
body.big-screen .btn-large { padding: 1rem 2rem; font-size: 1.15rem; }

/* ---------- responsive ---------- */

@media (max-width: 700px) {
    .app { padding: 1rem 0.9rem 4rem; }
    .topbar { padding: 0 0.6rem; }
    .topbar-position { display: none; }
    .brand-name { display: none; }
    .stage { min-height: auto; padding-top: 1.5rem; }
    .question-card { padding: 1.25rem; border-radius: 16px; }
    .question-tags { margin-left: 0; width: 100%; justify-content: center; }
    .stage-controls .btn { flex: 1 1 auto; }
    .start-bar { flex-direction: column; align-items: stretch; text-align: center; }
    .start-bar .row { justify-content: center; }
    .podium { gap: 0.4rem; }
    .podium-1 .podium-block { height: 140px; }
    .podium-2 .podium-block { height: 105px; }
    .podium-3 .podium-block { height: 85px; }
    .podium-score { font-size: 1.6rem; }
    /* Settings rows stack: a label and its control fight for width otherwise. */
    .slider-row, .number-row, .field { flex-wrap: wrap; gap: 0.4rem 0.8rem; }
    .slider-label { min-width: 100%; }
    .slider-row input[type="range"] { flex: 1 1 60%; }
    .number-row .input-number, .field select { margin-left: auto; }
    .round-main { flex-wrap: wrap; }
    .round-count { width: 100%; padding-left: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        /* Without this, a delayed animation sits pinned to its `from` keyframe —
           opacity 0 — and the stagger survives as a sequence of pops. */
        animation-delay: -0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- print ---------- */

.print-root { display: none; }

@media print {
    /* Ctrl+P never reaches printNode(), so paper safety cannot be gated on
       .is-printing: browsers drop the dark backgrounds and the cream text is
       left on white paper. */
    body { padding: 0; background: #fff !important; color: #000; }
    body::before,
    .topbar,
    .overlay-root,
    .confetti-canvas { display: none !important; }
    /* Gold and muted text needs the dark ground it was picked against; on white
       it prints at 2-3:1. !important because the state rules that set those
       colours are more specific. The staged sheets are outside .app, untouched. */
    .app, .app * { color: #000 !important; }
    .hero-title .accent { -webkit-text-fill-color: #000; }

    /* A staged sheet replaces the app entirely. */
    body.is-printing .app { display: none !important; }
    body.is-printing .print-root { display: block; }

    .sheet {
        page-break-after: always;
        break-after: page;
        padding: 1.5cm;
        font-family: Georgia, 'Times New Roman', serif;
        color: #000;
    }
    .sheet:last-child { page-break-after: auto; break-after: auto; }
    .sheet-head { border-bottom: 2px solid #000; padding-bottom: 0.4cm; margin-bottom: 0.6cm; }
    .sheet-head h1 { font-size: 20pt; }
    .sheet-head p { font-size: 11pt; color: #444; }
    .sheet-team { display: flex; gap: 0.5cm; align-items: baseline; margin-bottom: 0.7cm; font-size: 13pt; }
    .sheet-team .sheet-rule { flex: 1; }
    .sheet-rule { display: block; border-bottom: 1px solid #999; min-height: 1.1em; min-width: 4cm; }
    .sheet-rounds { column-count: 2; column-gap: 1cm; }
    .sheet-round { break-inside: avoid; margin-bottom: 0.5cm; }
    .sheet-round h2 {
        font-size: 12pt; margin-bottom: 0.2cm; border-bottom: 1px solid #ccc;
        display: flex; justify-content: space-between; align-items: baseline;
    }
    .sheet-joker { font-size: 8pt; font-weight: normal; color: #555; }
    .sheet-lines { margin-left: 1.1em; }
    .sheet-lines li { margin-bottom: 0.32cm; font-size: 10pt; }
    .sheet-foot { margin-top: 0.8cm; display: flex; align-items: center; gap: 0.4cm; font-size: 13pt; }
    .sheet-box { display: inline-block; width: 2.5cm; height: 1.2cm; border: 2px solid #000; }
    .key-lines { margin-left: 1.2em; }
    .key-lines li { margin-bottom: 0.28cm; font-size: 10.5pt; }
    .key-lines li.has-picture { min-height: 1.6cm; }
    .key-thumb {
        float: right;
        width: 2.4cm;
        max-height: 1.5cm;
        object-fit: contain;
        margin: 0 0 0.2cm 0.3cm;
        border: 1px solid #ccc;
        padding: 2px;
        background: #fff;
    }
    .key-question { display: block; }
    .key-answer { font-size: 11pt; }
    .key-alt, .key-source { color: #555; font-size: 9pt; }
    .key-worth { color: #000; font-size: 9pt; font-weight: bold; }
    .sheet-table { width: 100%; border-collapse: collapse; font-size: 11pt; }
    .sheet-table th, .sheet-table td { border: 1px solid #666; padding: 0.15cm 0.25cm; text-align: center; }
    .sheet-table .left { text-align: left; }
    .sheet-winner { margin-top: 0.6cm; font-size: 13pt; font-weight: bold; }
}
