/* Vereinsmeisterschaft BAM Bowler e.V.
   Übernimmt die Tokens und Maße aus Vereinsmeisterschaft.dc.html.
   Farben: Akzent-Ramp um #ff1f92, das Pink der Vereinswebsite (vereinsdesign.css). */

html, body { margin: 0; background: #e4e1e2; }
html {
  /* Ohne das vergroessert iOS im Querformat eigenmaechtig die Schrift. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  /* Der graue Blitz beim Antippen wirkt auf Touch wie ein Fehler. Die
     Rueckmeldung uebernehmen :active-Regeln der jeweiligen Bedienelemente. */
  -webkit-tap-highlight-color: transparent;
  /* Verhindert seitliches Wackeln, wenn ein Kind doch einmal zu breit ist. */
  overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: #d20d76; }
a:hover { color: #a30a5c; }

.app-root {
  min-height: 100vh;
  /* svh rechnet die eingeblendete Adressleiste mobiler Browser mit ein;
     100vh waere dort zu hoch und erzeugt einen Sprung beim Scrollen. */
  min-height: 100svh;
  background: radial-gradient(1100px 600px at 12% -10%, rgba(255, 31, 146, 0.10) 0%, transparent 62%), var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;

  --color-bg: #e4e1e2;
  --color-surface: #f3f1f2;
  --color-text: #1a1618;
  --color-divider: rgba(26, 22, 24, 0.14);
  --color-neutral-100: #f8f7f7;
  --color-neutral-200: #eceaeb;
  --color-neutral-300: #d9d5d7;
  --color-neutral-400: #b0a9ac;
  --color-neutral-500: #8a8286;
  --color-neutral-600: #6b6367;
  --color-neutral-700: #554e51;
  --color-neutral-800: #332d30;
  --color-neutral-900: #1a1618;
  --color-accent: #ff1f92;
  --color-accent-100: #ffe4f1;
  --color-accent-200: #ffd0e6;
  --color-accent-300: #ff7cc2;
  --color-accent-400: #ff4fa8;
  --color-accent-500: #ff1f92;
  --color-accent-600: #e8137f;
  --color-accent-700: #d20d76;
  --color-accent-800: #a30a5c;
  --color-accent-900: #5c0634;
}

/* ── Kopf & Navigation ─────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 20; }
.topbar-main {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: radial-gradient(520px 200px at 6% 120%, rgba(255, 31, 146, 0.45) 0%, transparent 70%), #141013;
  color: #fff;
}
.topbar-logo {
  width: 58px; height: 58px; border-radius: 999px; object-fit: cover;
  background: #000; flex: none; box-shadow: 0 0 0 2px rgba(255, 31, 146, 0.55);
}
.topbar-title { font-family: var(--font-heading); font-size: 24px; letter-spacing: .01em; }
.topbar-sub { font-size: 13px; color: #ff7cc2; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; flex-wrap: wrap; }
.topbar-domain {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,0.22); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; color: rgba(255,255,255,0.82);
}
.topbar-domain .dot { width: 8px; height: 8px; border-radius: 999px; background: #ff1f92; display: inline-block; }
.role-pill { border-radius: 999px; padding: 9px 18px; font-size: 14px; font-weight: 700; }
.role-pill.is-admin { background: #ffd0e6; color: #a30a5c; }
.role-pill.is-public { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85); }
.auth-btn {
  border: 1px solid rgba(255,255,255,0.28); background: rgba(255,255,255,0.06); color: #fff;
  border-radius: 999px; min-height: 48px; padding: 0 22px; font-size: 16px; font-weight: 600;
  font-family: var(--font-body); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
}
.auth-btn:hover { background: rgba(255, 31, 146, 0.35); border-color: #ff1f92; color: #fff; }

.tabbar {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: rgba(248, 247, 247, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-divider); box-shadow: var(--shadow-sm);
}

/* Pille — der eine Zustandsschalter des Designs */
.pill {
  border: 1px solid var(--color-neutral-300); background: transparent; color: var(--color-neutral-800);
  font-family: var(--font-body); font-size: 16px; font-weight: 600;
  padding: 11px 22px; min-height: 48px; border-radius: 999px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.pill:hover { filter: brightness(0.96); color: var(--color-neutral-800); }
.pill.is-on, .pill.is-on:hover,
label.pill:has(input:checked) { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
label.pill:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.pill input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.lock-note {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: var(--color-accent-100); color: var(--color-accent-900);
  font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--color-accent-300);
}
.lock-note .dot { width: 10px; height: 10px; border-radius: 999px; background: var(--color-accent); flex: none; }
.flash { background: var(--color-neutral-100); color: var(--color-neutral-900); border-bottom: 1px solid var(--color-divider); }
.flash.is-warn { background: var(--color-accent-100); color: var(--color-accent-900); border-bottom-color: var(--color-accent-300); }

/* ── Seitenrahmen ──────────────────────────────────────────────────────── */
.page { padding: var(--space-8) var(--space-6); }
.page-narrow { max-width: 1180px; }
.page-mid { max-width: 1100px; }
.page-print { max-width: 1000px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-bottom: var(--space-6); }
.page-title { font-family: var(--font-heading); font-size: 46px; margin: 0; line-height: 1.1; }
.push-right { margin-left: auto; }

.grid { display: grid; gap: var(--space-4); }
.grid-6 { display: grid; gap: var(--space-6); }
/* min(…, 100%) ist hier entscheidend: Ein blosses minmax(380px, 1fr) erzwingt
   auf einem 360-px-Telefon eine 380 px breite Spalte und schiebt die ganze
   Seite seitlich aus dem Bild. Mit min() schrumpft die Spalte stattdessen. */
.cols-300 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.cols-190 { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.cols-320 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.cols-380 { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.cols-480 { grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); }
.cols-280 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.cols-240 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.cols-420 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.start { align-items: start; }

/* ── Dashboard ─────────────────────────────────────────────────────────── */
.champ-card { padding: var(--space-6); box-shadow: var(--shadow-md); }
.champ-card.is-won { background: linear-gradient(135deg, #ff1f92 0%, #a30a5c 100%); color: #fff; }
.champ-kicker { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700); }
.champ-card.is-won .champ-kicker, .champ-card.is-won .champ-note { color: rgba(255,255,255,0.82); }
.champ-name { font-family: var(--font-heading); font-size: 34px; line-height: 1.15; margin-top: var(--space-2); }
.champ-note { font-size: 15px; margin-top: var(--space-1); color: var(--color-neutral-700); }

/* — Spielmodus — */
.mode-card { padding: var(--space-6); gap: var(--space-2); }
.mode-head { display: flex; align-items: flex-start; gap: var(--space-3); }
.mode-name { font-family: var(--font-heading); font-size: 24px; line-height: 1.2; margin-top: 2px; }
.mode-head .tag { margin-left: auto; flex: none; }
.mode-hint { margin: 0; font-size: 15px; color: var(--color-neutral-700); max-width: 62ch; }
.mode-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.mode-safe { font-size: 13px; color: var(--color-neutral-600); }
.mode-games { font-size: 15px; font-weight: 600; margin-top: 4px; }
.undo-card {
  flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4);
  padding: var(--space-4) var(--space-6); margin-bottom: var(--space-6);
  border: 2px solid var(--color-accent-300); font-size: 15px;
}
.undo-card > div { flex: 1 1 320px; }
.undo-card.is-blocked { border-color: var(--color-divider); color: var(--color-neutral-700); }
.games-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 150px)) auto;
  gap: var(--space-3); align-items: end; justify-content: start;
  margin-top: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--color-divider);
}
.games-form .input { width: 100%; min-height: 52px; font-size: 20px; }
.games-form .btn { min-height: 52px; }

.stat-card { padding: var(--space-6); }
.stat-label { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700); }
.stat-value { font-family: var(--font-heading); font-size: 40px; line-height: 1.1; margin-top: var(--space-2); }
.stat-note { font-size: 15px; color: var(--color-accent-700); font-weight: 600; margin-top: var(--space-1); }

.group-card { padding: var(--space-6); min-width: 0; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.group-title { font-family: var(--font-heading); font-size: 26px; }
.group-count { font-size: 14px; color: var(--color-neutral-700); }

.top-row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) 64px 86px;
  align-items: center; gap: var(--space-3); padding: 10px 0; border-top: 1px solid var(--color-divider);
}
.top-row .name { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-row .total { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.top-row .avg { font-variant-numeric: tabular-nums; color: var(--color-neutral-700); text-align: right; white-space: nowrap; }

.badge {
  width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  background: var(--color-neutral-200); color: var(--color-neutral-800);
}
.badge.rank-1 { background: var(--color-accent); color: #fff; }
.badge.rank-top { background: #ffd0e6; color: #5c0634; }

/* ── Tabellen ──────────────────────────────────────────────────────────── */
.table-num { font-variant-numeric: tabular-nums; }
.print-table { font-size: 15px; }
.table th.r, .table td.r { text-align: right; }
/* Namen nicht umbrechen — die Tabellen sind ohnehin seitlich wischbar,
   eine zweizeilige Zeile ("Reischmann, / Michael") liest sich schlechter. */
.table td.nowrap { white-space: nowrap; }
.table tr.qualified { background: rgba(255, 203, 230, 0.45); }

/* Außer Wertung: vollständig lesbar, aber sichtbar abgesetzt. */
.table tr.outside td { color: var(--color-neutral-600); }
.table tr.outside td:first-child { color: var(--color-neutral-400); font-weight: 400; }
.table tr.outside:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.table tr.outside-divider td {
  padding-top: var(--space-4); border-bottom: 1px solid var(--color-divider);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent-700); font-weight: 700; background: transparent;
}
.table tr.outside-divider:hover { background: transparent; }
.outside-tag { margin-left: var(--space-2); font-size: 10px; vertical-align: middle; }

/* — Rückfrage-Dialog (ersetzt window.confirm) — */
.confirm-backdrop { z-index: 60; }
.confirm-backdrop .dialog { width: min(460px, 100%); box-shadow: var(--shadow-lg); }
.confirm-backdrop .dialog-body { font-size: 16px; opacity: 1; color: var(--color-neutral-800); line-height: 1.5; }
.confirm-backdrop .dialog-actions { flex-wrap: wrap; }

/* — Bericht — */
.channel-card { padding: var(--space-6); margin-bottom: var(--space-6); gap: var(--space-3); }
.channel-head { display: flex; align-items: flex-start; gap: var(--space-3); }
.channel-title { font-family: var(--font-heading); font-size: 24px; }
.channel-hint { font-size: 14px; color: var(--color-neutral-700); margin-top: 2px; }
.channel-head .tag { margin-left: auto; flex: none; }
.channel-text {
  width: 100%; min-height: 200px; font-size: 16px; line-height: 1.55;
  font-family: var(--font-body); border-radius: var(--radius-md); resize: vertical;
}
.channel-meta { font-size: 13px; color: var(--color-neutral-600); }
.channel-note { font-size: 14px; color: var(--color-neutral-700); }
.channel-error {
  font-size: 14px; font-weight: 600; color: var(--color-accent-800);
  background: var(--color-accent-100); border: 1px solid var(--color-accent-300);
  border-radius: var(--radius-md); padding: var(--space-2) var(--space-3);
}
.channel-actions {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  align-items: center; margin-top: var(--space-2);
}
.channel-actions .push-right { margin-left: auto; }

/* — Zugriff — */
.warn-box {
  background: var(--color-accent-100); border: 1px solid var(--color-accent-300);
  border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-6);
  font-size: 15px; color: var(--color-accent-900); line-height: 1.5;
}
.warn-inline { font-size: 12px; color: var(--color-accent-700); font-weight: 600; margin-top: 4px; }
.inline-form { display: flex; align-items: center; gap: var(--space-1); margin: 0; }
/* Schmal genug, dass die Tabelle auf einem 1024er Bildschirm ohne Scrollen
   passt — aber breit genug, dass man noch lesen kann, was man tippt. */
.input-inline { min-height: 44px; width: 100%; min-width: 96px; flex: 1 1 auto; font-size: 15px; }
.inline-form .btn { flex: none; padding-inline: var(--space-2); }
.pill input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.table td.empty-game { color: var(--color-neutral-400); }
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Beim seitlichen Wischen in der Tabelle nicht die ganze Seite mitziehen
     und keine "Seite neu laden"-Geste ausloesen. */
  overscroll-behavior-x: contain;
}

/* ── Spieler ───────────────────────────────────────────────────────────── */
.form-card { padding: var(--space-6); margin-bottom: var(--space-6); }
.form-card h2 { font-family: var(--font-heading); font-size: 22px; margin: 0 0 var(--space-4); }
.form-row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; }
.field-label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--color-neutral-700); }
.input-lg { min-height: 52px; font-size: 17px; width: 100%; }
.input-xl { min-height: 56px; font-size: 17px; width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; }
.btn-touch { min-height: 48px; }

/* ── Ergebnis-Eingabe ──────────────────────────────────────────────────── */
.entry-grid { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
@media (max-width: 860px) { .entry-grid { grid-template-columns: minmax(0, 1fr); } }
.entry-list { padding: var(--space-3); max-height: 70vh; overflow: auto; }
.entry-item {
  display: flex; width: 100%; align-items: center; gap: var(--space-3); text-align: left;
  border: none; background: transparent; color: var(--color-text);
  border-radius: var(--radius-md); padding: 12px 14px; min-height: 56px; margin-bottom: 4px;
  cursor: pointer; font-family: var(--font-body); font-size: 16px; text-decoration: none;
}
.entry-item .n { flex: 1; min-width: 0; font-weight: 600; }
.entry-item .p { font-size: 13px; opacity: .8; }
.entry-item.is-on { background: var(--color-accent); color: #fff; }
.entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-6); }
.entry-name { font-family: var(--font-heading); font-size: 30px; }
.entry-sum { margin-left: auto; font-size: 16px; color: var(--color-neutral-700); }
.entry-sum strong { font-size: 22px; color: var(--color-text); }

.game-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: var(--space-3); margin-bottom: var(--space-6); }
.game-tile {
  border: 2px solid var(--color-neutral-300); background: var(--color-neutral-100);
  border-radius: var(--radius-md); padding: var(--space-3); min-height: 94px;
  cursor: pointer; font-family: var(--font-body); text-align: left;
}
.game-tile .lbl { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--color-neutral-700); }
.game-tile .val { font-family: var(--font-heading); font-size: 34px; line-height: 1.2; color: var(--color-text); }
.game-tile .val.is-empty { color: var(--color-neutral-400); }
.game-tile.is-active { border-color: #ff7cc2; background: #ffe4f1; }
.game-tile.is-active .lbl { color: #a30a5c; }
.game-tile.is-active .val { color: #5c0634; }

.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); max-width: 420px; }
.key {
  border: 1px solid var(--color-neutral-300); background: var(--color-neutral-100); color: var(--color-text);
  border-radius: var(--radius-md); min-height: 68px; font-size: 26px; font-weight: 700;
  font-family: var(--font-body); cursor: pointer;
}
.key:active { transform: scale(.97); }
.key.is-clear { background: var(--color-neutral-200); }
.key.is-go { background: var(--color-accent-200); color: var(--color-accent-800); }
.hint { margin: var(--space-4) 0 0; font-size: 14px; color: var(--color-neutral-700); }

/* Das aktive Punktefeld im Finale auch per Tastatur deutlich zeigen. */
.score-box.editable:focus-visible { outline: 3px solid var(--color-accent-300); outline-offset: 2px; }

/* ── Finale: Turnierbaum ───────────────────────────────────────────────────
   Halbfinale → Endspiel → Vereinsmeister, von links nach rechts.

   Die Linien sind Pseudo-Elemente der Spielkarten und rechnen mit zwei
   Voraussetzungen, die das Template garantiert:
   1. Alle drei Karten sind gleich hoch — gleicher Aufbau, Namen und
      Ergebniszeile einzeilig, Punktefelder mit fester Höhe.
   2. Endspiel und Pokal stehen senkrecht mittig in ihrer Spalte; die Spalte ist
      so hoch wie beide Halbfinals samt Abstand. Damit liegt die Mitte des
      Endspiels genau dort, wo sich die Linien der Halbfinals treffen.
   Die Karte hat einen 2-px-Rand; "+ 2px" gleicht ihn aus, weil sich Prozent-
   angaben absolut positionierter Kinder auf die Innenkante beziehen.
   ─────────────────────────────────────────────────────────────────────── */
.final-grid { display: grid; gap: var(--space-8); }
.final-col { min-width: 0; }
.final-col-title { font-family: var(--font-heading); font-size: 30px; margin-bottom: var(--space-3); }

.bk {
  --bk-gx: 40px;                       /* Spaltenabstand = Platz für die Linien */
  --bk-gy: 24px;                       /* Abstand der beiden Halbfinals */
  --bk-line: 2px;
  --bk-ink: var(--color-neutral-400);
  --bk-win: var(--color-accent);
  max-width: 1120px;
}
/* Das Pokalfeld bleibt schmal, damit die Namen in den Spielkarten Platz
   haben: Ab 960 px passt "Schnorrenberg, Heidi" ungekürzt in eine Zeile. */
.bk-head, .bk-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(150px, .55fr);
  column-gap: var(--bk-gx);
}
.bk-head {
  margin-bottom: var(--space-2);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  color: var(--color-neutral-700);
}
.bk-semis { display: flex; flex-direction: column; gap: var(--bk-gy); }
.bk-final, .bk-champ { display: flex; flex-direction: column; justify-content: center; }

.final-match { position: relative; padding: var(--space-3) var(--space-4); border: 2px solid var(--color-neutral-300); }
.final-match.is-final { border-color: var(--color-accent-400); }
.final-match-label {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.final-side { display: flex; align-items: center; gap: var(--space-2); padding: 6px 0; border-top: 1px solid var(--color-divider); }
.seed { width: 28px; height: 28px; border-radius: 999px; background: var(--color-neutral-200); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.final-side .nm { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-box {
  display: grid; place-items: center; flex: none;
  width: 70px; height: 48px; border: 2px solid var(--color-neutral-300);
  background: var(--color-neutral-100); color: var(--color-text);
  border-radius: var(--radius-md); font-family: var(--font-heading); font-size: 22px;
  text-align: center; cursor: default; font-variant-numeric: tabular-nums;
}
.score-box.editable { cursor: pointer; }
.score-box.is-focus { background: #ffe4f1; border-color: #ff7cc2; color: #5c0634; }
.final-result {
  font-size: 14px; color: var(--color-accent-700); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Sieger und Unterlegene */
.final-side.is-winner .nm { color: var(--color-accent-800); font-weight: 700; }
.final-side.is-winner .seed { background: var(--color-accent); color: #fff; }
.final-side.is-winner .score-box { border-color: var(--color-accent-400); }
.final-side.is-loser .nm, .final-side.is-loser .seed { color: var(--color-neutral-500); }

/* Linien: Halbfinale → Treffpunkt (┐ und ┘) */
.bk-match::before, .bk-match::after { position: absolute; pointer-events: none; border: 0 solid var(--bk-ink); }
.bk-semis .bk-match::after {
  content: ""; left: calc(100% + 2px); width: calc(var(--bk-gx) / 2 - 2px);
  height: calc(50% + 2px + var(--bk-gy) / 2);
  border-right-width: var(--bk-line);
}
.bk-semis .bk-match:first-child::after { top: 50%; border-top-width: var(--bk-line); }
.bk-semis .bk-match:last-child::after  { bottom: 50%; border-bottom-width: var(--bk-line); }
/* Treffpunkt → Endspiel → Pokal */
.bk-final .bk-match::before {
  content: ""; right: calc(100% + 2px); top: 50%;
  width: calc(var(--bk-gx) / 2 + var(--bk-line)); border-top-width: var(--bk-line);
}
.bk-final .bk-match::after {
  content: ""; left: calc(100% + 2px); top: 50%;
  width: var(--bk-gx); border-top-width: var(--bk-line);
}
/* Der Weg der Sieger in Vereinsfarbe */
.bk-semis .bk-match.has-winner::after,
.bk-final .bk-match.has-winner::after { border-color: var(--bk-win); }
.bk-body:has(.bk-semis .bk-match.has-winner + .bk-match.has-winner) .bk-final .bk-match::before { border-color: var(--bk-win); }

/* Pokal */
.bk-trophy {
  text-align: center; padding: var(--space-4);
  border-radius: calc(var(--radius-lg) * 1.15);
  background: var(--color-neutral-100); border: 2px dashed var(--color-neutral-300);
  color: var(--color-neutral-700);
}
.bk-trophy.is-won {
  background: linear-gradient(135deg, #ff1f92 0%, #a30a5c 100%); color: #fff;
  border: 2px solid transparent; box-shadow: var(--shadow-md);
}
.bk-cup { display: block; width: 34px; height: 34px; margin: 0 auto var(--space-2); }
/* "VEREINSMEISTERIN" ist ein Wort ohne Trennstelle — schmal gesetzt, damit
   es auch im schmalsten Pokalfeld (150 px) nicht über den Rand läuft. */
.bk-trophy-kicker { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; opacity: .85; }
.bk-trophy-name { margin-top: var(--space-1); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.bk-trophy.is-won .bk-trophy-name { font-family: var(--font-heading); font-weight: 400; font-size: 22px; line-height: 1.2; }

/* Ohne Finalrunde (Modus "6 Spiele"): Baum bleibt sichtbar, zählt aber nicht */
.bk.is-inactive .bk-body { opacity: .6; }
.bk.is-inactive .bk-match::before, .bk.is-inactive .bk-match::after { border-color: var(--bk-ink); }

/* Zu schmal für drei Spalten: der Baum läuft senkrecht, die Linien sammeln
   sich am rechten Rand. Darunter würden längere Namen in drei Spalten
   abgeschnitten — nachgemessen, nicht geschätzt. */
@media screen and (max-width: 959px) {
  .bk { --bk-gy: 16px; --bk-rail: 16px; max-width: 560px; }
  .bk-head { display: none; }
  .bk-body { display: flex; flex-direction: column; gap: var(--bk-gy); padding-right: calc(var(--bk-rail) + 4px); }
  .bk-final, .bk-champ { display: block; }

  /* ┐ von HF1 bis HF2, ┤ von HF2 bis ins Endspiel */
  .bk-semis .bk-match::after,
  .bk-semis .bk-match:first-child::after,
  .bk-semis .bk-match:last-child::after {
    top: 50%; bottom: auto; width: var(--bk-rail);
    height: calc(100% + 4px + var(--bk-gy));
    border-width: var(--bk-line) var(--bk-line) 0 0;
  }
  .bk-semis .bk-match:last-child::after { border-bottom-width: var(--bk-line); }
  .bk-final .bk-match::before { content: none; }
  .bk-final .bk-match::after {
    left: 50%; top: calc(100% + 2px); width: 0; height: var(--bk-gy);
    border-width: 0 0 0 var(--bk-line);
  }
}

.final-pad-wrap { position: sticky; bottom: var(--space-4); display: flex; justify-content: flex-end; margin-top: var(--space-6); }
.final-pad { padding: var(--space-4); box-shadow: var(--shadow-lg); width: min(360px, 100%); }
.final-pad-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.final-pad-head .t { font-weight: 700; font-size: 15px; }
.final-pad .keypad { gap: var(--space-2); max-width: none; }
.final-pad .key { min-height: 62px; font-size: 24px; }

/* ── Archiv ────────────────────────────────────────────────────────────── */
.archive-champ { padding: var(--space-6); background: linear-gradient(135deg, #ff1f92 0%, #a30a5c 100%); color: #fff; }
.archive-champ .k { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,0.82); }
.archive-champ .n { font-family: var(--font-heading); font-size: 32px; margin-top: var(--space-2); }
.section-title { font-family: var(--font-heading); font-size: 30px; margin: var(--space-8) 0 var(--space-4); }
.card-title-lg { font-family: var(--font-heading); font-size: 24px; margin-bottom: var(--space-3); }
.arch-side { display: grid; grid-template-columns: 28px minmax(0, 1fr) 64px; align-items: center; gap: var(--space-3); padding: 9px 0; border-top: 1px solid var(--color-divider); }
.arch-side .nm { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch-side .sc { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Vereinsmeister ────────────────────────────────────────────────────── */
.honor-card { padding: var(--space-6); gap: 0; box-shadow: var(--shadow-sm); }
.honor-card.is-current { border: 2px solid var(--color-accent-300); }
.honor-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.honor-year {
  font-family: var(--font-heading); font-size: 34px; line-height: 1;
  color: var(--color-accent-700); text-decoration: none;
}
a.honor-year:hover { color: var(--color-accent-800); }
.honor-head .tag { margin-left: auto; }
.honor-row { padding: var(--space-3) 0; border-top: 1px solid var(--color-divider); }
.honor-kicker {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-neutral-700); font-weight: 600;
}
.honor-name { font-family: var(--font-heading); font-size: 22px; line-height: 1.2; margin-top: 2px; }
.honor-name.is-open { font-family: var(--font-body); font-size: 16px; color: var(--color-neutral-500); }
.honor-meta { font-size: 14px; color: var(--color-neutral-700); font-variant-numeric: tabular-nums; margin-top: 2px; }
.honor-link { display: inline-block; margin-top: var(--space-3); font-size: 14px; font-weight: 600; }

/* ── Auslosung ─────────────────────────────────────────────────────────── */
.draw-grid { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
@media (max-width: 900px) { .draw-grid { grid-template-columns: minmax(0, 1fr); } }
.wheel-wrap { position: relative; width: 100%; max-width: 330px; margin: 0 auto var(--space-6); aspect-ratio: 1; }
.wheel-pointer {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-top: 22px solid var(--color-text); z-index: 2;
}
.wheel {
  position: absolute; inset: 0; border-radius: 999px;
  box-shadow: var(--shadow-lg); border: 8px solid #141013;
  transform: rotate(0deg);
  transition: transform 3.2s cubic-bezier(.17,.67,.14,1);
}
.wheel-mark { position: absolute; inset: 0; display: flex; justify-content: center; pointer-events: none; }
.wheel-mark span { color: #fff; font-weight: 700; font-size: 14px; margin-top: 16px; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.wheel-hub {
  position: absolute; top: 50%; left: 50%; width: 74px; height: 74px; margin: -37px 0 0 -37px;
  border-radius: 999px; background: #141013; color: #fff; display: grid; place-items: center;
  font-family: var(--font-heading); font-size: 13px; text-align: center; z-index: 3;
}
/* Bahnen · Erste Bahn · Plätze je Bahn, darunter der Knopf über die volle
   Breite — so passt es in die schmale Spalte und aufs Handy. */
.draw-config { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); align-items: end; }
.draw-config .input { width: 100%; min-height: 56px; font-size: 20px; }
.draw-config .btn { grid-column: 1 / -1; min-height: 52px; }
.draw-range { margin: var(--space-2) 0 var(--space-6); font-size: 14px; color: var(--color-neutral-700); }
.draw-next { font-family: var(--font-heading); font-size: 26px; margin-bottom: var(--space-4); }
.draw-note { min-height: 26px; margin-top: var(--space-3); font-weight: 700; color: var(--color-accent-700); }
.draw-progress { font-size: 14px; color: var(--color-neutral-700); }
.draw-warn { font-size: 14px; color: var(--color-accent-700); font-weight: 600; margin-top: var(--space-1); }
.lane-card { padding: var(--space-4); }
.lane-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.lane-head .t { font-family: var(--font-heading); font-size: 22px; }
.lane-load {
  margin-left: auto; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700;
  background: var(--color-neutral-200); color: var(--color-neutral-700);
}
.lane-load.is-full { background: #ffd0e6; color: #a30a5c; }
.lane-player { padding: 9px 0; border-top: 1px solid var(--color-divider); font-weight: 600; }

/* ── Beamer ────────────────────────────────────────────────────────────── */
.beamer-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-6); }
.beamer-logo { width: 88px; height: 88px; border-radius: 999px; object-fit: cover; background: #000; flex: none; }
.beamer-title { font-family: var(--font-heading); font-size: 56px; line-height: 1; }
.beamer-sub { font-size: 20px; color: var(--color-neutral-700); }
.beamer-group { background: var(--color-neutral-100); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-md); }
.beamer-group h2 { font-family: var(--font-heading); font-size: 34px; margin: 0 0 var(--space-4); }
.beamer-row { display: flex; align-items: center; gap: var(--space-4); padding: 14px 0; border-top: 1px solid var(--color-divider); }
.beamer-row .badge { width: 46px; height: 46px; font-family: var(--font-heading); font-size: 22px; font-weight: 400; }
.beamer-row .nm { flex: 1; min-width: 0; font-size: 28px; font-weight: 600; }
.beamer-row .tot { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Scoresheets ───────────────────────────────────────────────────────── */
.sheet-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-left: auto; align-items: center; }
.sheet-pos { font-size: 15px; color: var(--color-neutral-700); min-width: 92px; text-align: center; }
.sheet-search { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); max-width: 640px; }
.sheet-note { font-size: 15px; font-weight: 600; color: var(--color-accent-700); }
.sheet-wrap { max-width: 640px; }
.sheet {
  background: #fff; color: #111; border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-md); padding: 26px; break-inside: avoid;
}
.sheet + .sheet { margin-top: var(--space-6); }
.sheet-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid #ff1f92; padding-bottom: 14px; }
.sheet-head img { width: 56px; height: 56px; border-radius: 999px; object-fit: cover; background: #000; flex: none; }
.sheet-head .ttl { font-family: var(--font-heading); font-size: 22px; }
.sheet-head .sub { font-size: 13px; color: #555; }
.sheet-kicker { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #555; }
.sheet-startno { font-family: var(--font-heading); font-size: 26px; }
.sheet-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.sheet-meta .sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sheet-value { font-size: 20px; font-weight: 700; border-bottom: 1px solid #bbb; padding: 4px 0; }
.sheet-lane-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #ff1f92; font-weight: 700; }
.sheet-lane-box { height: 34px; border: 2px solid #ff1f92; border-radius: 8px; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sheet th { text-align: left; border-bottom: 2px solid #111; padding: 8px 6px; }
.sheet th.game-col { width: 34%; }
.sheet td { border-bottom: 1px solid #ccc; padding: 13px 6px; }
.sheet td.lbl { font-weight: 600; }
.sheet tr.sum td { border-bottom: 2px solid #111; font-weight: 700; }
.sheet tr.sum td.pin { background: #ffe4f1; font-weight: 400; }
.sheet td.section {
  padding: 18px 6px 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: #ff1f92; font-weight: 700; border-bottom: none;
}

/* ── Druckliste ────────────────────────────────────────────────────────── */
.print-head {
  display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-6);
  padding-bottom: var(--space-4); border-bottom: 2px solid var(--color-divider);
}
.print-head img { width: 64px; height: 64px; border-radius: 999px; object-fit: cover; background: #000; flex: none; }
.print-head .t { font-family: var(--font-heading); font-size: 34px; line-height: 1.15; }
.print-head .s { color: var(--color-neutral-700); }
.print-only { display: none; }

/* ── Anmeldung ─────────────────────────────────────────────────────────── */
.login-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(26, 22, 24, 0.55);
  display: grid; place-items: center; padding: var(--space-6);
}
.login-card { padding: var(--space-8); width: min(440px, 100%); box-shadow: var(--shadow-lg); }
.login-title { font-family: var(--font-heading); font-size: 28px; margin-bottom: var(--space-2); }
.login-intro { margin: 0 0 var(--space-6); color: var(--color-neutral-700); font-size: 16px; }
.login-field { display: block; margin-bottom: var(--space-4); }
.login-field .input { width: 100%; min-height: 56px; font-size: 18px; }
.login-field input[type="password"] { letter-spacing: .12em; }
.login-error { min-height: 22px; color: var(--color-accent-700); font-size: 15px; font-weight: 600; margin-bottom: var(--space-3); }
.takeover {
  background: var(--color-accent-100); border: 1px solid var(--color-accent-300);
  border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-4);
  font-size: 15px; color: var(--color-accent-900);
}
.login-actions { display: flex; gap: var(--space-3); justify-content: flex-end; }

/* ══ Telefon ═══════════════════════════════════════════════════════════════
   Android und iOS. Die Seiten bleiben dieselben — sie werden nur enger
   gesetzt, die Navigation wird einzeilig und wischbar, und alles, was
   angetippt wird, behaelt mindestens 44 px Kantenlaenge.
   ═══════════════════════════════════════════════════════════════════════ */

/* Touchgeraete: iOS zoomt beim Antippen jedes Feldes, dessen Schrift kleiner
   als 16 px ist — und zoomt danach nicht von allein zurueck. Deshalb sind
   alle Eingaben auf Touch mindestens 16 px gross. */
@media screen and (pointer: coarse) {
  .input, .input-inline, select, textarea { font-size: 16px; }
  .channel-text { font-size: 16px; }
}

/* "screen and" ist hier keine Formsache: A4 mit 12 mm Rand ergibt einen
   Satzspiegel von 186 mm — umgerechnet rund 703 px. Ohne die Einschraenkung
   wuerde jede Regel dieses Blocks auch beim Drucken gelten und die
   Scoresheets auf Papier verkleinern. */
@media screen and (max-width: 720px) {
  .app-root { font-size: 16px; }

  /* Der Kopf mit Logo und Rolle darf wegscrollen; die Reiterleiste bleibt
     oben stehen, damit der Seitenwechsel immer einen Tipp entfernt ist. */
  .topbar { position: static; }
  .tabbar { position: sticky; top: 0; z-index: 20; }

  .topbar-main { gap: var(--space-3); padding: var(--space-3) var(--space-4); }
  .topbar-logo { width: 42px; height: 42px; }
  .topbar-title { font-size: 19px; }
  .topbar-sub { font-size: 12px; }
  /* Die eigene Adresse steht in der Adresszeile des Browsers — auf dem
     Telefon ist sie im Kopf nur verschenkte Breite. */
  .topbar-domain { display: none; }
  .topbar-right { gap: var(--space-2); width: 100%; margin-left: 0; }
  .role-pill { padding: 7px 14px; font-size: 13px; }
  .auth-btn { min-height: 44px; padding: 0 16px; font-size: 15px; margin-left: auto; }

  /* Zwoelf Reiter ergaeben umgebrochen vier Zeilen und damit einen halben
     Bildschirm Navigation. Stattdessen eine Zeile zum Wischen. */
  .tabbar {
    flex-wrap: nowrap; overflow-x: auto; gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .pill { flex: none; font-size: 15px; padding: 9px 16px; min-height: 44px; }

  .lock-note { padding: var(--space-3) var(--space-4); font-size: 14px; }

  /* Seitenrand: 16 px, im Querformat aber mindestens so viel, dass nichts
     unter der Notch oder der abgerundeten Ecke verschwindet. */
  .page {
    padding: var(--space-6) var(--space-4) var(--space-8);
    padding-left: max(var(--space-4), env(safe-area-inset-left));
    padding-right: max(var(--space-4), env(safe-area-inset-right));
    padding-bottom: max(var(--space-8), env(safe-area-inset-bottom));
  }
  .page-head { gap: var(--space-3); margin-bottom: var(--space-4); }
  .page-title { font-size: 30px; }
  .section-title { font-size: 24px; margin: var(--space-6) 0 var(--space-3); }
  .push-right { margin-left: 0; }

  .champ-card, .stat-card, .group-card, .form-card, .channel-card,
  .final-match, .archive-champ, .login-card { padding: var(--space-4); }
  .champ-name { font-size: 26px; }
  .stat-value { font-size: 30px; }
  .mode-card, .honor-card { padding: var(--space-4); }
  .honor-year { font-size: 28px; }
  .honor-name { font-size: 20px; }
  .mode-name { font-size: 20px; }
  .mode-form > form { flex: 1 1 100%; }
  .mode-form .btn { width: 100%; }
  .games-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .games-form .btn { grid-column: 1 / -1; width: 100%; }
  .group-title, .card-title-lg { font-size: 21px; }
  .channel-title, .entry-name, .final-col-title { font-size: 23px; }
  .print-head { gap: var(--space-3); }
  .print-head .t { font-size: 24px; }
  .print-head img { width: 48px; height: 48px; }
  /* Ohne min-width:0 schiebt das laengste Wort ("Vereinsmeisterschaft")
     den Textblock ueber den Rand hinaus, statt umzubrechen. */
  .print-head > div { min-width: 0; overflow-wrap: anywhere; }

  /* Platz-/Name-/Summe-Zeile: schmalere Zahlenspalten, damit der Name
     nicht nach drei Buchstaben abgeschnitten wird. */
  .top-row { grid-template-columns: 28px minmax(0, 1fr) 54px 68px; gap: var(--space-2); }
  .arch-side { gap: var(--space-2); }

  /* Eingabe: die Spielerliste darf nicht den halben Bildschirm fuellen,
     der Ziffernblock soll ohne Scrollen erreichbar sein. */
  .entry-list { max-height: 40vh; }
  .entry-head { margin-bottom: var(--space-4); }
  .entry-sum { margin-left: 0; }
  .keypad { max-width: none; gap: var(--space-2); }
  .key { min-height: 64px; font-size: 24px; }
  .game-tile { min-height: 82px; padding: var(--space-2); }
  .game-tile .val { font-size: 28px; }

  /* Finale: der Ziffernblock sitzt am unteren Rand ueber die volle Breite,
     mit Abstand zur Wischleiste des iPhones. */
  .final-pad-wrap {
    justify-content: stretch;
    bottom: max(var(--space-3), env(safe-area-inset-bottom));
    margin-top: var(--space-4);
  }
  .final-pad { width: 100%; }
  .final-match { padding: var(--space-4); }
  .score-box { width: 84px; min-height: 52px; font-size: 21px; }

  /* Formularzeilen: der abschliessende Knopf ueber die volle Breite statt
     als schmaler Rest neben einem leeren Feld. */
  .form-row { gap: var(--space-3); }
  .form-row > .btn { flex: 1 1 100%; }
  .channel-actions .btn { flex: 1 1 auto; }
  .channel-actions .push-right { margin-left: 0; }
  .dialog-actions .btn { flex: 1 1 auto; }

  .sheet { padding: var(--space-4); }
  /* Fuenf Knoepfe nebeneinander sind 487 px breit — auf dem Telefon
     brechen sie um und teilen sich die Zeile. Der Zaehler wandert
     voran, damit "Zurueck" und "Weiter" beieinander bleiben. */
  .sheet-nav { margin-left: 0; width: 100%; }
  .sheet-nav .btn { flex: 1 1 auto; }
  .sheet-pos { order: -1; flex: 1 1 100%; text-align: left; }
  .sheet-head { gap: var(--space-3); }
  .sheet-head img { width: 44px; height: 44px; }
  /* "Vereinsmeisterschaft" ist bei 22 px breiter als die Restspalte und
     schiebt sich sonst unter die Start-Nr. Getrennt wird nach den Regeln
     der Sprache (lang="de"), nicht mitten im Wort. */
  .sheet-head .ttl {
    font-size: 17px;
    -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word;
  }
  .sheet-head .sub { font-size: 12px; }
  .sheet-startno { font-size: 22px; }
  /* Name, Wertung und Bahnen-Nr. untereinander statt in zwei Spalten —
     nebeneinander ueberlappen die Beschriftungen. */
  .sheet-meta { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); margin: var(--space-4) 0; }
  .sheet td { padding: 11px 4px; }

  /* Breite Tabellen werden gewischt statt gequetscht. */
  .scroll-x > .table, .scroll-x > .table-num { min-width: max-content; }
}

/* Sehr schmale Geraete (iPhone SE, aeltere Android-Modelle). */
@media screen and (max-width: 400px) {
  .page-title { font-size: 26px; }
  .champ-name { font-size: 23px; }
  .top-row { grid-template-columns: 26px minmax(0, 1fr) 50px 62px; }
  .top-row .avg { font-size: 14px; }
  .pill { padding: 9px 14px; }
  .game-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Druck ─────────────────────────────────────────────────────────────── */
@page { size: A4; margin: 12mm; }

@media print {
  .no-print { display: none !important; }
  .page { padding: 0 !important; }
  /* Ein Scrollbereich kennt auf Papier keinen Rand zum Wischen — sichtbar
     bliebe nur der Ausschnitt. Auf A4 passt die Tabelle ohnehin. */
  .scroll-x { overflow: visible !important; }
  .scroll-x > .table, .scroll-x > .table-num { min-width: 0 !important; }
  html, body { background: #fff; }
  .print-only { display: flex !important; }
  .final-grid { display: block !important; }
  .final-col { page-break-after: always; break-after: page; break-inside: avoid; }
  .final-col:last-child { page-break-after: auto; break-after: auto; }
  /* Turnierbaum auf A4 hoch: Der Satzspiegel ist 186 mm (~703 px) breit.
     Drei Spalten passen mit schmaleren Punktefeldern und kleinerer Schrift;
     für einen Namen bleiben rund 150 px, genug für "Schnorrenberg, Heidi".
     Je Wertung eine Seite — die Höhe ist dort kein Thema. */
  .final-col-title { font-size: 24px; margin-bottom: var(--space-3); }
  .bk { --bk-gx: 30px; --bk-gy: 18px; max-width: none; }
  .bk-head, .bk-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(120px, .5fr); }
  .final-match { padding: 8px 10px; }
  .final-match-label { font-size: 10px; }
  .final-side { padding: 4px 0; gap: 6px; }
  .final-side .nm { font-size: 13px; }
  .seed { width: 22px; height: 22px; font-size: 11px; }
  .score-box { width: 50px; height: 30px; min-height: 0; font-size: 16px; border-width: 1px; }
  .final-result { font-size: 11px; }
  /* Farbverläufe druckt der Browser nicht mit — der Pokal wird auf Papier
     ein weißes Feld mit Rahmen in Vereinsfarbe. */
  .bk-trophy, .bk-trophy.is-won {
    background: #fff !important; color: #111 !important;
    border: 2px solid #ff1f92 !important; box-shadow: none !important; padding: 10px;
  }
  .bk-trophy:not(.is-won) { border-style: dashed !important; border-color: #bbb !important; }
  .bk-cup { width: 24px; height: 24px; color: #ff1f92; }
  .bk-trophy-name, .bk-trophy.is-won .bk-trophy-name { font-size: 15px; }
  .bk-trophy-kicker { font-size: 9px; letter-spacing: .04em; }
  .bk-head { font-size: 10px; letter-spacing: .06em; }
  /* Rangliste und Druckliste haben bis zu 14 Spalten. Mit echten dreistelligen
     Pinzahlen braucht die Tabelle in Bildschirmmaßen 203 mm und läuft damit
     über den A4-Satzspiegel von 186 mm hinaus — die Spalte „Diff.“ fiele weg. */
  .table { font-size: 11px; }
  .table th, .table td { padding: 4px 4px; }
  .table th { letter-spacing: 0.04em; }
  .print-table { font-size: 11px; }
  .sheet { page-break-after: always; break-after: page; border: none !important; padding: 0 !important; }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
  .sheet-wrap { max-width: none; }
  .app-root {
    background: #fff !important;
    --color-bg: #ffffff; --color-surface: #ffffff; --color-text: #111111;
    --color-divider: rgba(0,0,0,0.22);
    --color-neutral-100: #ffffff; --color-neutral-200: #f2f2f2; --color-neutral-300: #d8d8d8;
    --color-neutral-400: #9a9a9a; --color-neutral-700: #555555; --color-neutral-800: #222222;
    --color-neutral-900: #111111;
  }
}

/* ── Fußzeile: Impressum/Datenschutz + SiteLock (lokales Symbol) ─────── */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-6) var(--space-6) calc(var(--space-6) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-divider);
  font-size: 0.875rem;
}
.site-footer a { color: var(--color-neutral-700); text-decoration: none; border-radius: 4px; }
.site-footer a:hover { color: var(--color-accent); text-decoration: underline; }
.site-footer a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.site-footer__links { display: flex; gap: var(--space-4); }
.site-footer__seal { display: inline-flex; align-items: center; gap: 6px; }
.site-footer__seal svg { color: var(--color-accent-2); flex: none; }
