:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --bg-2: #11161f;
  --surface: #151b26;
  --surface-2: #1b2230;
  --line: #263042;
  --line-soft: #1e2635;
  --text: #eef1f6;
  --text-2: #b4bccb;
  --muted: #7d8799;
  --accent: #46c2a0;
  --accent-2: #f2a65a;
  --succ: #3987e5;
  --avg: #8b93a3;
  --poor: #e0703a;
  --up: #3987e5;
  --down: #e0703a;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --chip: #1f2737;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.25);
  --glow: radial-gradient(1200px 500px at 15% -10%, rgba(70,194,160,.13), transparent 60%),
          radial-gradient(900px 500px at 95% 0%, rgba(242,166,90,.09), transparent 60%);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f5f1; --bg-2: #efede7; --surface: #ffffff; --surface-2: #f7f6f2;
  --line: #e2dfd7; --line-soft: #ece9e2;
  --text: #14171c; --text-2: #4c525c; --muted: #7a7f88;
  --accent: #128a6c; --accent-2: #c86a17;
  --succ: #2a78d6; --avg: #8a8f98; --poor: #d0581f; --up: #2a78d6; --down: #d0581f;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --chip: #f0eee8;
  --shadow: 0 1px 2px rgba(20,23,28,.05), 0 8px 24px rgba(20,23,28,.05);
  --glow: radial-gradient(1200px 500px at 15% -10%, rgba(18,138,108,.08), transparent 60%),
          radial-gradient(900px 500px at 95% 0%, rgba(200,106,23,.06), transparent 60%);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); background-image: var(--glow); background-attachment: fixed;
  color: var(--text); font: 15px/1.55 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; }
h1, h2, h3, .display { font-family: "Space Grotesk", Inter, sans-serif; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.05; font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); } .t2 { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }

/* header */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line-soft); }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 32px; height: 32px; }
.brand-bg { fill: var(--surface-2); } .brand-a { stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; } .brand-dot { fill: var(--accent-2); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-family: "Space Grotesk"; font-size: 15px; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
nav { display: flex; gap: 4px; margin-left: auto; }
nav a { text-decoration: none; color: var(--text-2); padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; }
nav a:hover { color: var(--text); background: var(--surface); }
nav a.on { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--text-2); border-radius: 8px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#theme svg { fill: currentColor; stroke: none; }
.menu-btn { display: none; }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; outline: none; }
.loading { color: var(--muted); padding: 80px 0; text-align: center; }
.foot { border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }
.foot-inner { max-width: 1240px; margin: 0 auto; padding: 18px 24px; display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }

/* layout pieces */
.hero { padding: 24px 0 36px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: end; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; display: inline-flex; gap: 8px; align-items: center; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.lede { color: var(--text-2); font-size: 18px; max-width: 620px; margin-top: 18px; }
.page-head { margin: 8px 0 28px; }
.page-head p { color: var(--text-2); max-width: 760px; font-size: 16px; margin-top: 10px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.section { margin-top: 40px; }
.section > h2 { margin-bottom: 6px; }
.section > .sub { color: var(--text-2); margin-bottom: 18px; max-width: 760px; }

.kpi { padding: 18px 20px; }
.kpi .v { font-family: "Space Grotesk"; font-size: 34px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .l { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.kpi .n { color: var(--muted); font-size: 12px; margin-top: 8px; }

.feature { text-decoration: none; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s; }
.feature:hover { border-color: var(--line); transform: translateY(-2px); }
.feature .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.feature .ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature p { color: var(--text-2); font-size: 14px; margin: 0; }
.feature .go { color: var(--accent); font-size: 13px; font-weight: 600; margin-top: auto; }

.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--chip); color: var(--text-2); border-radius: 999px; padding: 3px 10px; font-size: 12px; white-space: nowrap; text-decoration: none; border: 1px solid transparent; }
a.chip:hover { border-color: var(--line); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.band { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.band i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.b-successful i { background: var(--succ); } .b-average i { background: var(--avg); } .b-poor i { background: var(--poor); }
.tag-deep { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
input[type=search], select { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 14px; }
input[type=search] { min-width: 260px; flex: 1; max-width: 380px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--text-2); padding: 6px 11px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
label.check { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); font-size: 14px; cursor: pointer; }
.count { color: var(--muted); font-size: 13px; margin-left: auto; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--surface); cursor: pointer; user-select: none; }
th.r, td.r { text-align: right; }
th .arr { opacity: .7; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.title { font-weight: 600; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
td .meter { display: inline-block; width: 60px; height: 6px; background: var(--line-soft); border-radius: 4px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
td .meter b { display: block; height: 100%; border-radius: 4px; }
.more { display: block; margin: 14px auto 0; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 9px 18px; font: inherit; cursor: pointer; }

/* charts */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis text, .chart text { fill: var(--muted); font-size: 11px; font-family: Inter, sans-serif; }
.grid-line { stroke: var(--line-soft); stroke-width: 1; }
.base-line { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hit { fill: transparent; cursor: crosshair; }
.dot-l { font-size: 11px; fill: var(--text-2); pointer-events: none; }
#tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; box-shadow: 0 10px 30px rgba(0,0,0,.3); opacity: 0; transform: translateY(4px); transition: opacity .08s, transform .08s; max-width: 280px; }
#tip.on { opacity: 1; transform: none; }
#tip b { font-weight: 600; } #tip .row { display: flex; justify-content: space-between; gap: 16px; } #tip .row span:first-child { color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
#tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* game page */
.back { color: var(--muted); text-decoration: none; font-size: 14px; display: inline-flex; gap: 6px; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.game-head { display: grid; grid-template-columns: 1fr 420px; gap: 28px; align-items: start; margin-bottom: 24px; }
.game-head img { width: 100%; border-radius: 12px; border: 1px solid var(--line-soft); aspect-ratio: 460/215; object-fit: cover; background: var(--surface); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 18px 0 8px; }
.fact { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; }
.fact .v { font-family: "Space Grotesk"; font-size: 22px; font-weight: 600; }
.fact .l { color: var(--muted); font-size: 12px; }
.mech-group { margin-top: 18px; }
.mech-group h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mech { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface); margin-bottom: 8px; }
.mech summary { list-style: none; cursor: pointer; padding: 12px 16px; display: flex; gap: 12px; align-items: baseline; }
.mech summary::-webkit-details-marker { display: none; }
.mech summary b { font-weight: 600; }
.mech summary .what { color: var(--text-2); font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mech[open] summary .what { white-space: normal; }
.mech .body { padding: 0 16px 14px; font-size: 14px; color: var(--text-2); }
.mech dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; margin: 0 0 10px; }
.mech dt { color: var(--muted); } .mech dd { margin: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { font-size: 12px; padding: 3px 9px; border-radius: 7px; background: var(--chip); color: var(--text-2); }
.opt.locked { box-shadow: inset 0 0 0 1px var(--line); background: none; }
.links-list { columns: 2; column-gap: 28px; font-size: 14px; color: var(--text-2); }
.links-list li { break-inside: avoid; margin-bottom: 6px; }

.callout { border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); padding: 14px 18px; border-radius: 0 12px 12px 0; color: var(--text-2); font-size: 14px; }
.callout b { color: var(--text); }
.steps { counter-reset: s; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.step::before { counter-increment: s; content: counter(s); width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-family: "Space Grotesk"; font-weight: 600; color: var(--accent); }
.step p { color: var(--text-2); font-size: 14px; margin: 2px 0 0; }
.status { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; }
.st-live { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.st-next { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 15%, transparent); }
.st-later { color: var(--muted); background: var(--chip); }

@media (max-width: 980px) {
  .hero, .game-head { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .top-inner { padding: 10px 16px; gap: 12px; }
  nav { display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 16px 14px; }
  nav.open { display: flex; }
  #theme { margin-left: auto; }
  .menu-btn { display: grid; }
  main { padding: 20px 16px 48px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .kpis { grid-template-columns: 1fr 1fr !important; }
  .kpi .v { font-size: 26px; }
  input[type=search] { flex-basis: 100%; }
  td.title { max-width: 190px; }
  h1 { font-size: 30px; }
  input[type=search] { min-width: 0; max-width: none; width: 100%; }
  .links-list { columns: 1; }
  .mech dl { grid-template-columns: 1fr; }
  .foot-inner { padding: 16px; }
}
