/* Taktik-Brett Herren 3 – Handy zuerst */
:root {
  /* Rot/Schwarz – die „navy“-Namen sind jetzt Schwarz-/Grautöne */
  --navy-950: #000000;
  --navy-900: #0A0A0A;
  --navy-800: #161616;
  --navy-700: #262626;
  --navy-600: #3D3D3D;
  --navy-300: #B8B8B8;
  --navy-200: #E2E2E2;
  --red: #D1000A;
  --red-hi: #FB3A30;
  --orange: #F3A16D;
  --orange-dk: #D95E12;
  --green: #3DBE7A;
  --ink: #FFFFFF;
  --ink-2: #E2E2E2;
  --ink-3: #9E9E9E;
  --line: rgba(255, 255, 255, .14);
  --card: #141414;
  --card-2: #1E1E1E;
  --radius: 14px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--navy-900);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar) + var(--safe-b));
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
img { display: block; max-width: 100%; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- Kopf ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--safe-t)) var(--gutter) 10px;
  background: var(--navy-950);
  border-bottom: 3px solid var(--red);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.badge {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(160deg, var(--navy-700) 0 58%, var(--red) 58% 100%);
  font-weight: 800; letter-spacing: .02em; font-size: 16px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 17px; }
.brand-text small { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.logout {
  font-size: 14px; color: var(--ink-2); text-decoration: none;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); min-height: 44px; display: inline-flex; align-items: center;
}

/* ---------- Startseite ---------- */
.hero {
  padding: 26px var(--gutter) 22px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(209, 0, 10, .45), transparent 55%),
    linear-gradient(180deg, var(--navy-800), var(--navy-900));
}
.hero-kicker { margin: 0 0 4px; color: var(--orange); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 13px; }
.hero h1 { margin: 0; font-size: clamp(26px, 7.4vw, 40px); line-height: 1.1; letter-spacing: -.01em; text-wrap: balance; }
.hero-text { margin: 12px 0 0; color: var(--ink-2); font-size: 15px; max-width: 34em; }

.season {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 14px var(--gutter) 6px;
}
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; min-width: 0; }
.stat b { display: block; font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

.section-title { margin: 18px var(--gutter) 10px; font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; }
.game-list { list-style: none; margin: 0; padding: 0 var(--gutter) 24px; display: grid; gap: 12px; }
.game-link {
  display: grid; grid-template-columns: 104px 1fr; gap: 14px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: relative;
}
.game-link:active { background: var(--card-2); }
.game-pic { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--navy-800); }
.game-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.game-pic-fallback { display: none; }
.game-pic.no-pic { background: linear-gradient(160deg, var(--navy-700) 0 60%, var(--red) 60%); display: grid; place-items: center; }
.game-pic.no-pic .game-pic-fallback { display: block; font-weight: 800; font-size: 26px; }
.game-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.game-date { font-size: 13px; color: var(--ink-3); }
.game-motto { font-size: 13px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .04em; }
.game-opp { font-size: 17px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.game-score { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.game-score b { font-size: 24px; font-variant-numeric: tabular-nums; }
.game-score small { color: var(--ink-3); font-size: 13px; }
.res { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 7px; border-radius: 6px; align-self: center; }
.res-S { background: rgba(61, 190, 122, .18); color: #7FE2AC; }
.res-N { background: rgba(251, 58, 48, .18); color: #FF8A82; }
.res-U { background: rgba(243, 161, 109, .18); color: var(--orange); }
.game-counts { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--ink-3); }
.game-counts b { color: var(--ink); }

/* ---------- Spielkopf ---------- */
.game-head {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
  padding: 12px var(--gutter);
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
}
.motto { width: 64px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--navy-700); }
.motto img { width: 100%; height: 100%; object-fit: cover; }
.game-head-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.game-head:has(.motto[hidden]) { grid-template-columns: 1fr; }
.game-select-wrap { position: relative; display: block; }
.game-select-wrap::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); pointer-events: none;
}
#gameSelect {
  width: 100%; min-height: 44px; appearance: none; -webkit-appearance: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 38px 10px 12px; font-size: 16px; font-weight: 600; text-overflow: ellipsis;
}
.match-line { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ml-teams { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; color: var(--ink-2); }
.ml-teams .us { color: var(--ink); font-weight: 700; }
.ml-score { font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ml-meta { color: var(--ink-3); }
.ml-motto { color: var(--orange); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }

/* ---------- Player (klebt oben beim Scrollen) ---------- */
.player {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy-950);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  padding-top: var(--safe-t);
}
.video-wrap { position: relative; background: #000; aspect-ratio: 16 / 9; max-height: 46vh; margin: 0 auto; }
.video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.speed-flag {
  position: absolute; top: 8px; left: 8px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; pointer-events: none;
}
.now { padding: 8px var(--gutter) 0; min-height: 52px; }
.now-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.now-time { font-weight: 800; color: var(--orange); font-variant-numeric: tabular-nums; font-size: 15px; flex: none; }
.now-title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px var(--gutter) 10px; }
.controls button {
  display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 0 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 600;
}
.controls button svg { width: 18px; height: 18px; }
.controls button[aria-pressed="true"] { background: var(--red); border-color: var(--red); }
.controls button:disabled { opacity: .35; cursor: default; }
.controls button:not(:disabled):active { transform: scale(.97); }

/* ---------- Szenenliste ---------- */
.board { padding: 14px 0 20px; }
.board-head { padding: 0 var(--gutter); }
.board-head h2 { margin: 0; font-size: 22px; }
.board-sub { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px var(--gutter) 2px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; scroll-padding: 0 var(--gutter);
}
.chips::-webkit-scrollbar { display: none; }
.chips + .chips { padding-top: 6px; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--navy-900); border-color: var(--ink); }
.chip-n { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }

.list { list-style: none; margin: 10px 0 0; padding: 0 var(--gutter); display: grid; gap: 8px; }
.list-sep { margin: 10px 0 2px; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.item-btn {
  width: 100%; display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--navy-600);
  border-radius: 12px; padding: 8px; min-height: 76px;
}
.k-angriff .item-btn { border-left-color: var(--red); }
.k-abwehr .item-btn { border-left-color: var(--navy-300); }
.k-bv .item-btn { border-left-color: var(--orange-dk); }
.item-btn:active { background: var(--card-2); }
.item-btn[aria-current="true"] { background: #2A0A0C; border-color: var(--red); border-left-color: var(--red); }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--navy-800); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-ico {
  position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0, 0, 0, .7);
}
.play-ico::after {
  content: ""; position: absolute; left: 12px; top: 9px;
  border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.item-btn[aria-current="true"] .play-ico { background: var(--red); }
.item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.time { font-weight: 800; color: var(--orange); font-variant-numeric: tabular-nums; }
.idx { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.item-title { font-weight: 700; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.item-sub { font-size: 13px; color: var(--ink-3); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bdg { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: rgba(171, 173, 227, .14); color: var(--ink-2); }
.b-7m { background: rgba(243, 161, 109, .2); color: var(--orange); }
.b-own { background: rgba(209, 0, 10, .25); color: #FF8A82; }
.b-opp { background: rgba(255, 255, 255, .12); color: var(--navy-200); }
.b-sure { background: rgba(61, 190, 122, .18); color: #7FE2AC; }
.b-maybe { background: rgba(171, 173, 227, .14); }
.b-unsure { background: rgba(243, 161, 109, .14); color: #F7C8A6; }
.b-cam { background: transparent; border: 1px dashed var(--line); color: var(--ink-3); }
.empty { color: var(--ink-3); padding: 20px 0; text-align: center; }
.load-error { margin: 20px var(--gutter); padding: 14px; border-radius: 12px; background: rgba(209, 0, 10, .2); }

/* ---------- Tableiste unten ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(0, 0, 0, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 0 max(4px, env(safe-area-inset-right, 0px)) var(--safe-b) max(4px, env(safe-area-inset-left, 0px));
}
.tabs button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar); background: none; border: 0; color: var(--ink-3); font-size: 12px; font-weight: 600; padding: 0 2px;
}
.tabs button span { white-space: nowrap; }
.tabs button em {
  position: absolute; top: 6px; left: calc(50% + 8px); font-style: normal; font-size: 10px; font-weight: 800;
  background: var(--navy-700); color: var(--ink-2); border-radius: 999px; padding: 0 5px; min-width: 18px; line-height: 16px; text-align: center;
}
.tabs button em:empty { display: none; }
.tabs button[aria-current="page"] { color: var(--ink); }
.tabs button[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--red);
}
.tabs button[aria-current="page"] em { background: var(--red); color: #fff; }

/* ---------- Login ---------- */
.login-page {
  padding-bottom: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(209, 0, 10, .5), transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(120, 0, 6, .35), transparent 60%),
    var(--navy-900);
}
.login { width: 100%; max-width: 380px; padding: calc(24px + var(--safe-t)) var(--gutter) calc(24px + var(--safe-b)); text-align: center; }
.login-badge {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--navy-700) 0 58%, var(--red) 58% 100%);
  font-weight: 800; font-size: 28px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.login h1 { margin: 0; font-size: 28px; }
.login-sub { margin: 4px 0 24px; color: var(--ink-3); }
.login-form { text-align: left; display: grid; gap: 8px; }
.login-form label { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.pw-row { display: flex; gap: 8px; }
.pw-row input {
  flex: 1; min-width: 0; min-height: 52px; padding: 0 14px; font-size: 17px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
}
.pw-row input:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px rgba(243, 161, 109, .3); }
.pw-toggle { flex: none; min-width: 84px; min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font-size: 14px; }
.login-error { margin: 4px 0 0; color: #FF8A82; font-weight: 600; }
.btn-primary {
  margin-top: 10px; min-height: 52px; border: 0; border-radius: 12px; background: var(--red); color: #fff;
  font-size: 17px; font-weight: 700; box-shadow: 0 6px 18px rgba(209, 0, 10, .35);
}
.btn-primary:active { transform: scale(.98); }

/* ---------- größere Bildschirme ---------- */
@media (min-width: 720px) {
  .view, .top { max-width: 760px; margin-left: auto; margin-right: auto; }
  .top { border-radius: 0 0 14px 14px; }
  .game-list { grid-template-columns: 1fr 1fr; }
  .motto { width: 88px; }
}
@media (min-width: 720px) and (min-height: 700px) {
  .video-wrap { max-height: 52vh; }
}
/* Querformat am Handy: Video so groß wie möglich */
@media (orientation: landscape) and (max-height: 500px) {
  .player { position: relative; }
  .video-wrap { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
