/* ---- tokens ---- */
:root {
  color-scheme: dark;
  --page: #09090b; --surface: #121215; --surface-2: #1a1a1f;
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781; --grid: #26262b; --border: rgba(255,255,255,0.08);
  --a: #3987e5; --b: #d95926;
  --win: #0ca30c; --loss: #d03b3b; --win-dim: rgba(12,163,12,0.14); --loss-dim: rgba(208,59,59,0.14);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; padding-block: 0 40px; padding-inline: 16px; }
.tab { font-variant-numeric: tabular-nums; }
a { color: inherit; }
h2 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.err { color: var(--loss); padding: 40px; text-align: center; }
.ci { position: relative; } .ci img { width: 40px; height: 40px; border-radius: 8px; display: block; }
.ci em { position: absolute; right: -3px; bottom: -3px; font: 600 10px/1 system-ui; background: var(--page); color: var(--ink-2); padding: 2px 4px; border-radius: 4px; font-style: normal; }
.items { display: flex; gap: 2px; justify-content: flex-end; }
.items img, .items i { width: 22px; height: 22px; border-radius: 4px; background: var(--surface-2); display: block; }

/* ---- scoreboard ---- */
.team .th { display: flex; gap: 10px; align-items: baseline; padding: 4px 6px; font-size: 12px; }
.team .th .res { font-weight: 700; } .team.w .th .res { color: var(--win); } .team.l .th .res { color: var(--loss); }
.team .th .objs { color: var(--muted); }
.sb-head, .sb { display: grid; grid-template-columns: 34px minmax(0,1fr) 84px 72px 78px 172px; gap: 8px; align-items: center; padding: 3px 6px; }
.sb-head { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 0; }
.sb { border-radius: 6px; font-size: 12px; }
.sb:nth-child(odd) { background: var(--surface-2); }
.sb.a { box-shadow: inset 3px 0 0 var(--a); } .sb.b { box-shadow: inset 3px 0 0 var(--b); }
.sb .ci img { width: 32px; height: 32px; border-radius: 6px; }
.sb .ci em { font-size: 9px; padding: 1px 3px; }
.sb .pn { min-width: 0; } .sb .pn .nm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sb.a .pn .nm { color: var(--a); } .sb.b .pn .nm { color: var(--b); }
.sb .pn small, .sb small { display: block; color: var(--muted); font-size: 11px; }
.sb b { font-weight: 600; }
.sb .dbar { height: 4px; background: var(--grid); border-radius: 2px; margin-top: 3px; position: relative; overflow: hidden; }
.sb .dbar b { position: absolute; inset: 0 auto 0 0; background: var(--ink-2); border-radius: 2px; }
.sb .items img, .sb .items i { width: 18px; height: 18px; border-radius: 3px; }
.big-sb .sb-head, .big-sb .sb { grid-template-columns: 44px minmax(0,1fr) 110px 110px 110px 230px; font-size: 13px; padding: 6px 10px; }
.big-sb .sb .ci img { width: 40px; height: 40px; border-radius: 8px; }
.big-sb .sb .items img, .big-sb .sb .items i { width: 24px; height: 24px; }
.big-sb .team .th { font-size: 14px; padding: 10px 10px 6px; }

/* ---- timeline ---- */
.tl { display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 8px; }
.tl h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tl h3 span { font-weight: 400; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tl-legend { font-size: 10px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tl-legend b { color: var(--ink-2); }
.tl-legend .k { width: 8px; height: 8px; border-radius: 50%; display: inline-block; } .tl-legend .k.got { background: var(--win); } .tl-legend .k.died { background: var(--loss); }
.tl-legend .tw { width: 3px; height: 7px; background: var(--ink-2); display: inline-block; }
.chart { position: relative; }
.gold { width: 100%; height: auto; display: block; }
.gold .grid { stroke: var(--grid); stroke-width: 1; } .gold .zero { stroke: var(--muted); stroke-width: 1; }
.gold .ax { fill: var(--muted); font-size: 10px; }
.gold .line { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.gold .fill-up { fill: var(--win); opacity: .22; } .gold .fill-dn { fill: var(--loss); opacity: .22; }
.gold .objline { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 3; opacity: .5; vector-effect: non-scaling-stroke; }
.gold .objlbl { font-size: 10px; font-weight: 700; fill: var(--ink-2); }
.gold .obj.theirs .objlbl { fill: var(--muted); }
.gold .twr.mine { fill: var(--ink-2); } .gold .twr.theirs { fill: var(--muted); }
.gold .kill { stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; } .gold .kill.got { fill: var(--win); } .gold .kill.died { fill: var(--loss); }
.gold .cursor { stroke: var(--ink-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tip { position: absolute; top: 8px; left: 0; background: var(--page); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--ink-2); pointer-events: none; white-space: nowrap; }
.tip b.up { color: var(--win); } .tip b.dn { color: var(--loss); }
.tl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1300px) { .tl-grid { grid-template-columns: 1fr; } }
.build { display: flex; flex-wrap: wrap; gap: 6px; }
.buy { text-align: center; } .buy img { width: 26px; height: 26px; border-radius: 5px; display: block; background: var(--surface-2); }
.buy small { display: block; font-size: 9px; color: var(--muted); margin-top: 2px; }
/* moments */
.moments { display: flex; flex-direction: column; gap: 6px; }
a.moment { text-decoration: none; color: inherit; }
.moment .go { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; } .moment:hover .go { color: var(--ink); }
.moment { display: grid; grid-template-columns: 58px 1fr 74px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--grid); opacity: calc(0.6 + 0.4 * var(--w, 1)); transition: background .15s, opacity .15s; }
.moment:hover { background: color-mix(in oklab, var(--surface-2) 70%, var(--ink) 6%); opacity: 1; }
.moment.good { border-left-color: var(--win); } .moment.bad { border-left-color: var(--loss); }
.moment .mt { font-size: 12px; color: var(--ink-2); font-weight: 600; line-height: 1.2; } .moment .mt small { display: block; color: var(--muted); font-weight: 400; font-size: 10px; }
.moment .mh { font-weight: 600; font-size: calc(12px + 2px * var(--w, 1)); line-height: 1.3; }
.moment .mr { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 5px; }
.moment .grp { display: inline-flex; align-items: center; gap: 2px; }
.moment .grp .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 3px; }
.moment .f { width: 22px; height: 22px; border-radius: 5px; box-shadow: 0 0 0 2px var(--ring); --ring: var(--grid); }
.moment .f.k { --ring: var(--win); } .moment .f.d { --ring: var(--loss); } .moment .f.ta { outline: 2px solid var(--a); outline-offset: 1px; } .moment .f.tb { outline: 2px solid var(--b); outline-offset: 1px; }
.chip-ev { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap; }
.chip-ev.good { border-color: color-mix(in oklab, var(--win) 60%, transparent); color: var(--ink); } .chip-ev.bad { border-color: color-mix(in oklab, var(--loss) 60%, transparent); color: var(--ink); } .chip-ev.soul { border-color: var(--ink-2); }
.moment .ms { text-align: right; font-weight: 700; font-size: 15px; } .moment .ms small { display: block; font-size: 9px; color: var(--muted); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; }
.moment .ms.up { color: var(--win); } .moment .ms.dn { color: var(--loss); }
.tl-grid.with-map { grid-template-columns: 1fr 380px; align-items: start; }
@media (max-width: 1100px) { .tl-grid.with-map { grid-template-columns: 1fr; } }
.minimap { position: relative; width: 100%; aspect-ratio: 1; border-radius: 12px; background-size: cover; border: 1px solid var(--border); overflow: hidden; }
.minimap .dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid rgba(0,0,0,.7); transition: opacity .15s, transform .15s; }
.minimap .dot.k { background: var(--win); } .minimap .dot.d { background: var(--loss); }
.minimap .dot.me { width: 14px; height: 14px; border-color: #fff; }
.minimap .dot.t { border-radius: 2px; width: 9px; height: 9px; }
.minimap .dot.o { width: 18px; height: 18px; font: 800 10px/14px system-ui; color: #000; text-align: center; border-radius: 4px; }
.minimap.focus .dot { opacity: .18; } .minimap.focus .dot.hi { opacity: 1; transform: translate(-50%, -50%) scale(1.35); z-index: 2; }
.mm-legend { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 8px; align-items: center; font-size: 10px; color: #fff; background: rgba(0,0,0,.55); border-radius: 6px; padding: 4px 8px; flex-wrap: wrap; }
.mm-legend .dot { position: static; transform: none; display: inline-block; vertical-align: middle; margin-right: 2px; }
.mm-legend .dot.o { width: 14px; height: 14px; line-height: 10px; font-size: 8px; }
.evlog { max-height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; font-size: 12px; padding-right: 4px; }
.ev { display: grid; grid-template-columns: 40px 1fr; gap: 8px; padding: 2px 6px; border-radius: 4px; color: var(--ink-2); border-left: 2px solid var(--grid); }
.ev.good { border-left-color: var(--win); } .ev.bad { border-left-color: var(--loss); } .ev.soul { border-left-color: var(--ink-2); }
.ev .t { color: var(--muted); } .ev b { color: var(--ink); font-weight: 600; } .ev .sub, .ev .sd { color: var(--muted); }
.ev .sd { color: var(--win); }

.big-tl .buy img { width: 34px; height: 34px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop  { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
