/* 2KDESTINY – Designsystem. Weiß, Garnet-Rot, Schwarz/Anthrazit. Selbst gehostete Schriften (keine Google-Fonts-Abrufe → DSGVO). */
@font-face { font-family: 'Archivo'; src: url(/fonts/archivo-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url(/fonts/archivo-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url(/fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url(/fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --paper: #ffffff; --field: #f5f4f2; --line: #e3e1de; --ink: #000000; --anthracite: #2e3136; --muted: #686c73;
  --garnet: #8c1c24; --garnet-ink: #ffffff; --garnet-soft: #f6e9ea;
  --ok: #2f6b3f; --ok-soft: #e7f1ea; --warn: #8a5a00; --warn-soft: #fbf1dc; --test: #4f5687; --test-soft: #eceef8; --bad: #9b1c1c;
  --team: var(--garnet);
  --panel-dark: #2e3136;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-s: 6px; --r-m: 10px; --tap: 48px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17191c; --field: #1f2226; --line: #33373d; --ink: #f4f3f1; --anthracite: #d9dadc; --muted: #9da1a8;
    --garnet: #c2414b; --garnet-soft: #3a1f22; --ok: #7cc28e; --ok-soft: #1e3325; --warn: #e2b04f; --warn-soft: #3a2f17;
    --test: #a9afe0; --test-soft: #262a40; --panel-dark: #0d0e10; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17191c; --field: #1f2226; --line: #33373d; --ink: #f4f3f1; --anthracite: #d9dadc; --muted: #9da1a8;
  --garnet: #c2414b; --garnet-soft: #3a1f22; --ok: #7cc28e; --ok-soft: #1e3325; --warn: #e2b04f; --warn-soft: #3a2f17;
  --test: #a9afe0; --test-soft: #262a40; --panel-dark: #0d0e10; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 400 1rem/1.55 var(--body); -webkit-font-smoothing: antialiased; padding-bottom: env(safe-area-inset-bottom, 0px); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: .005em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0; max-width: 68ch; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--garnet); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.boot { padding: 2rem; color: var(--muted); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--panel-dark); color: #fff; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 0; height: 100vh; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.55rem; line-height: 1; }
.brand small { display: block; font-family: var(--body); font-weight: 400; font-size: .8rem; opacity: .7; margin-top: .3rem; }
.hash { height: 6px; background: repeating-linear-gradient(90deg, var(--garnet) 0 18px, transparent 18px 26px); border-radius: 3px; }
.nav { display: flex; flex-direction: column; gap: .25rem; }
.nav a { display: flex; align-items: center; gap: .65rem; min-height: var(--tap); padding: 0 .85rem; border-radius: var(--r-s); text-decoration: none; font-weight: 600; opacity: .82; }
.nav a:hover { opacity: 1; background: rgba(255,255,255,.07); }
.nav a[aria-current="page"] { opacity: 1; background: var(--garnet); color: #fff; }
.nav .group { font-size: .78rem; opacity: .55; padding: .75rem .85rem .25rem; }
.side-foot { margin-top: auto; font-size: .85rem; display: flex; flex-direction: column; gap: .5rem; }
.side-foot button { all: unset; cursor: pointer; opacity: .75; min-height: 40px; display: flex; align-items: center; }
.side-foot button:hover { opacity: 1; }
main { padding: clamp(1rem, 3vw, 2.25rem); max-width: 1180px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head p { color: var(--muted); margin-top: .35rem; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 0 0 0; height: auto; top: auto; flex-direction: row; padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom, 0px)); z-index: 20; gap: 0; }
  .brand, .hash, .nav .group, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: .1rem; font-size: .72rem; padding: .3rem .4rem; min-height: 54px; justify-content: center; }
  .nav a .lbl-long { display: none; }
  main { padding-bottom: 6rem; }
  .mobile-top { display: flex !important; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.mobile-top b { font-family: var(--display); font-size: 1.3rem; }

/* ---------- Bausteine ---------- */
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.panel { border: 1px solid var(--line); border-radius: var(--r-m); padding: 1.1rem 1.2rem; background: var(--paper); }
.panel > h2, .panel > h3 { margin-bottom: .75rem; }
.panel.quiet { background: var(--field); border-color: transparent; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.item { display: flex; align-items: center; gap: .9rem; min-height: 60px; padding: .55rem .25rem; text-decoration: none; }
a.item:hover { background: var(--field); }
.item .main { flex: 1; min-width: 0; }
.item .t { font-weight: 600; }
.item .s { color: var(--muted); font-size: .875rem; }
.date-chip { font-family: var(--display); font-weight: 700; text-align: center; min-width: 54px; line-height: 1; border-left: 4px solid var(--team); padding: .2rem .5rem; }
.date-chip b { display: block; font-size: 1.6rem; }
.date-chip span { font-size: .8rem; color: var(--muted); }
.empty { padding: 1.25rem; text-align: left; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-m); }

.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.b-synthetic_test { background: var(--test-soft); color: var(--test); }
.b-draft, .b-in_review { background: var(--warn-soft); color: var(--warn); }
.b-limited { background: var(--warn-soft); color: var(--warn); border: 1px solid currentColor; }
.b-expert_approved { background: var(--ok-soft); color: var(--ok); }
.b-rejected { background: var(--garnet-soft); color: var(--bad); }
.b-unit { background: var(--field); color: var(--anthracite); }
.test-banner { background: var(--test-soft); color: var(--test); padding: .6rem 1rem; border-radius: var(--r-s); font-size: .9rem; margin-bottom: 1rem; }

/* ---------- Formulare ---------- */
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
label .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-s); min-height: var(--tap); padding: .55rem .75rem; width: 100%; }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--garnet); outline: none; }
.form { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form .full { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem; }
.check { flex-direction: row; align-items: center; gap: .5rem; border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 0 .8rem; min-height: var(--tap); font-weight: 400; cursor: pointer; }
.check input { width: 20px; min-height: 20px; accent-color: var(--garnet); }

.btn { font: 600 1rem var(--body); min-height: var(--tap); padding: 0 1.15rem; border-radius: var(--r-s); border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; text-decoration: none; }
.btn:hover { background: var(--field); }
.btn.primary { background: var(--garnet); border-color: var(--garnet); color: var(--garnet-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.sm { min-height: 40px; padding: 0 .8rem; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { min-width: var(--tap); padding: 0; }

/* ---------- Block-Editor ---------- */
.block { border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--r-m); background: var(--paper); }
.block.u-offense { border-left-color: var(--garnet); }
.block.u-defense { border-left-color: var(--anthracite); }
.block.u-team { border-left-color: var(--muted); }
.block-head { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; cursor: pointer; }
.block-head .pos { font-family: var(--display); font-weight: 700; font-size: 1.4rem; width: 1.6rem; text-align: center; color: var(--muted); }
.block-head .main { flex: 1; min-width: 0; }
.block-body { padding: 0 .9rem .9rem; border-top: 1px solid var(--line); }
.block-body .form { padding-top: .9rem; }
.save-state { font-size: .8rem; color: var(--muted); min-width: 8ch; }
.timeline { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--field); margin: .5rem 0 1rem; }
.timeline span { display: block; height: 100%; border-right: 2px solid var(--paper); }
.timeline .u-offense { background: var(--garnet); } .timeline .u-defense { background: var(--anthracite); }
.timeline .u-team { background: var(--muted); } .timeline .u-individual { background: var(--test); }

/* ---------- Live Coach: die Spieluhr ist das prägende Element ---------- */
.live { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.live-top { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--line); gap: .5rem; }
.live-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding: 1rem clamp(1rem, 4vw, 2.5rem) 7rem; max-width: 900px; width: 100%; margin: 0 auto; }
.clock { font-family: var(--display); font-weight: 700; font-size: clamp(5rem, 22vw, 10rem); line-height: .9; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.clock.over { color: var(--garnet); }
.clock-bar { height: 8px; background: var(--field); border-radius: 4px; overflow: hidden; }
.clock-bar i { display: block; height: 100%; background: var(--garnet); transition: width .9s linear; }
.drill-name { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1; }
.cues { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.cues li { font-size: 1.3rem; font-weight: 600; padding: .55rem .9rem; background: var(--field); border-radius: var(--r-s); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; }
.kv dt { color: var(--muted); font-size: .9rem; } .kv dd { margin: 0; }
.live-controls { position: fixed; inset: auto 0 0 0; display: flex; gap: .5rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px)); background: var(--paper); border-top: 1px solid var(--line); justify-content: center; }
.live-controls .btn { min-height: 58px; flex: 1; max-width: 220px; font-size: 1.05rem; }
details.more { border-top: 1px solid var(--line); padding-top: .75rem; }
details.more summary { cursor: pointer; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.next { color: var(--muted); }
.next b { color: var(--ink); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--panel-dark); color: #fff; padding: clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 79px, rgba(255,255,255,.07) 79px 81px); pointer-events: none; }
.login-art h1 { font-size: clamp(3rem, 8vw, 6rem); line-height: .88; }
.login-art p { opacity: .75; font-size: 1.05rem; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-form form { width: min(380px, 100%); display: grid; gap: 1rem; }
@media (max-width: 820px) { .login { grid-template-columns: 1fr; } .login-art { min-height: 34vh; } }

.err { color: var(--bad); font-weight: 600; }
#toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: .7rem 1.1rem; border-radius: var(--r-s); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.error { background: var(--bad); color: #fff; }
.offline-pill { background: var(--warn-soft); color: var(--warn); padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
