:root {
  --bg: #f3f6f4;
  --panel: #ffffff;
  --panel-2: #f7faf8;
  --line: #dde6e0;
  --text: #15241c;
  --muted: #5f7268;
  --accent: #129b4c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(18,155,76,.10);
  --home: #18a957;
  --away: #2f7de1;
  --warn: #b7791f;
  --bad: #d64545;
  --header: #ffffff;
  --shadow: 0 1px 2px rgba(16,36,26,.06), 0 2px 8px rgba(16,36,26,.04);
  --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }

.top { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--header); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 20px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.tagline { color: var(--muted); font-size: 14px; }

.layout { max-width: 1240px; margin: 0 auto; padding: 20px 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
h1 { font-size: 20px; margin: 0; }
h1 small { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 6px; }
h2 { font-size: 16px; margin: 0 0 4px; }
h3 { font-size: 14px; margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.updated, .hint { color: var(--muted); font-size: 13px; }
.intro { margin: -6px 0 14px; }
.empty { color: var(--muted); padding: 20px; text-align: center; background: var(--panel); border-radius: var(--radius); margin: 0; }

.cards { display: grid; gap: 10px; }
.card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; color: var(--text); width: 100%; text-align: left; font: inherit;
}
.card:hover, .card.active { border-color: var(--accent); }
.card .league { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.card .league img { width: 16px; height: 16px; object-fit: contain; }
.team { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.away { justify-content: flex-end; text-align: right; }
.team img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.score { text-align: center; min-width: 72px; }
.score b { font-size: 20px; letter-spacing: .04em; }
.score small { display: block; color: var(--muted); font-size: 12px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.live { background: rgba(183,121,31,.12); color: var(--warn); }
.badge.hit { background: var(--accent-soft); color: var(--accent); }
.badge.miss { background: rgba(214,69,69,.10); color: var(--bad); }
.card, .hit, .note, .detail { box-shadow: var(--shadow); }
.badge.void { background: var(--panel-2); color: var(--muted); }

.tg-join { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; padding: 10px 14px; border-radius: 10px;
  background: #e8f4fc; border: 1px solid #b9dcf3; color: var(--text); }
.tg-join:hover { text-decoration: none; border-color: #229ed9; }
.tg-join svg { width: 28px; height: 28px; flex: none; fill: #229ed9; }
.tg-join span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tg-join small { color: var(--muted); font-size: 13px; }
.tg-join em { font-style: normal; font-weight: 600; background: #229ed9; color: #fff; padding: 6px 14px; border-radius: 8px; flex: none; }

.record { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 10px; }
.record:empty { display: none; }
.record-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.record-box span, .record-box small { color: var(--muted); font-size: 12px; }
.record-box b { font-size: 20px; color: var(--accent); }
.record-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }

.sidebar { display: flex; flex-direction: column; gap: 12px; }
.hits { display: grid; gap: 8px; }
.hit { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--text); text-align: left; width: 100%; }
.hit:hover { border-color: var(--accent); }
.hit b { display: block; font-size: 14px; }
.hit span { color: var(--muted); font-size: 12px; }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-size: 13px; color: var(--muted); }
.note strong { color: var(--text); }

.detail { background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius); padding: 18px; position: relative; scroll-margin-top: 12px; }
.feed > .detail { margin-bottom: 16px; }
.card { scroll-margin-top: 12px; }
.detail .close { position: absolute; top: 10px; right: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; }
.match-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; text-align: center; margin: 10px 0 6px; }
.match-head .side { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.match-head .side img { width: 54px; height: 54px; object-fit: contain; }
.match-head .big { font-size: 34px; font-weight: 800; letter-spacing: .05em; }
.meta { color: var(--muted); font-size: 13px; text-align: center; margin-bottom: 14px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 0 70px; }
.meta img { width: 20px; height: 20px; object-fit: contain; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.box { min-width: 0; }
.box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.box + .box, .grid-2 + .box, .box + .grid-2 { margin-top: 14px; }

.gauge { display: flex; align-items: center; gap: 16px; }
.gauge-ring { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.gauge-ring span { width: 72px; height: 72px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.parts { display: grid; gap: 6px; flex: 1; font-size: 13px; }
.part { display: grid; grid-template-columns: 110px 1fr 28px; gap: 8px; align-items: center; }
.part i { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.part i b { display: block; height: 100%; background: var(--accent); }

.stat { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.stat .label { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 12px; margin-bottom: -4px; }
.stat .v { font-weight: 700; }
.stat .v.r { text-align: right; }
.bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.bar .h { background: var(--home); }
.bar .a { background: var(--away); margin-left: auto; }

.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.events li { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); gap: 8px; align-items: center; overflow-wrap: anywhere; }
.events .min { text-align: center; color: var(--muted); font-weight: 700; }
.events .home { text-align: right; }
.ev-goal { color: var(--accent); font-weight: 700; }
.ev-card-y { color: var(--warn); }
.ev-card-r { color: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; }
td.n, th.n { text-align: right; }
tr.hl-home td { background: rgba(24,169,87,.10); }
tr.hl-away td { background: rgba(47,125,225,.10); }
td .tm { display: flex; align-items: center; gap: 6px; }
td .tm img { width: 18px; height: 18px; object-fit: contain; }
.table-wrap { max-height: 360px; overflow: auto; }

.prob { display: flex; height: 26px; border-radius: 8px; overflow: hidden; font-size: 12px; font-weight: 700; }
.prob div { display: grid; place-items: center; min-width: 0; color: #fff; }
.prob .h { background: var(--home); } .prob .d { background: #9aa8a0; } .prob .a { background: var(--away); }
.legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }

svg.chart { width: 100%; height: 160px; display: block; }
svg.chart .axis { stroke: var(--line); }
svg.chart text { fill: var(--muted); font-size: 10px; }

.locked { position: relative; overflow: hidden; min-height: 300px; }
.locked .blur { filter: blur(7px); pointer-events: none; user-select: none; opacity: .7; }
.locked .unlock { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; }
.locked .unlock div { background: rgba(255,255,255,.95); box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; max-width: 360px; }
button.primary, .consent button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 9px; padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; }
button.ghost, .consent button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }

.foot { border-top: 1px solid var(--line); padding: 20px 24px 28px; text-align: center; color: var(--muted); font-size: 13px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 8px; }
.foot p { margin: 4px 0; }

.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 720px; margin: 0 auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 16px; align-items: center; justify-content: space-between; z-index: 10; box-shadow: 0 10px 30px rgba(16,36,26,.15); background: var(--panel); }
.consent p { margin: 0; font-size: 13px; }
.consent div { display: flex; gap: 8px; flex: none; }

.doc { max-width: 820px; margin: 0 auto; padding: 24px 24px 48px; }
.doc h1 { font-size: 26px; margin-bottom: 4px; }
.doc h2 { font-size: 18px; margin: 28px 0 8px; }
.doc p, .doc li { color: #2c3d34; }
.doc .muted { color: var(--muted); }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .meta { padding: 0; }
  .detail { padding: 46px 12px 14px; }
}
@media (max-width: 520px) {
  .top { padding: 12px 16px; }
  .tagline { display: none; }
  .card { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .table-wrap, .box table { display: block; overflow-x: auto; }
  .card .badge { grid-column: 1 / -1; justify-self: center; }
  .match-head .big { font-size: 26px; }
  .match-head .side img { width: 40px; height: 40px; }
  .part { grid-template-columns: 90px 1fr 24px; }
  .consent { flex-direction: column; align-items: stretch; }
}
