:root {
  --bg: #14110f;
  --surface: #1f1b18;
  --surface-2: #2a2521;
  --line: #3a332d;
  --text: #f4ede4;
  --muted: #a89c8f;
  --accent: #f2a93b;
  --accent-ink: #1c1407;
  --cup: #d8392b;
  --cup-rim: #f1e6d6;
  --live: #ff5a4a;
  --ok: #4cb873;
  --warn: #e8b23a;
  --bad: #e0574a;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --num: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  color-scheme: dark;
}

/* ---------- Motiv: Winterzauber ----------
   Von der Turnierleitung unter Einstellungen umschaltbar, steckt in S.plan.motiv
   und wird per body-Klasse auf allen drei Oberflaechen angewendet (common.js).
   Becherfarben (--cup/--cup-rim) bleiben bewusst unveraendert - rote Becher
   bleiben sofort als Bierpong erkennbar, nur Hintergrund/Akzente werden eisig. */
body.motiv-winter {
  --bg: #0a1220;
  --surface: #121c33;
  --surface-2: #1c2a4a;
  --line: #2d3f66;
  --text: #eef5fd;
  --muted: #92a8ce;
  --accent: #6fe0f0;
  --accent-ink: #052126;
  --live: #ff7a90;
  --ok: #56e0a0;
  --warn: #ffd873;
  --bad: #ff7a90;
}
body.motiv-winter .login-brand h1,
body.motiv-winter .hero-titel { background: linear-gradient(135deg, #eef5fd, #a9ddff 55%, #6fe0f0); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.motiv-winter::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 900px 500px at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
#schneefall { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
#schneefall .flocke {
  position: absolute; top: -8vh; font-size: var(--groesse); color: #eaf6ff;
  opacity: .8; text-shadow: 0 0 6px rgba(190, 230, 255, .55);
  animation: schnee-fall var(--dauer) linear infinite; animation-delay: var(--verzoegerung);
}
@keyframes schnee-fall {
  from { transform: translateY(0) translateX(0) rotate(0deg); }
  to { transform: translateY(115vh) translateX(var(--drift)) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  #schneefall { display: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.klein { font-size: .82rem; }

/* ---------- Grundbausteine ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 8px 16px 120px; }
.wrap.wide { max-width: 1320px; padding-bottom: 60px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); z-index: 10; }
.topbar .links { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h1 { font-size: 1.05rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .rechts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.zurueck { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-size: 1.2rem; flex-shrink: 0; }

.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: .85rem; border: 1px solid var(--line); text-decoration: none; }
.chip.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .78rem; letter-spacing: -.02em; flex-shrink: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 1rem; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 800; }
.btn.ok { background: var(--ok); color: #08140c; border-color: transparent; font-weight: 800; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .9rem; }
.btn.tiny { min-height: 32px; padding: 0 10px; font-size: .8rem; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.label { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
h2 { font-size: 1rem; margin: 24px 0 10px; }
.notice { padding: 10px 14px; border-radius: 10px; font-size: .9rem; margin: 10px 0; }
.notice.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.notice.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); }
.notice.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); }
.notice.info { background: var(--surface-2); border: 1px solid var(--line); }

.feld { display: grid; gap: 6px; }
.feld span { color: var(--muted); font-size: .82rem; font-weight: 600; }
.feld input, .feld select, .input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 1rem; width: 100%; }
.feld input:focus, .input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: puls 1.6s infinite; flex-shrink: 0; }
@keyframes puls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 70%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.badge-live { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: var(--live); }
.on-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.on-dot.on { background: var(--ok); }

.verbindung { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: var(--bad); color: #fff; text-align: center; font-size: .82rem; font-weight: 700; padding: 4px; }

/* ---------- Login / Startbildschirm ---------- */
body.login-modus .topbar { display: none; }
.login { min-height: 100dvh; display: grid; align-content: center; gap: 26px; padding: 32px 20px; max-width: 420px; margin: 0 auto; }
body.login-modus { background: radial-gradient(700px 360px at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%) var(--bg); }
body.login-modus .wrap { padding: 0; max-width: none; }
.login-brand { text-align: center; display: grid; justify-items: center; gap: 6px; }
.login-verein { color: var(--accent); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .78rem; margin-top: 8px; }
.login-brand h1 { margin: 0; font-size: 1.9rem; letter-spacing: -.01em; }
.login-turnier { color: var(--muted); font-size: .92rem; }
.login-form { display: grid; gap: 14px; padding: 20px; }

/* ---------- Tischübersicht ---------- */
.hallo { margin: 18px 0 4px; font-size: 1.35rem; font-weight: 800; }

/* ---------- Oeffentliche Startseite: Hero ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin: 4px 0 20px; padding: 18px 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); border: 1px solid var(--line); border-radius: 18px; position: relative; }
.hero img { flex-shrink: 0; border-radius: 10px; }
.hero-titel { margin: 0; font-size: 1.55rem; line-height: 1.2; overflow-wrap: anywhere; }
.hero-sub { color: var(--muted); font-size: .92rem; margin-top: 4px; font-weight: 700; }
.hero-live-pille { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; background: color-mix(in srgb, var(--live) 18%, transparent); color: var(--live); border: 1px solid color-mix(in srgb, var(--live) 45%, transparent); padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: .78rem; letter-spacing: .05em; flex-shrink: 0; }
@media (max-width: 480px) {
  .hero { padding: 14px 16px; }
  .hero-titel { font-size: 1.25rem; }
}
.tisch-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tisch-tile { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 6px; align-content: start; min-height: 128px; }
.tisch-tile.ist-live { border-color: color-mix(in srgb, var(--live) 55%, var(--line)); }
.tisch-tile.ist-meins { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tisch-tile .kopf { display: flex; justify-content: space-between; align-items: center; }
.tisch-tile .nr { font-family: var(--num); font-size: 1.6rem; font-weight: 900; color: var(--accent); line-height: 1; }
.tisch-tile .gr { color: var(--muted); font-size: .75rem; }
.tisch-tile .teams { font-size: .86rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.tisch-tile .teams .sc { font-family: var(--num); color: var(--accent); }
.mini-spiel + .mini-spiel { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.mini-zeile { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .84rem; font-weight: 700; }
.mini-zeile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mini-zeile b { font-family: var(--num); flex-shrink: 0; }
.tisch-tile .fuss { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; gap: 6px; }
.tisch-tile .fuss .tm { white-space: nowrap; align-self: end; font-family: var(--num); font-variant-numeric: tabular-nums; color: var(--text); font-weight: 700; }
.frei { color: var(--ok); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }

.eigen-banner { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface)); border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px; margin: 14px 0 4px; text-align: left; width: 100%; }
.eigen-banner .t { font-weight: 800; }
.eigen-banner .s { color: var(--muted); font-size: .82rem; margin-top: 2px; }

/* ---------- Spielkarten ---------- */
.match { display: grid; gap: 6px; }
.match .vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.match .vs .t { font-weight: 700; font-size: 1.08rem; overflow-wrap: anywhere; }
.match .vs .t:last-child { text-align: right; }
.match .vs .x { color: var(--muted); font-weight: 700; }
.match .vs .x.sc { color: var(--accent); font-family: var(--num); font-size: 1.2rem; }
.match .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .8rem; align-items: center; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.placeholder { color: var(--muted); font-style: italic; font-weight: 500 !important; }
.gesperrt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.karte-aktion { display: flex; gap: 8px; margin-top: 12px; }
.karte-aktion .btn { flex: 1; }

/* ---------- Spielansicht ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 8px; }
.game > * { min-width: 0; }
.zuschauer-banner { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .88rem; }
.team { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; }
.team.vorne { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.team-head { display: flex; align-items: center; gap: 10px; }
.team-name { flex: 1; min-width: 0; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-weight: 700; font-size: 1.05rem; }
div.team-name { background: transparent; border-color: transparent; padding-left: 0; overflow-wrap: anywhere; }
.team-name:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.team-name.changed { border-color: var(--warn); }
.hits { font-family: var(--num); font-size: 2.6rem; font-weight: 800; min-width: 2ch; text-align: right; line-height: 1; }
.team-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); font-size: .8rem; min-height: 18px; }
.team-sub button { white-space: nowrap; color: var(--accent); font-size: .8rem; padding: 4px 0; }

.rack { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 12px; }
.rack-row { display: flex; gap: 8px; }
.cup { width: 60px; height: 60px; border-radius: 50%; position: relative; background: radial-gradient(circle at 50% 45%, #7a1a12 0 44%, var(--cup) 46% 70%, var(--cup-rim) 72% 80%, #9a2b20 82%); box-shadow: 0 3px 0 #5d150e, 0 6px 14px rgba(0,0,0,.35); transition: transform .12s, opacity .2s, filter .2s; }
.cup.hit { opacity: .28; filter: grayscale(1); transform: scale(.9); box-shadow: none; }
.cup.hit::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; color: var(--text); }
.cup.extra { background: radial-gradient(circle at 50% 45%, #5f4310 0 44%, var(--accent) 46% 70%, var(--cup-rim) 72% 80%, #8a6a1e 82%); box-shadow: 0 3px 0 #6b4c10, 0 6px 14px rgba(0,0,0,.35); }
.nur-lesen .cup { pointer-events: none; cursor: default; }

.center { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.timer { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 2.4rem; font-weight: 800; line-height: 1; }
.timer.low { color: var(--warn); }
.timer.over { color: var(--bad); }
.timer-btns { display: flex; gap: 8px; }
.result-line { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--line); padding-top: 8px; }
.result-line b { font-family: var(--num); font-size: 1.5rem; }

.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 6; }
.bottom-bar .inner { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: grid; place-items: end center; z-index: 20; padding: 16px; }
@media (min-width: 700px) { .overlay { place-items: center; } }
.sheet { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 14px; max-height: 92dvh; overflow: auto; }
.final { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; }
.final .n { font-weight: 700; overflow-wrap: anywhere; }
.final .s { font-family: var(--num); font-size: 3.2rem; font-weight: 900; color: var(--accent); }
.big-check { font-size: 3.4rem; text-align: center; color: var(--ok); line-height: 1; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; z-index: 60; font-size: .9rem; transition: opacity .3s; max-width: calc(100% - 32px); text-align: center; }
.toast.bad { border-color: var(--bad); }
.toast.weg { opacity: 0; }

.menue { position: absolute; right: 12px; top: 58px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px; min-width: 220px; z-index: 30; box-shadow: 0 12px 30px rgba(0,0,0,.45); display: grid; }
.menue .wer { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menue button, .menue a { text-align: left; padding: 11px 12px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: .95rem; }
.menue button:hover, .menue a:hover { background: var(--surface-2); }

/* ---------- Turnierleitung ---------- */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tabs button { padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: .92rem; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.aktiv { background: var(--surface-2); color: var(--text); }
.tabs .zahl { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-size: .75rem; font-weight: 800; }
.tabs-mobil { display: none; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.stat { padding: 14px 16px; }
.stat b { display: block; font-family: var(--num); font-size: 1.9rem; margin-top: 2px; }

.leitung-layout { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.leitung-layout h2:first-child { margin-top: 0; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.live-tile { padding: 14px; display: grid; gap: 10px; align-content: start; min-height: 190px; }
.live-tile.ist-live { border-color: color-mix(in srgb, var(--live) 50%, var(--line)); }
.live-tile .kopf { display: flex; justify-content: space-between; align-items: center; }
.live-tile .kopf b { font-size: 1rem; }
.live-tile .zeile { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.live-tile .zeile .n { font-weight: 700; font-size: .92rem; overflow-wrap: anywhere; }
.live-tile .zeile .h { font-family: var(--num); font-weight: 900; font-size: 1.4rem; }
.dots { display: flex; gap: 3px; margin-top: 3px; flex-wrap: wrap; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--cup); }
.dots i.hit { background: var(--line); }
.dots i.extra { background: var(--accent); }
.dots i.extra.hit { background: var(--line); }
.live-tile .fuss { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: .82rem; color: var(--muted); }
.live-tile .tm { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 800; color: var(--text); font-size: 1.05rem; }
.live-tile .aktionen { display: flex; gap: 6px; flex-wrap: wrap; }
.live-tile.leer { color: var(--muted); }

.reports { display: grid; gap: 10px; }
.report { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; padding: 14px 16px; }
.report .score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.report .score .num { font-family: var(--num); font-size: 1.6rem; font-weight: 900; color: var(--accent); white-space: nowrap; }
.report .score .t { font-weight: 700; overflow-wrap: anywhere; }
.report .score .t:last-child { text-align: right; }
.report .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.report .knoepfe { display: flex; gap: 8px; justify-content: flex-end; }
.report.done { opacity: .55; }
.report.kompakt { grid-template-columns: 1fr; gap: 8px; }
.report.kompakt .score .num { font-size: 1.3rem; }
.report.kompakt .knoepfe { justify-content: stretch; }
.report.kompakt .knoepfe .btn.ok { flex: 1; }
.tag { font-size: .74rem; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.warn { border-color: color-mix(in srgb, var(--warn) 60%, transparent); color: var(--warn); white-space: normal; }
.tag.bad { border-color: color-mix(in srgb, var(--bad) 60%, transparent); color: var(--bad); }
.tag.ok { border-color: color-mix(in srgb, var(--ok) 60%, transparent); color: var(--ok); }
.tag.nr { background: var(--accent); color: var(--accent-ink); font-weight: 800; border-color: transparent; }
.tag.schiri { color: var(--text); }

.filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 14px; }

.schiri-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.einst-layout { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.form-grid { display: grid; gap: 12px; }
.zugang { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 50%, transparent); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.zugang code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-size: 1.05rem; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tabelle td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .aktionen { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.rolle { font-size: .72rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.rolle.admin { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

@media (max-width: 1080px) {
  .leitung-layout, .schiri-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tabs-desktop { display: none; }
  .tabs-mobil { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 15; border-radius: 0; border-width: 1px 0 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabs-mobil button { flex: 1; justify-content: center; flex-direction: column; gap: 2px; font-size: .78rem; padding: 6px 4px; }
  .wrap.wide { padding-bottom: 100px; }
  .report { grid-template-columns: 1fr; }
  .report .knoepfe { justify-content: stretch; }
  .report .knoepfe .btn.ok { flex: 1; }
  .live-grid { grid-template-columns: 1fr 1fr; }
  .live-tile { min-height: 0; padding: 12px; }
  /* Nur für schmale Listen-Tabellen (z.B. Schiris) gedacht - zerlegt jede Zeile in
     eine Karte. Für breite Daten-Tabellen mit vielen Spalten (Gruppentabellen) würde
     das die Zellen durcheinanderwürfeln - die scrollen stattdessen horizontal (siehe
     overflow-x:auto am Container) und bleiben bei reinem .tabelle unangetastet. */
  .tabelle.karten-mobil thead { display: none; }
  .tabelle.karten-mobil tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tabelle.karten-mobil td { border: 0; padding: 0; }
  .tabelle.karten-mobil td.nb-hide { display: none; }
  .tabelle.karten-mobil td.aktionen-zelle { grid-column: 1 / -1; }
  .tabelle.karten-mobil .aktionen { justify-content: flex-start; }
}
@media (max-width: 460px) {
  .live-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .cup { width: 50px; height: 50px; }
  .hits { font-size: 2.2rem; }
  .tisch-grid { gap: 8px; }
}

/* ---------- KO-Baum ---------- */
.bracket-scroll { overflow-x: auto; padding-bottom: 10px; margin-top: 10px; }
/* KO-Baum im Infoscreen-Dashboard: muss sich in den Resthoehen-Platz der
   unteren Sektion einfuegen statt eigene Hoehe mitzubringen - daher eigene,
   etwas kompaktere Groessen statt der normalen Spielplan-Ansicht. */
.info-ko-scroll { flex: 1 1 auto; min-height: 0; overflow: hidden; margin-top: 0; }
.info-ko-scroll .bracket { gap: 2.2vw; }
.info-ko-scroll .bracket-runde { min-width: 11vw; }
.info-ko-scroll .bracket-spiel { padding: .35vh .6vw; }
.info-ko-scroll .bracket-zeile { font-size: clamp(.55rem, .85vw, .78rem); padding: .1vh 0; }
.info-ko-scroll .bracket-titel { font-size: clamp(.5rem, .75vw, .68rem); margin-bottom: 2px; }
.info-ko-scroll .bracket-live { font-size: clamp(.45rem, .65vw, .6rem); }
.bracket { display: flex; gap: 44px; min-width: max-content; padding: 4px 4px 4px 0; position: relative; }
.bracket-runde { display: flex; flex-direction: column; min-width: 190px; }
.bracket-titel { text-align: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.bracket-spiele { display: flex; flex-direction: column; gap: 14px; position: relative; }
.bracket-spiel { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; z-index: 1; }
.bracket-spiel.ist-live { border-color: color-mix(in srgb, var(--live) 55%, var(--line)); }
.bracket-zeile { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: .86rem; }
.bracket-zeile .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-zeile.sieger .n { font-weight: 800; color: var(--text); }
.bracket-zeile:not(.sieger) .n { color: var(--muted); }
.bracket-zeile .s { font-family: var(--num); font-weight: 800; flex-shrink: 0; }
.bracket-zeile .n em { font-style: italic; opacity: .75; }
.bracket-live { display: flex; align-items: center; gap: 4px; font-size: .68rem; color: var(--live); font-weight: 800; margin-top: 4px; }

/* ---------- Infoscreen-Modus ----------
   Ein durchgehendes Dashboard, das komplett auf einen Bildschirm passen soll
   (Teams sollen jederzeit zum Fernseher gehen und alles auf einen Blick sehen
   koennen - kein Scrollen, kein Slide-Wechsel). Deshalb konsequent vh/vw/clamp()
   statt fester px-Groessen, und ein hartes overflow:hidden als Netz, falls der
   Inhalt (z.B. bei sehr vielen Teams pro Gruppe) doch mal zu viel wird - dann
   wird lieber alles etwas kleiner/enger statt dass irgendwo abgeschnitten wird. */
body.infoscreen-modus { overflow: hidden; }
body.infoscreen-modus .topbar, body.infoscreen-modus .tabs-mobil { display: none; }
body.infoscreen-modus .wrap { max-width: none; width: 100vw; height: 100dvh; padding: 1.4vh 1.6vw; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; }
.info-exit { position: fixed; top: 14px; right: 16px; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 1.1rem; color: var(--muted); text-decoration: none; z-index: 40; }
.info-kopf { flex: 0 0 auto; color: var(--accent); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: clamp(.8rem, 1.5vw, 1.15rem); margin-bottom: .8vh; display: flex; align-items: center; gap: 10px; }
.info-kopf img { height: clamp(20px, 2.4vh, 32px) !important; }
.info-leer { color: var(--muted); font-size: clamp(.75rem, 1vw, .95rem); padding: .4vh 0; }

.info-dash { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: .9vh; }
.info-h { flex: 0 0 auto; font-size: clamp(.85rem, 1.5vw, 1.2rem); font-weight: 800; margin: 0 0 .3vh; }

/* Oben (Live/Naechste) bekommt IMMER seine volle, natuerliche Hoehe - echte
   Spieldaten duerfen nie unsichtbar abgeschnitten werden. Die Gruppen-Kacheln
   darunter nehmen sich dafuer nur so viel Platz wie ihr Inhalt braucht
   (grid-auto-rows statt 1fr, align-content:start) statt sich auf die ganze
   Resthoehe aufzublasen - bei wenigen gespielten Spielen blieben die Kacheln
   sonst grotesk hoch und leer. */
.info-dash-top { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2vw; }
.info-dash-top > div { display: flex; flex-direction: column; min-height: 0; }
.info-zeile { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: .6vw; padding: .2vh 0; font-size: clamp(.6rem, 1.05vw, .92rem); font-weight: 700; border-bottom: 1px solid var(--line); }
.info-zeile:last-child { border-bottom: none; }
.info-zeile.live { color: var(--live); }
.info-zeile .info-team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.info-zeile .info-team.re { text-align: right; }
.info-zeile .info-sc { font-family: var(--num); text-align: center; color: var(--accent); min-width: 2.4em; }
.info-zeile.live .info-sc { color: var(--live); }
.info-zeile .info-info { font-size: .8em; color: var(--muted); white-space: nowrap; font-weight: 600; }

.info-gruppen-tabellen { flex: 1 1 auto; min-height: 0; overflow: hidden; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: min-content; align-content: start; gap: .6vh .7vw; }
/* Feste Hoehe fuer alle Kacheln (Platz fuer Kopf + Tabellenkopf + 7 Teams),
   damit sie unabhaengig von der aktuellen Teamzahl pro Gruppe alle gleich
   gross sind - nicht erst ab 7 Teams nachtraeglich wachsen. */
.info-gtable { height: 22vh; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .5vh .6vw; overflow: hidden; }
.info-gtable-kopf { font-weight: 800; color: var(--accent); font-size: clamp(.65rem, 1.1vw, .95rem); margin-bottom: .2vh; }
.info-gtable table { width: 100%; border-collapse: collapse; font-size: clamp(.55rem, .85vw, .78rem); table-layout: fixed; }
.info-gtable th { text-align: left; color: var(--muted); font-weight: 600; padding: 0 2px; }
.info-gtable td { padding: 1px 2px; border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Team-Spalte bekommt den meisten Platz (keine feste Breite = Rest bei
   table-layout:fixed), die Statistik-Spalten bleiben schmal. */
.info-gtable th:nth-child(1), .info-gtable td:nth-child(1) { width: 1.3em; }
.info-gtable th:nth-child(3), .info-gtable td:nth-child(3) { width: 1.6em; }
.info-gtable th:nth-child(4), .info-gtable td:nth-child(4) { width: 3.3em; }
.info-gtable th:nth-child(5), .info-gtable td:nth-child(5) { width: 2.1em; }
.info-gtable th:nth-child(6), .info-gtable td:nth-child(6) { width: 2.1em; text-align: right; }
@media (max-width: 1100px) {
  .info-gruppen-tabellen { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .info-dash-top { grid-template-columns: 1fr; }
  .info-gruppen-tabellen { grid-template-columns: 1fr; }
}
