@font-face {
  font-family: "Fredoka";
  font-weight: 400;
  src: url("assets/fonts/fredoka-400.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  font-weight: 500;
  src: url("assets/fonts/fredoka-500.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  font-weight: 600;
  src: url("assets/fonts/fredoka-600.woff2") format("woff2");
  font-display: swap;
}
/* ---------- Grundlagen ---------- */
:root {
  --bg: #050a1a;
  --card: rgba(12, 26, 68, 0.84);
  --card-border: rgba(160, 190, 255, 0.22);
  --line: rgba(190, 210, 255, 0.22);
  --control: #071233;
  --control-border: rgba(170, 200, 255, 0.45);
  --control-hover: #16307a;
  --royal: #1848c8;
  --ink: #0a1a4a;
  --inset: rgba(255, 255, 255, 0.04);
  --text: #eef3ff;
  --text-2: #dbe5fb;
  --muted: #aab9da;
  --accent: #2f6fef;
  --accent-2: #8fbaff;
  --focus: #a9c8ff;
  --ok: #6ff0a8;
  --warn: #ffcf66;
  --bad: #ff9a9a;
  --radius: 18px;
  --radius-control: 12px;
  --radius-inner: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ico-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --ico-cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --ico-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='4'/%3E%3C/svg%3E");
  --ico-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%2393a3c4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--text); font-family: "Fredoka", system-ui, sans-serif; font-weight: 400; overflow: hidden; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }
body.fake-ball #stage { cursor: none; }
::selection { background: rgba(47, 123, 255, 0.55); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

#debug { position: fixed; top: 8px; left: 8px; width: 320px; background: rgba(0, 0, 0, 0.82); border: 1px solid #2a62d9; border-radius: var(--radius-inner); padding: 6px; pointer-events: none; }
#debug canvas { width: 100%; display: block; border-radius: 6px; }
#debug p { margin: 4px 0 0; font: 12px ui-monospace, monospace; color: #cfe0ff; }

/* ---------- Seite ---------- */
#setup {
  position: fixed; inset: 0; overflow: auto; padding: 24px 20px 40px;
  scrollbar-color: rgba(130, 170, 255, 0.35) transparent; caret-color: var(--accent-2);
  background: var(--bg);
}
/* Vereinslogo groß und ausgegraut hinter allem */
#setup::before { content: ''; position: fixed; inset: 0; background: url("assets/logo.svg") center / min(78vh, 78vw) no-repeat; filter: grayscale(1); opacity: 0.1; pointer-events: none; }
.shell { position: relative; max-width: 1120px; margin: 0 auto; }

.topbar { display: flex; align-items: center; gap: 12px 18px; margin-bottom: 20px; flex-wrap: wrap; }
#logo { height: 64px; width: auto; }
.brand { flex: 1; min-width: 220px; }
h1 { margin: 0; font: 600 28px/1.15 "Fredoka", system-ui, sans-serif; letter-spacing: 0.005em; color: #fff; text-wrap: balance; }
.tagline { margin: 3px 0 0; color: var(--muted); font-size: 15px; line-height: 1.35; }

.chips { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; }
.chips li { font-size: 13px; line-height: 1; padding: 8px 12px 8px 26px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); position: relative; background: var(--inset); white-space: nowrap; }
.chips li::before { content: ''; position: absolute; left: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.chips li.done { color: #d6ffe6; border-color: rgba(111, 240, 168, 0.4); background: rgba(111, 240, 168, 0.08); }
.chips li.done::before { background: var(--ok); }
.fs-btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.fs-btn .ico { flex: none; opacity: 0.85; }

.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 20px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; background: transparent; color: var(--muted); padding: 9px 18px; border-radius: var(--radius-inner); font-size: 16px; }
.tabs button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.tabs { position: relative; }
/* gleiche Schriftstärke für alle Reiter: sonst ändert sich beim Wechsel ihre Breite und die Leiste ruckt */
.tabs button { position: relative; z-index: 1; font-weight: 500; transition: none; }
/* Schrift passend zur Markierung: der verlassene Reiter wird sofort hell, der neue erst dunkel, wenn sie ankommt */
.tabs button[aria-selected="true"] { color: var(--ink); background: #fff; transition: color 0.14s 0.08s; }
/* Markierung, die zum gewählten Reiter gleitet; sobald sie sitzt, braucht der Reiter keinen eigenen Grund */
.tab-pill { position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: var(--radius-inner); background: #fff; opacity: 0; transition: transform 0.38s var(--ease), width 0.38s var(--ease); }
.tab-pill.ready { opacity: 1; }
.tab-pill.ready ~ button[aria-selected="true"] { background: transparent; }
.tab-pill.ready ~ button[aria-selected="true"]:hover { background: transparent; }

.alert:empty { display: none; }
.alert { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-control); border: 1px solid rgba(255, 207, 102, 0.35); background: rgba(255, 207, 102, 0.08); color: #ffe7b3; font-size: 15px; line-height: 1.45; }

.foot { margin-top: 28px; color: var(--muted); font-size: 13px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.foot .link { padding: 6px 0; }

/* ---------- Karten ---------- */
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.card > :last-child, .card details.more > :last-child { margin-bottom: 0; }
.card p:empty { display: none; }
.card-head { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 16px; }
h3 { margin: 0; font: 600 19px/1.25 "Fredoka", system-ui, sans-serif; color: #fff; text-wrap: balance; }
h4.sub { margin: 20px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); font: 600 15px/1.3 "Fredoka", system-ui, sans-serif; color: var(--accent-2); }
h4.sub:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.lead { margin: 0 0 16px; color: var(--text-2); font-size: 15px; line-height: 1.5; max-width: 72ch; }
.note { margin: 6px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 78ch; }
.note.warn { color: #ffcf9c; }
.note b, .lead b, .tips b { font-weight: 600; color: var(--text); }
.muted { color: var(--muted); font-size: 13px; line-height: 1.4; }
.caption { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; text-wrap: balance; }
.status { margin: 12px 0 0; font-size: 14px; line-height: 1.4; color: var(--text-2); }

/* ---------- Bedienelemente ---------- */
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.row > label.field { margin: 0; }
select, button, input[type=text], input[type=number] {
  font: inherit; font-size: 15px; line-height: 1.3; padding: 10px 16px; min-height: 42px; border-radius: var(--radius-control);
  border: 1px solid var(--control-border); background-color: var(--control); color: #fff;
  transition: background-color 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
input[type=text], input[type=number] { padding: 10px 12px; min-width: 0; }
input[type=text]:hover, input[type=number]:hover, select:hover { border-color: rgba(160, 195, 255, 0.55); }
input::placeholder { color: var(--muted); opacity: 1; }
select { appearance: none; padding-right: 38px; background-image: var(--ico-chevron); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; cursor: pointer; max-width: 100%; text-overflow: ellipsis; }
button { cursor: pointer; }
button:hover { border-color: rgba(160, 195, 255, 0.7); background-color: var(--control-hover); }
button:disabled { opacity: 0.45; cursor: default; transform: none; }
button:disabled:hover { border-color: var(--control-border); background-color: var(--control); }
button.primary { background: #fff; border-color: #fff; color: var(--ink); font-weight: 600; }
button.primary:hover { background: #dce8ff; border-color: #dce8ff; }
button.primary:disabled:hover { background: #fff; border-color: #fff; }
button.big { font-size: 22px; padding: 16px 44px; border-radius: 16px; }
button.ghost { background-color: transparent; }
button.ghost:hover { background-color: rgba(255, 255, 255, 0.06); }
button.link { background: none; border: 0; color: var(--accent-2); padding: 10px 6px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
button.link:hover { color: #fff; background: none; }
button.danger { border-color: rgba(255, 143, 143, 0.35); color: #ffc9c9; background-color: transparent; }
button.danger:hover { background-color: rgba(255, 143, 143, 0.1); border-color: rgba(255, 143, 143, 0.7); }
button.active { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
button .dot, .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: -2px; }
.swatch { border: 1px solid rgba(255, 255, 255, 0.4); }
label { display: inline-flex; gap: 8px; align-items: center; }
label.field { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 4px 0 12px; color: var(--text-2); font-size: 15px; }
label.field > span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
label.check { font-size: 15px; color: var(--text-2); align-items: flex-start; line-height: 1.35; cursor: pointer; }
input[type=checkbox], input[type=radio] {
  appearance: none; flex: none; width: 20px; height: 20px; margin: 0; cursor: pointer;
  border: 1.5px solid rgba(150, 185, 255, 0.5); background: var(--control) center / 14px no-repeat;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
input[type=checkbox] { border-radius: 6px; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:hover, input[type=radio]:hover { border-color: var(--focus); }
input[type=checkbox]:checked { background-color: var(--accent); border-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input[type=radio]:checked { border-color: var(--accent-2); box-shadow: inset 0 0 0 4px var(--control), inset 0 0 0 10px var(--accent-2); }
input[type=range] { width: 200px; max-width: 100%; accent-color: var(--accent); cursor: pointer; }
#camera-select { flex: 1; min-width: 180px; }

.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--radius-control); background: var(--inset); border: 1px solid var(--line); margin-bottom: 14px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { padding: 9px 18px; border-radius: 9px; color: var(--muted); transition: background-color 0.15s, color 0.15s; }
.segmented label:hover span { color: #fff; }
.segmented input:checked + span { background: #fff; color: var(--ink); font-weight: 500; }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

details.more { margin-top: 4px; border-top: 1px solid var(--line); }
details.more summary { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--accent-2); font-size: 14px; list-style: none; padding: 12px 0; border-radius: 6px; }
details.more summary:hover { color: #fff; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: ''; flex: none; width: 16px; height: 16px; background: currentColor; mask: var(--ico-chevron) center / 16px no-repeat; -webkit-mask: var(--ico-chevron) center / 16px no-repeat; transform: rotate(-90deg); transition: transform 0.2s var(--ease); }
details.more[open] summary::before { transform: none; }
details.more[open] { padding-bottom: 12px; }
details.more + details.more { margin-top: 0; }
.tips { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.tips li { max-width: 78ch; }
.tips li + li { margin-top: 4px; }
.tips li::marker { color: var(--accent-2); }

/* ---------- Start ---------- */
.start-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.start-grid .card { margin-bottom: 0; }
.hero { padding: 32px; background: var(--royal); border-color: var(--royal); display: flex; flex-direction: column; justify-content: center; }
.hero .lead, .hero .muted { color: #fff; }
.hero button.ghost { border-color: rgba(255, 255, 255, 0.75); }
.hero button.ghost:hover { background-color: rgba(255, 255, 255, 0.14); border-color: #fff; }
.hero button.link { color: #fff; }
.hero-title { margin: 0 0 8px; font: 600 40px/1.1 "Fredoka", system-ui, sans-serif; color: #fff; text-wrap: balance; overflow-wrap: anywhere; }
.hero .lead { margin-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 24px; }
.actions.quiet { margin-top: 16px; gap: 8px 12px; }
.howsteps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.howsteps li { counter-increment: s; position: relative; padding: 0 0 18px 48px; min-height: 32px; }
.howsteps li:last-child { padding-bottom: 0; }
.howsteps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--royal); border: 2px solid #fff; color: #fff; font-weight: 600; font-size: 15px; }
.howsteps b { display: block; font-weight: 600; color: #fff; margin-bottom: 2px; padding-top: 4px; }
.howsteps span { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 78ch; }
.howsteps.compact li { padding-bottom: 14px; }
.howsteps.compact li:last-child { padding-bottom: 0; }
.media { margin-top: 16px; padding: 14px 14px 16px; }
#howto { width: 100%; display: block; border-radius: var(--radius-control); cursor: pointer; }
.privacy .tips li { max-width: none; }

/* ---------- Einrichten ---------- */
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 16px; align-items: start; }
.preview-card { position: sticky; top: 0; }
#preview { width: 100%; border-radius: var(--radius-control); border: 1px solid var(--line); background: #0a0f1d; cursor: crosshair; display: block; }
.step > header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.step .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--royal); border: 2px solid #fff; font-weight: 600; font-size: 15px; flex: none; }
.step .state { margin-left: auto; font-size: 13px; color: var(--muted); text-align: right; }
.step.done .num { background: var(--ok); border-color: var(--ok); font-size: 0; }
.step.done .num::after { content: ''; width: 16px; height: 16px; background: #04331c; mask: var(--ico-check) center / 16px no-repeat; -webkit-mask: var(--ico-check) center / 16px no-repeat; }
.step.done .state { color: var(--ok); }

#test-box { margin: 4px 0 14px; padding: 14px 16px; border-radius: var(--radius-control); border: 1px solid var(--line); background: rgba(5, 12, 30, 0.6); }
#test-step { font-size: 17px; font-weight: 600; margin: 0 0 10px; font-variant-numeric: tabular-nums; }
#test-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
#test-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: #fff; }
#test-verdict { font-weight: 600; margin: 12px 0 6px; }
#test-verdict.g0 { color: var(--ok); } #test-verdict.g1 { color: var(--warn); } #test-verdict.g2 { color: var(--bad); }
#test-result { list-style: none; padding: 0; margin: 0; font-size: 14px; line-height: 1.45; }
#test-result li { position: relative; padding: 8px 0 8px 24px; border-top: 1px solid var(--line); }
#test-result li b { font-weight: 600; }
#test-result li .tip { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
#test-result li::before { content: ''; position: absolute; left: 0; top: 10px; width: 16px; height: 16px; background: var(--muted); mask: var(--ico-dot) center / 16px no-repeat; -webkit-mask: var(--ico-dot) center / 16px no-repeat; }
#test-result li.g0::before { background: var(--ok); mask-image: var(--ico-check); -webkit-mask-image: var(--ico-check); }
#test-result li.g1::before { background: var(--warn); }
#test-result li.g2::before { background: var(--bad); mask-image: var(--ico-cross); -webkit-mask-image: var(--ico-cross); }

/* Kamerawerte unter dem Kamerabild */
.cam-stats { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 12px 0 0; }
.cam-stats li { background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius-inner); padding: 7px 10px; display: flex; flex-direction: column; gap: 2px; }
.cam-stats li span { font-size: 12px; color: var(--muted); }
.cam-stats li b { font-size: 15px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.cam-stats li.ok b { color: var(--ok); }
.cam-stats li.bad { border-color: rgba(255, 140, 120, 0.5); }
.cam-stats li.bad b { color: var(--bad); }

/* ---------- Spieler, Einstellungen, Hilfe ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-grid .card { margin-bottom: 0; }
.settings-grid .wide { grid-column: 1 / -1; }
.toggles { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
.player { display: flex; gap: 10px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.player:first-child { padding-top: 0; }
.player input[type=text] { flex: 1 1 160px; }
.player .rank { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.player .lefty { font-size: 14px; white-space: nowrap; color: var(--text-2); cursor: pointer; }
.player button { margin-left: auto; }
.add-player { margin-top: 16px; }
.add-player input[type=text] { flex: 0 1 220px; }
.age { width: 84px; }
.shirt-no { width: 72px; }
#custom-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; margin-bottom: 20px; }
#custom-games b { grid-column: 1 / -1; color: var(--accent-2); margin-top: 10px; font-weight: 600; font-size: 14px; }
#custom-games b:first-child { margin-top: 0; }
#custom-games label { font-size: 14px; color: var(--text-2); cursor: pointer; }
.table-wrap { overflow-x: auto; }
/* Auswertung: Kennzahlen, Trainingstage, Übungen */
.tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 20px; }
.game-detail .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.game-detail .tiles { margin: 8px 0 0; }
.day-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin-top: 8px; }
.day-chart { margin: 0; }
.day-chart figcaption { font-size: 14px; font-weight: 500; color: var(--text-2); }
.day-chart .score-chart { margin-top: 4px; }
.score-chart .bar { fill: var(--accent-2); cursor: pointer; }
.score-chart .bar:hover, .score-chart .bar:focus { fill: #fff; outline: none; }
.cal-wrap { margin-bottom: 4px; }
.calendar { display: flex; gap: 4px; align-items: flex-start; }
.cal-days, .cal-week { display: grid; grid-template-rows: repeat(7, 18px); gap: 4px; }
.cal-days span { font-size: 12px; line-height: 18px; color: var(--muted); padding-right: 6px; }
.cal-week i, .cal-legend i { display: block; width: 18px; height: 18px; border-radius: 5px; background: rgba(255, 255, 255, 0.07); }
/* eine Farbe, heller = mehr Runden */
.calendar .c1, .cal-legend .c1 { background: #2a4fae; }
.calendar .c2, .cal-legend .c2 { background: #4f7ff2; }
.calendar .c3, .cal-legend .c3 { background: #b4cdff; }
.calendar .cf { background: transparent; }
.cal-week i:not(.cf):hover { outline: 2px solid #fff; outline-offset: 1px; }
.cal-legend { display: flex; align-items: center; gap: 4px; margin: 10px 0 0; flex-wrap: wrap; }
.cal-legend i { width: 14px; height: 14px; border-radius: 4px; }
.games-list { font-size: 14px; font-variant-numeric: tabular-nums; }
.game-row { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: 8px; align-items: center; width: 100%; padding: 10px 0; text-align: right; }
.game-row > span:first-child { text-align: left; }
.game-row.head { color: var(--muted); font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--line); }
button.game-row { min-height: 44px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 10px 0; font-size: 14px; }
button.game-row:hover { background-color: rgba(255, 255, 255, 0.05); }
button.game-row > span:first-child { font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
button.game-row[aria-expanded="true"] { border-bottom-color: transparent; }
button.game-row[aria-expanded="true"] > span:first-child { color: var(--accent-2); }
.game-row .up { color: var(--ok); }
.game-row .down { color: #ffb38a; }
.game-detail { padding: 6px 0 18px; border-bottom: 1px solid var(--line); }
.score-chart { display: block; width: 100%; max-width: 760px; height: auto; margin-top: 12px; }
.score-chart .axis { stroke: var(--line); stroke-width: 1; }
.score-chart .tick { fill: var(--muted); font-size: 12px; font-family: inherit; }
.score-chart .line { fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.score-chart .dot { fill: var(--accent-2); stroke: var(--card); stroke-width: 2; cursor: pointer; }
.score-chart .dot:hover, .score-chart .dot:focus { fill: #fff; outline: none; }
.rounds { width: 100%; max-width: 760px; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.rounds th, .rounds td { padding: 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rounds th:first-child, .rounds td:first-child { text-align: left; padding-left: 0; }
.rounds th { color: var(--muted); font-weight: 500; font-size: 13px; }
.rounds tr:last-child td { border-bottom: 0; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.keys dt { font-weight: 600; min-width: 34px; padding: 3px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--control-border); text-align: center; color: #fff; }
.keys dd { margin: 0; color: var(--text-2); align-self: center; }

/* Hilfe: Anleitung Logitech C920 mit Bild aus Logi Options+ */
.logi { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; align-items: start; margin-bottom: 16px; }
.logi figure { margin: 0; }
.logi img { width: 100%; height: auto; border-radius: var(--radius-inner); display: block; }
/* kleines Bild zu einem Schritt der Anleitung */
.hint-img { display: block; width: 300px; max-width: 100%; height: auto; margin-top: 10px; border-radius: var(--radius-inner); border: 1px solid var(--card-border); }
.logi figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }

@media (max-width: 860px) {
  .start-grid, .setup-grid, .settings-grid, .logi, .day-charts { grid-template-columns: minmax(0, 1fr); }
  .preview-card { position: static; order: -1; }
  .hero-title { font-size: 32px; }
  .logi figure { max-width: 260px; }
}
@media (max-width: 560px) {
  #setup { padding: 16px 16px 32px; }
  .topbar { gap: 12px 14px; margin-bottom: 16px; }
  #logo { height: 48px; }
  .brand { min-width: 0; flex-basis: calc(100% - 62px); }
  h1 { font-size: 22px; }
  .tagline { font-size: 14px; }
  .chips { flex: 1; flex-wrap: wrap; }
  .fs-btn { padding: 10px 12px; }
  .fs-btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tabs { width: 100%; margin-bottom: 16px; }
  .tabs { gap: 2px; }
  .tabs button { flex: 1 1 auto; padding: 9px 7px; font-size: 14px; }
  .card { padding: 18px; }
  .hero { padding: 22px 18px; }
  .hero-title { font-size: 28px; }
  button.big { font-size: 20px; padding: 14px 36px; }
  .media { padding: 10px 10px 14px; }
  .cam-stats, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-row { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
  .game-row > span:nth-child(4) { display: none; }
  input[type=range] { flex: 1 1 140px; width: auto; }
}
/* ---------- Bewegung ---------- */
/* Seitenwechsel: der Inhalt kommt aus der Richtung, in die geblättert wurde */
@keyframes panel-in { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 18px)); } }
.tab-panel.enter { animation: panel-in 0.32s var(--ease) both; }
/* erledigter Schritt: die Nummer springt kurz auf, das Häkchen zeichnet sich */
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes draw-check { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
.step.done .num { animation: pop 0.42s var(--ease); }
.step.done .num::after { animation: draw-check 0.3s 0.12s ease-out both; }
/* Statuspunkt oben: wird grün und schickt einen Ring los */
@keyframes ring { from { box-shadow: 0 0 0 0 rgba(111, 240, 168, 0.7); } to { box-shadow: 0 0 0 9px rgba(111, 240, 168, 0); } }
.chips li { transition: color 0.25s, border-color 0.25s, background-color 0.25s; }
.chips li.done::before { animation: pop 0.4s var(--ease), ring 0.7s ease-out; }
/* Kästchen: das Häkchen wächst hinein */
input[type=checkbox] { background-size: 0; transition: background-color 0.15s, border-color 0.15s, background-size 0.2s var(--ease), transform 0.12s; }
input[type=checkbox]:checked { background-size: 14px; }
input[type=checkbox]:active, input[type=radio]:active { transform: scale(0.88); }
/* Knöpfe geben beim Drücken nach */
button:active { transform: scale(0.97); }
button.big:active { transform: scale(0.96); }
/* Hinweis erscheint von oben */
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } }
.alert:not(:empty) { animation: drop-in 0.28s var(--ease); }
/* Aufklapper: Inhalt fährt aus (wo der Browser es kann) */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  details.more::details-content { block-size: 0; overflow: hidden; transition: block-size 0.32s var(--ease), content-visibility 0.32s allow-discrete; }
  details.more[open]::details-content { block-size: auto; }
}
/* Auswertung: Kalender baut sich wochenweise auf, Balken wachsen, die Linie zeichnet sich */
@keyframes week-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes bar-up { from { transform: scaleY(0); } }
@keyframes line-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes dot-in { from { opacity: 0; transform: scale(0); } }
.tab-panel.enter .cal-week { animation: week-in 0.4s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms); }
.tab-panel.enter .score-chart .bar { transform-box: fill-box; transform-origin: bottom; animation: bar-up 0.55s 0.15s var(--ease) both; }
.score-chart .line[pathLength] { stroke-dasharray: 1; }
.tab-panel.enter .score-chart .line, .game-detail .score-chart .line { animation: line-draw 0.8s 0.1s ease-out both; }
.tab-panel.enter .score-chart .dot, .game-detail .score-chart .dot { transform-box: fill-box; transform-origin: center; animation: dot-in 0.3s 0.6s var(--ease) both; }
.game-detail { animation: drop-in 0.3s var(--ease); }
/* Konfetti, wenn alles eingerichtet ist */
.confetti-bit { position: fixed; z-index: 9; width: 8px; height: 12px; margin: -6px 0 0 -4px; border-radius: 2px; pointer-events: none; }

/* Weniger Bewegung gewünscht: Zustände wechseln weiter (Farbe, Häkchen), aber nichts fährt, springt oder zeichnet sich */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  button:active, input:active { transform: none; }
}

/* ---------- Begrüßungsseite vor der App ---------- */
#welcome { position: fixed; inset: 0; z-index: 5; overflow: auto; background: #0d1c4a; color: var(--text); scrollbar-color: rgba(130, 170, 255, 0.35) transparent; }
.w-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.w-brand { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); margin-bottom: 28px; }
.w-logo { height: clamp(96px, 17vw, 200px); width: auto; flex: none; }
.w-club { margin: 0 0 6px; font: 600 clamp(20px, 2.6vw, 34px)/1.2 "Fredoka", system-ui, sans-serif; color: #fff; }
.w-hero { background: linear-gradient(90deg, rgba(6, 16, 48, 0.78) 0%, rgba(6, 16, 48, 0.5) 45%, rgba(6, 16, 48, 0.08) 100%), url("assets/platz.webp") center / cover no-repeat; padding: clamp(48px, 10vh, 112px) 0; }
.w-hero h1, .w-hero .w-club, .w-hero .w-lead { text-shadow: 0 2px 14px rgba(4, 10, 32, 0.55); }
.w-hero h1 { margin: 0; font: 600 clamp(44px, 9vw, 92px)/1 "Fredoka", system-ui, sans-serif; letter-spacing: -0.01em; color: #fff; }
.w-lead { margin: 0; max-width: 62ch; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.5; color: #fff; }
.w-hero .actions { margin-top: 32px; gap: 14px 22px; }
.w-link { color: #fff; font-size: 17px; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.w-link:hover { color: var(--accent-2); }
.w-section { padding: 72px 0; }
.w-section h2, .w-donate h2 { margin: 0 0 20px; font: 600 clamp(28px, 3.4vw, 40px)/1.15 "Fredoka", system-ui, sans-serif; color: #fff; text-wrap: balance; }
.w-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; }
.w-section .howsteps b { font-size: 18px; }
.w-section .howsteps span { font-size: 15.5px; color: var(--text-2); }
.w-section .howsteps li { padding-bottom: 22px; }
.w-media { margin: 0; }
.w-media canvas { width: 100%; display: block; border-radius: var(--radius); cursor: pointer; }
#w-count { display: inline; }
.w-media figcaption, .w-qr figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
.w-needs-band { padding-top: 0; }
/* Was man braucht: fünf Aufnäher wie die Knöpfe im Spiel. Zeigt man darauf, werden sie weiß –
   so wie im Spiel, wenn der Ball auf einem Knopf liegt. */
.w-needs { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 36px 28px; margin: 32px 0 0; padding: 0; }
.w-needs li { text-align: center; }
.w-patch { display: grid; place-items: center; width: min(100%, 148px); aspect-ratio: 1; margin: 0 auto 18px; border-radius: 50%; background: var(--royal); border: 6px solid #fff; color: #fff; transition: background-color 0.2s, color 0.2s; }
.w-patch svg { width: 58%; height: 58%; transition: transform 0.45s var(--ease); }
.w-ball { fill: #ffe14a; stroke: #ffe14a; }
.w-needs li:hover .w-patch { background: #fff; color: var(--ink); }
.w-needs li:hover .w-patch svg { transform: scale(1.1) rotate(-5deg); }
.w-needs h3 { margin: 0 0 6px; font: 600 21px/1.25 "Fredoka", system-ui, sans-serif; color: #fff; }
.w-needs p { margin: 0 auto; max-width: 26ch; font-size: 15.5px; line-height: 1.5; color: var(--text-2); }
.w-needs b { font-weight: 600; color: #fff; }
@media (max-width: 900px) {
  /* schmal: Aufnäher links, Text rechts daneben */
  .w-needs { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .w-needs li { display: grid; grid-template-columns: 84px minmax(0, 1fr); column-gap: 18px; align-items: center; text-align: left; }
  .w-patch { grid-row: span 2; width: 84px; margin: 0; border-width: 4px; }
  .w-needs h3 { align-self: end; margin-bottom: 2px; font-size: 19px; }
  .w-needs p { align-self: start; margin: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .w-needs li:hover .w-patch svg { transform: none; } }
.w-guide-band { padding-top: 0; }
/* Bild-Anleitung: zwei Bilder nebeneinander; Nummer, Titel und Text stehen in den Bildern selbst */
.w-guide { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin: 32px 0 0; padding: 0; }
.w-guide img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
/* ungerade Zahl an Bildern: das letzte mittig statt allein links */
.w-guide li:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 14px); }
@media (max-width: 760px) { .w-guide { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .w-guide li:last-child:nth-child(odd) { width: auto; justify-self: stretch; } }
.w-stats-band { padding-top: 0; }
.w-text { margin: 0; max-width: 70ch; font-size: 17px; line-height: 1.55; color: var(--text-2); }
.w-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; }
.w-stats li { padding: 12px 14px; }
.w-stats li b { font-size: 24px; }
.w-stats-band .actions { margin-top: 24px; }
@media (max-width: 900px) { .w-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .w-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.w-note { margin: 18px 0 0; max-width: 70ch; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.w-foot { padding: 28px 0 36px; }
.w-foot .w-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.w-foot p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }
/* Spendenaufruf: die eine kräftige Fläche der Seite */
.w-donate { background: var(--royal); padding: 76px 0; }
.w-donate .w-split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.7fr); }
.w-donate .w-note { color: #fff; }
.w-donate .actions { margin-top: 28px; }
.w-button { display: inline-block; padding: 16px 36px; border-radius: 16px; background: #fff; color: var(--ink); font: 600 20px/1.2 "Fredoka", system-ui, sans-serif; text-decoration: none; transition: background-color 0.15s; }
.w-button:hover { background: #dce8ff; }
.w-qr { margin: 0; justify-self: end; width: min(100%, 280px); }
.w-qr #w-qr-code { background: #fff; border-radius: var(--radius-control); padding: 6px; }
.w-qr svg, .w-qr img { display: block; width: 100%; height: auto; border-radius: 8px; }
.w-qr figcaption { color: #fff; font-size: 14px; }
@media (max-width: 860px) {
  .w-split, .w-donate .w-split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .w-qr { justify-self: start; }
  .w-section { padding: 52px 0; }
  .w-donate { padding: 56px 0; }
}
@media (max-width: 560px) {
  .w-inner { padding: 0 16px; }
}
