:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #eef0ec;
  --ink: #15201b;
  --ink-2: #4a5650;
  --ink-3: #75817b;
  --line: #dde2dc;
  --accent: #0f7a4f;
  --accent-ink: #ffffff;
  --c1: #0f7a4f;
  --cx: #a7b0aa;
  --c2: #2e5fa8;
  --ok: #157a3c;
  --ok-bg: #e2f3e8;
  --no: #b3261e;
  --no-bg: #fbe7e5;
  --warn-bg: #fff4d6;
  --warn-ink: #6b4d00;
  --value: #7a3db8;
  --value-bg: #f1e8fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 2px 10px rgba(20, 30, 25, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1720;
    --surface: #17212b;
    --surface-2: #1e2a35;
    --ink: #e8eef0;
    --ink-2: #b4c0c6;
    --ink-3: #85939a;
    --line: #2a3843;
    --accent: #3ec98a;
    --accent-ink: #062014;
    --c1: #3ec98a;
    --cx: #5d6b74;
    --c2: #6f9ef0;
    --ok: #57d68f;
    --ok-bg: #12301f;
    --no: #ff8a80;
    --no-bg: #3a1a18;
    --warn-bg: #3a3012;
    --warn-ink: #f3d98a;
    --value: #c79bff;
    --value-bg: #2c1f40;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; margin-top: 1.1rem; color: var(--ink-2); }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
/* Fließendes Layout: nutzt die Fensterbreite, Ränder wachsen mit, ab 1800 px wird nicht weiter gestreckt */
.wrap { width: 100%; max-width: 1800px; margin: 0 auto;
        padding: 0 max(clamp(16px, 3vw, 48px), env(safe-area-inset-left)) 0 max(clamp(16px, 3vw, 48px), env(safe-area-inset-right)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Kopf */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; gap: 1rem; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; }
.bm-ring { fill: none; stroke: var(--accent); stroke-width: 2; }
.bm-pent { fill: var(--accent); }
.nav { display: flex; gap: .25rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { text-decoration: none; padding: .45rem .7rem; border-radius: 999px; color: var(--ink-2); font-size: .95rem; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--ink); color: var(--bg); }
@media (max-width: 560px) {
  .top-row { padding-top: .4rem; padding-bottom: .4rem; }
  .nav { margin-left: 0; width: 100%; }
}

.disclaimer { background: var(--warn-bg); color: var(--warn-ink); font-size: .85rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.main { padding-top: 1.25rem; padding-bottom: 2rem; }
.foot { color: var(--ink-3); font-size: .8rem; padding-bottom: 2.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.foot p { margin: .25rem 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font: inherit; }

/* Seitentitel */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.eyebrow { margin: 0 0 .2rem; color: var(--ink-3); font-size: .85rem; font-weight: 500; }
.back { margin: 0 0 .75rem; font-size: .9rem; }
.back a { color: var(--ink-2); text-decoration: none; }
.mdpick { display: flex; align-items: center; gap: .4rem; }
select, input {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: .5rem .7rem; min-height: 44px; font-size: 16px;
}
.iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); font-size: 1.3rem; line-height: 1;
}
.iconbtn:hover { background: var(--surface-2); }
.btn, .btn-small {
  font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px;
  padding: .6rem 1rem; min-height: 44px; cursor: pointer;
}
.btn-small { padding: .4rem .8rem; }
.js .js-hide { display: none; }

.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-3); margin-bottom: .75rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.pb-1 { background: var(--c1); } .dot.pb-x { background: var(--cx); } .dot.pb-2 { background: var(--c2); }

/* Karten */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
@media (max-width: 380px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-link { display: block; padding: .9rem 1rem 1rem; text-decoration: none; border-radius: inherit; }
.card-link:hover { background: color-mix(in oklab, var(--surface) 92%, var(--accent)); }
.card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.is-done { opacity: .92; }
.card-meta { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--ink-3); margin-bottom: .6rem; }

.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; }
.team { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.team-away { justify-content: flex-end; text-align: right; }
.tname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { text-align: center; min-width: 3.2rem; }
.final { font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.vs { color: var(--ink-3); }
.live { font-size: .75rem; font-weight: 700; color: var(--no); text-transform: uppercase; letter-spacing: .04em; }
.crest { flex: none; object-fit: contain; }
.crest-md { width: 28px; height: 28px; }
.crest-lg { width: 56px; height: 56px; }
.crest-blank { display: inline-grid; place-items: center; background: var(--surface-2); border-radius: 50%; font-weight: 700; color: var(--ink-3); }

.probbar { display: block; width: 100%; height: 8px; border-radius: 999px; margin: .8rem 0 .45rem; overflow: hidden; }
.pb-1 { fill: var(--c1); } .pb-x { fill: var(--cx); } .pb-2 { fill: var(--c2); }
.probs { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.probs .hi { color: var(--ink); font-weight: 700; }
.card-foot { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; min-height: 30px; }
.why { font-size: .82rem; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.tip { display: inline-flex; align-items: stretch; border-radius: 8px; overflow: hidden; flex: none; font-size: .8rem; border: 1px solid var(--line); }
.tip-k { background: var(--ink); color: var(--bg); font-weight: 800; padding: .2rem .55rem; }
.tip-c { padding: .2rem .5rem; color: var(--ink-2); }
.tip-hoch .tip-k { background: var(--accent); color: var(--accent-ink); }

.chip { display: inline-block; font-size: .72rem; font-weight: 600; padding: .12rem .45rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip-lock { background: var(--surface-2); }
.chip-value { background: var(--value-bg); color: var(--value); }
.chip-injury, .chip-illness, .chip-suspension { background: var(--no-bg); color: var(--no); }
.chip-doubtful { background: var(--warn-bg); color: var(--warn-ink); }
.chip-coach { background: var(--warn-bg); color: var(--warn-ink); }
.chip-key { background: var(--ink); color: var(--bg); }
.verdict { font-size: .78rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.no { background: var(--no-bg); color: var(--no); }

/* Detail */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.1rem 1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.teams-lg .tname { font-size: clamp(1rem, 3.5vw, 1.35rem); white-space: normal; }
.teams-lg .final { font-size: 2rem; }
@media (max-width: 520px) {
  .teams-lg { grid-template-columns: 1fr auto 1fr; }
  .teams-lg .team { flex-direction: column; text-align: center; }
  .teams-lg .team-away { flex-direction: column-reverse; }
  .crest-lg { width: 44px; height: 44px; }
}
.probs-lg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.probs-lg > div { background: var(--surface-2); border-radius: 10px; padding: .5rem .6rem; display: grid; }
.probs-lg .k { font-weight: 800; font-size: .8rem; color: var(--ink-3); }
.probs-lg .v { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.probs-lg .l { font-size: .75rem; color: var(--ink-3); }
.probs-lg .hi { outline: 2px solid var(--accent); }
.hero-foot { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; font-size: .9rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); min-width: 0; }
details.panel summary { cursor: pointer; font-weight: 600; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0 1rem; }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.reasons li { padding: .45rem .6rem .45rem .7rem; border-left: 3px solid var(--cx); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: .92rem; }
.reasons .side-home { border-left-color: var(--c1); }
.reasons .side-away { border-left-color: var(--c2); }
.reasons .who { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }

.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: .4rem .35rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl thead th { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.tbl tbody th { font-weight: 500; color: var(--ink-2); }
.tbl tr.mark td { background: color-mix(in oklab, var(--surface) 85%, var(--accent)); font-weight: 600; }
.tbl-hist a { text-decoration: none; font-weight: 500; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.res { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: .72rem; font-weight: 800; }
.res-S { background: var(--ok-bg); color: var(--ok); }
.res-U { background: var(--surface-2); color: var(--ink-2); }
.res-N { background: var(--no-bg); color: var(--no); }
.str { font-size: .7rem; color: var(--ink-3); }
.str-stark { color: var(--no); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; font-size: .92rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
@media (max-width: 420px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: .4rem; } }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; font-size: .92rem; }
.news { padding-left: 1.1rem; margin: 0; display: grid; gap: .35rem; font-size: .9rem; }
.news a { text-decoration: none; }
.news a:hover, .src:hover { text-decoration: underline; }
.src { font-size: .78rem; color: var(--ink-3); text-decoration: none; margin-left: .25rem; }

/* Historie */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg a { text-decoration: none; padding: .35rem .8rem; border-radius: 999px; font-size: .9rem; color: var(--ink-2); }
.seg a.on { background: var(--ink); color: var(--bg); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; display: grid; }
.stat-v { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-v.pos { color: var(--ok); } .stat-v.neg { color: var(--no); }
.stat-l { font-size: .78rem; color: var(--ink-3); }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.2rem; color: var(--ink-2); list-style: none; }
.notice { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: .6rem .9rem; margin-bottom: 1rem; }
.row-form { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.flash { margin-bottom: 1rem; }
.tlink { text-decoration: none; }
.tlink:hover { text-decoration: underline; }
.h-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.notes { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .35rem; font-size: .92rem; }
.notes li { display: flex; gap: .5rem; align-items: baseline; }
.notes .sign { flex: none; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: inline-grid; place-items: center;
               font-weight: 800; font-size: .8rem; background: var(--surface-2); color: var(--ink-2); }
.notes .note-plus .sign { background: var(--ok-bg); color: var(--ok); }
.notes .note-minus .sign { background: var(--no-bg); color: var(--no); }
.notes.compact { font-size: .85rem; }
.dossier-head .team { gap: 1rem; }
.squad { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: .4rem 1.2rem; }
.squad h3 { margin-top: .4rem; }
.squad-list { gap: .25rem; font-size: .9rem; }
.squad-list li { display: grid; grid-template-columns: 2rem 1fr; gap: .4rem; align-items: baseline; }
.squad-list .num { text-align: right; }
.squad-list li.is-out > span:last-child { color: var(--no); }
.dossier-head h1 { margin-bottom: .2rem; }
.invite-text { width: 100%; font: .85rem/1.45 var(--mono); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; resize: vertical; }
.userrow.is-new { background: color-mix(in oklab, var(--surface) 88%, var(--accent)); border-radius: 10px; padding-left: .6rem; padding-right: .6rem; }
.invite { margin-top: .4rem; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
a.btn-small { text-decoration: none; display: inline-flex; align-items: center; }
.sendbar { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin: -.25rem 0 1rem; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: .45rem; }
.btn-ghost:hover { background: var(--surface-2); }
.ico { width: 18px; height: 18px; fill: #2aa3e0; flex: none; }
.danger { color: var(--no); }
.form-gap { margin-top: 1.2rem; }
.narrow { max-width: 420px; }
.stack label.check, .setting label.check { display: inline-flex; gap: .5rem; align-items: center; color: var(--ink); }
.check input { width: 18px; height: 18px; flex: none; }
.checks { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.checks legend { font-weight: 600; margin-bottom: .4rem; font-size: .95rem; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.userlist { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; }
.userrow { border-bottom: 1px solid var(--line); padding: .6rem 0; }
.userhead { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.userrow details { margin-top: .3rem; }
.userrow label { display: inline-grid; gap: .2rem; }
.setting { display: grid; gap: .35rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.setting > label:first-child { font-weight: 600; }
.setting-state { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
details summary { cursor: pointer; }
.paircode code { font-size: 1.3rem; padding: .3rem .7rem; user-select: all; }
.check { display: inline-flex; gap: .4rem; align-items: center; font-size: .9rem; }
.check input { min-height: auto; }

/* Login */
.login { max-width: 400px; margin: 2rem auto; }
.stack { display: grid; gap: .8rem; }
.stack label { display: grid; gap: .3rem; font-size: .9rem; color: var(--ink-2); }
.error { background: var(--no-bg); color: var(--no); padding: .5rem .7rem; border-radius: 8px; }

@media (prefers-reduced-motion: no-preference) {
  .card-link, .nav a, .iconbtn { transition: background-color .15s ease; }
}

/* Breite Fenster: Detailseiten in mehr Spalten, Texte nicht endlos breit */
@media (min-width: 1400px) {
  .cols { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
  .hero { max-width: 1100px; }
  .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (min-width: 1100px) { .settings-form { max-width: 900px; } }
/* Mittlere Breiten (Tablet): Navigation darf umbrechen statt abgeschnitten zu werden */
@media (min-width: 561px) and (max-width: 980px) {
  .nav { flex-wrap: wrap; justify-content: flex-end; }
}
.panel, .card, .hero { min-width: 0; }
.tbl { table-layout: auto; }

.qr svg { width: 220px; height: 220px; background: #fff; border-radius: 10px; padding: 6px; }
