/* ==========================================================================
   Kickfeed – Design-System
   Farben aus dem Trainingsalltag: Rasen, Kreide, Leibchen-Neon, Hütchen-Orange.
   Eine Schrift (Saira) mit Breitenachse: breit = Anzeigetafel/Marke, normal = Text.
   Regeln: 3 Schriftstärken (400/600/800, 900 nur Spielstand) · 4er-Abstände ·
   2 Radien (Bedienelemente 12, Flächen 18) · Effekte nur Anzeigetafel & Tor.
   ========================================================================== */

:root {
  /* Farben */
  --chalk: #F4F6F1;
  --surface: #FFFFFF;
  --surface-2: #EEF2EC;
  --line: #DFE6DC;
  --line-strong: #CBD6C8;
  --ink: #0B2A1D;
  --ink-2: #3E5A4C;
  --muted: #6A8275;
  --pitch: #0F6B45;
  --pitch-hover: #0C5B3A;
  --pitch-ink: #FFFFFF;
  --pitch-soft: #E3F1E8;
  --deep: #0A3D29;
  --deep-ink: #F4F6F1;
  --bib: #D6F53A;
  --bib-ink: #0B2A1D;
  --bib-soft: #F4FBD3;
  --cone: #FF5B1F;
  --yellow: #F2B705;
  --red: #E0312B;
  --danger: #C8281F;
  --wa: #1FA855;

  /* Schrift */
  --font: 'Saira', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wide: 104%;
  --xwide: 112%;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;

  /* Raster */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --r-ctl: 12px;
  --r-card: 18px;
  --r-board: 24px;

  /* Schatten (bewusst zurückhaltend) */
  --shadow-sm: 0 1px 2px rgb(11 42 29 / .05);
  --shadow-md: 0 1px 2px rgb(11 42 29 / .06), 0 6px 16px -8px rgb(11 42 29 / .18);
  --shadow-lg: 0 2px 4px rgb(11 42 29 / .08), 0 18px 36px -14px rgb(11 42 29 / .45);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --stripes: repeating-linear-gradient(90deg, rgb(255 255 255 / .045) 0 32px, transparent 32px 64px);
  color-scheme: light;
}

/* Dunkelmodus: automatisch nach System – oder fest per Einstellung (data-theme auf <html>) */
:root[data-theme="dark"] {
    --chalk: #07150E;
    --surface: #0E2117;
    --surface-2: #15301F;
    --line: #1F3A2A;
    --line-strong: #2C4D3A;
    --ink: #EAF2EC;
    --ink-2: #B9CDBF;
    --muted: #8BA595;
    --pitch: #2BB673;
    --pitch-hover: #33C67F;
    --pitch-ink: #04210F;
    --pitch-soft: #12382A;
    --bib-soft: #1F2D16;
    --deep: #0C4A31;
    --danger: #FF6B5E;
    --yellow: #FFC928;
    --red: #FF5A52;
    --shadow-sm: none;
    --shadow-md: 0 1px 2px rgb(0 0 0 / .45);
    --shadow-lg: 0 18px 36px -14px rgb(0 0 0 / .85);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chalk: #07150E;
    --surface: #0E2117;
    --surface-2: #15301F;
    --line: #1F3A2A;
    --line-strong: #2C4D3A;
    --ink: #EAF2EC;
    --ink-2: #B9CDBF;
    --muted: #8BA595;
    --pitch: #2BB673;
    --pitch-hover: #33C67F;
    --pitch-ink: #04210F;
    --pitch-soft: #12382A;
    --bib-soft: #1F2D16;
    --deep: #0C4A31;
    --danger: #FF6B5E;
    --yellow: #FFC928;
    --red: #FF5A52;
    --shadow-sm: none;
    --shadow-md: 0 1px 2px rgb(0 0 0 / .45);
    --shadow-lg: 0 18px 36px -14px rgb(0 0 0 / .85);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- Basis */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font: 400 var(--fs-base)/1.45 var(--font);
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--s8) + env(safe-area-inset-bottom));
}
body.sheet-open { overflow: hidden; }
#app { max-width: 560px; margin: 0 auto; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 800; }
h2 { font-size: var(--fs-lg); letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2.5px solid var(--pitch); outline-offset: 2px; border-radius: 8px; }

.i { display: block; flex: none; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.block { display: block; }
.center { text-align: center; }
.warn { color: #B45309; }
.with-icon { display: flex; align-items: center; gap: var(--s2); }
.with-icon > .i { color: var(--muted); }
.sep::before { content: '·'; margin: 0 6px; opacity: .6; }
.count { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s3); }
.row { display: flex; gap: var(--s2); align-items: center; }
.row:empty { display: none; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.section-title, .section-head h2 { font-size: var(--fs-md); font-weight: 800; }
.section-title { margin: var(--s3) 2px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: var(--s4) 2px 0; }
.hint { font-size: var(--fs-sm); color: var(--muted); text-align: center; padding: 0 var(--s4); }

/* ---------------------------------------------------------------- Kopfzeile */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: var(--s2);
  min-height: 60px;
  padding: calc(var(--s2) + env(safe-area-inset-top)) var(--s2) var(--s2);
  background: color-mix(in srgb, var(--chalk) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { margin-top: 1px; font-size: var(--fs-sm); color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; }
.logo { width: 40px; height: 40px; border-radius: 11px; flex: none; margin-left: var(--s2); }
.topbar.brand { box-shadow: none; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; padding-top: calc(var(--s4) + env(safe-area-inset-top)); }
.topbar.brand h1 { font-size: 28px; font-weight: 800; font-stretch: var(--xwide); letter-spacing: -.03em; color: var(--deep); }
.topbar.brand .logo { width: 44px; height: 44px; border-radius: 12px; }
:root[data-theme="dark"] .topbar.brand h1 { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar.brand h1 { color: var(--ink); } }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--ink);
}
.icon-btn:active { background: var(--surface-2); }

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s4);
  border: 1px solid transparent; border-radius: var(--r-ctl);
  font-size: var(--fs-md); font-weight: 600; line-height: 1.2; text-align: center;
  background: var(--surface-2); color: var(--ink);
  transition: background-color .15s, border-color .15s, transform .1s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn-primary { background: var(--pitch); color: var(--pitch-ink); }
.btn-primary:active { background: var(--pitch-hover); }
.btn-dark { background: var(--deep); color: var(--deep-ink); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-whatsapp { background: var(--wa); color: #fff; }
.btn-xl { min-height: 56px; font-size: var(--fs-base); font-weight: 800; border-radius: 16px; width: 100%; }
.btn-sm { min-height: 40px; padding: 0 var(--s3); font-size: var(--fs-sm); }
.btn-square { width: 48px; padding: 0; flex: none; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: var(--s1) 0; color: var(--pitch); font-weight: 600; font-size: var(--fs-sm); text-align: left; }

/* Nächstes Spiel (zweizeilig) */
.next-game { flex-direction: column; gap: 2px; min-height: 64px; }
.next-label { font-size: var(--fs-xs); font-weight: 600; opacity: .8; }
.next-teams { display: flex; align-items: center; gap: var(--s2); font-weight: 800; }

/* ---------------------------------------------------------------- Flächen */

:where(.card) { display: block; } /* Spezifität 0: Layout-Klassen wie .row/.stack-sm gewinnen immer */
.card {
  padding: var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
}
.card h2 { font-size: var(--fs-md); }
/* Karten mit innerem Stapel: muss nach .card stehen, sonst überschreibt display:block die Abstände */
.card.stack-sm { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 28px; }
.card-head h2 { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.card-head .count, .card-head .status { white-space: nowrap; }
.card-sub { margin-top: calc(-1 * var(--s3)); font-size: var(--fs-sm); color: var(--muted); }
.card-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4);
  margin-top: var(--s1); padding-top: var(--s4); border-top: 1px solid var(--line);
}
.card-section { display: flex; flex-direction: column; gap: var(--s3); padding-top: var(--s4); border-top: 1px solid var(--line); }
.text-btn { display: inline-flex; align-items: center; gap: 6px; padding: var(--s1) 0; border: 0; background: none; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; }
.text-btn.danger { color: var(--danger); }
.text-btn .i { opacity: .8; }
/* Feldpaare: Eingaben bündig, auch wenn ein Label umbricht */
.row:has(> .field) { align-items: flex-end; gap: var(--s3); }
.field-note { font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.card.subtle { display: flex; flex-direction: column; gap: var(--s4); background: transparent; border-style: dashed; box-shadow: none; }
.card.subtle .btn-sm { white-space: nowrap; }
.link-card { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); font-weight: 600; transition: transform .15s var(--ease); }
.link-card:active { transform: scale(.99); }
.link-card-label { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.link-card-label > .i { color: var(--pitch); }
.link-card-meta { display: flex; align-items: center; gap: 2px; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }

/* Spieltage auf der Startseite */
.md-card { display: flex; flex-direction: column; gap: var(--s1); transition: transform .15s var(--ease); }
.md-card:active { transform: scale(.99); }
.md-card strong { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; margin-top: var(--s1); }
.md-card-top { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.md-meta { font-size: var(--fs-sm); }
.md-card-score { display: flex; align-items: center; gap: var(--s2); font-weight: 600; margin-top: var(--s2); }
.md-card-score b { font-size: var(--fs-xl); font-weight: 900; font-stretch: var(--xwide); padding: 0 2px; }
.md-card.is-live {
  color: var(--deep-ink); border-color: transparent;
  background:
    radial-gradient(90% 120% at 100% 0%, rgb(214 245 58 / .16), transparent 55%),
    var(--stripes),
    linear-gradient(165deg, #0F5A3A, var(--deep) 60%, #072D1E);
  box-shadow: var(--shadow-lg);
}
.md-card.is-live .muted, .md-card.is-live .badge { color: rgb(244 246 241 / .7); }
.md-card.is-live .chip-outline { color: var(--bib); border-color: rgb(214 245 58 / .45); }
.md-card.is-live .md-card-score b { color: var(--bib); }

.onboarding { background: var(--deep); color: var(--deep-ink); border-color: transparent; }
.onboarding h2 { font-size: var(--fs-lg); }
.onboarding ol { margin: var(--s3) 0 0; padding-left: 22px; display: grid; gap: var(--s2); }
.onboarding li::marker { font-weight: 800; color: var(--bib); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1;
  padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
}
.chip-live { background: var(--cone); color: #fff; }
.chip-muted { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); }
.chip-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--pitch); color: var(--pitch); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.jersey { display: block; flex: none; overflow: visible; }

/* Hinweise */
.notice {
  display: flex; gap: var(--s2); align-items: flex-start;
  margin: 0 0 var(--s3); padding: var(--s3); border-radius: var(--r-ctl);
  background: var(--bib-soft); color: var(--ink-2); font-size: var(--fs-sm);
}
.notice .i { color: var(--pitch); margin-top: 1px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s6) var(--s4); color: var(--muted); font-size: var(--fs-sm); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-card); }

/* ---------------------------------------------------------------- Formulare */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
input:not([type=checkbox]):not([type=color]), select, textarea {
  width: 100%; min-height: 48px; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface);
  font-size: var(--fs-base);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--pitch); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pitch) 18%, transparent); outline: none; }
textarea { resize: vertical; line-height: 1.5; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--pitch); flex: none; margin: 0; }
.check { display: flex; align-items: center; gap: var(--s3); padding: 6px 0; font-size: var(--fs-md); }
.check .jersey { margin-left: -2px; }
.check-list { display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); padding: var(--s1) var(--s3); }
.plan { margin: 0; padding-left: 22px; color: var(--muted); font-size: var(--fs-sm); columns: 2; }

.segmented { display: flex; gap: var(--s1); padding: var(--s1); background: var(--surface-2); border-radius: 14px; }
.segmented button {
  flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2);
  font-size: var(--fs-sm); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 var(--s2);
}
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-md); }

.colors { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.color { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line-strong); }
.color.on { box-shadow: 0 0 0 2.5px var(--ink); }
input[type=color] { width: 44px; height: 34px; border: 0; background: none; padding: 0; }

.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.player-list li { display: flex; gap: var(--s2); align-items: center; }
.player-list input.num { width: 52px; text-align: center; flex: none; font-weight: 600; }
.keeper-btn {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--line-strong);
}
.keeper-btn.on { color: var(--pitch); background: var(--pitch-soft); border-color: var(--pitch); }

/* ---------------------------------------------------------------- Spielliste & Tabelle */

.game-row {
  display: block; padding: var(--s3) var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-sm); transition: transform .15s var(--ease);
}
.game-row:active { transform: scale(.99); }
.game-row.is-own { border-color: color-mix(in srgb, var(--pitch) 35%, var(--line)); }
.game-row.is-done .game-score { color: var(--ink-2); }
.game-row-head { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); margin-bottom: var(--s2); }
.game-row-body { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s3); align-items: center; font-weight: 600; font-size: var(--fs-md); }
.team-l, .team-r { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.team-l span, .team-r span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-r { justify-content: flex-end; text-align: right; }
.game-score { font-size: var(--fs-xl); font-weight: 900; font-stretch: var(--xwide); text-align: center; display: flex; flex-direction: column; line-height: 1.05; min-width: 60px; }
.game-score small { font-size: 11px; color: var(--muted); font-weight: 600; font-stretch: 100%; }

.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-top: var(--s3); }
.tbl th { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; padding: 6px 4px; text-align: center; }
.tbl td { padding: 10px 4px; text-align: center; border-top: 1px solid var(--line); }
.tbl .l { text-align: left; }
.tbl td.l { display: flex; align-items: center; gap: var(--s2); font-weight: 600; }
.tbl td b { font-weight: 800; font-size: var(--fs-md); }
.tbl tr.own td { background: var(--pitch-soft); font-weight: 600; }
.tbl tr.own td:first-child { border-radius: 10px 0 0 10px; }
.tbl tr.own td:last-child { border-radius: 0 10px 10px 0; }

.live-card h2 { display: flex; align-items: center; gap: var(--s2); }
.live-card h2 .i { color: var(--pitch); }
.live-link code { display: block; padding: 11px 13px; background: var(--surface-2); border-radius: var(--r-ctl); font: 600 var(--fs-sm)/1.3 var(--font); word-break: break-all; color: var(--ink-2); }
.pulse, .sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cone); display: inline-block; flex: none; animation: pulse 2s infinite; }
.sync-dot { background: var(--pitch); }
.sync-dot[data-state=offline] { background: #F59E0B; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(255 91 31 / .45); } 70% { box-shadow: 0 0 0 7px rgb(255 91 31 / 0); } 100% { box-shadow: 0 0 0 0 rgb(255 91 31 / 0); } }

.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: var(--fs-md); font-weight: 600;
  transition: background-color .15s, border-color .15s, transform .15s var(--spring);
}
.chip-btn:active { transform: scale(.95); }
.chip-btn small { font-size: 11px; font-weight: 800; color: var(--muted); }
.chip-btn.on { background: var(--pitch); border-color: var(--pitch); color: var(--pitch-ink); }
.chip-btn.on small { color: inherit; opacity: .8; }
.chip-btn.off { color: var(--muted); background: transparent; border-style: dashed; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.chip-ico { opacity: .85; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }

.vs { font-size: var(--fs-sm); font-weight: 600; font-stretch: 100%; color: var(--muted); letter-spacing: .02em; }
.chips-soft .chip-btn.on { background: var(--pitch-soft); border-color: color-mix(in srgb, var(--pitch) 40%, transparent); color: var(--ink); }
.chips-soft .chip-check { color: var(--pitch); }
.live-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--s2); }
.live-actions .btn { padding: 0 var(--s2); gap: 6px; white-space: nowrap; font-size: var(--fs-sm); }
.live-status { font-size: var(--fs-sm); color: var(--muted); }

/* ---------------------------------------------------------------- Anzeigetafel (der eine Hingucker) */

.scoreboard {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s2);
  margin: var(--s3) var(--s4) 0; padding: var(--s5) var(--s3) var(--s4);
  border-radius: var(--r-board); color: var(--deep-ink);
  background:
    radial-gradient(60% 90% at 0% 0%, color-mix(in srgb, var(--home, #0F6B45) 42%, transparent), transparent 70%),
    radial-gradient(60% 90% at 100% 0%, color-mix(in srgb, var(--away, #0F6B45) 42%, transparent), transparent 70%),
    var(--stripes),
    linear-gradient(180deg, #0E5537, var(--deep) 60%, #072A1C);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgb(255 255 255 / .1);
}
.scoreboard::after { /* Mittelkreis */
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 50%; width: 160px; height: 160px; margin: -80px 0 0 -80px;
  border-radius: 50%; border: 2px solid rgb(244 246 241 / .08);
}
.sb-team { display: flex; flex-direction: column; align-items: center; gap: var(--s2); min-width: 0; text-align: center; }
.sb-team .jersey { filter: drop-shadow(0 4px 8px rgb(0 0 0 / .25)); }
.sb-name { font-weight: 600; font-size: var(--fs-sm); line-height: 1.25; overflow-wrap: anywhere; }
.sb-mid { display: flex; flex-direction: column; align-items: center; }
.sb-label { font-size: var(--fs-xs); font-weight: 600; opacity: .75; margin-bottom: 2px; }
.sb-score { display: flex; align-items: center; gap: 10px; font-size: 56px; font-weight: 900; font-stretch: var(--xwide); line-height: 1; letter-spacing: -.02em; }
.sb-colon { display: flex; flex-direction: column; gap: 9px; }
.sb-colon::before, .sb-colon::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; }
.sb-so { margin-top: 6px; font-size: var(--fs-xs); font-weight: 600; opacity: .8; }
.sb-clock {
  margin-top: var(--s3); padding: 5px 12px; border-radius: 999px;
  background: rgb(244 246 241 / .12); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em;
}
.sb-clock.running { background: var(--cone); color: #fff; font-weight: 800; animation: clockGlow 2.4s ease-in-out infinite; }
@keyframes clockGlow { 50% { box-shadow: 0 0 16px 1px rgb(255 91 31 / .45); } }
.scoreboard.is-ft .sb-clock { background: var(--bib); color: var(--bib-ink); font-weight: 800; }

/* ---------------------------------------------------------------- Ticker: Steuerung */

.control-row { display: flex; gap: var(--s2); align-items: stretch; }
.clock-adjust {
  display: flex; align-items: center; gap: 2px; padding: 2px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface);
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
}
.clock-adjust .icon-btn { width: 40px; height: 42px; border-radius: 10px; }
.clock-adjust span { padding: 0 2px; }

/* Ereignis-Raster: 6er-Grid, Kacheln je 2 Spalten */
.ev-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s2); }
.ev {
  grid-column: span 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 84px; padding: var(--s2);
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .12s var(--ease), background-color .12s;
}
.ev:active { transform: scale(.96); background: var(--surface-2); }
.ev-label { font-size: var(--fs-sm); font-weight: 600; }
.ev-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); }
.ev-goal {
  grid-column: span 4; min-height: 108px; gap: var(--s2);
  background: var(--bib); color: var(--bib-ink); border-color: transparent;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), 0 8px 20px -10px rgb(140 175 10 / .9);
}
.ev-goal .ev-label { font-size: var(--fs-xl); font-weight: 800; font-stretch: var(--xwide); letter-spacing: -.01em; }
.ev-goal:active { background: #C9E82E; }
.ev-against { min-height: 108px; }
.ev-against .ev-label { font-size: var(--fs-md); }
.ev-grid.is-neutral .ev-goal { grid-column: span 3; }
.ev-note {
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; width: 100%;
  border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); background: transparent;
  color: var(--ink-2); font-size: var(--fs-md); font-weight: 600;
}

/* Farbtöne der Ereignisse */
.tone-goal { color: var(--bib-ink); }
.tone-yellow { color: var(--yellow); }
.tone-red { color: var(--red); }
.tone-phase { color: var(--muted); }
.tone-neutral { color: var(--ink-2); }

/* ---------------------------------------------------------------- Verlauf */

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.tl-item {
  width: 100%; display: grid; grid-template-columns: 46px 34px 1fr auto; gap: var(--s2); align-items: center;
  padding: var(--s3); text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-sm);
}
.tl-min { font-size: var(--fs-md); font-weight: 800; color: var(--muted); white-space: nowrap; }
.tl-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); }
.tl-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tl-title { font-size: var(--fs-md); font-weight: 600; line-height: 1.3; }
.tl-sub { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-end { display: flex; align-items: center; gap: var(--s2); }
.tl-score { padding: 4px 9px; border-radius: 8px; background: var(--deep); color: var(--deep-ink); font-size: var(--fs-sm); font-weight: 800; font-stretch: var(--wide); }
.tl-sent { color: var(--wa); }
.tl-item.is-goal { border-color: color-mix(in srgb, var(--bib) 70%, var(--line)); background: linear-gradient(90deg, var(--bib-soft), var(--surface) 70%); }
.tl-item.is-goal .tl-ico { background: var(--bib); }
.tl-item.is-against .tl-score { background: var(--surface-2); color: var(--ink-2); }

/* Spielphasen als Trenner */
.tl-phase button {
  width: 100%; display: flex; align-items: center; gap: var(--s2);
  padding: var(--s1) 0; border: 0; background: none; color: var(--muted);
  font-size: var(--fs-sm); font-weight: 600;
}
.tl-phase button::before, .tl-phase button::after { content: ''; flex: 1; height: 1px; background: var(--line-strong); }
.tl-phase b { color: var(--ink); font-weight: 800; margin-left: 4px; }

/* ---------------------------------------------------------------- Bottom-Sheet */

#sheet-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#sheet-root.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(7 21 14 / .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .15s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--chalk); border-radius: var(--r-board) var(--r-board) 0 0;
  padding: var(--s2) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgb(0 0 0 / .2);
  animation: sheetUp .3s var(--ease);
}
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 2px auto var(--s4); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-bottom: var(--s4); }
.sheet-head h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.015em; }
.title-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); }
.title-ico.tone-goal { background: var(--bib); }
.minute-tag { font-size: var(--fs-md); font-weight: 800; color: var(--muted); }
.sheet-body { margin-bottom: var(--s4); }
.sheet-actions {
  display: flex; flex-direction: column; gap: var(--s2);
  position: sticky; bottom: calc(-1 * var(--s4) - env(safe-area-inset-bottom));
  background: var(--chalk); padding: var(--s3) 0 calc(var(--s2) + env(safe-area-inset-bottom));
  box-shadow: 0 -1px 0 var(--line);
}
.minute-ctl { display: flex; align-items: center; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-ctl); font-weight: 800; }
.minute-ctl .icon-btn { width: 40px; height: 40px; border-radius: 10px; }
.minute-ctl span { min-width: 48px; text-align: center; }
.quick-add input { min-height: 44px; font-size: var(--fs-md); }
.quick-add .btn-square { width: 44px; min-height: 44px; }
.preview-text { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s3) var(--s4); margin-bottom: var(--s3); font-size: var(--fs-md); }
.so-input { align-items: flex-end; }
.so-input input { text-align: center; font-size: 26px; font-weight: 900; font-stretch: var(--xwide); }
.so-colon { font-size: 28px; font-weight: 900; padding-bottom: var(--s2); }

/* ---------------------------------------------------------------- Ergebnis */

.card-preview { border-radius: var(--r-card); overflow: hidden; background: var(--deep); box-shadow: var(--shadow-lg); }
.card-preview canvas { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------- Toast */

#toast {
  position: fixed; left: 50%; bottom: calc(var(--s5) + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 100; display: flex; align-items: center; gap: var(--s4);
  width: max-content; max-width: calc(100% - 32px); padding: var(--s3) var(--s4); border-radius: 14px;
  background: var(--deep); color: var(--deep-ink); font-size: var(--fs-md); font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s var(--ease);
}
#toast[hidden] { display: none; }
#toast button { border: 0; background: none; color: var(--bib); font-weight: 800; padding: 0; white-space: nowrap; }

/* ---------------------------------------------------------------- Bewegung (sparsam) */

.fx-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 200; }
.fx-enter { animation: enter .24s var(--ease); }
.fx-goal { animation: goalPop .9s var(--spring); }
.fx-board { animation: boardFlash 1s ease-out; }
.fx-against { animation: against .45s ease; }
.timeline li:first-child .tl-item { animation: enter .3s var(--ease); }

@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes goalPop { 25% { transform: scale(1.22); color: var(--bib); } }
@keyframes boardFlash { 0%, 30% { box-shadow: 0 0 0 3px var(--bib), 0 0 40px 4px rgb(214 245 58 / .4), var(--shadow-lg); } }
@keyframes against { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.card-head h2 > .i { color: var(--pitch); }

/* ---------------------------------------------------------------- Turnier: Ergebnis-Eingabe, Bilanz, Bereiche */

.section-head.first { margin-top: 0; }
.scope-card { display: flex; flex-direction: column; gap: var(--s3); background: transparent; border-style: dashed; box-shadow: none; }
.chip-action { background: var(--pitch-soft); color: var(--pitch); }
button.game-row { width: 100%; text-align: inherit; font: inherit; color: inherit; cursor: pointer; }
.center-btn { align-self: center; justify-content: center; }
.plan li.is-hidden { opacity: .4; }

.record { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.record > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--s3) var(--s1); border-radius: var(--r-ctl); background: var(--surface-2); }
.record b { font-size: var(--fs-xl); font-weight: 900; font-stretch: var(--xwide); line-height: 1.1; }
.record span { font-size: 11px; font-weight: 600; color: var(--muted); }
.record > div:first-child b { color: var(--pitch); }

.result-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: var(--s2); }
.result-team { display: flex; flex-direction: column; align-items: center; gap: var(--s2); min-width: 0; text-align: center; }
.result-team > span { font-weight: 600; font-size: var(--fs-md); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-colon { padding-bottom: 26px; color: var(--muted); }
.result-colon .sb-colon { gap: 10px; }
.stepper { display: flex; align-items: center; gap: var(--s1); padding: var(--s1); border-radius: 18px; background: var(--surface); border: 1px solid var(--line-strong); }
.stepper button {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  border: 0; background: var(--surface-2); color: var(--ink);
  transition: transform .1s var(--ease);
}
.stepper button:active { transform: scale(.92); }
.stepper button:disabled { opacity: .35; }
.stepper button:last-child { background: var(--pitch); color: var(--pitch-ink); }
.stepper output { min-width: 44px; text-align: center; font-size: 36px; font-weight: 900; font-stretch: var(--xwide); line-height: 1; }
.result-grid.small .stepper output { font-size: 26px; }
.result-grid.small .stepper button { width: 42px; height: 42px; }

/* ---------------------------------------------------------------- Spielplan bearbeiten */

.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.plan-item {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s2) var(--s2) var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm);
}
.plan-item.is-own { border-color: color-mix(in srgb, var(--pitch) 35%, var(--line)); }
.plan-no { font-weight: 800; font-stretch: var(--wide); color: var(--muted); text-align: center; }
.plan-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: var(--s1) 0; border: 0; background: none; text-align: left; }
.plan-teams { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-weight: 600; font-size: var(--fs-md); line-height: 1.3; min-width: 0; }
.plan-teams .pt { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.plan-vs { color: var(--muted); }
.plan-meta { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.plan-actions { display: flex; }
.plan-actions .icon-btn { width: 40px; height: 40px; }
.plan-actions .icon-btn:disabled { opacity: .25; }
.plan-tools { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.plan-tools .btn, .sheet-actions .row .btn { white-space: nowrap; font-size: var(--fs-sm); padding: 0 var(--s3); }
.game-row.is-tbd { border-style: dashed; }
.game-row.is-tbd .team-l, .game-row.is-tbd .team-r { color: var(--ink-2); }
.team-pick { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: var(--s2); }
.swap-btn { margin-bottom: 2px; border: 1px solid var(--line-strong); }
.swap-btn:disabled { opacity: .35; }

/* Dunkelmodus: Feinheiten */
.theme-switch { margin-top: var(--s1); }
:root[data-theme="dark"] .tl-score, :root[data-theme="dark"] .md-card:not(.is-live) .md-card-score b { color: var(--ink); }
:root[data-theme="dark"] .tl-score { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
:root[data-theme="dark"] .tl-item.is-goal .tl-score { background: var(--bib); color: var(--bib-ink); box-shadow: none; }
:root[data-theme="dark"] .ev-goal { box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), 0 8px 24px -10px rgb(214 245 58 / .45); }
:root[data-theme="dark"] .card.subtle, :root[data-theme="dark"] .scope-card { border-color: var(--line-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tl-score { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
  :root:not([data-theme="light"]) .tl-item.is-goal .tl-score { background: var(--bib); color: var(--bib-ink); box-shadow: none; }
  :root:not([data-theme="light"]) .ev-goal { box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), 0 8px 24px -10px rgb(214 245 58 / .45); }
  :root:not([data-theme="light"]) .card.subtle, :root:not([data-theme="light"]) .scope-card { border-color: var(--line-strong); }
}
/* Tor-Symbol: dunkel nur auf Neon-Fläche, sonst Neon */
:root[data-theme="dark"] .tone-goal { color: var(--bib); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tone-goal { color: var(--bib); } }
.tl-item.is-goal .tl-ico, .title-ico.tone-goal, .ev-ico.tone-goal { color: var(--bib-ink); }

/* ---------------------------------------------------------------- UI-Review: Feinschliff */

/* Auswahllisten (Teams): Zeilen mit Trennlinien statt aneinanderklebender Einträge */
.check-list { padding: 0 var(--s3); }
.check-list .check { min-height: 48px; padding: var(--s2) 0; }
.check-list .check + .check { border-top: 1px solid var(--line); }
.quick-team input { min-height: 44px; font-size: var(--fs-md); }
.quick-team .btn-square { width: 44px; min-height: 44px; }

/* Eigene Farbe als runder Knopf statt eckigem Systemfeld */
input[type=color] {
  -webkit-appearance: none; appearance: none;
  width: 34px; height: 34px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px dashed var(--line-strong); background: none;
}
input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }

/* Auswahlfelder: Platz für den Pfeil, Text wird nicht angeschnitten */
select { padding-right: 32px; text-overflow: ellipsis; }

/* Startseite: Datenaktionen */
.data-actions { gap: var(--s2) var(--s5); }
.data-actions label { cursor: pointer; }
.check-list + input, .check-list + .quick-team { margin-top: 6px; }

/* Rechtliches: dezente Fußzeile auf Startseite und Live-Seite */
.app-foot { display: flex; justify-content: center; align-items: center; gap: var(--s2); padding: var(--s2) var(--s4) var(--s4); font-size: var(--fs-xs); color: var(--muted); }
.app-foot a { color: var(--muted); padding: var(--s2) var(--s1); }
.app-foot a:active { color: var(--ink-2); }
.app-foot span { opacity: .5; }

/* ---------------------------------------------------------------- Zwischenstand & Schnellmodus */
.digest-btn { justify-content: space-between; border-color: color-mix(in srgb, var(--wa) 45%, var(--line-strong)); }
.digest-btn > .i { color: var(--wa); }
.digest-count { margin-left: auto; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--wa) 14%, transparent); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; }
.tl-pending { display: grid; place-items: center; color: var(--line-strong); }
.quick-chips .chip-btn { min-height: 52px; padding: 0 18px; font-size: var(--fs-base); }

/* ---------------------------------------------------------------- Hilfe, Tipps, Installation */

.tip {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s3); align-items: start;
  padding: var(--s3) var(--s4); border-radius: var(--r-card);
  background: var(--bib-soft); border: 1px solid color-mix(in srgb, var(--bib) 70%, var(--line));
}
.tip p { font-size: var(--fs-md); line-height: 1.5; color: var(--ink-2); }
.tip b { color: var(--ink); font-weight: 600; }
.tip-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--bib); color: var(--bib-ink); }
.tip-ok { grid-column: 2; justify-self: start; color: var(--pitch); padding: 0; }

.install-card { display: flex; flex-direction: column; gap: var(--s3); border-color: color-mix(in srgb, var(--bib) 70%, var(--line)); }
.install-head { display: flex; gap: var(--s3); align-items: center; }
.install-head img { border-radius: 10px; }
.inline-ico { display: inline-block; vertical-align: -3px; }

.help-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s6); }
.help-steps li { display: flex; flex-direction: column; gap: var(--s3); }
.help-step-text { display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); align-items: start; }
.help-step-text p { margin-top: 2px; font-size: var(--fs-md); line-height: 1.5; color: var(--ink-2); }
.help-no { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--deep); color: var(--bib); font-weight: 800; }
.help-shot { margin: 0 auto; width: min(78%, 300px); border-radius: 22px; overflow: hidden; border: 6px solid var(--deep); box-shadow: var(--shadow-lg); aspect-ratio: 780 / 1100; background: var(--surface-2); }
.help-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.help-install { display: grid; gap: var(--s4); }
.help-install ol { margin: var(--s2) 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: var(--fs-md); color: var(--ink-2); }
.help-install b { color: var(--ink); font-weight: 600; }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) 0; font-weight: 600; font-size: var(--fs-md); cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq .faq-chev { color: var(--muted); transition: transform .2s var(--ease); flex: none; }
.faq details[open] .faq-chev { transform: rotate(180deg); }
.faq p { padding: 0 0 var(--s4); font-size: var(--fs-md); line-height: 1.55; color: var(--ink-2); }
.faq b { color: var(--ink); font-weight: 600; }
.help a, .tip a { color: var(--pitch); font-weight: 600; }
