:root {
  --ink: #17211c; --ink2: #5a6560; --teal: #cc141c; --teal-soft: #fbe9ea;
  --gold: #d9a441; --card: #ffffff; --bg: #f2f5f3; --line: #e3e8e5;
  --red: #c8352f; --sand: #f6f1e7; --topbar: #a80e17;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
#topbar { position: sticky; top: 0; z-index: 20; background: var(--topbar); color: #fff; padding: 10px 14px calc(10px); padding-top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.brand-icon { width: 34px; height: 34px; border-radius: 8px; }
#topbar h1 { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
#topbar p { font-size: 11.5px; color: #f5c6ca; }
#mode-badge { font-size: 10.5px; background: rgba(255,255,255,.14); border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
#mode-badge.live { background: #fff; color: #a80e17; font-weight: 600; }
main { padding: 14px 14px 90px; max-width: 720px; margin: 0 auto; }
#tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabbar a { flex: 1; text-align: center; padding: 11px 0 12px; color: var(--ink2); text-decoration: none; font-size: 12.5px; font-weight: 600; }
#tabbar a.active { color: var(--teal); box-shadow: inset 0 2px 0 var(--teal); }
.card { overflow-wrap: anywhere; background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(20,40,30,.06); }
.card h2 { font-size: 15px; margin-bottom: 10px; }
.card h2 .sub { display: block; font-size: 11.5px; color: var(--ink2); font-weight: 500; margin-top: 2px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { min-width: 0; }
.tile { background: var(--teal-soft); border-radius: 12px; padding: 10px 12px; }
.tile b { display: block; font-size: 21px; color: var(--teal); }
.tile span { font-size: 11.5px; color: var(--ink2); }
.podium { display: flex; flex-direction: column; gap: 8px; }
.podium-row { display: flex; align-items: center; gap: 10px; }
.medal { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: #9aa7a1; flex: none; }
.medal.m1 { background: var(--gold); } .medal.m2 { background: #8d9aa4; } .medal.m3 { background: #b07a4f; }
.podium-row .name { flex: 1; font-weight: 600; }
.podium-row .name small { display: block; color: var(--ink2); font-weight: 400; font-size: 11.5px; }
.podium-row .pts { font-weight: 700; color: var(--teal); }
.statements { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.statement { scroll-snap-align: start; flex: 0 0 82%; background: linear-gradient(135deg, #7f0a11, #cc141c); color: #fff; border-radius: 14px; padding: 14px 16px; }
.statement p { font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.statement small { display: block; margin-top: 8px; color: #f0b9bd; font-size: 11px; }
table.rank { width: 100%; border-collapse: collapse; }
table.rank th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink2); text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.rank th:first-child, table.rank td:first-child { text-align: left; }
table.rank td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.rank tr:last-child td { border-bottom: 0; }
table.rank .pname { text-align: left; font-weight: 600; }
table.rank .pname small { display: block; font-weight: 400; color: var(--ink2); font-size: 11px; }
.badge { display: inline-block; font-size: 10px; font-weight: 600; border-radius: 99px; padding: 1px 7px; margin-left: 5px; vertical-align: 1px; }
.badge.neu { background: var(--teal-soft); color: var(--teal); }
.badge.offen { background: #fdf0dd; color: #9a6a12; }
.badge.conflict { background: #fbe7e6; color: var(--red); }
.badge.ok { background: var(--teal-soft); color: var(--teal); }
.chips { display: flex; gap: 6px; margin-bottom: 10px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.day { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.day .date { flex: none; width: 62px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.day .date small { display: block; color: var(--ink2); font-weight: 500; font-size: 10.5px; }
.day .score { font-size: 18px; font-weight: 800; color: var(--ink); flex: none; min-width: 52px; }
.day .score.cancelled { color: var(--ink2); font-size: 12px; font-weight: 600; }
.day .meta { flex: 1; font-size: 12px; color: var(--ink2); min-width: 0; }
.day .icons { flex: none; display: flex; gap: 4px; }
.divider { height: 1px; background: var(--line); margin: 10px -14px 10px; }
.notice { background: var(--sand); border-radius: 12px; padding: 11px 13px; font-size: 12.5px; color: #6d5c33; }
.notice.red { background: #fbe7e6; color: #8e2b26; }
.notice b { display: block; margin-bottom: 2px; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team { background: var(--bg); border-radius: 10px; padding: 10px; }
.team h3 { font-size: 12px; color: var(--ink2); margin-bottom: 6px; }
.team ul { padding-left: 16px; font-size: 13px; }
.photos { display: flex; gap: 8px; overflow-x: auto; }
.photos img { height: 150px; border-radius: 10px; flex: none; }
.btn { display: block; width: 100%; border: 0; border-radius: 12px; background: var(--teal); color: #fff; font-size: 15px; font-weight: 700; padding: 13px; text-align: center; cursor: pointer; text-decoration: none; }
.btn.secondary { background: #fff; color: var(--teal); border: 1.5px solid var(--teal); }
.btn.ghost { background: transparent; color: var(--ink2); font-weight: 600; font-size: 13px; padding: 8px; }
.btn:disabled { opacity: .45; }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); margin: 10px 0 4px; }
input[type=text], input[type=date], input[type=number], select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; background: #fff; color: var(--ink); }
input[type=number] { padding: 8px 10px; }
.rrow { display: grid; grid-template-columns: 1fr 58px 58px 30px; gap: 6px; align-items: center; margin-bottom: 6px; }
.rrow .del { border: 0; background: none; color: var(--red); font-size: 17px; }
.rhead { display: grid; grid-template-columns: 1fr 58px 58px 30px; gap: 6px; font-size: 10.5px; color: var(--ink2); font-weight: 700; margin-bottom: 4px; }
.rhead span:nth-child(2), .rhead span:nth-child(3) { text-align: center; }
.scoreline { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-preview { width: 100%; border-radius: 12px; }
#overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8,18,14,.92); display: flex; align-items: center; justify-content: center; padding: calc(env(safe-area-inset-top, 0px) + 52px) 12px calc(env(safe-area-inset-bottom, 0px) + 76px); }
#overlay img { max-width: 100%; max-height: 100%; border-radius: 8px; }
#overlay .close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 8px); right: 14px; background: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 17px; }
#overlay .close-bottom { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); background: #fff; border: 0; border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 700; color: #a80e17; }
.audit { font-size: 12px; color: var(--ink2); }
.audit li { margin-bottom: 6px; }
ul.clean { list-style: none; padding: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; }
.kv dt { color: var(--ink2); } .kv dd { margin: 0; font-weight: 600; text-align: right; }
.footnote { font-size: 11px; color: var(--ink2); margin-top: 10px; }
.player-link { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.center { text-align: center; }
.tablescroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.rank.full { min-width: 640px; }
table.rank.full th { cursor: pointer; user-select: none; white-space: nowrap; }
table.rank.full th.sorted { color: var(--teal); }
table.rank.full .sticky { position: sticky; left: 0; background: var(--card); z-index: 2; min-width: 118px; max-width: 118px; box-shadow: 1px 0 0 var(--line); padding-left: 14px; }
table.rank.full td { white-space: nowrap; }
#overlay[hidden] { display: none; }

/* Mobile-first Rangliste */
.metric-chips { flex-wrap: wrap; }
.ranklist { padding: 6px 0; }
.rankrow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line, #e6eae7); }
.rankrow:last-of-type { border-bottom: 0; }
.ranknr { width: 26px; font-weight: 700; color: var(--ink2, #5b6b62); text-align: right; flex: none; }
.rankname { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.rankname small { display: block; font-weight: 400; font-size: 12px; color: var(--ink2, #5b6b62); margin-top: 2px; }
.rankval { font-size: 20px; font-weight: 800; color: var(--teal, #cc141c); flex: none; }
.fulldetails { margin-top: 10px; }
.fulldetails summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 12px 14px; }

.eyebrow { font-size: 12px; letter-spacing: .4px; text-transform: uppercase; color: var(--ink2); margin: 0 0 4px; }
a.card.hero { display: block; text-decoration: none; color: inherit; }
.hero-score { font-size: 40px; font-weight: 800; text-align: center; margin: 2px 0 10px; }
.hero-top { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.hero-pill { background: var(--bg2, #eef3f0); border-radius: 999px; padding: 5px 10px; font-size: 13px; }
.medal.mup { background: var(--teal); font-size: 12px; }
.chip.disabled { opacity: .4; pointer-events: none; }
.chips.months { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.chips.months::-webkit-scrollbar { display: none; }
.chips.months .chip { flex: none; }

a.card.hero { background: linear-gradient(150deg, #8f0a12, #cc141c 65%); color: #fff; border-radius: 16px; box-shadow: 0 6px 18px rgba(168, 14, 23, .28); }
a.card.hero .eyebrow { color: #f3c4c7; }
a.card.hero .hero-pill { background: rgba(255, 255, 255, .16); color: #fff; }
a.card.hero .hero-pill b { color: #ffd9dc; }
a.card.hero .footnote { color: #f3c4c7; }

.story-hero-line { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--teal-soft); border-radius: 12px; margin-bottom: 8px; }
.story-hero-line .medal.big { width: 34px; height: 34px; font-size: 15px; flex: none; }
.story-hero-line b { font-size: 16px; }
.story-hero-line small { display: block; color: var(--ink2); font-size: 12px; font-weight: 400; }
.story-hero-line .story-pts { margin-left: auto; font-size: 24px; font-weight: 800; color: var(--teal); }
.quiet-sources { font-size: 12px; color: var(--ink2); margin: 2px 2px 12px; }
.quiet-sources summary { cursor: pointer; }

/* Story-Cards (Highlights) */
.card.story { text-align: center; padding-bottom: 18px; }
.card.story .podium { text-align: left; margin: 10px 0 12px; }
.story-line { font-size: 17px; font-weight: 600; line-height: 1.45; margin: 4px 0 8px; }
.story-big { font-size: 46px; font-weight: 800; color: var(--teal); line-height: 1.05; }
.story-sub { color: var(--ink2); font-size: 13px; margin: 4px 0 6px; }
.story-jump { font-size: 30px; font-weight: 800; color: var(--teal); margin: 8px 0 2px; }
.story-jump .arrow { color: #c9a227; }
.hero-cta { display: inline-block; background: #fff; color: var(--kjg-red, #cc141c); border-radius: 999px; padding: 8px 18px; font-size: 13.5px; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.nickline { display: flex; gap: 8px; margin-top: 8px; }
.nickline input { flex: 1; border: 1.5px solid var(--line, #d8e0dc); border-radius: 10px; padding: 10px 12px; font-size: 16px; }
