/* Moordspel: één stylesheet voor alle schermen. Donker, papier voor bewijsstukken, rood als accent. */
:root {
  --bg: #14110f;
  --panel: #1e1a17;
  --panel-2: #26211d;
  --line: #3b332c;
  --text: #efe6d8;
  --muted: #b3a795;
  --faint: #7d7264;
  --accent: #c0392b;
  --accent-ink: #fff4ee;
  --gold: #c9a45c;
  --paper: #ece2cf;
  --paper-ink: #231d18;
  --ok: #6fbf73;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.55 var(--sans); min-height: 100vh; }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0 0 .8em; }
strong { color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px 64px; }
.wide { max-width: 1100px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 6px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Bovenbalk */
.top { position: sticky; top: 0; z-index: 20; background: rgba(20, 17, 15, .94); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: .02em; color: var(--text); text-decoration: none; }
.brand b { color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pill.live { border-color: var(--accent); color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.on { background: var(--ok); }
/* Ruimte in de bovenbalk: alleen de fase-pil krimpt (met ...) als het smal wordt, zodat de taalknop altijd past. */
.top .wrap > * { flex-shrink: 0; }
.top #phase { display: block; flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .top .wrap { gap: 8px; } .top .brand { font-size: 16px; } .top .pill { font-size: 12px; padding: 3px 8px; } .top .lang button { padding: 4px 7px; } }
@media (max-width: 360px) { .top .pill { display: none; } }

/* Taalknop (EN | NL) */
.lang { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.lang button { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; min-height: 28px; padding: 0 9px; cursor: pointer; }
.lang button + button { border-left: 1px solid var(--line); }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* Kaarten */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card + .card { margin-top: 12px; }
.card h3 { margin-bottom: 8px; }
.hero { padding: 22px 16px; margin-top: 16px; }
.hero .meta { color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.badge.kern { border-color: var(--gold); color: var(--gold); }
.banner { margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--panel-2); border-left: 4px solid var(--accent); }
.text p:last-child { margin-bottom: 0; }

/* Tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; position: sticky; top: 49px; z-index: 10; background: var(--bg); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 14px; font-size: 15px; cursor: pointer; color: var(--muted); }
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 12px; line-height: 18px; text-align: center; }
.panel { padding-top: 12px; }

/* Lijsten */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.numbered { counter-reset: n; }
.numbered > li { position: relative; padding-left: 38px; }
.numbered > li::before { counter-increment: n; content: counter(n); position: absolute; left: 0; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.timeline > li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.timeline .when { color: var(--gold); font-size: 14px; font-weight: 600; }
.person .who { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.person .by { color: var(--muted); font-size: 14px; }
.person .rel { margin-top: 6px; }

/* Knoppen en velden */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; text-decoration: none; font-weight: 600; font-size: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.on { border-color: var(--gold); color: var(--gold); }
.field { display: block; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.choice { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--panel); }
.choice + .choice { margin-top: 8px; }
.choice input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--panel-2); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 48px; height: 48px; border: 0; background: var(--panel-2); font-size: 22px; cursor: pointer; }
.stepper output { min-width: 64px; text-align: center; font-size: 22px; font-weight: 700; }

/* Bewijsstukken */
.clue { background: var(--paper); color: var(--paper-ink); border-radius: 10px; padding: 14px 16px; border-left: 5px solid var(--accent); }
.clue + .clue { margin-top: 12px; }
.clue h3 { color: var(--paper-ink); }
.clue strong { color: var(--paper-ink); }
.clue .kicker { color: #8a5a1f; }
.news { background: var(--panel-2); border: 1px solid var(--accent); border-radius: var(--r); padding: 14px 16px; }
.news + .news { margin-top: 12px; }

/* Scenariokeuze */
.scenarios { display: grid; gap: 12px; }
.scenario { text-align: left; cursor: pointer; width: 100%; }
.scenario[aria-pressed="true"] { border-color: var(--accent); background: var(--panel-2); }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Onthulling */
.bar { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 10px; align-items: center; margin: 8px 0; }
.bar .fill { height: 14px; border-radius: 7px; background: var(--accent); min-width: 4px; }
.scores td, .scores th { padding: 8px 6px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.scores { width: 100%; border-collapse: collapse; }
.scores .pts { font-weight: 700; color: var(--gold); text-align: right; white-space: nowrap; }

/* Host */
.players > li { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.players .acts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.players .qr { grid-column: 1 / -1; background: #fff; padding: 10px; border-radius: 10px; width: max-content; }
.players .qr svg, .players .qr img { display: block; width: 180px; height: 180px; }
.phases { display: flex; gap: 6px; flex-wrap: wrap; }
.read { font-family: var(--serif); font-size: 19px; line-height: 1.5; }
details.card summary { cursor: pointer; font-weight: 600; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 50; max-width: calc(100% - 32px); }

/* TV: groot, leesbaar van de bank */
body.tv { font-size: clamp(18px, 1.6vw, 34px); overflow-x: hidden; }
.tv .stage { min-height: 100vh; padding: 4vh 5vw; display: flex; flex-direction: column; }
.tv .corner { position: fixed; right: 2vw; bottom: 2vh; color: var(--faint); font-size: .7em; letter-spacing: .1em; }
.tv .corner .lang button { font-size: 1em; min-height: 1.9em; padding: 0 .55em; }
.tv h1 { font-size: clamp(40px, 6vw, 120px); }
.tv h2 { font-size: clamp(28px, 3.4vw, 70px); }
.tv .kicker { font-size: .7em; }
.tv .lead { font-family: var(--serif); font-size: 1.25em; line-height: 1.45; max-width: 46em; }
.tv .castgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15em), 1fr)); gap: .8em; margin-top: 1.4em; }
.tv .castgrid .card { padding: .8em 1em; }
.tv .castgrid .who { font-family: var(--serif); font-weight: 600; font-size: 1.1em; }
.tv .clues { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22em), 1fr)); gap: 1em; margin-top: 1.2em; align-items: start; }
.tv .clue + .clue { margin-top: 0; }
.tv .big { font-size: clamp(60px, 10vw, 200px); font-weight: 700; font-family: var(--serif); line-height: 1; }

@media (max-width: 520px) {
  h1 { font-size: 29px; }
  .timeline > li { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Berichten vooraf (speler: tab Nieuw; host: modus en feestdatum) en e-mailvelden bij de spelers */
.news h3 { margin-top: 2px; }
.news .mine { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.subhead { margin: 18px 0 10px; }
.pfields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
@media (max-width: 520px) { .pfields { grid-template-columns: 1fr; } }
.prep-form .choice { align-items: flex-start; }
.prep-form .choice input { margin-top: 3px; }
.prep-form .field { margin-top: 12px; }
.prep-form .btn { margin-top: 12px; }
.mailbox { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mailbox p { margin: 0 0 8px; }
.block { display: block; }

/* Spelfuncties: leider, het verhaal tot nu toe, geheimen die uitkomen, opdrachten, voortgang, waarom niet */
.gold { color: var(--gold); }
.badge.lead { border-color: var(--accent); color: var(--text); }
.hero .badge.lead { margin-top: 10px; }
.card.lead { border-color: var(--accent); }
.card.story { border-left: 4px solid var(--gold); }
.story .mine { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.card + .news { margin-top: 12px; }
details.earlier { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
details.earlier summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; }
details.earlier h4 { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 12px 0 4px; }
.numbered > li.is-out::before { background: var(--gold); color: var(--bg); }
.numbered > li.is-out > p { color: var(--muted); }
.sec-state { margin-top: 8px; display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
.sec-form { margin-top: 10px; display: grid; gap: 10px; }
select.input { color: var(--text); }
.progress .stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-weight: 600; }
.whynot + .whynot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.whynot h3 { margin-bottom: 4px; }
.recap-host { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--panel-2); border-radius: 0 var(--r) var(--r) 0; }

/* Relatieboom (SVG uit common.js) */
.tree-svg { display: block; width: 100%; height: auto; max-width: 560px; margin: 4px auto 0; }
.tree-svg text { font-family: var(--sans); }
.tree-svg .nm { font-family: var(--serif); font-size: 14px; font-weight: 600; fill: var(--text); }
.tree-svg .pl { font-size: 12px; fill: var(--muted); }
.tree-svg .nm, .tree-svg .pl { paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.tree-svg .pl.npc { font-style: italic; }
.tree-svg path { fill: none; stroke: #5c5147; stroke-width: 1.5; }
.tree-svg path.me { stroke: var(--accent); }
.tree-svg .lbl { font-size: 12px; fill: var(--muted); paint-order: stroke; stroke: var(--panel); stroke-width: 4px; stroke-linejoin: round; }
.tree-svg .nd { fill: var(--panel-2); stroke: var(--muted); stroke-width: 2.5; }
.tree-svg .nd.npc { fill: var(--panel); stroke-dasharray: 3 3; }
.tree-svg .nd.me { fill: var(--accent); }
.tree-svg .ring { fill: none; stroke: var(--gold); stroke-width: 1.5; }
.tree-svg .nd.g0 { stroke: #c9a45c; }
.tree-svg .nd.g1 { stroke: #7fa7c9; }
.tree-svg .nd.g2 { stroke: #6fbf73; }
.tree-svg .nd.g3 { stroke: #b48ead; }
.tree-svg .nd.g4 { stroke: #d08770; }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--muted); }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--muted); margin-right: 6px; vertical-align: -1px; }
.sw.g0 { border-color: #c9a45c; }
.sw.g1 { border-color: #7fa7c9; }
.sw.g2 { border-color: #6fbf73; }
.sw.g3 { border-color: #b48ead; }
.sw.g4 { border-color: #d08770; }
.tree-links > li { padding: 8px 0; font-size: 15px; }

/* Tv: boom in de lobby, het verhaal tot nu toe en de waarheidsmeter in de rondes */
.tv .lobby { margin-top: 1.4em; }
.tv .lobby .castgrid { margin-top: 0; }
.tv .lobby.has-tree { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4em; align-items: start; }
@media (max-width: 900px) { .tv .lobby.has-tree { grid-template-columns: 1fr; } }
.tv .treecard { padding: .8em 1em; }
.tv .tree-svg { max-width: none; max-height: 72vh; }
.tv .legend { font-size: .7em; }
.tv .tree-links > li { font-size: .8em; }
.tv .recap { margin: .2em 0 1em; padding: .7em 1em; border-left: 4px solid var(--gold); background: var(--panel); border-radius: 0 var(--r) var(--r) 0; max-width: 46em; }
.tv .recap .text { font-family: var(--serif); font-size: 1.05em; line-height: 1.45; }
.tv .truth { margin-top: 1.1em; max-width: 32em; font-size: .85em; color: var(--muted); }
.tv .meter { height: .55em; margin-top: .35em; border-radius: .3em; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.tv .meter span { display: block; height: 100%; background: var(--accent); }
