/* =====================================================================
   DartScorer Turniere - Farben wie die App (app.css), Hell/Dunkel nach Einstellung
   (html[data-theme] = auto | light | dark, Einstellungen in der Kopfzeile; auto = System)
   ===================================================================== */

:root {
   --accent: #22a55f;          /* Dart-Grün wie App, Logo und Website */
   --accent-strong: #14884a;
   --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
   /* Haupt-Buttons im Dart-Grün (weiße Schrift 4,5:1), in einem Turnier mit Branding in dessen Farbe; Kopfzeile grau */
   --primary: #14884a;
   --on-primary: #ffffff;
   --topbar: #1f2328;
   --topbar-2: #2b3038;
   --topbar-text: #e6e9ee;
   /* Branding der verknüpften App (js/core.js applyTournamentBranding): Zweitfarbe und Schriften, ohne = wie bisher */
   --accent2: var(--accent);
   --accent2-strong: var(--accent-strong);
   --font-display: "Varela Round", system-ui, sans-serif;
   --font-body: "Varela Round", system-ui, sans-serif;
   --on-accent: #ffffff;
   --bg: #eef1f4;
   --surface: #ffffff;
   --surface-2: #f4f6f8;
   --text: #111827;
   --muted: #5b6472;
   --border: #d7dce2;
   --line: #7d8693;   /* Baumlinien ≥ 3:1 */
   --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.08);
   --danger: #c93a3a;
   --warn: #9a5b00;
   --gold: #f5b700;
   --info: #3b82f6;   /* Teilnehmer-Hinweis, hell und dunkel lesbar */
   /* Akzentfarbe als Schrift: je Untergrund geprüft (≥ 4,5:1, auch auf --accent-soft). --accent-on-light für helle,
      --accent-on-dark für dunkle Flächen, --accent-text = die zur Fläche passende (Dunkel und TV setzen sie um);
      ebenso für die Zweitfarbe („Mein Spieler“) */
   --accent-on-light: #0f6e3b;
   --accent-on-dark: #22a55f;
   --accent-text: var(--accent-on-light);
   --accent2-on-light: var(--accent-on-light);
   --accent2-on-dark: var(--accent-on-dark);
   --accent2-text: var(--accent2-on-light);
   /* Fokusrahmen (auch ds-ui.css): Blau, auf dunklen Flächen (Kopfzeile, Dunkel, TV Nacht) Hellblau - ≥ 3:1 */
   --focus: #1d4ed8;
   --input-border: #727b88;   /* Rand von Eingabefeldern ≥ 3:1 (WCAG 1.4.11), auch auf --accent-soft */
   --on-danger: #ffffff;
   --radius: 14px;
   --radius-small: 10px;
   color-scheme: light;
}
/* Dunkel: gewählt oder (auto) vom System - beide Blöcke gleich halten */
:root[data-theme="dark"] {
   --bg: #0e1013;
   --surface: #171a1f;
   --surface-2: #1f232a;
   --text: #f2f4f7;
   --muted: #a2abb8;
   --border: #2b3039;
   --line: #6b7482;
   --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.35);
   --danger: #ef6262;   /* Gefahr-Rot wie App und Live Display */
   --on-danger: #111827;
   --warn: #e0a040;
   --accent-text: var(--accent-on-dark);
   --accent2-text: var(--accent2-on-dark);
   --focus: #93c5fd;
   --input-border: #7d8693;
   color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
   :root[data-theme="auto"] {
      --bg: #0e1013;
      --surface: #171a1f;
      --surface-2: #1f232a;
      --text: #f2f4f7;
      --muted: #a2abb8;
      --border: #2b3039;
      --line: #6b7482;
      --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.35);
      --danger: #ef6262;   /* Gefahr-Rot wie App und Live Display */
      --on-danger: #111827;
      --warn: #e0a040;
      --accent-text: var(--accent-on-dark);
      --accent2-text: var(--accent2-on-dark);
      --focus: #93c5fd;
      --input-border: #7d8693;
      color-scheme: dark;
   }
}

/* Startseite, Anlegen, Liste, Verbinden (html.neutral): Akzente ohne Markenfarbe - dort stehen Turniere mit eigener
   Markenfarbe (z. B. Rosa) nebeneinander, ein eigenes Grün würde sich beißen; nur die Haupt-Buttons (--primary) bleiben grün */
html.neutral { --accent: #5b6472; --accent-strong: #3a414b; --accent2: var(--accent); --accent2-strong: var(--accent-strong);
   --accent-on-light: #3a414b; --accent-on-dark: #a2abb8; }
html[data-theme="dark"].neutral { --accent: #a2abb8; --accent-strong: #8a94a3; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"].neutral { --accent: #a2abb8; --accent-strong: #8a94a3; } }
/* Turnier ohne Branding (html.site-colors): Farben der Website - Dart-Grün (Werte aus :root, Buttons auch im Dunkeln weiß
   auf #14884a), Rot als Zierlinie. Rot bewusst nie auf Buttons: Rot steht für Löschen und andere kritische Entscheidungen */
html.site-colors .topbar { box-shadow: inset 0 -3px 0 #e0353d; }

/* Farben aus dem Branding; im Dunkeln die kräftige Variante etwas heller (wie das Standardgrün). Buttons (--primary) immer
   in der geprüften kräftigen Farbe (weiße Schrift ≥ 4,5:1, brandingStrongColor), auch im Dunkeln. Schrift in Markenfarbe:
   hell die kräftige etwas dunkler (auch auf --accent-soft lesbar), dunkel die Markenfarbe mit Weiß aufgehellt (auch Navy,
   Schwarz) */
html.branded { --accent: var(--b-accent); --accent-strong: var(--b-accent-strong); --primary: var(--b-accent-strong);
   --accent-on-light: color-mix(in srgb, var(--b-accent-strong) 85%, #000); --accent-on-dark: color-mix(in srgb, var(--b-accent) 45%, #fff); }
html.branded2 { --accent2: var(--b-accent2); --accent2-strong: var(--b-accent2-strong);
   --accent2-on-light: color-mix(in srgb, var(--b-accent2-strong) 85%, #000); --accent2-on-dark: color-mix(in srgb, var(--b-accent2) 45%, #fff); }
html[data-theme="dark"].branded { --accent-strong: color-mix(in srgb, var(--b-accent) 50%, var(--b-accent-strong)); }
html[data-theme="dark"].branded2 { --accent2-strong: color-mix(in srgb, var(--b-accent2) 50%, var(--b-accent2-strong)); }
/* „Schrift auf Buttons: Dunkel“ (buttonFill): Buttons in der unveränderten Markenfarbe mit dunkler Schrift */
html.branded.button-fill { --primary: var(--b-accent-fill); --on-primary: var(--b-on-accent); --on-accent: var(--b-on-accent); }
@media (prefers-color-scheme: dark) {
   html[data-theme="auto"].branded { --accent-strong: color-mix(in srgb, var(--b-accent) 50%, var(--b-accent-strong)); }
   html[data-theme="auto"].branded2 { --accent2-strong: color-mix(in srgb, var(--b-accent2) 50%, var(--b-accent2-strong)); }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
h1, .match-row .legs, .live-score, .tv-row-score { font-family: var(--font-display); }
/* Kleine Überschriften: bei Schriften nur aus Großbuchstaben (Bebas, --font-label aus core.js) in der Textschrift */
h2, h3 { font-family: var(--font-label, var(--font-display)); }
.topbar { font-family: "Varela Round", system-ui, sans-serif; }   /* Kopfzeile bleibt neutral */
body {
   font-family: var(--font-body);
   background: var(--bg);
   color: var(--text);
   min-height: 100vh;
   min-height: 100dvh;
   display: flex;
   flex-direction: column;
   line-height: 1.4;
}
a { color: var(--accent-text); }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: 1.6em; margin: 0 0 4px; }
h2 { font-size: 1.2em; margin: 24px 0 10px; }
h3 { font-size: 1em; margin: 0 0 8px; }
.muted { color: var(--muted); }
/* nur für Screenreader (z. B. „erledigt“, „am Wurf“, Überschrift des Reiterinhalts) */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
[hidden] { display: none !important; }   /* hidden gilt auch für Elemente mit eigenem display (flex, inline …) */

/* ---------- Kopf und Fuß ---------- */
/* Kopfzeile immer neutral (auch bei Turnieren mit Branding): Marke, Menü, Sprache; darunter die Reiter */
.topbar { background: var(--topbar); color: var(--topbar-text); --focus: #93c5fd; }
.topbar-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; max-width: 1100px; margin: 0 auto; }
.brand { color: #fff; text-decoration: none; font-size: 1.1em; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.topnav { display: flex; gap: 4px; margin-left: 12px; flex: 1; }
.topnav-link { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 8px; color: var(--topbar-text); text-decoration: none; }
.topnav-link i { opacity: 0.75; }
.topnav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.topnav-link.active { background: rgba(255, 255, 255, 0.14); color: #fff; }
.topnav-link { white-space: nowrap; }
/* Zwischen Handy-Menü und breitem Bildschirm: ohne Symbole, damit die vier Punkte in eine Zeile passen */
@media (min-width: 721px) and (max-width: 960px) {
   .topnav-link i { display: none; }
   .topnav-link { padding: 7px 10px; }
}
.menu-toggle { display: none; background: transparent; color: inherit; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 8px; padding: 5px 10px; font: inherit; cursor: pointer; }
.toptabs { --focus: #93c5fd; display: flex; gap: 6px; padding: 6px max(16px, calc((100% - 1100px) / 2 + 16px)); background: var(--topbar-2); overflow-x: auto; scrollbar-width: thin; }
.toptabs[hidden] { display: none; }
.toptab { display: inline-flex; align-items: center; flex: 0 0 auto; max-width: 240px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); border: 1px solid transparent; }
.toptab a { display: inline-flex; align-items: center; gap: 7px; min-width: 0; padding: 5px 4px 5px 8px; color: var(--topbar-text); text-decoration: none; font-size: 0.9em; }
.toptab a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toptab:hover { background: rgba(255, 255, 255, 0.1); }
.toptab.active { background: var(--bg); border-color: rgba(255, 255, 255, 0.2); }
.toptab.active a { color: var(--text); }
/* Standard-Logo je Design (logoImg() in js/core.js): helle Fassung auf heller Fläche, dunkle auf dunkler */
html:not([data-theme="dark"]):not([data-theme="auto"]) .std-logo-dark, html[data-theme="dark"] .std-logo-light { display: none; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .std-logo-light { display: none; } }
@media not (prefers-color-scheme: dark) { html[data-theme="auto"] .std-logo-dark { display: none; } }
.toptab-logo { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; flex: 0 0 20px; }
.toptab-close { background: transparent; border: 0; color: inherit; opacity: 0.6; cursor: pointer; padding: 5px 8px; font: inherit; font-size: 0.85em; }
.toptab.active .toptab-close { color: var(--text); }
.toptab-close:hover { opacity: 1; }
@media (max-width: 720px) {
   .topbar-row { flex-wrap: wrap; }
   .menu-toggle { display: inline-flex; }
   .topnav { display: none; order: 3; flex-basis: 100%; flex-direction: column; margin: 4px 0 0; }
   .topbar.menu-open .topnav { display: flex; }
   .topbar-button { margin-left: auto; }
}
.tm-head { display: flex; align-items: center; gap: 12px; }
.tm-head > *, .home-lead { min-width: 0; }
.tm-head h1, .home-lead h1 { overflow-wrap: anywhere; }   /* lange Namen ohne Leerzeichen */
.head-logo { height: 44px; width: auto; max-width: 140px; object-fit: contain; border-radius: 6px; flex: 0 0 auto; }
/* Wortmarke „DartScorer Turniere“ bzw. englisch „Tournaments“ (Kopfleiste immer dunkel), je nach <html lang> */
.brand img { display: block; height: 28px; width: auto; }
html[lang="en"] .brand .lang-de, html:not([lang="en"]) .brand .lang-en { display: none; }
.footer-sep { color: var(--muted); }
.tv-logo { height: 2.6em; width: auto; max-width: 8em; object-fit: contain; flex: 0 0 auto; align-self: center; }
.tv-logo-default { height: 2.2em; max-width: 15em; }   /* Wortmarke „DartScorer Turniere“ ohne Branding */
.print-logo { display: block; max-height: 16mm; max-width: 50mm; margin: 0 0 2mm; }
/* Einstellungen (Sprache, Design, Vollbild) - wie das Einstellungsfeld des Live Displays */
.topbar-row { position: relative; }
.topbar-button {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   min-width: 44px;
   min-height: 44px;
   background: transparent;
   color: inherit;
   border: 1px solid rgba(255, 255, 255, 0.35);
   border-radius: 10px;
   font: inherit;
   cursor: pointer;
}
.topbar-button[aria-expanded="true"] { background: rgba(255, 255, 255, 0.14); }
.settings-panel {
   position: absolute;
   top: calc(100% + 4px);
   right: 16px;
   z-index: 50;
   width: min(340px, calc(100vw - 32px));
   padding: 8px 14px 14px;
   border: 1px solid var(--border);
   border-radius: var(--radius);
   background: var(--surface);
   color: var(--text);
   box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
   font-family: var(--font-body);
}
.settings-row {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 6px 12px;
   padding: 8px 0 10px;
   border-bottom: 1px solid var(--border);
   color: var(--muted);
}
.settings-row:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-row > .segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; color: var(--text); }
.settings-row > .segmented button { justify-content: center; padding: 0 6px; }
.settings-row > .btn { width: 100%; justify-content: center; }
/* Dunkel: Feld hebt sich ab wie die Dialoge (s. „Dialog“) - Fläche einen Hauch heller, heller Rand, kräftigerer Schatten */
@supports (color: light-dark(#000, #fff)) {
   .settings-panel {
      --modal-surface: light-dark(var(--surface), color-mix(in srgb, var(--surface) 95%, #fff));
      --modal-surface-2: light-dark(var(--surface-2), color-mix(in srgb, var(--surface-2) 95%, #fff));
      background: var(--modal-surface);
      border-color: light-dark(var(--border), rgba(255, 255, 255, 0.16));
      box-shadow: 0 10px 30px light-dark(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
   }
   .settings-panel > * { --surface: var(--modal-surface); --surface-2: var(--modal-surface-2); }
}
.page { width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; flex: 1; }

/* ---------- Hilfe (/hilfe): häufige Fragen wie in der App ---------- */
.faq-list { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface); }
.faq-item > summary { display: flex; align-items: center; min-height: 48px; padding: 8px 14px; font-weight: bold; cursor: pointer; list-style: none; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: "+"; margin-left: auto; padding-left: 12px; color: var(--muted); font-size: 1.2em; }
.faq-item[open] > summary::after { content: "−"; }
.faq-answer { padding: 0 14px 14px; line-height: 1.5; }
.faq-answer p { margin: 0 0 8px; }
.faq-answer ul { margin: 0 0 8px; padding-left: 1.2em; }
.faq-answer li { margin: 4px 0; }
.footer { text-align: center; padding: 16px; font-size: 0.9em; color: var(--muted); }

/* ---------- Bausteine ---------- */
.card {
   background: var(--surface);
   border: 1px solid var(--border);
   border-radius: var(--radius);
   box-shadow: var(--shadow);
   padding: 16px;
}
.card + .card { margin-top: 12px; }
.btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   border: 1px solid var(--border);
   background: var(--surface);
   color: var(--text);
   border-radius: var(--radius-small);
   padding: 9px 14px;
   font: inherit;
   cursor: pointer;
   text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 0.9em; }
@media (pointer: coarse) {
   .btn, .btn.small, .tab, .list-filter button, .tv-panel-check, .menu-toggle, .dialog-close, .toptab-close { min-height: 44px; }
   .menu-toggle, .dialog-close, .toptab-close { min-width: 44px; justify-content: center; }
   /* weitere Tippziele auf 44 px (Fingerbedienung) */
   .icon-btn { min-width: 44px; min-height: 44px; }
   .stepper button, .topnav-link, .toptab > a, .segmented button, .role-box > summary, .stepper button,
   select, input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="search"] { min-height: 44px; }
   .toptab > a { display: inline-flex; align-items: center; }
   .match .live-link { display: inline-block; padding: 10px 6px; margin: -10px -6px; }   /* größere Tippfläche ohne mehr Platz */
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn[hidden] { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
   display: inline-flex;
   align-items: center;
   gap: 5px;
   padding: 3px 10px;
   border-radius: 999px;
   background: var(--surface-2);
   border: 1px solid var(--border);
   font-size: 0.85em;
}
.chip.accent { background: var(--accent-soft); border-color: var(--accent); }
.note {
   background: var(--accent-soft);
   border-left: 4px solid var(--accent);
   border-radius: var(--radius-small);
   padding: 10px 12px;
   margin: 10px 0;
}
.note.error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-left-color: var(--danger); }
/* Rollenhinweis im Turnierkopf: Veranstalter in Akzentfarbe, Teilnehmer blau, Zuschauer neutral */
.role-box { border-left: 4px solid var(--line); background: var(--surface-2); border-radius: var(--radius-small); padding: 10px 12px; margin: 10px 0; }
.role-box .role-title { margin: 0; cursor: pointer; }
.role-box[open] > .role-title { margin-bottom: 4px; }
.vis-choice { margin: 10px 0; }
.vis-choice-title { margin: 0 0 4px; font-size: 0.9em; color: var(--muted); }
.vis-choice[aria-invalid="true"], .vis-choice:has(input[aria-invalid="true"]) { outline: 2px solid var(--danger); outline-offset: 4px; border-radius: 4px; }
.more-actions { margin-top: 8px; }
/* TV: freie Boards in einer Zeile unter den belegten */
.tv-free-boards { margin: 0.8em 0 0; color: var(--muted); font-size: 1.1em; }
.role-box ul { margin: 0; padding-left: 1.3em; font-size: 0.93em; }
.role-box li + li { margin-top: 2px; }
.role-organizer { border-left-color: var(--accent); background: var(--accent-soft); }
.role-player { border-left-color: var(--info); background: color-mix(in srgb, var(--info) 12%, var(--surface)); }
.role-player .role-title .fas { color: var(--info); }
.role-viewer .role-title .fas { color: var(--muted); }
.empty { color: var(--muted); padding: 12px 0; }

/* ---------- Formulare ---------- */
label.field { display: block; margin: 10px 0; }
label.field > span { display: block; font-size: 0.9em; color: var(--muted); margin-bottom: 4px; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="search"], input[type="date"], input[type="time"],
select, textarea {
   width: 100%;
   font: inherit;
   color: var(--text);
   background: var(--surface);
   border: 1px solid var(--input-border);
   border-radius: var(--radius-small);
   padding: 8px 10px;
}
textarea { min-height: 160px; resize: vertical; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .match.clickable:focus-visible {
   outline: 2px solid var(--focus);
   outline-offset: 1px;
}
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; cursor: pointer; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > * { flex: 1 1 160px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline input { flex: 1 1 8em; min-width: 0; }
.inline input[type="number"] { flex: 0 0 90px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Auswahl des Modus als Kacheln */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.choice {
   display: block;
   border: 2px solid var(--border);
   border-radius: var(--radius);
   padding: 12px;
   cursor: pointer;
   background: var(--surface);
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice strong { display: flex; gap: 8px; align-items: center; }
.choice small { display: block; color: var(--muted); margin-top: 4px; }
.choice.selected { border-color: var(--accent); background: var(--accent-soft); }
.choice:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Neues Turnier: Schritte über die volle Breite (Spieler/Spiele unten in der Leiste, alle Angaben in der Vorschau) */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.wizard > * { min-width: 0; }   /* sonst wächst die Spalte auf die Breite des Vorschau-Baums (Handy: 726 px) */
.wz-preview-head p { margin: 0 0 6px; }
.wizard-form h1 { margin-bottom: 12px; }
.wz-step { display: none; }
.wz-step.active { display: block; }
.wz-step > h2:first-child, .wz-step > .field:first-child { margin-top: 4px; }
.wizard-form .choices { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; counter-reset: none; }
.stepper li { flex: 1; min-width: 0; }
.stepper button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-small);
   background: var(--surface); color: var(--muted); font: inherit; font-size: 0.9em; cursor: pointer; text-align: left; }
.stepper button:hover { background: var(--surface-2); }
.stepper-no { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
   background: var(--surface-2); border: 1px solid var(--border); font-weight: bold; font-size: 0.85em; }
.stepper-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper button.active { border-color: var(--primary); color: var(--text); font-weight: bold; }
.stepper button.active .stepper-no { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.stepper button.done .stepper-no { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
@media (max-width: 640px) {
   /* nur die Nummer sichtbar, der Name bleibt für Screenreader */
   .stepper-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
   .stepper button { justify-content: center; }
}
/* Tablet: Beschriftung unter die Nummer statt stark gekürzt daneben */
@media (min-width: 641px) and (max-width: 979px) {
   .stepper button { flex-direction: column; gap: 4px; padding: 6px 4px; }
   .stepper-label { white-space: normal; text-align: center; font-size: 0.85em; line-height: 1.2; }
}
.wz-nav { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.wz-count { margin-right: auto; font-size: 0.9em; }
/* Handy: oben „Schritt n von 5“ + Abbrechen, darunter Zurück | Weiter bzw. Turnier anlegen (bekommt den Rest der Breite,
   in Schritt 1 die volle Breite; erst unter etwa 340 px bricht „Turnier anlegen“ um) */
@media (max-width: 600px) {
   .wz-nav { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
   .wz-count { grid-area: 1 / 1; align-self: center; margin: 0; }
   .wz-cancel { grid-area: 1 / 2; justify-self: end; }
   .wz-back { grid-area: 2 / 1; }
   .wz-go { grid-area: 2 / 2; }
   .wz-back[hidden] ~ .wz-go { grid-column: 1 / -1; }
}
/* Schritt 2: „6 Spieler · 15 Spiele“ unten rechts im Namensfeld (Text läuft nicht darunter) */
.wz-players { position: relative; margin: 10px 0; }
.wz-players label.field { margin: 0; }
.wz-players textarea { display: block; padding-bottom: 30px; resize: none; }   /* Höhe setzt growPlayers() (wizard.js) */
.wz-tally { position: absolute; right: 10px; bottom: 6px; padding: 0 4px; font-size: 0.85em; background: var(--surface);
   pointer-events: none; }
.wz-tally:empty { display: none; }
.wz-sum-name { font-weight: bold; font-size: 1.1em; overflow-wrap: anywhere; }
.wz-review { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin: 4px 0 8px;
   border-radius: var(--radius-small); background: var(--surface-2); border: 1px solid var(--border); }
.wz-review p { margin: 0; flex: 1 1 260px; }
.small-note { font-size: 0.9em; display: flex; align-items: center; gap: 8px; margin: 6px 0 0; }
.tlist-logo.small { width: 24px; height: 24px; flex-basis: 24px; border-radius: 5px; }
.preview { overflow: hidden; }

/* ---------- Listen ---------- */
/* Kacheln im Raster: gleich hoch, ohne den Abstand von .card + .card; Datum unten bündig */
.groups > .card + .card { margin-top: 0; }
/* Startseite: Einleitung ohne Kasten, Turniere als Liste */
.home-hero { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 56px; align-items: center; margin: 32px 0 56px; }
.home-lead h1 { font-size: 2.4em; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 14px; }
.home-lead > p { margin: 0 0 24px; color: var(--muted); font-size: 1.08em; line-height: 1.6; }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.big { padding: 12px 20px; font-size: 1.05em; }
.home-icon { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
   border: 1px solid var(--border); color: var(--accent-text); background: var(--surface); font-size: 0.95em; }
.home-facts, .home-features ul { list-style: none; margin: 0; padding: 0; }
.home-facts { border-left: 1px solid var(--border); padding-left: 32px; display: grid; gap: 22px; }
.home-facts li, .home-features li { display: flex; gap: 14px; align-items: flex-start; }
.home-facts strong, .home-features strong { display: block; margin: 6px 0 4px; }
.home-facts p, .home-features li p { margin: 0; color: var(--muted); font-size: 0.93em; line-height: 1.55; }
.home-features h2 { font-size: 0.8em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 18px; }
.home-features ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 40px; border-top: 1px solid var(--border); padding-top: 28px; }
@media (max-width: 900px) {
   .home-hero { grid-template-columns: 1fr; gap: 32px; margin: 16px 0 40px; }
   .home-facts { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 24px; }
   .home-features ul { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
   .home-lead h1 { font-size: 1.9em; }
   .home-features ul { grid-template-columns: 1fr; gap: 22px; }
}
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.list-head h1 { margin: 0; }
.list-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.list-search { flex: 1 1 220px; max-width: 360px; }
.list-filter { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-small); overflow: hidden; background: var(--surface); }
.list-filter button { border: 0; background: transparent; color: var(--text); padding: 8px 14px; font: inherit; cursor: pointer; }
.list-filter button + button { border-left: 1px solid var(--border); }
.list-filter button.active { background: var(--primary); color: var(--on-primary); }
.tlist { list-style: none; margin: 0 0 8px; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tlist li + li { border-top: 1px solid var(--border); }
.tlist a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: inherit; text-decoration: none; }
.tlist a:hover, .tlist a:focus-visible { background: var(--surface-2); }
.tlist a > .fa-chevron-right { color: var(--muted); flex: 0 0 auto; }
.tlist-logo { width: 40px; height: 40px; flex: 0 0 40px; object-fit: contain; border-radius: 8px; }
.tlist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tlist-name { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlist-meta { font-size: 0.82em; color: var(--muted); }
.tlist-side { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 0 1 auto; }
@media (max-width: 560px) {
   .tlist a { flex-wrap: wrap; }
   .tlist-side { order: 3; width: 100%; justify-content: flex-start; padding-right: 1.5em; }
}

/* ---------- Turnier ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 12px; overflow-x: auto; }
.tab:focus-visible { outline-offset: -3px; }   /* sonst schneidet der Scrollbereich der Leiste den Rahmen ab */
@media (max-width: 520px) { .tabs { flex-wrap: wrap; overflow: visible; } }
.tab {
   border: 0;
   background: transparent;
   color: var(--muted);
   font: inherit;
   padding: 8px 14px;
   border-bottom: 3px solid transparent;
   cursor: pointer;
   white-space: nowrap;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
/* Endstand: Treppchen (2 | 1 | 3) und die weiteren Plätze */
.final h2 { margin-bottom: 4px; }
.podium-stage { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; max-width: 560px; margin: 6px auto 0; text-align: center; }
.step { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.step .medal { font-size: 1.8em; line-height: 1; }
.step.first .medal { font-size: 2.4em; }
.step-names strong { display: block; overflow-wrap: anywhere; line-height: 1.25; }
.step.first .step-names strong { font-size: 1.2em; }
.step-names strong.mine { color: var(--accent2-text); }
.step-info { font-size: 0.8em; color: var(--muted); }
.step-block { width: 100%; margin-top: 4px; border: 1px solid var(--border); border-bottom-width: 4px; border-radius: 10px 10px 0 0;
   display: flex; align-items: center; justify-content: center; font-size: 1.35em; font-weight: bold; background: var(--surface-2); }
.step.first .step-block { height: 76px; border-bottom-color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, var(--surface)); }
.step.second .step-block { height: 54px; border-bottom-color: #9aa4b1; background: color-mix(in srgb, #9aa4b1 18%, var(--surface)); }
.step.third .step-block { height: 40px; border-bottom-color: #c07a3c; background: color-mix(in srgb, #c07a3c 16%, var(--surface)); }
.final-rest { list-style: none; margin: 14px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border); columns: 2 240px; column-gap: 28px; }
.final-rest li { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; break-inside: avoid; }
.final-place { flex: 0 0 2.4em; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.final-names { flex: 0 1 auto; min-width: 0; }
.final-info { font-size: 0.8em; color: var(--muted); white-space: nowrap; }
.final-names .mine { font-weight: bold; color: var(--accent2-text); }
.medal.gold { color: var(--gold); }
.medal.silver { color: #9aa4b1; }
.medal.bronze { color: #c07a3c; }

/* Begegnung */
.match {
   position: relative;
   width: 100%;
   background: var(--surface);
   border: 1px solid var(--border);
   border-radius: var(--radius-small);
   font-size: 0.92em;
}
.match.clickable { cursor: pointer; }
/* Button über der ganzen Karte (bedienbar per Tastatur und Screenreader); Live-Link liegt darüber */
.match-hit { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: inherit;
   background: transparent; color: inherit; font: inherit; cursor: pointer; }
.match-hit:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.match .live-link { position: relative; z-index: 1; }
.match.clickable:hover { border-color: var(--accent); }
.match.ready { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.match.bye { border-style: dashed; background: var(--surface-2); }   /* abgesetzt ohne Transparenz (Kontrast) */
.match-label {
   display: flex;
   justify-content: space-between;
   gap: 8px;
   padding: 3px 10px;
   font-size: 0.85em;   /* vorher 0.78em = 11,5 px, zu klein auf dem Handy */
   color: var(--muted);
   border-bottom: 1px solid var(--border);
}
.match-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-text); font-weight: 600; }
.match-status { flex: 0 0 auto; align-self: center; padding: 0 0.6em; border-radius: 999px; font-size: 0.9em; line-height: 1.5; white-space: nowrap;
   background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.match-status.ready { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.match-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; }
.match-row + .match-row { border-top: 1px solid var(--border); }
.match-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Spielplan: ganze Namen (auf dem Handy gibt es keinen Tooltip) - im Baum und im TV bleibt es einzeilig */
body:not(.tv) .schedule .match-row .name { white-space: normal; overflow-wrap: anywhere; }
/* Live-Stand eines laufenden Spiels (aus dem Live Display) */
.match-row .live-score { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: bold; color: var(--danger); }
.match-row.live .legs { min-width: 1.8em; padding-left: 0.4em; border-left: 1px solid var(--border); }
.match-row.active { box-shadow: inset 4px 0 0 var(--danger); }
.match-row .legs { min-width: 1.4em; text-align: right; font-variant-numeric: tabular-nums; font-weight: bold; }
.match-row.winner .name { font-weight: bold; }
.match-row.loser { color: var(--muted); }
.match-row .open { color: var(--muted); font-style: italic; }

/* Läuft gerade (aus der App gemeldet) */
.match.running { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.match-live {
   display: flex;
   align-items: center;
   gap: 6px;
   padding: 3px 10px;
   font-size: 0.78em;
   color: var(--danger);
   border-bottom: 1px solid var(--border);
}
.live-link { margin-left: auto; color: var(--danger); font-weight: bold; text-decoration: none; white-space: nowrap; }
.live-link:hover { text-decoration: underline; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: 0 0 8px; animation: live-pulse 1.6s ease-in-out infinite; }
.chip.live { color: var(--danger); border-color: var(--danger); }
@keyframes live-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Kampflos */
.match-note { display: flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 0.85em; color: var(--muted); border-bottom: 1px solid var(--border); }
/* Ergebnis aus der App, Spiel von einem Zuschauer gestartet (render.js byViewer) */
.match-note.by-viewer { color: var(--warn); }
.by-viewer-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--warn); }
.walkover { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.walkover summary { cursor: pointer; color: var(--muted); }

/* Spieler verwalten: die Liste scrollt mit dem Dialog (keine Scrollfläche in der Scrollfläche) */
.player-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.player-row { display: flex; align-items: center; gap: 6px; }
.player-row input { flex: 1; min-width: 0; }
.player-row .chip { color: var(--accent-text); }
.icon-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--radius-small); width: 36px; height: 36px; cursor: pointer; flex: 0 0 36px; }
.icon-btn.danger { color: var(--danger); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }

/* Turnierbaum: Spalten je Runde, Linien per Rahmen */
.bracket-wrap { overflow-x: auto; padding-bottom: 8px; }
/* breiter erst ab 5 Runden (passen nicht mehr in 1100 px); 64 Spieler = 6 Runden à 230 px */
.page:has(.bracket > .bracket-round:nth-child(5)) { max-width: min(1700px, 100%); }
.bracket { display: flex; min-width: min-content; }
.bracket-round { display: flex; flex-direction: column; width: 230px; flex: 0 0 230px; }
.bracket-round > h3 { text-align: center; font-size: 0.9em; color: var(--muted); margin: 0 0 6px; }
.bracket-matches { flex: 1; display: flex; flex-direction: column; }
.bracket-slot { flex: 1; display: flex; align-items: center; position: relative; padding: 6px 18px; min-height: 84px; }
.bracket-round:first-child .bracket-slot { padding-left: 0; }
.bracket-round:last-child .bracket-slot { padding-right: 0; }
.bracket-round:not(:last-child) .bracket-slot::after {
   content: "";
   position: absolute;
   right: 0;
   top: 50%;
   width: 18px;
   border-top: 2px solid var(--line);
}
.bracket-round:not(:last-child) .bracket-slot:nth-child(odd)::before,
.bracket-round:not(:last-child) .bracket-slot:nth-child(even)::before {
   content: "";
   position: absolute;
   right: 0;
   height: 50%;
   border-right: 2px solid var(--line);
}
.bracket-round:not(:last-child) .bracket-slot:nth-child(odd)::before { top: 50%; }
.bracket-round:not(:last-child) .bracket-slot:nth-child(even)::before { top: 0; }
.bracket-round:not(:first-child) .bracket-slot > .match::before {
   content: "";
   position: absolute;
   left: -19px;
   top: 50%;
   width: 18px;
   border-top: 2px solid var(--line);
}
.bracket-extra { margin-top: 12px; max-width: 230px; }
/* Im Baum: „läuft gerade“/„kampflos“ als Abzeichen über der Karte - die Karte bleibt gleich hoch und nichts wird verdeckt;
   .badges gibt allen Plätzen oben und unten gleich viel Luft dafür (Linien bleiben gerade) */
.bracket.badges .bracket-slot { padding-top: calc(6px + 1.5em); padding-bottom: calc(6px + 1.5em); }
.bracket .match-live, .bracket .match-note {
   position: absolute; bottom: 100%; top: auto; left: 0; right: auto; max-width: 100%; z-index: 1;
   margin-bottom: 3px; padding: 0 0.6em; line-height: 1.6; font-size: 0.8em; white-space: nowrap;
   overflow: hidden; text-overflow: ellipsis;   /* lange Abzeichen („läuft an Board 12 · Live ansehen“) mit … */
   background: var(--surface); border: 1px solid currentColor; border-radius: 999px;
}
.bracket .match-live .live-link { margin-left: 0.5em; }
.bracket-finals { display: flex; flex-wrap: wrap; gap: 0 16px; }
.bracket.plain .bracket-slot::before, .bracket.plain .bracket-slot::after, .bracket.plain .bracket-slot > .match::before { display: none; }
.bracket.plain .bracket-slot { padding-left: 6px; padding-right: 6px; }
.match.skipped { border-style: dashed; background: var(--surface-2); color: var(--muted); }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table.standings { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.standings th, .standings td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.standings th { color: var(--muted); font-weight: normal; font-size: 0.85em; }
.standings th.name, .standings td.name { text-align: left; width: 100%; }
.table-wrap .standings th.name, .table-wrap .standings td.name { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.standings tr.qualified td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
/* auto-fit: wenige Gruppen teilen sich die ganze Breite (keine leere Spalte); engere Zellen, damit die Tabelle in 320 px
   ohne Scrollbalken passt - erst lange Namen scrollen (Namensspalte bleibt stehen) */
.groups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
@media (min-width: 521px) { .groups .standings th, .groups .standings td { padding-left: 5px; padding-right: 5px; } }   /* Handy: 4px (unten) */
.section-title { margin: 20px 0 8px; }

/* Statistik */
.boards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.board.card + .board.card { margin-top: 0; }
.board h3 { display: flex; gap: 8px; align-items: center; }
.board h3 i { color: var(--accent-text); }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-list li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--border); }
.board-list li:last-child { border-bottom: 0; }
.board-list li.first strong { color: var(--accent2-text); }
.board-list .rank { width: 1.8em; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.match-stats { margin: 4px 0 10px; }
.match-stats th:not(.name) { color: var(--text); font-weight: bold; }

.totals { margin-bottom: 12px; }
.totals-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.total { display: flex; flex-direction: column; gap: 2px; }
.total .muted { font-size: 0.82em; }
.total strong { font-size: 1.25em; font-variant-numeric: tabular-nums; }
.running-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Mein Spieler */
.me-box { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; }
.me-select { display: flex; flex: 1 1 260px; align-items: center; gap: 8px; min-width: 0; }
.me-select select { flex: 1 1 180px; width: auto; min-width: 0; max-width: 100%; }
.me-box p { margin: 0; }
.me-info { font-weight: bold; color: var(--accent-text); }
.match.mine { background: color-mix(in srgb, var(--accent2) 16%, var(--surface)); }
.match.mine .match-row .name { font-weight: bold; }

/* Boards */
.boards-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.boards-grid > .card + .card { margin-top: 0; }
.board-card.busy { border-color: var(--danger); }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.board-head h3 { margin: 0; }
.board-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
/* lange Auswahl („Automatisch (nächstes Spiel)“) rutscht in eine eigene Zeile, statt abgeschnitten zu werden */
.board-tools select { flex: 1 1 16em; min-width: 0; }

/* Fernsehansicht */
/* Flächen wie App und Live Display (klassisch): Nacht Dart-Schwarz mit Creme-Schrift, Tag Creme; bei einem Branding mit
   Flächen „Neutral“ (html.tv-neutral, applyTournamentBranding) Grau/Weiß wie die übrige Turnierseite */
body.tv {
   --bg: #0d0d0c;
   --surface: #1b1a18;
   --surface-2: #23211e;
   --text: #f2ead8;
   --muted: #b3a891;
   --border: #322f2a;
   --line: #7a7265;   /* Baumlinien ≥ 3:1 */
   --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--surface));
   color-scheme: dark;
   /* Gefahr/Warnung, Schrift in Akzentfarbe und Fokus passend zum dunklen Grund - unabhängig vom Design der Seite */
   --danger: #ef6262;
   --on-danger: #111827;
   --warn: #e0a040;
   --accent-text: var(--accent-on-dark);
   --accent2-text: var(--accent2-on-dark);
   --focus: #93c5fd;
   --input-border: #857c6b;
   /* Rand gegen Overscan vieler TVs (2,5 % bzw. 3 %), Kopfband zieht bis an den Rand */
   --tv-pad-y: max(0.9em, 2.5vh);
   --tv-pad-x: max(1.4em, 3vw);
   /* Schrift nach Breite und Höhe (Handy quer, 4K ohne Deckel bei 30 px) */
   font-size: clamp(14px, min(1.3vw, 2.4vh), 56px);
   overflow: hidden;
   height: 100vh;
   height: 100dvh;
   min-height: 0;
   /* zusätzlicher Rand „Rand (TV)“ (tvOverscanButton, Standard aus) */
   padding: var(--tv-overscan, 0px);
   box-sizing: border-box;
}
body.tv .topbar, body.tv .footer { display: none; }
/* Saison-Effekt dezent vor dem Inhalt (season.css): unter den Live-Display-Rahmen und Dialogen */
body.tv { --season-front-z: 4; }
body.tv .page { max-width: none; padding: var(--tv-pad-y) var(--tv-pad-x) max(1.2em, 2.5vh); flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
body.tv .bracket-slot { min-height: 3.6em; }   /* mit der TV-Schrift statt fester 84 px */
/* Kopfbereich (Titel + Ansichten) als abgesetztes Band */
.tv-top {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 0.5em 1.2em;
   margin: calc(-1 * var(--tv-pad-y)) calc(-1 * var(--tv-pad-x)) 0.9em;
   padding: var(--tv-pad-y) var(--tv-pad-x) 0.5em;
   background: var(--surface);
   border-bottom: 1px solid var(--border);
   box-shadow: 0 0.3em 1.2em rgba(0, 0, 0, 0.45);
}
.tv-title { flex: 1 1 auto; min-width: 0; }
.tv-top h1 { font-size: 1.25em; margin: 0; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-meta { font-size: 0.72em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-meta strong { color: var(--accent-text); }
.tv-tools { order: 2; display: flex; align-items: center; gap: 0.5em; margin-left: auto; }
.tv-clock { font-size: 1.25em; font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 0.2em; }
.tv-exit { color: var(--muted); opacity: 0.75; padding: 0.2em 0.4em; }
.tv-theme { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 999px; width: 2.2em; height: 2.2em; font: inherit; cursor: pointer; }
.tv-theme:hover { color: var(--text); border-color: var(--accent); }
.tv-theme.on { color: var(--accent-text); border-color: var(--accent); }   /* Rand (TV) eingeschaltet */

/* Tagansicht (Umschalter in der Kopfzeile): Creme wie App und Live Display (neutral: Grau/Weiß, s. u.) */
body.tv.tv-light {
   --bg: #f2ead8;
   --surface: #fffaf1;
   --surface-2: #fbf1df;
   --text: #111111;
   --muted: #5e5546;
   --border: #e3d2b2;
   --line: #857a66;
   --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
   --danger: #c93a3a;
   --on-danger: #ffffff;
   --warn: #9a5b00;
   --accent-text: var(--accent-on-light);
   --accent2-text: var(--accent2-on-light);
   --focus: #1d4ed8;
   --input-border: #7d7260;
   color-scheme: light;
}
/* Branding mit Flächen „Neutral“: Grau bzw. Weiß wie die übrige Turnierseite */
html.tv-neutral body.tv {
   --bg: #0b0d10; --surface: #15181d; --surface-2: #1d2128; --text: #f2f4f7; --muted: #a2abb8; --border: #2b3039;
   --line: #6b7482; --input-border: #7d8693;
}
html.tv-neutral body.tv.tv-light {
   --bg: #eef1f4; --surface: #ffffff; --surface-2: #f4f6f8; --text: #111827; --muted: #5b6472; --border: #d7dce2;
   --line: #7d8693; --input-border: #727b88;
}
/* Neutrale Seiten in der TV-Ansicht (/tv): Neutralgrau passend zum TV-Design, nicht zum Design der Seite
   (sonst dunkelgrau auf dunklem Grund) */
html.neutral body.tv:not(.tv-light) { --accent: #a2abb8; --accent-strong: #8a94a3; }
html.neutral body.tv.tv-light { --accent: #5b6472; --accent-strong: #3a414b; }
body.tv.tv-light .tv-top { box-shadow: 0 0.3em 1.2em rgba(16, 24, 40, 0.12); }

/* Statistik-Tafel: Bestenlisten breit genug, dass Namen nicht mitten im Wort brechen */
body.tv .tv-boards { grid-template-columns: repeat(auto-fit, minmax(18em, 1fr)); }
body.tv .tv-boards .board-list .name { overflow-wrap: normal; word-break: normal; }
body.tv .totals-grid { grid-template-columns: repeat(auto-fit, minmax(8.5em, 1fr)); }
.tv-exit:hover { opacity: 1; }

/* Leiste mit allen Ansichten; der Balken in der aktiven Ansicht zeigt die Zeit bis zum Wechsel */
/* zweite Zeile: Ansichten inkl. Play/Pause; die Ansichten bleiben in einer Zeile und gleiten seitlich */
.tv-tabs { flex: 0 1 auto; min-width: 0; position: relative; display: flex; gap: 0.4em; overflow-x: auto; scrollbar-width: none; padding: 1px; }
.tv-tabs::-webkit-scrollbar { display: none; }
.tv-tabs .tv-tab { flex: 0 0 auto; white-space: nowrap; }
.tv-tabs.more-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 2.5em); mask-image: linear-gradient(to right, transparent, #000 2.5em); }
.tv-tabs.more-right { -webkit-mask-image: linear-gradient(to left, transparent, #000 2.5em); mask-image: linear-gradient(to left, transparent, #000 2.5em); }
.tv-tabs.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 2.5em, #000 calc(100% - 2.5em), transparent); mask-image: linear-gradient(to right, transparent, #000 2.5em, #000 calc(100% - 2.5em), transparent); }
.tv-nav { order: 3; flex: 1 1 100%; min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 0.4em; margin: 0; font-size: 0.85em; }
.tv-tab {
   position: relative;
   overflow: hidden;
   isolation: isolate;
   display: inline-flex;
   align-items: center;
   gap: 0.5em;
   padding: 0.45em 1.1em;
   border: 1px solid var(--border);
   border-radius: 999px;
   background: var(--surface);
   color: var(--muted);
   font: inherit;
   cursor: pointer;
}
.tv-tab.active { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); font-weight: bold; }
/* Fortschritt bis zum Wechsel: füllt den ganzen Button von links nach rechts (hinter dem Text) */
.tv-progress {
   position: absolute;
   inset: 0 auto 0 0;
   width: 0;
   z-index: -1;
   background: color-mix(in srgb, var(--accent) 38%, var(--surface));
   animation: tv-progress var(--tv-seconds, 15s) linear forwards;
}
@keyframes tv-progress { from { width: 0; } to { width: 100%; } }
.tv-arrow, .tv-pause {
   border: 1px solid var(--border);
   background: transparent;
   color: var(--muted);
   border-radius: 999px;
   width: 2.2em;
   height: 2.2em;
   font: inherit;
   cursor: pointer;
}
.tv-pause { margin-left: auto; }
.tv-nav > .tv-arrow, .tv-nav > .tv-pause { flex: 0 0 auto; }
.tv-nav.paused .tv-pause { color: var(--accent-text); border-color: var(--accent); }
.tv-arrow:hover, .tv-pause:hover, .tv-tab:hover { border-color: var(--accent); color: var(--text); }

/* Ansicht: füllt den Rest des Bildschirms; Inhalt wird per fitTvPanel() eingepasst, nie abgeschnitten */
/* Innenrand für Rahmen/Schatten der Karten (sonst am Rand abgeschnitten); der negative Außenrand hält die Kante bündig
   mit dem Kopf, rechts und unten bleibt etwas mehr Luft */
.tv-panel { flex: 1; min-height: 0; overflow: hidden; position: relative; padding: 0.4em 0.9em 0.9em 0.4em; margin: -0.4em -0.4em 0 -0.4em; }
/* bewusst ohne Einblend-Animation: bleibt sie hängen (manche Fernseh-Browser), wäre der Inhalt verschoben/unsichtbar */
.tv-fit { transform-origin: top left; }
body.tv .bracket-wrap { overflow: visible; }
body.tv .bracket { min-width: 100%; }
body.tv .bracket { justify-content: center; }
body.tv .bracket-round { flex: 1 1 0; width: auto; min-width: 11em; max-width: 32em; }
body.tv .bracket-finals { gap: 0 1.2em; }
body.tv .bracket-extra { max-width: none; flex: 0 1 16em; min-width: 12em; }
body.tv .boards-grid { grid-template-columns: repeat(auto-fit, minmax(16em, 1fr)); }
body.tv .board-head h3, body.tv .board-head .chip, .match-label > span:last-child { white-space: nowrap; }
body.tv .match { font-size: 1em; }
/* TV: nichts umbrechen - fitTvPanel verkleinert stattdessen (sehr lange Namen notfalls mit „…“) */
body.tv .match-row .name, body.tv .board-list .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.tv .tv-boards .board-list .name { overflow-wrap: normal; }
body.tv .match-label { align-items: center; padding: 0.35em 0.7em; font-size: 0.85em; }
body.tv .match-row { font-weight: 600; }
body.tv .schedule-list { grid-template-columns: repeat(auto-fit, minmax(15em, 1fr)); }
body.tv .card { box-shadow: none; }
body.tv .standings td, body.tv .standings th { white-space: nowrap; }
body.tv .groups { grid-template-columns: repeat(auto-fit, minmax(20em, 1fr)); }
body.tv .table-wrap, body.tv .bracket-wrap { scrollbar-width: none; }
@media (prefers-reduced-motion: reduce) {
   .tv-progress { animation: none; }
}
/* Schmale Bildschirme (Handy): Leiste einzeilig und seitlich wischbar, kleinere Kopfzeile */
@media (max-width: 700px) {
   body.tv { font-size: 14px; --tv-pad-y: 0.8em; --tv-pad-x: 0.8em; }
   .tv-top { margin-bottom: 0.8em; padding-bottom: 0.6em; }
}

/* Fernseher verbinden (/tv) */
/* Gleiche Karte wie die Verbinden-Seite des Live Displays (live/index.php .connect/.pair), auch dieselbe Schriftgröße */
.tv-connect { margin: auto; text-align: center; width: min(34em, calc(100% - 32px)); padding: 1.6em; font-size: clamp(16px, 2vmin, 32px);
   border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.tv-connect h1 { font-size: 1.5em; margin: 0 0 0.6em; }
.tv-connect p { line-height: 1.45; }   /* wie „Live Display verbinden“ (live/index.php .connect) */
.tv-connect-howto strong { color: var(--text); }
.tv-connect-about { margin: 1.2em 0 0; }
.tv-connect-about a { color: #22a55f; }
body.tv.tv-light .tv-connect-about a { color: #0f6e3b; }
.tv-connect-mark { display: block; height: 2.2em; width: auto; max-width: 100%; margin: 0 auto 0.8em; }
.tv-connect-label { margin: 0; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.85em; color: var(--muted); }
/* Code im Dart-Grün wie auf dem Live Display - hier gibt es noch kein Turnier, dessen Farbe sich beißen könnte */
.tv-connect-code { font-size: min(clamp(2.4rem, 12vmin, 10rem), 18vh); font-weight: bold; letter-spacing: 0.08em; line-height: 1.1; white-space: nowrap;
   color: #22a55f; margin: 6px 0; font-variant-numeric: tabular-nums; }
body.tv.tv-light .tv-connect-code { color: #14884a; }   /* Tagansicht: kräftiges Grün (≥ 4,5:1 auf Weiß) */
.tv-code-input { width: 8.5em !important; font-size: 1.4em; letter-spacing: 0.15em; text-align: center; }
.tv-pair-url { font-weight: bold; font-size: 1.1em; margin: 0.3em 0 0.8em; }

/* TV-Tafel Spielplan: Spieltage als kompakte Karten */
.tv-schedule { display: grid; gap: 1em; grid-template-columns: repeat(auto-fit, minmax(22em, 1fr)); align-items: start; }
.tv-schedule > .card { margin: 0; }
.tv-round h3 { margin: 0 0 0.3em; color: var(--accent-text); }
.tv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.8em; align-items: center; padding: 0.4em 0; border-top: 1px solid var(--border); font-weight: 600; }
.tv-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-row-name:first-child { text-align: right; }
.tv-row-name.loser, .tv-row-name.open { color: var(--muted); font-weight: normal; }
.tv-row-name.open { font-style: italic; }
.tv-row-name.winner { font-weight: bold; }
.tv-row-score { min-width: 4em; text-align: center; font-variant-numeric: tabular-nums; font-weight: bold; display: inline-flex; align-items: center; justify-content: center; gap: 0.4em; }
.tv-row.ready:not(.running) .tv-row-score { color: var(--muted); font-weight: normal; }
.tv-row.running .tv-row-score { color: var(--danger); }
.tv-round-idle { margin: 0.4em 0 0; font-size: 0.85em; }

/* Fernsteuerung: Tafel-Auswahl */
.tv-panel-check { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 0.9em; }
.tv-panel-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* Board-Karte: danach geplantes Spiel */
.board-after { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.board-after-label { font-size: 0.8em; font-weight: bold; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-text); }
.board-after-match { font-weight: 600; }
.board-after .muted { font-size: 0.85em; }
body.tv .board-after-match { white-space: nowrap; }

/* Board-Tafeln: Live Displays in fester Ebene über dem Platzhalter (.tv-frame-slot), Karte ohne Live Display groß */
.tv-panel.live { display: flex; flex-direction: column; gap: 0.6em; }
.tv-frame-slot { flex: 1; min-height: 0; border-radius: var(--radius-small); background: #000; }
.tv-frames { position: fixed; z-index: 5; }
.tv-frames[hidden] { display: none; }
.tv-frames iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius-small); background: #000; display: none; }
.tv-frames iframe.shown { display: block; }
.tv-board-single { max-width: 60em; margin: 0 auto; }
.tv-board-single .board-card { font-size: 1.3em; }

/* Spotlight: Live Display groß in der Fernsehansicht */
.tv-spotlight { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.6em; }
.tv-spotlight-bar { display: flex; align-items: center; gap: 0.8em; font-size: 1.3em; flex-wrap: wrap; }
.tv-spotlight-bar .live-dot { width: 0.6em; height: 0.6em; flex-basis: 0.6em; }
.tv-spotlight-name { margin-left: auto; color: var(--muted); }
.tv-spotlight iframe { flex: 1; width: 100%; min-height: 0; border: 0; border-radius: var(--radius-small); background: #000; }

/* Kamerabilder: Videos in fester Ebene wie die Live Displays (#tvCams), Punktestand als Einblendung darüber (js/tv.js) */
.tv-frames video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-small); background: #000; display: none; }
.tv-frames video.shown { display: block; }
.tv-frame-slot { position: relative; }
.tv-cam-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 0.4em; margin: 0; color: #c7ccd4; font-size: 1.3em; }
/* Bildfläche (placeTvFrames) über der Ebene #tvCams (z-index 5); Farben fest wie eine TV-Grafik, unabhängig von Tag/Nacht.
   Spalten: Wurf-Punkt | Name | Sets | Legs | Rest; Größe size-s…xl, Transparenz des Hintergrunds alpha-0…50 (vom Handy) */
.tv-cam-area { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.tv-cam-overlay { margin: 0; min-width: 13em; max-width: 100%; padding: 0.45em 0.6em 0.5em;
    border-radius: 0.3em; background: rgba(12, 16, 24, var(--cam-bg, 0.85)); color: #fff; font-size: 1.25em; line-height: 1.3;
    box-shadow: 0 0.2em 0.8em rgba(0, 0, 0, 0.3); }
.tv-cam-overlay.size-s { font-size: 0.95em; }
.tv-cam-overlay.size-l { font-size: 1.6em; }
.tv-cam-overlay.size-xl { font-size: 2.05em; }
.tv-cam-overlay.alpha-0 { --cam-bg: 1; }
.tv-cam-overlay.alpha-30 { --cam-bg: 0.7; }
.tv-cam-overlay.alpha-50 { --cam-bg: 0.5; }
.tv-cam-overlay.only-title { min-width: 0; }
/* Anker je Position (camAnchors): Logo, Text und Punktestand an derselben Stelle stehen untereinander */
.tv-cam-anchor { position: absolute; display: flex; flex-direction: column; gap: 0.5em; max-width: calc(100% - 1.6em); }
.tv-cam-anchor.pos-tl, .tv-cam-anchor.pos-tc, .tv-cam-anchor.pos-tr { top: 0.75em; }
.tv-cam-anchor.pos-bl, .tv-cam-anchor.pos-bc, .tv-cam-anchor.pos-br { bottom: 0.75em; }
.tv-cam-anchor.pos-tl, .tv-cam-anchor.pos-bl { left: 0.75em; align-items: flex-start; }
.tv-cam-anchor.pos-tr, .tv-cam-anchor.pos-br { right: 0.75em; align-items: flex-end; }
.tv-cam-anchor.pos-tc, .tv-cam-anchor.pos-bc { left: 50%; transform: translateX(-50%); align-items: center; }
.tv-cam-logo { display: block; width: auto; max-width: 40vw; object-fit: contain; filter: drop-shadow(0 0.1em 0.3em rgba(0, 0, 0, 0.5)); }
.tv-cam-logo.size-s { height: 2.2em; }
.tv-cam-logo.size-m { height: 3.2em; }
.tv-cam-logo.size-l { height: 4.6em; }
.tv-cam-logo.size-xl { height: 6.5em; }
.tv-cam-text { font-weight: bold; line-height: 1.15; overflow-wrap: anywhere; text-align: center; unicode-bidi: plaintext;
    text-shadow: 0 0 0.25em rgba(0, 0, 0, 0.9), 0 0.06em 0.12em rgba(0, 0, 0, 0.9); }
.tv-cam-text.size-s { font-size: 1.2em; }
.tv-cam-text.size-m { font-size: 1.8em; }
.tv-cam-text.size-l { font-size: 2.6em; }
.tv-cam-text.size-xl { font-size: 3.6em; }
.tv-cam-overlay-title { display: flex; align-items: baseline; gap: 0.4em; font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.06em; color: #c7ccd4; white-space: nowrap; }
.tv-cam-overlay-round { margin-left: auto; padding-left: 1em; text-transform: none; letter-spacing: 0; }
.tv-cam-overlay-row { display: grid; grid-template-columns: 0.7em minmax(0, 1fr) 2.2em 2.2em 2.9em; align-items: center; column-gap: 0.4em; margin-top: 0.15em; }
.tv-cam-overlay-row.head { margin: 0.25em 0 0; padding-top: 0.25em; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.6em;
    grid-template-columns: minmax(0, 1fr) calc(2.2em / 0.6) calc(2.2em / 0.6) calc(2.9em / 0.6); column-gap: calc(0.4em / 0.6);
    text-transform: uppercase; letter-spacing: 0.06em; color: #c7ccd4; }
.tv-cam-overlay-format { padding-left: calc(1.1em / 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-cam-overlay-dot { width: 0.45em; height: 0.45em; border-radius: 50%; }
.tv-cam-overlay-row.active .tv-cam-overlay-dot { background: #f5c518; }
.tv-cam-overlay-name { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: isolate; }
.tv-cam-overlay-num { text-align: center; font-variant-numeric: tabular-nums; }
.tv-cam-overlay-row:not(.head) .tv-cam-overlay-num { padding: 0.05em 0; border-radius: 0.2em; background: rgba(255, 255, 255, 0.12); font-weight: bold; }
.tv-cam-overlay-rest { padding: 0.05em 0.2em; border-radius: 0.2em; background: #f5c518; color: #111; font-weight: bold; text-align: center;
    font-variant-numeric: tabular-nums; }

/* Kameraseite /<id>/kamera (Handy, js/kamera.js) und Dialog „Kameras“ */
.cam-card { max-width: 40em; margin: 0 auto; }
.cam-card h1 { margin-bottom: 0.2em; }
.cam-name { margin-top: 0; }
.cam-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin: 12px 0; }
.cam-fields label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.cam-preview { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: #000; border-radius: var(--radius-small); }
/* Vorschau mit Kasten, wo am TV der Punktestand liegt */
.cam-stage { position: relative; }
.cam-mock-area { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cam-text-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-weight: 600; }
.cam-text-field input { width: 100%; }
.cam-fields input[type="color"] { width: 64px; height: 40px; padding: 2px; }
.cam-mock-anchor { position: absolute; display: flex; flex-direction: column; gap: 4px; max-width: calc(100% - 16px); pointer-events: none; }
.cam-mock-anchor.pos-tl, .cam-mock-anchor.pos-tc, .cam-mock-anchor.pos-tr { top: 8px; }
.cam-mock-anchor.pos-bl, .cam-mock-anchor.pos-bc, .cam-mock-anchor.pos-br { bottom: 8px; }
.cam-mock-anchor.pos-tl, .cam-mock-anchor.pos-bl { left: 8px; align-items: flex-start; }
.cam-mock-anchor.pos-tr, .cam-mock-anchor.pos-br { right: 8px; align-items: flex-end; }
.cam-mock-anchor.pos-tc, .cam-mock-anchor.pos-bc { left: 50%; transform: translateX(-50%); align-items: center; }
.cam-overlay-mock { padding: 4px 10px; border-radius: 4px; color: #fff; font-size: 0.85em; border: 1px dashed rgba(255, 255, 255, 0.6); }
.cam-logo-mock { display: block; width: auto; max-width: 40vw; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }
.cam-logo-mock.size-s { height: 22px; }
.cam-logo-mock.size-m { height: 32px; }
.cam-logo-mock.size-l { height: 46px; }
.cam-logo-mock.size-xl { height: 64px; }
.cam-text-mock { font-weight: bold; line-height: 1.15; text-align: center; overflow-wrap: anywhere; unicode-bidi: plaintext;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.9); }
.cam-text-mock.size-s { font-size: 0.85em; }
.cam-text-mock.size-m { font-size: 1.15em; }
.cam-text-mock.size-l { font-size: 1.5em; }
.cam-text-mock.size-xl { font-size: 1.9em; }
.cam-overlay-field { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-small); }
.cam-overlay-field legend { padding: 0 4px; font-weight: 600; }
.cam-overlay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cam-overlay-grid .btn { justify-content: center; }
.cam-overlay-label { margin: 10px 0 4px; font-weight: 600; font-size: 0.9em; }
.cam-overlay-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cam-overlay-mock { background: rgba(12, 16, 24, var(--cam-bg, 0.85)); }
.cam-overlay-mock.size-s { font-size: 0.7em; }
.cam-overlay-mock.size-l { font-size: 1.05em; }
.cam-overlay-mock.size-xl { font-size: 1.3em; }
.cam-overlay-mock.alpha-0 { --cam-bg: 1; }
.cam-overlay-mock.alpha-30 { --cam-bg: 0.7; }
.cam-overlay-mock.alpha-50 { --cam-bg: 0.5; }
.cam-status { font-size: 1.1em; }
.cam-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.cam-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cam-list-info { flex: 1 1 14em; }

/* Links per E-Mail */
.mail-row input { flex: 1 1 14em; min-width: 0; }
/* Teilen-Dialog: Abschnitte Link / App / QR-Code / E-Mail */
.share-section { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border); }
.share-section > h3:first-child { margin-top: 0; }
.share-section .qr { margin: 6px auto 0; }
.share-section .actions { margin-top: 6px; }
.mail-guard { margin: 10px 0 4px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius-small); }
.mail-guard .field { margin: 0 0 6px; }
.guard-question { font-weight: 600; }
.mail-guard .guard-answer { width: 5em; text-align: center; }
.btn.whatsapp { background: #25d366; border-color: #1ebe5a; color: #0b1f12; }
.btn.whatsapp:hover { background: #1ebe5a; }
.note.mail-warning { border-left-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.note.mail-warning .fa-exclamation-triangle { color: #b8860b; }

/* Fernbedienung im Dialog „Fernsehansicht“ */
.tv-remote h3 { margin: 18px 0 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.tv-remote h3:first-child { margin-top: 4px; padding-top: 0; border-top: 0; }
.tv-remote-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.tv-remote-row .inline select { width: auto; }


/* Spielplan */
.schedule h3 { margin: 18px 0 8px; }
.schedule-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }

/* Handy: weniger Rand, Tabellen enger */
@media (max-width: 520px) {
   .page { padding: 12px 10px 32px; }
   .card { padding: 12px; }
   .card .card { padding: 10px; box-shadow: none; }
   .standings th, .standings td { padding: 6px 4px; }
}

/* ---------- Dialog ---------- */
.dialog {
   border: 1px solid var(--border);
   border-radius: var(--radius);
   background: var(--surface);
   color: var(--text);
   padding: 0;
   width: min(480px, calc(100vw - 32px));
   box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
/* Scrollbalken schmal und dezent statt des grauen Standardbalkens (wie app.css „Dialoge“) */
.dialog { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 28%, transparent) transparent; }
/* Dunkel (auch TV): stärker abgedunkelt, Fläche einen Hauch heller, heller Rand - wie die Dialoge der App (app.css) */
@supports (color: light-dark(#000, #fff)) {
   .dialog {
      --modal-surface: light-dark(var(--surface), color-mix(in srgb, var(--surface) 95%, #fff));
      --modal-surface-2: light-dark(var(--surface-2), color-mix(in srgb, var(--surface-2) 95%, #fff));
      background: var(--modal-surface);
      border-color: light-dark(var(--border), rgba(255, 255, 255, 0.16));
   }
   .dialog > * {
      --surface: var(--modal-surface);
      --surface-2: var(--modal-surface-2);
      --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
   }
   .dialog::backdrop {
      background: light-dark(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.72));
      -webkit-backdrop-filter: blur(2px);
      backdrop-filter: blur(2px);
   }
}
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px 8px;
   position: sticky; top: 0; z-index: 2; background: var(--surface); }
.dialog-head h2 { margin: 0; font-size: 1.15em; display: flex; gap: 8px; align-items: center; }
.dialog-close { border: 0; background: transparent; color: var(--muted); font-size: 1.2em; cursor: pointer; padding: 4px 8px; }
.dialog-body { padding: 8px 16px 16px; }
.dialog-body h3 { margin: 16px 0 8px; }
.result-input { display: grid; grid-template-columns: 1fr 90px; gap: 8px; align-items: center; margin: 8px 0; }
.result-input .name { font-weight: bold; overflow: hidden; text-overflow: ellipsis; }
.app-start { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-small); padding: 10px 12px; margin: 4px 0 14px; }
.app-start h3 { margin: 0 0 4px; }
.app-start p { margin: 0 0 6px; }
.app-start .actions { margin-top: 6px; }
.inline > span { white-space: nowrap; color: var(--muted); }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; min-width: 0; font-size: max(16px, 0.85em); }   /* 16 px: kein Zoom beim Antippen (iOS) */
.qr { display: block; margin: 12px auto; width: 180px; height: 180px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 8px; }

/* ---------- Druckansicht (/<id>/druck): am Bildschirm als A4-Blatt, beim Drucken ohne Bedienung ---------- */
.print-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 6px; }
/* Zeile 1: Zurück links, Drucken rechts; Zeile 2: die Arten als Reiter wie auf der Turnierseite */
.print-kinds { order: 1; flex-basis: 100%; margin: 4px 0 0; flex-wrap: wrap; overflow: visible; }   /* umbrechen: keine Art versteckt */
.print-kinds .tab { display: inline-flex; align-items: center; gap: 7px; padding-inline: 11px; }
.print-go { margin-left: auto; }
.print-hint { margin: 10px 0; font-size: 0.9em; }
/* Namen (auch in Schrift von rechts nach links) gegen ihre Nachbarn abgrenzen: Zahlen und andere Namen behalten ihre
   Reihenfolge; Namen in Texten isoliert isolateName() (core.js) */
.name, .tv-row-name, .sheet-name, .cert-name, .tlist-name, .wz-sum-name, .step-names > *, .final-names > span,
.tv-spotlight-name, .poster-name, .cert-tournament { unicode-bidi: isolate; }
/* Druckvorschau am Bildschirm: feste mm-Spalten passen auf schmalen Handys nicht ganz - das Blatt scrollt dann für sich
   (der Druck selbst ist unverändert); Plakat, Urkunde und Board-Aushang haben feste Seitenform und bleiben, wie sie sind */
@media screen { .print-doc:not(.print-poster):not(.print-cert):not(.print-board) { overflow-x: auto; } }
.print-doc {
   --text: #111; --muted: #555; --surface: #fff; --surface-2: #f3f4f6; --border: #c8ccd2; --line: #9aa1aa; --accent-soft: #eef4ea;
   background: #fff; color: #111; color-scheme: light;
   width: 100%; max-width: 210mm; margin: 0 auto 24px; padding: 14mm 13mm; box-sizing: border-box;
   border-radius: 6px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18); font-size: 10.5pt; line-height: 1.35;
}
.print-head h1 { font-size: 19pt; margin: 0 0 2px; }
/* QR-Code zum Turnier (nur Spielplan) rechts oben */
.print-head.with-qr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; column-gap: 12px; align-items: start; }
.print-head.with-qr > h1, .print-head.with-qr > .print-meta { grid-column: 1; }
.print-head.with-qr > h2 { grid-column: 1 / -1; }
.print-qr { grid-column: 2; grid-row: 1 / 3; margin: 0; text-align: center; }
.print-qr .qr { width: 24mm; height: 24mm; margin: 0 auto; padding: 0; border-radius: 0; }
.print-qr figcaption { font-size: 7pt; color: #555; line-height: 1.25; margin-top: 2px; }
.print-meta { margin: 0; color: #555; font-size: 9.5pt; }
.print-head h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13pt; margin: 10px 0 4px;
   padding-bottom: 4px; border-bottom: 2px solid #111; }
.print-head h2 small { font-size: 8.5pt; font-weight: normal; color: #555; }
.print-section { margin-top: 12px; }
.print-section h3, .print-stats > h3, .print-break-title { font-size: 11.5pt; margin: 14px 0 4px; }
.print-section h4 { font-size: 10.5pt; margin: 8px 0 2px; }
.print-idle { margin: 0 0 4px; color: #555; font-size: 9pt; }
/* feste Spaltenbreiten: alle Tabellen stehen exakt untereinander */
.print-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.print-table th.small, .print-table td.small { width: 20mm; white-space: nowrap; }
.print-table th.res, .print-table td.res { width: 28mm; }
.print-table th.fill, .print-table td.fill { width: 16mm; }
.print-table th.fill.wide, .print-table td.fill.wide { width: 26mm; }
.print-table td { overflow: hidden; text-overflow: ellipsis; }
.print-table th { text-align: left; font-size: 8.5pt; font-weight: 600; color: #555; border-bottom: 1px solid #111; padding: 3px 6px; }
.print-table td { border-bottom: 1px solid #c8ccd2; padding: 6px; vertical-align: middle; }
.print-table td.home { text-align: right; }
.print-table th.home { text-align: right; }
.print-table th.res { text-align: center; }
.print-table td.res { text-align: center; white-space: nowrap; }
.print-table td.res.done { font-weight: bold; }
.print-table td.res small { font-weight: normal; color: #555; }
.print-table td.small { font-size: 9pt; color: #555; }
.print-table td.fill { border-left: 1px solid #e3e5e8; }
.print-table .open { color: #666; font-style: italic; }
.print-box { display: inline-block; width: 2em; height: 1.45em; border: 1px solid #333; border-radius: 2px; vertical-align: middle; }
.print-ranking { margin: 4px 0 0; padding-left: 2em; }
.print-ranking li { padding: 2px 0; }
.print-ranking li.top { font-weight: bold; }
.print-note { padding: 6px 10px; border: 1px solid #c8ccd2; border-radius: 4px; background: #f3f4f6; }
.print-foot { margin-top: 18px; padding-top: 6px; border-top: 1px solid #c8ccd2; color: #777; font-size: 8.5pt; text-align: right; }
/* wiederverwendete Bausteine (Tabelle, Statistik) schlicht */
.print-doc .card { box-shadow: none; border: 1px solid #c8ccd2; background: #fff; }
.print-doc .table-wrap { overflow: visible; }
.print-doc .standings { font-size: 9.5pt; }
.print-doc .note { background: #f3f4f6; }

@media print {
   @page { size: A4; margin: 12mm; }
   html, body.print-view { background: #fff !important; }
   body.print-view .topbar, body.print-view .footer, .print-toolbar, .print-hint { display: none !important; }
   body.print-view .page { padding: 0; max-width: none; margin: 0; }
   .print-doc { box-shadow: none; border-radius: 0; padding: 0; margin: 0; max-width: none; }
   .print-section, .print-doc .card, .print-table tr, .print-ranking { break-inside: avoid; }
   .print-doc h3, .print-doc h4 { break-after: avoid; }
}

/* ---------- Spielberichtsbögen: ein Blatt je Spiel ---------- */
.print-sheet { padding: 11mm 11mm 9mm; font-size: 9.5pt; }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 6px 16px;
   border-bottom: 2px solid #111; padding-bottom: 4px; }
.sheet-title { font-size: 10pt; }
.sheet-title small { color: #555; }
.sheet-fields { display: flex; flex-wrap: wrap; gap: 12px; }
@media screen and (max-width: 600px) { .print-doc { padding: 16px 12px; } }
.sheet-field { display: inline-flex; align-items: flex-end; gap: 4px; }
.sheet-field small { color: #555; font-size: 8pt; }
.sheet-line { display: inline-block; min-width: 22mm; border-bottom: 1px solid #333; padding: 0 2px; min-height: 1.2em; font-weight: 600; }
.sheet-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin: 8px 0 2px; font-size: 15pt; font-weight: bold; }
.sheet-players .sheet-name:first-child { text-align: right; }
.sheet-name.open { color: #666; font-weight: normal; font-style: italic; font-size: 11pt; border-bottom: 1px solid #333; padding-bottom: 2px; }
.sheet-vs { font-size: 9pt; font-weight: normal; color: #555; }
.sheet-format { text-align: center; margin: 0 0 6px; color: #555; font-size: 8.5pt; }
.sheet-legs { display: grid; gap: 4mm 4mm; }
.sheet-legs.cols-1 { grid-template-columns: minmax(0, 90mm); justify-content: center; }
.sheet-legs.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet-legs.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sheet-leg { break-inside: avoid; }
.sheet-leg-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 8.5pt; margin-bottom: 2px; }
.sheet-start { color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-check { display: inline-block; width: 3mm; height: 3mm; border: 1px solid #333; vertical-align: -1px; position: relative; }
.sheet-check.on::after { content: "✕"; position: absolute; inset: -1px 0 0; font-size: 2.6mm; line-height: 3mm; text-align: center; color: #111; font-weight: bold; }
/* ausgefüllte Bögen */
.sheet-table th.won { background: #e3eedd; }
.sheet-table td.co { font-weight: bold; }
.sheet-table td.bust { color: #a33; font-size: 7pt; }
.sheet-table.cricket td.mark { font-size: 10pt; font-weight: bold; }
.sheet-name.won::after { content: " ✓"; font-size: 0.7em; }
.print-box.filled { text-align: center; font-weight: bold; line-height: 1.45em; }
.sheet-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8pt; }
.sheet-table th { border: 1px solid #555; padding: 1px 3px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #f1f2f4; }
.sheet-table tr.sub th { font-weight: normal; color: #555; font-size: 7pt; }
.sheet-table td { border: 1px solid #9aa1aa; height: 5mm; padding: 0 3px; text-align: center; }
.sheet-table .b { border-left: 2px solid #111; }
.sheet-table tr.start td { color: #555; font-weight: 600; background: #f7f7f8; }
.sheet-table.cricket td { height: 7mm; }
.sheet-table.cricket .mid { width: 12mm; font-weight: bold; background: #f1f2f4; }
.sheet-table.cricket tr.points td { height: 8mm; }
.sheet-table.cricket tr.points .mid { font-size: 7pt; font-weight: 600; }
.sheet-foot { margin-top: 5mm; display: grid; grid-template-columns: 1fr 1fr; gap: 3mm 8mm; align-items: start; break-inside: avoid; }
.sheet-result { font-size: 11pt; align-self: center; }
.sheet-result small { color: #555; font-size: 8pt; }
.sheet-extra { border-collapse: collapse; font-size: 8pt; width: 100%; }
.sheet-extra th, .sheet-extra td { border: 1px solid #9aa1aa; padding: 2px 4px; text-align: left; height: 6mm; }
.sheet-extra th { background: #f1f2f4; font-weight: 600; }
.sheet-signs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8mm; margin-top: 4mm; }
.sheet-sign { display: flex; flex-direction: column; gap: 1mm; }
.sheet-sign .sheet-line { min-width: 0; width: 100%; height: 7mm; }
.sheet-sign small { color: #555; font-size: 7.5pt; }
@media print {
   .print-sheet { break-after: page; padding: 0; }
   .print-sheet:last-of-type { break-after: auto; }
}

/* ---------- Plakat und Urkunden (poster.js): eine A4-Seite je Blatt, Farben werden mitgedruckt ---------- */
/* Einstellungen über dem Blatt (printPanel): Karte mit Gruppen nebeneinander, Fußzeile mit Anzahl und Hinweisen */
.print-extra { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 0 0 14px; padding: 14px 16px;
   background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.print-extra-group { flex: 1 1 260px; min-width: 0; margin: 0; padding: 0; border: 0; }
.print-extra-group.wide { flex: 2 1 420px; }
.print-extra-group > legend { display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 8px; font-weight: 600; }
.print-extra-group > legend .fas { color: var(--muted); }
.print-extra-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px 12px; align-items: end; }
.print-extra .field { margin: 0; }
.print-extra .field.wide, .print-extra .check { grid-column: 1 / -1; }
.print-extra .check { margin: 0; align-items: flex-start; }
.print-extra .check input { margin-top: 0.2em; flex: none; }
.print-extra textarea { min-height: 3.2em; }
.print-extra-foot { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
   border-top: 1px solid var(--border); padding-top: 10px; }
.print-extra-foot .small-note { margin: 0 0 0 auto; }
.print-poster, .print-cert, .print-board {
   --print-accent: var(--b-accent, #22a55f);
   --print-accent-text: var(--b-accent-strong, #14884a);   /* Schrift: kräftige Variante, auch helle Markenfarben ≥ 4,5:1 auf Weiß */
   -webkit-print-color-adjust: exact; print-color-adjust: exact;
   aspect-ratio: 210 / 297; display: flex; flex-direction: column; align-items: center; text-align: center;
}
.print-poster, .print-board { padding: 0 14mm 12mm; border-top: 5mm solid var(--print-accent); }
.poster-logo-box { margin: 12mm 0 6mm; }
.poster-logo { display: block; max-width: 110mm; max-height: 62mm; margin: 0 auto; }
.poster-name { font-size: 44pt; line-height: 1.1; margin: 0 0 6mm; overflow-wrap: anywhere; }
.poster-name.medium { font-size: 36pt; }
.poster-name.long { font-size: 28pt; }
.poster-when { font-family: var(--font-display); font-size: 20pt; font-weight: bold; color: var(--print-accent-text); margin: 0 0 2mm; }
.poster-where { font-family: var(--font-display); font-size: 16pt; margin: 0 0 3mm; }
.poster-when .fas, .poster-where .fas { font-size: 0.8em; }
.poster-format { font-size: 11pt; color: #555; margin: 2mm 0 4mm; }
.poster-text { font-size: 13pt; white-space: pre-line; margin: 0 0 4mm; max-width: 160mm; }
.poster-qrs { margin-top: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10mm; width: 100%; padding-top: 6mm; border-top: 1px solid #c8ccd2; }
.poster-qrs.single { grid-template-columns: 1fr; }
.poster-qr { margin: 0; }
.poster-qr .qr { width: 52mm; max-width: 100%; height: auto; aspect-ratio: 1; margin: 0 auto 2mm; padding: 0; border-radius: 0; }   /* schmaler Bildschirm: kleiner, Druck 52 mm */
.poster-qr figcaption { font-size: 9pt; color: #555; line-height: 1.35; overflow-wrap: anywhere; }
.poster-qr figcaption strong { font-family: var(--font-display); font-size: 13pt; color: #111; }
.poster-hint { font-size: 9.5pt; color: #555; margin: 3mm 0 0; }
.print-cert { padding: 10mm; }
.cert-frame { flex: 1; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center;
   border: 2.5mm solid var(--print-accent); outline: 0.6mm solid var(--print-accent); outline-offset: -5mm; padding: 14mm 14mm 12mm; }
.cert-logo { display: block; max-width: 70mm; max-height: 38mm; margin: 0 auto 6mm; }
.cert-title { font-family: var(--font-display); font-size: 40pt; font-weight: bold; letter-spacing: 0.12em; text-transform: uppercase;
   color: var(--print-accent-text); margin: 0 0 4mm; }
.cert-medal { font-size: 34pt; line-height: 1; margin: 0 0 2mm; }
.cert-medal.gold { color: #c9a227; }
.cert-name { font-family: var(--font-display); font-size: 30pt; font-weight: bold; line-height: 1.15; margin: 4mm 0 6mm; overflow-wrap: anywhere; }
.cert-lead { font-size: 13pt; color: #555; margin: 0; }
.cert-tournament { font-family: var(--font-display); font-size: 18pt; font-weight: bold; margin: 1mm 0 4mm; overflow-wrap: anywhere; }
.cert-place { font-family: var(--font-display); font-size: 24pt; font-weight: bold; color: var(--print-accent-text); margin: 0 0 6mm; }
.cert-format, .cert-stats { font-size: 10pt; color: #555; margin: 0 0 1.5mm; }
.cert-text { font-size: 12pt; white-space: pre-line; margin: 4mm 0 0; max-width: 140mm; }
.cert-foot { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 16mm; align-items: end; padding-top: 10mm; text-align: left; }
.cert-sign { display: flex; flex-direction: column; gap: 1mm; }
.cert-line { display: block; min-height: 7mm; border-bottom: 1px solid #333; font-size: 11pt; padding: 0 1mm; }
.cert-sign small { color: #555; font-size: 8.5pt; }
.board-card-head { display: flex; flex-direction: column; align-items: center; gap: 1.5mm; margin: 6mm 0 1mm; }
.board-card-logo { display: block; max-height: 18mm; max-width: 50mm; margin: 0 auto; }
.board-card-tournament { font-family: var(--font-display); font-size: 15pt; font-weight: bold; margin: 0; text-align: center; overflow-wrap: anywhere; }
.board-card-no { font-size: 50pt; line-height: 1.05; margin: 1mm 0 3mm; color: var(--print-accent-text); }
.board-card-qr { margin: 0; }
.board-card-qr .qr { width: 80mm; height: 80mm; margin: 0 auto 3mm; padding: 0; border-radius: 0; }
.board-card-qr figcaption { font-family: var(--font-display); font-size: 15pt; font-weight: bold; }
.board-card-note { max-width: 160mm; margin: 5mm 0 0; padding: 2.5mm 4mm; border: 1.5px solid var(--print-accent); border-radius: 2mm;
   font-size: 10.5pt; line-height: 1.35; text-align: left; }
.board-card-note .fas { color: var(--print-accent-text); }
.board-card-steps { text-align: left; font-size: 10.5pt; line-height: 1.35; margin: 4mm 0 0; padding-left: 7mm; max-width: 150mm; }
.board-card-steps li { margin: 0 0 1.5mm; }
.board-card-follow { margin: auto 0 0; display: flex; align-items: center; gap: 5mm; width: 100%; padding-top: 4mm; border-top: 1px solid #c8ccd2; text-align: left; }
.board-card-follow .qr { width: 24mm; height: 24mm; margin: 0; padding: 0; border-radius: 0; flex: none; }
.board-card-follow figcaption { font-size: 9pt; color: #555; overflow-wrap: anywhere; }
.board-card-follow strong { font-size: 11pt; color: #111; }
@media print {
   .print-extra { display: none !important; }
   .print-poster, .print-cert, .print-board { aspect-ratio: auto; height: 271mm; box-sizing: border-box; overflow: hidden; break-after: page; }
   .print-poster:last-of-type, .print-cert:last-of-type, .print-board:last-of-type { break-after: auto; }
   .print-poster, .print-board { padding: 0 6mm 4mm; }
   .print-extra-note { display: none !important; }
   .print-cert { padding: 0; }
}
