:root {
  --bg: #0b1410; --bg2: #101d17; --card: #15241d; --card2: #1b2e25; --line: #27402f; --text: #e8f1ec; --muted: #93a89c;
  --green: #22c55e; --green2: #16a34a; --gold: #facc15; --red: #ef4444; --amber: #f59e0b; --blue: #60a5fa; --pitch: #14532d; --pitch2: #166534;
  --radius: 14px; --nav-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); min-height: 100vh; }
body.no-nav { padding-bottom: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--green); }

/* Kopf + Navigation */
.hdr { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(11, 20, 16, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.hdr .ttl { flex: 1; min-width: 0; }
.hdr .ttl b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr .ttl small { color: var(--muted); font-size: 12px; }
.hdr .ico { background: none; border: 0; font-size: 20px; padding: 6px; cursor: pointer; border-radius: 10px; }
.hdr .back { background: var(--card); border: 1px solid var(--line); border-radius: 10px; width: 36px; height: 36px; cursor: pointer; font-size: 18px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--bg2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav button { flex: 1; background: none; border: 0; color: var(--muted); padding: 8px 2px 10px; font-size: 11px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: var(--nav-h); justify-content: center; }
.nav button span { font-size: 21px; line-height: 1; }
.nav button.on { color: var(--green); font-weight: 700; }
body.no-nav .nav { display: none; }

.wrap { max-width: 760px; margin: 0 auto; padding: 14px 16px 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card.hl { border-color: var(--green2); box-shadow: 0 0 0 1px var(--green2) inset; }
.card.warn { border-color: var(--amber); }
.card.live { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.sec { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrapx { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.big { font-size: 28px; font-weight: 800; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hide { display: none !important; }
h1 { font-size: 22px; margin: 6px 0 4px; }
h2 { font-size: 18px; margin: 0 0 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 11px 16px; background: var(--green2); color: #fff; font-weight: 700; cursor: pointer; min-height: 44px; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sec2 { background: var(--card2); border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: #7f1d1d; }
.btn.sm { padding: 7px 11px; min-height: 36px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--green); cursor: pointer; padding: 4px; text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card2); border-radius: 20px; padding: 8px 13px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 38px; }
.chip.on { background: var(--green2); border-color: var(--green2); color: #fff; }
.in { width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 44px; }
.in:focus { outline: 2px solid var(--green2); border-color: transparent; }
.lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 12px 0 5px; }
.err { color: #fca5a5; font-size: 13.5px; min-height: 18px; margin-top: 8px; }
select.in { appearance: auto; }

/* Vereinswappen */
.badge { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 800; font-size: 11px; flex: none; border: 2px solid rgba(255,255,255,.25); letter-spacing: -.02em; }
.badge.lg { width: 56px; height: 56px; font-size: 16px; }
.badge.sm { width: 24px; height: 24px; font-size: 8.5px; border-width: 1px; }

/* Anzeigetafel */
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.score .t { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; font-weight: 700; font-size: 14px; }
.score .t span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.score .res { font-size: 34px; font-weight: 900; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 800; background: var(--card2); border: 1px solid var(--line); }
.pill.live { background: var(--red); border-color: var(--red); color: #fff; animation: pulse 1.6s infinite; }
.pill.ok { background: rgba(34,197,94,.15); border-color: var(--green2); color: #86efac; }
.pill.warn { background: rgba(245,158,11,.15); border-color: var(--amber); color: #fcd34d; }
@keyframes pulse { 50% { opacity: .65; } }

/* Tabelle */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: right; color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--line); }
td { text-align: right; padding: 8px 4px; border-bottom: 1px solid rgba(39,64,47,.6); font-variant-numeric: tabular-nums; }
th.l, td.l { text-align: left; }
tr.mine td { background: rgba(34,197,94,.10); font-weight: 700; }
tr.up td:first-child { box-shadow: 3px 0 0 var(--green) inset; }
tr.down td:first-child { box-shadow: 3px 0 0 var(--red) inset; }
tr.click { cursor: pointer; }
.tclub { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tclub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-dots { display: inline-flex; gap: 2px; }
.form-dots i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.fS { background: var(--green); } .fU { background: var(--muted); } .fN { background: var(--red); }

/* Listen */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid rgba(39,64,47,.7); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; }
.item:last-child { border-bottom: 0; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: var(--card2); border: 1px solid var(--line); color: var(--muted); }
.tag.GK { color: #fde68a; } .tag.D { color: #93c5fd; } .tag.M { color: #86efac; } .tag.W { color: #c4b5fd; } .tag.F { color: #fca5a5; }
.skillchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.sk { font-size: 11.5px; padding: 1px 6px; border-radius: 6px; background: var(--bg2); color: var(--muted); }
.sk b { color: var(--text); }

/* Fähigkeits-Balken */
.bar { height: 8px; border-radius: 6px; background: var(--bg2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--green2), var(--green)); }
.skillrow { display: grid; grid-template-columns: 105px 1fr 118px; gap: 8px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.skillrow .w { text-align: right; font-size: 12.5px; }
.stars { color: var(--gold); letter-spacing: -1px; white-space: nowrap; }

/* Spielfeld (Aufstellung) */
.pitch { background: repeating-linear-gradient(180deg, var(--pitch) 0 44px, var(--pitch2) 44px 88px); border-radius: var(--radius); padding: 12px 6px; position: relative; border: 2px solid rgba(255,255,255,.18); }
.pitch::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: 0; height: 40px; border: 2px solid rgba(255,255,255,.15); border-bottom: 0; }
.prow { display: flex; justify-content: space-around; gap: 4px; margin: 10px 0; position: relative; z-index: 1; }
.slot { flex: 1; max-width: 118px; min-width: 0; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 6px 4px; text-align: center; cursor: pointer; color: #fff; min-height: 58px; }
.slot .pos { font-size: 10.5px; font-weight: 800; opacity: .8; }
.slot .nm { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .val { font-size: 11px; opacity: .85; }
.slot.empty { border-style: dashed; background: rgba(0,0,0,.15); }
.slot.bad { border-color: var(--amber); background: rgba(245,158,11,.25); }
.slot .ord { font-size: 10px; background: rgba(255,255,255,.2); border-radius: 5px; padding: 0 4px; }
.cmp { display: grid; grid-template-columns: 1fr 110px 1fr; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; }
.cmp .l { text-align: right; } .cmp .c { text-align: center; color: var(--muted); font-size: 12px; }
.cmpbar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--bg2); }
.cmpbar i:first-child { background: var(--green); } .cmpbar i:last-child { background: var(--blue); }

/* Ticker */
.ticker { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 42px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid rgba(39,64,47,.6); font-size: 14px; }
.ev .m { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev.goal { background: rgba(34,197,94,.10); border-radius: 10px; padding-left: 6px; padding-right: 6px; }
.ev.goal .txt { font-weight: 700; }
.ev.key { color: var(--muted); font-style: italic; }
.ev.red .txt::before { content: '🟥 '; } .ev.yellow .txt::before { content: '🟨 '; } .ev.injury .txt::before { content: '🚑 '; } .ev.knock .txt::before { content: '🩹 '; }
.ev.side-a .m { color: var(--blue); } .ev.side-h .m { color: var(--green); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { flex: 1; }

/* Unteres Blatt (Auswahl) */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--bg2); border-top-left-radius: 18px; border-top-right-radius: 18px; max-height: 86vh; overflow: auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); max-width: 760px; margin: 0 auto; }
.sheet h3 { margin: 0 0 10px; font-size: 17px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); background: #052e16; border: 1px solid var(--green2); color: #dcfce7; padding: 10px 16px; border-radius: 12px; z-index: 60; font-size: 14px; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.bad { background: #450a0a; border-color: var(--red); color: #fee2e2; }

/* News */
.news { border-bottom: 1px solid rgba(39,64,47,.7); padding: 10px 0; }
.news:last-child { border-bottom: 0; }
.news summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.news summary::-webkit-details-marker { display: none; }
.news ul { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.news li { margin: 3px 0; }

.auth { max-width: 420px; margin: 0 auto; padding: 40px 16px; }
.auth .logo { font-size: 54px; text-align: center; }
.test-banner { background: repeating-linear-gradient(45deg, #422006 0 12px, #3b1d05 12px 24px); border: 1px solid var(--amber); color: #fde68a; }
.sw { display: inline-block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.sw.on { outline: 3px solid var(--green); outline-offset: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

@media (min-width: 900px) {
  .wrap.wide { max-width: 1100px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
  .wrap.wide > .full { grid-column: 1 / -1; }
}

/* Zahlen-Darstellung 0.00–10.00 */
.sbar { position: relative; height: 13px; border-radius: 4px; background: #0a1510; overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.sbar i { position: absolute; left: 0; top: 0; bottom: 0; display: block; border-radius: 3px 0 0 3px; }
/* 10 gleich grosse Felder: Trennstriche über dem Balken */
.sbar::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 2px), #0b1410 calc(10% - 2px), #0b1410 10%); }
.sbar.top i { box-shadow: 0 0 10px #00e676; }
.skillrow { grid-template-columns: 96px 1fr 46px; }
.skillrow .w { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.strength { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.05; }
.strength small { font-size: 10px; font-weight: 700; color: var(--muted); }
.strength.lg { font-size: 30px; min-width: 84px; }
.note { display: inline-block; min-width: 38px; text-align: center; font-weight: 800; font-size: 12.5px; padding: 1px 6px; border: 1px solid; border-radius: 8px; font-variant-numeric: tabular-nums; }
.tstar { flex: none; vertical-align: middle; }
.sk b { font-variant-numeric: tabular-nums; }
.slot .val b { font-size: 12px; }

/* Trainingsplan: Prioritäten je Mannschaftsteil */
.trow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(39,64,47,.7); }
.trow:last-of-type { border-bottom: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.seg button { background: var(--card2); border: 0; border-left: 1px solid var(--line); color: var(--muted); font-weight: 800; min-width: 40px; min-height: 38px; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button.on { color: #fff; }
.seg button.on.p0 { background: #374151; }
.seg button.on.p1 { background: #a16207; }
.seg button.on.p2 { background: #15803d; }
.seg button.on.p3 { background: #16a34a; box-shadow: inset 0 0 0 2px #86efac; }
