/* ── Onit huisstijl, dark variant for courtside / broadcast tooling ──────────
   Brand red is the accent (primary actions + LIVE). Team identity stays
   blue (thuis) / amber (uit) so the colours carry meaning on the scoreboard. */
/* Aliases onto tokens.css (loaded first) so existing rules use the token system.
   Only names not present in tokens.css get literal values. */
/* Elk element met een eigen display:X-regel wint anders altijd van de
   browser-default [hidden]{display:none} (auteur-CSS gaat vóór UA-CSS,
   ongeacht specificiteit) -- zonder deze regel blijft zo'n element gewoon
   zichtbaar/klikbaar ondanks het hidden-attribuut (kostte ons eerder een
   echte bug op .tab, zie ROADMAP.md punt 6). Eén keer globaal afdichten
   i.p.v. per-element-selector bijhouden. */
[hidden] { display: none !important; }

:root {
  --onit-red: var(--accent);
  --onit-red-dark: var(--accent-hover);
  --onit-red-light: #FDE8E9;
  --onit-grey: #474745;
  --grey-med: var(--text-2);

  --surface: var(--surface-1);
  --text: var(--text-1);
  --muted: var(--text-2);

  --home: var(--team-home);
  --home-dark: #1f54bf;
  --away: var(--team-away);
  --away-dark: #cf8a06;
  --ok: var(--online);

  /* Readable ink on each team's fill (recomputed in JS when colour changes). */
  --team-home-ink: #ffffff;
  --team-away-ink: #1b1b1a;

  --radius: var(--r-lg);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { letter-spacing: .01em; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ── Top bar ───────────────────────────────────────────────────────────────*/
.topbar {
  display: flex; align-items: center; gap: 0;
  height: 56px; padding: 0 14px;
  background: var(--bg);
  border-bottom: 2px solid var(--club-color);
  position: sticky; top: 0; z-index: 10; flex-shrink: 0;
}
.topbar-logo { width: 44px; height: 44px; border-radius: 9px; object-fit: contain; flex-shrink: 0; display: block; margin-right: 10px; }
.topbar-center {
  /* Left-aligned so the name sits right next to the logo instead of
     centered across the whole remaining bar width (which reads as
     "far apart" on wide/desktop screens); still truncates cleanly on
     narrow/mobile widths via topbar-title's own ellipsis. */
  flex: 1; display: flex; flex-direction: column; align-items: flex-start;
  min-width: 0; gap: 1px; overflow: hidden;
}
.topbar-title { font-size: 15px; font-weight: 700; letter-spacing: -.02em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.topbar-right { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ── Status chips / badges ──────────────────────────────────────────────────*/
.status {
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 5px 11px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); white-space: nowrap;
}
.status.ok { color: #0c2; background: rgba(63,185,80,.15); border-color: rgba(63,185,80,.4); }
.status.err { color: #ffb3b3; background: rgba(227,6,19,.15); border-color: rgba(227,6,19,.45); }
.status.live { color: #fff; background: var(--onit-red); border-color: var(--onit-red); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: .12em;
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.badge.live { background: var(--live); color: #fff; border-color: var(--live); }
.badge.live::before { background: #fff; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.7); }
}
@media (prefers-reduced-motion: reduce) {
  .badge.live::before { animation: none; }
  *, *::before, *::after { transition: none !important; }
}

/* ── Layout wrappers ────────────────────────────────────────────────────────*/
.panel-wrap { max-width: 540px; margin: 0 auto; padding: 16px 16px 32px; }
.stream-wrap { max-width: 920px; margin: 0 auto; padding: 16px 16px 32px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}

/* ── Buttons ────────────────────────────────────────────────────────────────*/
.btn, button, a.btn {
  font: inherit; font-weight: 700; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 16px; cursor: pointer;
  min-height: var(--tap); /* WCAG 2.5.5 */
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  transition: transform .06s ease, filter .12s, background .12s;
}
a.btn { text-decoration: none; }
button:hover:not(:disabled), a.btn:hover, .btn:hover { filter: brightness(1.12); }
button:active:not(:disabled), .btn:active { transform: scale(.97); }
button:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 16px rgba(227,6,19,.25);
}
.btn-primary:hover { background: var(--onit-red-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(227,6,19,.5); color: #ff9a9a; }
.btn-text {
  background: none; border: none; padding: 8px 12px; color: var(--muted);
  font-weight: 600; font-size: 13px; text-decoration: underline; cursor: pointer;
}
.btn-text.danger { color: #d8736f; }

/* ── Inputs ─────────────────────────────────────────────────────────────────*/
input[type=text], input[type=password] {
  font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; width: 100%;
}
input:focus { outline: none; border-color: var(--onit-red); box-shadow: 0 0 0 3px rgba(227,6,19,.18); }
select {
  font: inherit; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; max-width: 220px;
}
textarea {
  font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; width: 100%; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--onit-red); box-shadow: 0 0 0 3px rgba(227,6,19,.18); }
.form-actions { display: flex; align-items: center; gap: 12px; }

/* ── AI-gegenereerde trainingssessie (Speelstijl & Trainingsgeneratie) ───── */
.ai-generated-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 12px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.session-result h3 { margin: 0 0 4px; font-size: var(--t-lg); }
.session-goal { margin: 0 0 16px; }
.exercise-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 18px 0 8px;
}
.exercise-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 14px; margin-bottom: 10px;
}
.exercise-card h4 { margin: 0 0 4px; font-size: var(--t-base); }
.exercise-card p { margin: 4px 0; }
.exercise-meta { font-size: 12px; color: var(--muted); }
.exercise-koppeling { font-style: italic; color: var(--text-2); font-size: 13px; margin-top: 6px; }

/* ── Speelstijl-baseline (read-only weergave) + accenten + geschiedenis ──── */
.baseline-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 16px; margin: 0; }
.baseline-summary dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.baseline-summary dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; }
.accent-details { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.accent-details > summary {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  cursor: pointer; padding: 6px 0; list-style: none;
}
.accent-details > summary::-webkit-details-marker { display: none; }
.accent-details[open] > summary { margin-bottom: 4px; }
.session-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.session-meta { margin: 0 0 8px; font-size: 13px; color: var(--muted); }

/* ── Printen van een trainingssessie ───────────────────────────────────────
   Print alleen #tgResult (de getoonde sessie); al het overige (topbar, tabs,
   formulieren, geschiedenis, overlays) valt weg. Altijd zwart-op-wit,
   ongeacht het gekozen thema, en een oefening wordt niet over twee pagina's
   gesplitst. */
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #000 !important; }
  .topbar, .tabs, .overlay, .no-print { display: none !important; }
  .view { display: none !important; }
  #view-speelstijl { display: block !important; }
  #view-speelstijl .wrap-narrow { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  #view-speelstijl .card { background: none !important; border: none !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; }
  #speelstijlBaselineViewCard, #trainingHistoryCard { display: none !important; }
  #trainingGenCard > :not(#tgResult) { display: none !important; }

  .session-result, .session-result * { color: #111 !important; background: transparent !important; }
  .session-result .session-meta, .session-result .exercise-meta, .session-result .exercise-group-label { color: #444 !important; }
  .session-result .ai-generated-badge { border: 1px solid #888 !important; }
  .session-result .exercise-card { border: 1px solid #bbb !important; border-radius: 4px; break-inside: avoid; }
  .session-result .exercise-group-label { break-after: avoid; }
  .session-result h3 { font-size: 20px; }
}

.training-history-list { display: flex; flex-direction: column; gap: 8px; }
.training-history-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 10px 12px;
}
.training-history-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.training-history-item-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.training-history-item-meta { font-size: 12px; color: var(--muted); }

/* ─────────────────────────── CONTROL PANEL ─────────────────────────────────*/
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.team-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.team-card .team-top { height: 4px; }
.team-card.home .team-top { background: var(--home); }
.team-card.away .team-top { background: var(--away); }
.team-card .inner { padding: 14px; display: flex; flex-direction: column; gap: 12px; }

.team-name {
  text-align: center; font-weight: 800; font-size: 16px;
  background: var(--bg); padding: 10px;
}
.team-score {
  text-align: center; font-size: 80px; font-weight: 900; line-height: 1;
  letter-spacing: -.04em;
  /* Subtle outline so a very dark team colour (e.g. black) never disappears
     into a dark-theme background — barely visible on bright colours, but
     saves legibility on black/near-black. */
  -webkit-text-stroke: 1px rgba(128, 128, 128, .45);
}
.team-card.home .team-score { color: var(--team-home); }
.team-card.away .team-score { color: var(--team-away); }

.btn-plus { font-size: var(--t-2xl); font-weight: 900; min-height: var(--tap-score); padding: 12px 8px; border: none; }
.team-card.home .btn-plus { background: var(--team-home); color: var(--team-home-ink); }
.team-card.away .btn-plus { background: var(--team-away); color: var(--team-away-ink); }
.btn-plus:hover { filter: brightness(1.08); }
.btn-minus { font-size: var(--t-base); padding: 10px; min-height: var(--tap); }

/* ── Combi-mode compact bediening (roadmap-punt 6) ────────────────────────────
   Overlay op het camerabeeld, alleen zichtbaar in landscape + #appShell.combi-
   mode (zie de landscape-camera-app-breakpoint verderop). Buiten die conditie
   altijd display:none, ook al staat de markup er statisch in #stageCard .stage. */
.combo-rail, .combo-clock-pill, .combo-lock-btn,
#filmenStatusRow, .filmen-live-cluster { display: none; }

.combo-rail-plus {
  width: 100%; min-height: var(--tap-score); border: none; border-radius: var(--r-md);
  font-size: var(--t-xl); font-weight: 900; color: #fff; cursor: pointer;
}
.combo-rail-plus:hover { filter: brightness(1.08); }
.combo-rail-home .combo-rail-plus { background: var(--team-home); color: var(--team-home-ink); }
.combo-rail-away .combo-rail-plus { background: var(--team-away); color: var(--team-away-ink); }
.combo-rail-score { font-size: var(--t-2xl); font-weight: 800; color: var(--text-1); }
.combo-rail-minus {
  width: 100%; min-height: var(--tap); border-radius: var(--r-md);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  color: var(--text-1); font-size: var(--t-sm); font-weight: 700; cursor: pointer;
}

.combo-clock-toggle {
  border: none; background: none; color: var(--text-1); cursor: pointer;
  font-size: var(--t-lg); font-weight: 800; font-variant-numeric: tabular-nums; padding: 4px 6px;
}
.combo-clock-toggle.is-running { color: var(--live); }
.combo-period { display: flex; align-items: center; gap: 4px; color: var(--text-2); font-size: var(--t-xs); font-weight: 700; }
.combo-period-btn { border: none; background: none; color: inherit; font-size: var(--t-sm); cursor: pointer; padding: 2px 4px; }

/* Vergrendel-stand: dekt alleen de nieuwe compacte bediening (rails + klok-
   pilletje) -- de bestaande bottom-bar (camera starten/checklist/go-live/
   Stop) vergrendelt bewust NIET mee, die moet altijd bereikbaar blijven. */
#stageCard.combo-locked .combo-rail,
#stageCard.combo-locked .combo-clock-pill { opacity: .35; pointer-events: none; }

/* Clock */
.clock-card { text-align: center; }
.clock-time { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: .04em; }
.clock-period {
  color: var(--muted); font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; font-size: 13px; margin: 6px 0 16px;
}
.btn-clock { width: 100%; font-size: 22px; padding: 18px; margin-bottom: 10px; }
.clock-secondary { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.half-length-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border);
}
.half-length-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.half-length-input-wrap { display: flex; align-items: center; gap: 6px; }
.half-length-input {
  width: 64px; padding: 8px 10px; text-align: center;
  font: inherit; font-weight: 700; font-size: 15px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
}
.half-length-input:focus { outline: none; border-color: var(--onit-red); box-shadow: 0 0 0 3px rgba(227,6,19,.18); }
select.half-length-input { width: auto; min-width: 150px; text-align: left; }
.half-length-unit { font-size: 13px; color: var(--text-2); font-weight: 600; }

/* Team settings (colour + logo) */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-col {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.settings-side { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.settings-side .dot { width: 12px; height: 12px; border-radius: 50%; }
.home-dot, .away-dot { box-shadow: inset 0 0 0 1px rgba(128,128,128,.4); }
.home-dot { background: var(--home); }
.away-dot { background: var(--away); }
.color-row { display: flex; align-items: center; justify-content: space-between; font-weight: 600; color: var(--muted); font-size: 14px; }
.color-row input[type=color] {
  width: 52px; height: 34px; padding: 0; border: 1px solid var(--border);
  border-radius: 8px; background: none; cursor: pointer;
}
.logo-thumb {
  width: 100%; aspect-ratio: 16/9; border-radius: 10px; border: 1px solid var(--border);
  background: #0e0e0d center/contain no-repeat; position: relative;
}
.logo-thumb.empty::after {
  content: "geen logo"; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; color: var(--muted); font-size: 12px;
}
.logo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.logo-actions .btn { flex: 1 1 auto; font-size: 14px; padding: 10px; }
.logo-actions .btn-text { flex: 1 1 100%; text-align: center; }

/* Team picker (Scorebord) */
.team-picker-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.team-picker-row { display: flex; flex-direction: column; gap: 6px; }
.picker-side-label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--text-2); padding-left: 2px; }
.team-chips-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.team-chips { display: flex; gap: 8px; padding: 4px 2px 8px; width: max-content; min-width: 100%; }
.team-chip {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--surface-2); border: 2px solid var(--border); border-radius: 12px;
  padding: 8px 10px; min-width: 68px; cursor: pointer; flex-shrink: 0;
  transition: border-color .12s, background .12s;
}
.team-chip:hover { border-color: var(--text-2); }
.team-chip.active { border-color: var(--accent); background: rgba(227,6,19,.09); }
.chip-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; display: block; }
.chip-dot { width: 36px; height: 36px; border-radius: 50%; display: block; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.chip-label { font-size: 11px; font-weight: 700; text-align: center; color: var(--text-1); line-height: 1.2; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-fine-tune { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.color-fine-tune .color-row { flex: 1 1 auto; }

/* Team management (Beheer) */
.team-list { display: flex; flex-direction: column; margin-bottom: 10px; }
.team-list-item { display: flex; flex-direction: column; border-bottom: 1px solid var(--border); }
.team-list-item:last-child { border-bottom: none; }
.team-list-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.team-list-logo {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg) center/contain no-repeat; flex-shrink: 0;
}
.team-list-name { flex: 1 1 auto; font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-edit-form { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 12px; }
.team-edit-input { height: 34px; padding: 0 10px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font: 13px/1 var(--font); outline: none; width: 100%; }
.team-edit-input:focus { border-color: var(--accent); }
.team-edit-color-row { display: flex; align-items: center; gap: 8px; }
.team-edit-color-swatch { width: 34px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 7px; background: none; cursor: pointer; flex-shrink: 0; }
.team-edit-color-hex { flex: 1; height: 34px; padding: 0 10px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font: 13px/1 monospace; outline: none; }
.team-edit-color-hex:focus { border-color: var(--accent); }
.team-edit-logo-row { display: flex; align-items: center; gap: 10px; }
.team-edit-logo-preview { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg) center/contain no-repeat; flex-shrink: 0; }
.team-edit-actions { display: flex; gap: 8px; align-items: center; padding-top: 2px; }
.team-add-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.team-add-name-row { display: flex; gap: 8px; align-items: center; }
.team-add-name-input { flex: 1 1 auto; min-width: 0; width: auto; }
.team-color-pick { width: 44px; height: 44px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; flex-shrink: 0; background: none; }
.team-add-logo-row { display: flex; align-items: center; gap: 8px; }
.logo-thumb-sq {
  width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2) center/contain no-repeat; flex-shrink: 0;
}

/* Sponsors / ads */
.ads-controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 12px; }
.switch-row { display: flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; }
.overlay-toggle-row { margin-top: 14px; font-size: 14px; }
.interval-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.interval-row input { width: 64px; padding: 8px 10px; }
/* Checkbox styled as a toggle */
.switch {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  width: 46px; height: 26px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border); position: relative; transition: background .15s; flex-shrink: 0;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch:checked { background: var(--onit-red); border-color: var(--onit-red); }
.switch:checked::after { transform: translateX(20px); }

.sponsor-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sponsor-item { display: flex; align-items: center; gap: 12px; }
.sponsor-thumb {
  flex: 1 1 auto; height: 52px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff center/contain no-repeat; background-size: contain;
}
.sponsor-item .btn-text { flex: 0 0 auto; }
.ads-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ads-actions .btn { flex: 0 0 auto; }

/* Live preview */
#preview { width: 100%; border-radius: 12px; background: #0e0e0d; display: block; aspect-ratio: 16/9; }

/* Footer actions */
.footer-actions { display: flex; justify-content: center; margin-top: 4px; }
.powered-by-footer {
  text-align: center; margin-top: 24px; padding-bottom: 20px;
  color: var(--text-3, var(--muted)); font-size: 11px; opacity: .7;
}
.manual-link { color: var(--live-blue); text-decoration: underline; }
.manual-link:hover { color: var(--accent); opacity: .8; }
.footer-sep { margin: 0 6px; }
.footer-brand-mark { height: 18px; width: auto; object-fit: contain; vertical-align: middle; opacity: .9; }

/* ─────────────────────────── STREAMING PAGE ────────────────────────────────*/
.stage {
  position: relative; background: #000; border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 16/9; border: 1px solid var(--border);
}
.stage video { display: none; }
.stage canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.stage .stage-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 600; text-align: center; padding: 24px; pointer-events: none;
}
.rotate-hint {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px;
  background: #14161b; color: var(--text-1);
  font-weight: 700; font-size: var(--t-lg); line-height: 1.4;
}
.rotate-hint .rotate-emoji { font-size: 56px; animation: rotateNudge 2s ease-in-out infinite; }
@keyframes rotateNudge { 0%,60%,100% { transform: rotate(0); } 30% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-hint .rotate-emoji { animation: none; } }

/* Manual fullscreen toggle — shown once the camera is running. Deliberately
   NOT the browser Fullscreen API: iOS Safari doesn't support requestFullscreen()
   on arbitrary elements, only a plain CSS "fill the viewport" toggle works
   everywhere. */
.stage-fullscreen-btn {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  width: 36px; height: 36px; border-radius: 999px; border: none;
  background: rgba(20, 22, 27, 0.65); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.stage-fullscreen-btn .ic { width: 18px; height: 18px; }

body.stage-locked { overflow: hidden; }
#stageCard.pseudo-fullscreen {
  position: fixed; inset: 0; z-index: 200;
  border: none; border-radius: 0; margin: 0; padding: 0;
  background: #000;
  display: flex; flex-direction: column;
}
#stageCard.pseudo-fullscreen .stage {
  flex: 1 1 auto; min-height: 0; aspect-ratio: unset; border-radius: 0; border: none; width: 100%;
}
#stageCard.pseudo-fullscreen .steps {
  position: absolute; inset: auto 0 0 0; z-index: 5;
  background: rgba(14, 16, 20, 0.80);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding: 8px 16px; margin-top: 0; gap: 10px; flex-wrap: nowrap; align-items: center;
}
#stageCard.pseudo-fullscreen .step-num { display: none; }
#stageCard.pseudo-fullscreen #ytNote { display: none; }

.steps { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3);
  font-size: 12px; font-weight: 800; color: var(--muted); flex-shrink: 0;
}
.step { display: flex; align-items: center; gap: 8px; }
.step-checklist {
  /* Geen flex-child van .steps meer (eigen sibling, zie app.html) --
     display:flex komt van de gedeelde .step-klasse. */
  flex-direction: column; align-items: flex-start; gap: 8px;
  margin-top: 14px;
  padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.checklist-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.checklist-items { display: flex; flex-direction: column; gap: 6px; }
.checklist-item { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.checklist-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--onit-red); cursor: pointer; flex-shrink: 0; }
.checklist-edit-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.checklist-edit-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.checklist-edit-row span { flex: 1 1 auto; }
.checklist-add-form { display: flex; gap: 8px; margin-bottom: 10px; }
.checklist-add-form input { flex: 1 1 auto; }
.streams-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.streams-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.streams-info { flex: 1 1 auto; color: var(--muted); }
.templates-list { display: flex; flex-direction: column; gap: 6px; }
.controls-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }

#log {
  white-space: pre-wrap; font: 12px/1.5 ui-monospace, "SF Mono", Menlo, "Courier New", monospace;
  color: var(--muted); background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; max-height: 150px; overflow: auto;
}

/* ── App tabs / views ───────────────────────────────────────────────────────*/
.tabs {
  display: flex; padding: 0;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
}
.tab {
  flex: 1; background: transparent; border: none; border-radius: 0;
  color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .01em;
  min-height: unset; position: relative; cursor: pointer;
  transition: color .15s;
}
/* (was hier ooit een .tab[hidden]-specifieke fix; nu globaal afgedekt door
   de [hidden]{display:none !important}-regel bovenaan dit bestand.) */
.tab-pip {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 18px; height: 2.5px; border-radius: 0 0 2px 2px;
  background: var(--club-color); opacity: 0; transition: opacity .15s;
}
.tab-icon { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.tab-label { font-size: 10px; }
.tab.active { color: var(--club-color); }
.tab.active .tab-pip { opacity: 1; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 16px 16px 32px; }

.pin-form { display: flex; flex-direction: column; gap: 12px; }
.pin-form label { display: flex; flex-direction: column; gap: 6px; font-size: var(--t-sm); font-weight: 600; color: var(--text-2); }
.big-lock { width: 34px; height: 34px; margin: 0 auto 8px; color: var(--text-1); }

/* ── Login overlay ──────────────────────────────────────────────────────────*/
.overlay {
  position: fixed; inset: 0; background: rgba(15,15,14,.94);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.overlay.show { display: flex; }
.overlay .box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; width: min(380px, 92vw); text-align: center;
}
.overlay .box img { height: 40px; width: auto; max-width: 160px; margin-bottom: 20px; }
.overlay h2 { margin: 0 0 4px; font-size: 22px; }
.overlay .pin-input {
  text-align: center; font-size: 28px; letter-spacing: .5em; font-weight: 800;
  padding-left: .5em; margin: 16px 0 4px;
}
.overlay button { width: 100%; margin-top: 14px; font-size: 17px; padding: 14px; }
.error-line { color: #ff9a9a; font-size: 13px; min-height: 18px; }

/* ── Misc ───────────────────────────────────────────────────────────────────*/
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

#flash {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 12px 18px; border-radius: 12px; opacity: 0; transition: opacity .3s;
  pointer-events: none; z-index: 50; max-width: 90vw; font-size: 14px;
}
#flash.show { opacity: 1; }

@media (max-width: 520px) {
  .topbar { padding: 0 10px; }
  .topbar-title { font-size: 13px; }
  .status, .badge { font-size: 11px; padding: 4px 9px; letter-spacing: .06em; }
  /* Verberg de sync-status tekst op kleine schermen — OFFLINE badge volstaat */
  #connStatus { display: none; }

  /* Filmen-stappen verticaal stapelen zodat camerakeuze + knop passen */
  .steps { flex-direction: column; align-items: stretch; }
  .step { width: 100%; flex-wrap: wrap; }
  .step select { flex: 1 1 auto; max-width: none; min-width: 0; }
  .step .btn { flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .team-score { font-size: var(--t-score-sm); }
  .clock-time { font-size: 60px; }
  .btn-minus { font-size: 14px; }
  .mqf-row-3 { grid-template-columns: 1fr 1fr; }
  .mqf-row-3 select { grid-column: 1 / -1; }
}

/* ── Licht thema: overrides voor hardgecodeerde donkere waarden ─────────────*/
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .overlay { background: rgba(220,220,218,.94); }
  :root:not([data-theme="dark"]) .overlay .box { background: var(--surface-1); }
  :root:not([data-theme="dark"]) #log { background: var(--surface-2); }
  :root:not([data-theme="dark"]) .match-picker-panel { background: var(--surface-1); }
}
:root[data-theme="light"] .overlay { background: rgba(220,220,218,.94); }
:root[data-theme="light"] .overlay .box { background: var(--surface-1); }
:root[data-theme="light"] #log { background: var(--surface-2); }
:root[data-theme="light"] .match-picker-panel { background: var(--surface-1); }

/* ── YouTube stream key setup (Beheer tab) ──────────────────────────────────*/
.ok { color: #3fb950; }
.btn-sm { min-height: 42px; padding: 8px 14px; font-size: 14px; }
.sk-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sk-header .sk-status-text { margin: 0; }
.sk-instructions { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.sk-instructions-title { font-weight: 700; font-size: 13px; color: var(--text-2); margin: 0 0 10px; }
.sk-steps { margin: 0 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 5px; list-style: decimal; }
.sk-steps li { font-size: 14px; line-height: 1.6; color: var(--text-1); }
.sk-note { font-size: 13px; color: var(--text-2); margin: 6px 0 0; line-height: 1.5; }
.sk-note.warn { color: var(--text-3); }
.sk-form { display: flex; flex-direction: column; gap: 6px; }
.sk-form-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.sk-form-row { display: flex; gap: 8px; align-items: flex-start; }
.sk-form-row input { flex: 1 1 auto; min-width: 0; }

/* ── Icons (mask → inherit currentColor) ─────────────────────────────────────*/
.ic {
  display: inline-block; width: 1.15em; height: 1.15em; flex: 0 0 auto;
  background-color: currentColor; vertical-align: -0.18em;
  -webkit-mask: var(--ic) center / contain no-repeat;
  mask: var(--ic) center / contain no-repeat;
}
.ic-camera { --ic: url(/assets/icons/icon-camera.svg); }
.ic-play   { --ic: url(/assets/icons/icon-play.svg); }
.ic-pause  { --ic: url(/assets/icons/icon-pause.svg); }
.ic-stop   { --ic: url(/assets/icons/icon-stop.svg); }
.ic-upload { --ic: url(/assets/icons/icon-upload.svg); }
.ic-lock   { --ic: url(/assets/icons/icon-lock.svg); }
.ic-sun    { --ic: url(/assets/icons/icon-sun.svg); }
.ic-moon   { --ic: url(/assets/icons/icon-moon.svg); }
.ic-expand   { --ic: url(/assets/icons/icon-expand.svg); }
.ic-collapse { --ic: url(/assets/icons/icon-collapse.svg); }
.gicon { width: 18px; height: 18px; display: block; }   /* full-colour <img> */

/* ── Thema-toggle knop ───────────────────────────────────────────────────────*/
#themeToggle {
  background: none; border: 1px solid var(--border);
  border-radius: 50%; width: 36px; height: 36px; min-height: unset;
  padding: 0; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
#themeToggle:hover { background: var(--surface-2); }
/* Icoontje via CSS instellen zodat er geen flash is vóór JS geladen is */
#themeIcon { --ic: url(/assets/icons/icon-moon.svg); }
[data-theme="dark"] #themeIcon { --ic: url(/assets/icons/icon-sun.svg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeIcon { --ic: url(/assets/icons/icon-sun.svg); }
}

/* Primary CTAs taller per token */
.btn-primary { min-height: var(--tap-primary); }

/* Clock toggle: play icon, swaps to pause when running */
.btn-clock { min-height: var(--tap-primary); }
.btn-clock::before {
  content: ""; display: inline-block; width: 1em; height: 1em; background-color: currentColor;
  -webkit-mask: url(/assets/icons/icon-play.svg) center / contain no-repeat;
  mask: url(/assets/icons/icon-play.svg) center / contain no-repeat;
}
.btn-clock.is-running::before {
  -webkit-mask-image: url(/assets/icons/icon-pause.svg);
  mask-image: url(/assets/icons/icon-pause.svg);
}

/* ── Match status card (Filmen + Scorebord) ──────────────────────────────────*/
.match-status-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.match-status-info { min-width: 0; flex: 1 1 auto; }
.match-status-text { font-size: 14px; color: var(--text-2); line-height: 1.4; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-status-text.active { color: var(--text-1); font-weight: 600; }

/* ── Match picker overlay panel ──────────────────────────────────────────────*/
.match-picker-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  width: min(500px, 96vw); max-height: min(720px, 92svh);
  display: flex; flex-direction: column; overflow: hidden;
}
.match-picker-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.match-picker-hdr h2 { font-size: 18px; font-weight: 800; margin: 0; }
.match-picker-scroll {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 18px 24px; display: flex; flex-direction: column; gap: 6px;
}

/* ── Match picker items ───────────────────────────────────────────────────────*/
.match-picker-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-1); transition: border-color .12s;
}
.match-picker-item.is-active { border-color: var(--accent); background: rgba(227,6,19,.05); }
.mpi-teams { display: flex; flex-direction: column; gap: 1px; }
.mpi-home { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpi-away { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpi-vs { color: var(--text-2); font-weight: 400; }
.mpi-bottom { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: nowrap; }
.mpi-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1 1 0; min-width: 0; }
.mpi-bottom > .btn { flex: 0 0 auto; width: auto; }
.mpi-dt { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.mpi-loc { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.match-type-badge {
  font-size: 11px; font-weight: 700; border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 7px; color: var(--text-2);
}
.match-picker-section-hdr {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3); padding: 6px 0 2px;
}
.match-past-details { margin-top: 4px; }
.match-past-details > summary {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  cursor: pointer; padding: 6px 0; list-style: none;
}
.match-past-details > summary::-webkit-details-marker { display: none; }
.match-past-details .match-picker-item { opacity: .65; }
.match-past-details[open] .match-picker-item { opacity: 1; }
.match-past-details .match-picker-list-inner { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

/* ── New match form (shared by picker + Beheer) ───────────────────────────────*/
.match-new-details { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 6px; }
.match-new-summary {
  font-size: 14px; font-weight: 700; color: var(--accent);
  cursor: pointer; padding: 4px 0; list-style: none;
}
.match-new-summary::-webkit-details-marker { display: none; }
.match-quick-form {
  display: flex; flex-direction: column; gap: 8px; padding-top: 12px;
}
.mqf-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.mqf-row-3 input, .mqf-row-3 select {
  width: 100%; max-width: none; padding: 10px 8px;
  font-size: 13px; font: inherit; font-size: 13px;
}
.mqf-row-3 select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px;
}
.mqf-team-row { display: flex; align-items: center; gap: 8px; }
.mqf-team-row input[type=text] { flex: 1 1 auto; min-width: 0; }
.mqf-team-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 2px 52px; min-height: 0; }
.mqf-team-chips:empty { display: none; }
.mqf-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.maf-location { width: 100%; }
.match-quick-form .btn-primary { width: 100%; }
.match-quick-form #mqMsg { text-align: center; }

/* ── Schedule list in Beheer ─────────────────────────────────────────────────*/
.match-schedule-list { display: flex; flex-direction: column; margin-bottom: 8px; }
.match-schedule-item { display: flex; flex-direction: column; border-bottom: 1px solid var(--border); }
.match-schedule-item:last-child { border-bottom: none; }
.msi-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.msi-info { flex: 1 1 auto; min-width: 0; }
.msi-teams { font-size: 14px; font-weight: 700; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msi-meta { font-size: 12px; color: var(--text-2); }
.msi-synced-badge { flex: 0 0 auto; font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--bg-2, rgba(128,128,128,0.15)); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.match-edit-form { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 14px; }
.match-edit-field { display: flex; flex-direction: column; gap: 4px; }
.match-edit-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.match-edit-input { height: 34px; padding: 0 10px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font: 13px/1 var(--font); outline: none; width: 100%; }
.match-edit-input:focus { border-color: var(--accent); }
.match-edit-color { width: 34px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 7px; background: none; cursor: pointer; flex-shrink: 0; }
.match-edit-team-row { display: flex; align-items: center; gap: 8px; }
.match-edit-team-row .match-edit-input { flex: 1; width: auto; }
.match-edit-dt-row { display: flex; gap: 10px; }
.match-edit-dt-row .match-edit-field { flex: 1; }
.match-edit-actions { display: flex; align-items: center; gap: 8px; padding-top: 2px; }
.mef-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }

/* ── Small team chips for match forms ────────────────────────────────────────*/
.team-chip-sm {
  padding: 5px 8px; min-width: unset; gap: 4px;
  flex-direction: row; min-height: unset;
}
.team-chip-sm .chip-logo { width: 22px; height: 22px; }
.team-chip-sm .chip-dot { width: 18px; height: 18px; flex-shrink: 0; }
.team-chip-sm .chip-label { font-size: 11px; max-width: 60px; }

/* ── Squad picker overlay ────────────────────────────────────────────────────*/
/* ── Rolkeuze-overlay (na inloggen: filmen / scorebord / filmen én scorebord) */
.role-chooser-box { width: min(420px, 94vw); }
.role-grid { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 16px; }
.role-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-1); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.role-card:hover { background: var(--surface-3); border-color: var(--text-2); }
.role-card-icon { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent); }
.role-card-icon-combi { display: flex; align-items: center; gap: 2px; width: auto; }
.role-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.role-card-title { font-size: 15px; font-weight: 700; }
.role-card-desc { font-size: 12px; color: var(--text-2); }
.role-chooser-hint { margin: 0; }

.squad-picker-box { width: min(480px, 94vw); text-align: left; }
.squad-picker-box h2 { text-align: center; margin: 0 0 20px; }
.squad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.squad-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; text-align: left;
  transition: background .15s, border-color .15s;
}
.squad-card:hover { background: var(--surface-3); border-color: var(--text-2); }
.squad-card-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
}
.squad-card-name { font-size: 15px; font-weight: 600; color: var(--text-1); }

/* Squad picker footer */
.squad-picker-footer { margin-top: 20px; text-align: center; }
.squad-picker-footer .btn-text { font-size: 13px; color: var(--text-3); }
.squad-picker-footer .btn-text:hover { color: var(--text-2); }

/* Playlists card (verenigingsadmin) */
.playlist-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 6px; }
.playlist-item-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.playlist-item-name { font-size: var(--t-sm); font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-item-status { font-size: var(--t-xs); color: var(--text-3); flex-shrink: 0; }
.playlist-item-status.ok { color: #22C55E; }
.playlist-edit-form { border-top: 1px solid var(--border); padding: 10px 12px; background: var(--surface-1); display: flex; flex-direction: column; gap: 8px; }
.playlist-input-wrap { display: flex; align-items: center; gap: 8px; }
.playlist-id-input { flex: 1; height: 36px; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-1); font: 13px/1 monospace; outline: none; }
.playlist-id-input:focus { border-color: rgba(255,255,255,.25); }
.playlist-select { flex: 1; height: 36px; padding: 0 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-1); font: var(--t-sm)/1 var(--font); outline: none; }
.playlist-actions { display: flex; align-items: center; gap: 8px; }
.playlist-actions .small.ok { color: #22C55E; }
.playlist-actions .small.err { color: #f87171; }

/* Squad PIN step */
.squad-pin-form { text-align: center; }
.squad-pin-header {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 18px; font-weight: 700; margin-bottom: 8px;
}
.squad-pin-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

/* Squad badge in topbar */
.squad-badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  margin-left: 8px;
}

/* Squad list in Beheer */
.squad-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.squad-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.squad-list-item:last-child { border-bottom: none; }
.squad-list-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.squad-list-name { flex: 1; font-size: 14px; }

/* Squad add form */
.squad-add-form { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.squad-add-form input[type="text"] { width: 100%; }
.squad-add-row { display: flex; gap: 14px; align-items: flex-end; }
.squad-add-color-label, .squad-add-pin-label {
  display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2);
}
.squad-add-color-label { flex: 0 0 auto; }
.squad-add-pin-label { flex: 1; }
.squad-add-pin-label input { width: 100%; }

/* Squad list: header + inline edit */
.squad-list-header { display: flex; align-items: center; gap: 8px; width: 100%; }
.squad-playlist-badge {
  font-size: 11px; color: var(--text-2); margin-right: auto;
}
.squad-playlist-badge.has-playlist { color: var(--accent); }

.squad-edit-area {
  padding: 10px 0 4px 22px; display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--border); margin-top: 6px;
}
.squad-edit-label { margin: 0; }
.squad-playlist-input, .squad-playlist-select { width: 100%; font-size: 13px; }
.squad-edit-actions { display: flex; align-items: center; gap: 10px; }

/* iCal-agenda koppeling (Wedstrijdschema-kaart) */
.ical-sync-box {
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.ical-sync-row { display: flex; gap: 8px; }
.ical-sync-row input { flex: 1; font-size: 13px; }

/* ── Landscape filming: fase-gebaseerde camera-app layout ────────────────────
   Herontwerp (ROADMAP.md punt 6, na een screenshot vanaf een echt toestel die
   liet zien dat alles-tegelijk-gestapeld niet past: browser-chrome in een
   gewone tab laat vaak maar ~276-300px effectieve hoogte over, niet de
   500+ px die 100svh belooft). Twee fasen i.p.v. één statisch scherm:
   Fase A "Voorbereiden" (#stageCard zonder .phase-live): statusrij +
   checklist + camera-select-bar, geen camerabeeld. Fase B "Live"
   (#stageCard.phase-live): camerabeeld vult alles, bediening zweeft
   eroverheen. Hoogte komt uit --avail-h (app.js meet de daadwerkelijke
   visualViewport-hoogte i.p.v. een vaste aanname te doen).
   Threshold 520px: covers all phones in landscape (375-430px), not tablets. */
@media (orientation: landscape) and (max-height: 520px) {
  /* Scorebord/Beheer in landscape: bestaande gecomprimeerde topbar+tabs,
     ONGEWIJZIGD (buiten scope van dit herontwerp). */
  .topbar { height: 44px; padding: 0 10px; }
  .topbar-logo { width: 32px; height: 32px; }
  .topbar-title { font-size: 13px; }
  .badge, .status { font-size: 11px; padding: 3px 8px; }
  .tabs { flex-shrink: 0; }
  .tab { flex-direction: row; gap: 6px; padding: 6px 0; }
  .tab-icon { width: 16px; height: 16px; }
  .tab-label { font-size: 11px; }

  /* Filmen (body.filmen-landscape-chrome, altijd samen met
     currentView==='filmen' -- zie updateFilmenChrome()): topbar+tabs weg,
     #filmenStatusRow (28px) neemt het over. --avail-h i.p.v. een vaste
     100svh-aftrek, want er is dan niets meer af te trekken.
     Op <body>, niet #appShell: .topbar is een sibling van #appShell in de
     DOM, geen descendant. */
  body.filmen-landscape-chrome .topbar,
  body.filmen-landscape-chrome .tabs { display: none; }
  body.filmen-landscape-chrome #view-filmen {
    height: var(--avail-h, 100svh);
    overflow: hidden;
  }
  body.filmen-landscape-chrome #filmenStatusRow {
    display: flex; align-items: center; gap: 8px;
    height: 28px; flex-shrink: 0; padding: 0 10px;
    background: var(--surface-2);
  }
  #filmenStatusLogo { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; }
  #filmenStatusName { color: var(--text-1); font-weight: 700; font-size: 12px; }
  #filmenStatusBadge {
    color: var(--text-2); font-size: 10px; font-weight: 700;
    border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px;
  }
  #filmenStatusBadge.live { color: var(--live); border-color: var(--live); }
  #filmenOverflowBtn {
    margin-left: auto; background: none; border: none; color: var(--text-2);
    font-size: 16px; line-height: 1; padding: 4px 6px; cursor: pointer;
  }
  #filmenOverflowMenu {
    position: absolute; top: 26px; right: 8px; z-index: 20;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
    box-shadow: 0 8px 20px rgba(0,0,0,.4); overflow: hidden; min-width: 160px;
  }
  .filmen-overflow-item {
    display: block; width: 100%; text-align: left; background: none; border: none;
    color: var(--text-1); font-size: 13px; font-weight: 600; padding: 10px 14px; cursor: pointer;
  }
  .filmen-overflow-item:hover { background: var(--surface-3); }

  #view-filmen .wrap-narrow {
    height: 100%;
    max-width: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Stage card: edge-to-edge, fills all space */
  #stageCard {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    background: #000;
    display: flex;
    flex-direction: column;
  }

  /* Fase A: geen camerabeeld -- de checklist/bottom-bar krijgen de volle
     #stageCard-hoogte. Fase B: camerabeeld vult alles, checklist/bottom-bar
     weg (ze staan toch al gated op !cameraStarted resp. cameraStarted). */
  #stageCard:not(.phase-live) .stage { display: none; }
  #stageCard.phase-live .steps,
  #stageCard.phase-live .step-checklist { display: none; }

  /* Canvas: stretches to fill the available height — no fixed 16/9 ratio */
  #stageCard .stage {
    flex: 1 1 auto;
    min-height: 0;
    aspect-ratio: unset;
    border-radius: 0;
    border: none;
    width: 100%;
  }

  /* Fase A bottom-bar: camera-select/kwaliteit/Camera starten */
  #stageCard .steps {
    flex-shrink: 0;
    background: #111;
    padding: 6px 10px;
    margin-top: 0;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
  }

  #stageCard .step { gap: 8px; flex-wrap: nowrap; align-items: center; }
  #stageCard .step-num { display: none; }
  #stageCard #ytNote { display: none; }

  #stageCard .btn, #stageCard a.btn {
    padding: 8px 14px;
    min-height: 36px;
    font-size: 13px;
  }
  #stageCard select {
    padding: 8px 10px;
    font-size: 13px;
    max-width: 160px;
  }

  /* Log/match-kaart/footer/overlay-toggle: geen nut in dit krappe scherm */
  #logCard, #matchStatusCard { display: none; }
  #view-filmen .powered-by-footer { display: none; }
  #stageCard .overlay-toggle-row { display: none; }

  /* Flash toast: float above the controls overlay instead of behind it */
  #flash { bottom: 76px; }

  /* Fase A: checklist krijgt de volle #stageCard-hoogte (geen camerabeeld
     om overheen te vallen -- zie ROADMAP.md punt 6 voor de oorspronkelijke
     overlap-bug die hiermee is opgelost). Interne scroll + vaste
     fade-gradient hint bij te lange lijsten. */
  #stageCard .step-checklist {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    overflow-y: auto;
    margin: 0;
    padding: 10px 14px;
    background: var(--bg);
  }
  #stageCard .step-checklist .checklist-title { font-size: 10px; }
  #stageCard .step-checklist .checklist-items { gap: 6px; }
  #stageCard .step-checklist .checklist-item { font-size: 12px; }
  .checklist-fade {
    position: absolute; bottom: 0; left: 0; right: 0; height: 24px;
    background: linear-gradient(transparent, var(--bg)); pointer-events: none;
  }

  /* Fase B: vergrendel-knop + live-cluster (linksboven/rechtsboven, universeel
     -- ook bij de kale "Filmen"-rol, niet alleen combi) en de klok/periode-pil
     (gecentreerd, los van dat cluster zodat een mistik nooit bij Stop komt). */
  #stageCard.phase-live .combo-lock-btn {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 8px; left: 8px; z-index: 7;
    width: 32px; height: 32px; padding: 0; border-radius: 50%;
    background: rgba(14, 16, 20, 0.70); border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-1);
  }
  #stageCard.phase-live .combo-lock-btn .ic { width: 16px; height: 16px; }

  #stageCard.phase-live .filmen-live-cluster {
    display: flex; align-items: center;
    position: absolute; top: 8px; right: 8px; z-index: 7; gap: 8px;
  }
  #filmenGoLiveBtn {
    background: var(--accent); color: #fff; border: none; border-radius: var(--r-md);
    font-size: 12px; font-weight: 700; padding: 8px 14px; white-space: nowrap; cursor: pointer;
  }
  #filmenGoLiveBtn:disabled { opacity: .5; cursor: not-allowed; }
  .filmen-live-group { display: flex; align-items: center; gap: 6px; }
  .filmen-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); flex-shrink: 0; }
  .filmen-live-text { color: #fff; font-size: 10px; font-weight: 700; }
  #filmenStopBtn {
    background: none; color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 6px;
    font-size: 10px; font-weight: 700; padding: 3px 8px; margin-left: 4px; cursor: pointer;
  }

  #stageCard.phase-live .combo-clock-pill {
    display: flex; align-items: center; gap: 6px;
    position: absolute; top: 48px; left: 50%; transform: translateX(-50%); z-index: 6;
    background: rgba(0, 0, 0, 0.4); border-radius: var(--r-pill); padding: 4px 10px;
  }
  #stageCard.phase-live .combo-clock-toggle { font-size: 12px; padding: 0; }
  #stageCard.phase-live .combo-period { font-size: 9px; }

  /* Score-rails (alleen combi-mode, zoals altijd): vaste zone in de hoek
     i.p.v. een volle-hoogte-strook, undo (↺) als klein rond badge in de
     binnenhoek i.p.v. eronder -- zo blijft het midden van het beeld vrij en
     komt niets in de buurt van het live-cluster/de klok-pil bovenaan. */
  #appShell.combi-mode #stageCard.phase-live .combo-rail {
    display: flex; align-items: center; justify-content: center;
    position: absolute; bottom: 0; z-index: 4;
    width: min(150px, 40vw); height: min(110px, 42%);
  }
  #appShell.combi-mode #stageCard.phase-live .combo-rail-home {
    left: 0; border-top-right-radius: var(--r-lg);
    background: color-mix(in srgb, var(--team-home) 82%, transparent);
  }
  #appShell.combi-mode #stageCard.phase-live .combo-rail-away {
    right: 0; border-top-left-radius: var(--r-lg);
    background: color-mix(in srgb, var(--team-away) 82%, transparent);
  }
  #stageCard.phase-live .combo-rail-plus {
    width: 100%; height: 100%; background: none; border-radius: 0;
    font-size: 30px;
  }
  #stageCard.phase-live .combo-rail-score { display: none; }
  #stageCard.phase-live .combo-rail-minus {
    position: absolute; top: 6px; width: 40px; height: 40px; min-height: 0;
    border-radius: 50%; background: rgba(0,0,0,.28); border: none;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
  }
  #stageCard.phase-live .combo-rail-home .combo-rail-minus { right: 6px; }
  #stageCard.phase-live .combo-rail-away .combo-rail-minus { left: 6px; }
}

/* ── Beheer: groepen en uitklapbare kaarten ─────────────────────────────── */
.beheer-seg { display: flex; gap: 6px; margin: 0 0 12px; }
.beheer-seg[hidden] { display: none; }
.beheer-seg-btn {
  flex: 1; background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--r-md); padding: 9px 4px; font-weight: 600; font-size: var(--t-sm);
  min-height: var(--tap);
}
.beheer-seg-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.card.group-off { display: none; }
.beheer-card { margin-bottom: 8px; }
.beheer-card:not(.open) { padding-top: 0; padding-bottom: 0; }
.beheer-head {
  display: flex; align-items: center; gap: 10px; min-height: 52px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.beheer-head:focus-visible { outline: 2px solid var(--live-blue); outline-offset: 2px; border-radius: var(--r-sm); }
.beheer-head .card-label { margin: 0; flex: 1; }
.card-status { font-size: var(--t-xs); color: var(--muted); text-align: right; }
.card-status.ok { color: var(--online); font-weight: 600; }
.card-status.warn { color: #E0A100; font-weight: 600; }
.beheer-chev { color: var(--muted); font-size: 20px; line-height: 1; transition: transform .12s; }
.beheer-card.open .beheer-chev { transform: rotate(90deg); }
.beheer-card.open > .beheer-head { margin-bottom: 10px; }
.beheer-card:not(.open) > :not(.beheer-head) { display: none; }
.squad-picker-footer-hint { margin: 0 0 6px; text-align: center; }
