:root {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #161616;
  --edge: #ffffff19;
  --muted: #b3b8bc;
  --quiet: #949ca1;
  --white: #ecf0f1;
  --ai: #82a8ff;
  --human: #b7ed79;
  --gold: #f5c771;
  --loss: #ff8e87;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: linear-gradient(174deg, #111313 0%, #171614 35%, #0e1318 68%, var(--bg) 94%); color: var(--white); font: 14px/1.45 var(--sans); }
button { font: inherit; cursor: pointer; color: inherit; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: default; }
.symbols { position: absolute; width: 0; height: 0; pointer-events: none; }
.icon { width: 17px; height: 17px; display: inline-block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.shell { max-width: 1920px; margin: 0 auto; padding: 0 28px; min-height: 680px; height: 100vh; height: 100dvh; display: grid; grid-template-rows: 64px 119px minmax(0, 1fr) 41px; }
.mast, .brand, .mast-right, .season { display: flex; align-items: center; }
.mast { justify-content: space-between; border-bottom: 1px solid var(--edge); }
.brand { gap: 11px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; background: var(--human); color: #151c0d; }
.brand-mark .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.brand h1 { margin: 0; font: 780 19px/1 var(--mono); }
.brand h1 strong { color: var(--human); }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.mast-right { gap: 14px; }
.demo-tag { color: var(--gold); border: 1px solid #5a492d; background: #211b12; font: 650 11px/1 var(--sans); padding: 6px 8px; border-radius: 3px; white-space: nowrap; }
.season { gap: 8px; color: var(--muted); font: 650 11px var(--mono); white-space: nowrap; }
.season span, .roster-label i, .foot i, .legend-label i { width: 7px; height: 7px; background: currentColor; display: inline-block; flex: none; }
.season span { width: 5px; height: 5px; color: var(--human); }
.duel { display: grid; grid-template-columns: minmax(0, 1fr) 234px minmax(0, 1fr); gap: 18px; align-items: center; }
.roster { position: relative; min-width: 0; align-self: stretch; display: grid; align-content: center; margin-block: 8px; padding: 8px 12px; }
.duel-art { display: none; position: absolute; object-fit: contain; pointer-events: none; }
.roster-label { display: flex; align-items: center; gap: 7px; font: 700 11px var(--mono); margin: 0 0 8px; color: var(--side); }
.roster-label span { color: var(--muted); font-size: 10px; }
.ai-roster { --side: var(--ai); }
.human-roster { --side: var(--human); }
.ai-roster .roster-label, .ai-roster .seats { justify-content: end; }
.seats { min-width: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 78px); gap: 7px; }
.seat-wrap { position: relative; min-width: 0; }
.seat { position: relative; display: grid; place-items: center; width: 100%; min-width: 0; height: 34px; padding: 0 3px; border: 1px solid var(--edge); border-radius: 4px; background: #161616; color: #fff; }
.seat:hover { background: #292929; }
.seat::after { content: ""; position: absolute; bottom: 3px; inset-inline: 7px; height: 2px; background: var(--player-color); }
.seat[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--player-color); }
.seat.is-pro .icon { position: absolute; bottom: -4px; right: -3px; width: 12px; height: 12px; padding: 1px; color: #161109; background: var(--gold); border: 1px solid #6e562d; border-radius: 2px; }
.seat-name { white-space: nowrap; font: 750 12px/1.3 var(--sans); }
.member-tip { position: absolute; z-index: 5; right: 0; top: calc(100% - 1px); width: 195px; background: #221e15; padding: 9px 10px; border: 1px solid #6e562d; color: var(--gold); border-radius: 4px; font-size: 11px; display: none; pointer-events: none; }
.seat-wrap:hover .member-tip, .seat-wrap:focus-within .member-tip { display: block; }
.score { border-inline: 1px solid var(--edge); text-align: center; align-self: center; padding: 1px 0; --leader: var(--human); }
.score p { margin: 0; color: var(--white); font-size: 12px; font-weight: 700; }
.score-number { margin: 3px 0 0; color: var(--leader); font: 800 42px/1.05 var(--mono); white-space: nowrap; }
.score-number small { font-size: 21px; }
.score > span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.board { min-width: 0; min-height: 0; border: 1px solid var(--edge); display: grid; grid-template-columns: clamp(155px, 15%, 220px) minmax(0, 1fr) clamp(247px, 25%, 420px); }
.rail, .battle, .tape { min-width: 0; min-height: 0; }
.rail, .tape { background: #181818b8; }
.rail { border-right: 1px solid var(--edge); padding: 17px 13px; display: flex; flex-direction: column; }
.panel-kicker { color: var(--quiet); font: 650 10px/1.2 var(--mono); white-space: nowrap; }
h2 { margin: 5px 0 0; font-size: 17px; font-weight: 760; }
.metric-list { display: grid; gap: 5px; margin-top: 18px; }
.metric { background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--muted); padding: 8px 7px; display: flex; align-items: center; gap: 8px; text-align: left; min-width: 0; }
.metric:hover { background: #252525; }
.metric[aria-pressed="true"] { background: #20251d; border-color: #394333; color: var(--human); }
.metric > span { min-width: 0; line-height: 1.2; }
.metric b, .metric small { display: block; }
.metric b { font-size: 13px; }
.metric small { margin-top: 3px; font: 500 10px var(--mono); color: var(--muted); }
.scan { border-top: 1px solid var(--edge); margin-top: auto; padding-top: 13px; }
.scan-heading { color: var(--white); display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.scan-heading .icon { color: var(--human); width: 15px; height: 15px; }
.scan-heading span { color: var(--quiet); font-size: 10px; font-weight: 500; margin-left: auto; }
.scan dl { margin: 9px 0; }
.scan dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; padding: 4px 0; }
.scan dt { font-size: 11px; color: var(--muted); white-space: nowrap; }
.scan dd { margin: 0; font: 750 16px var(--mono); }
.scan dd small { font-size: 10px; }
.scan-bar { height: 4px; background: linear-gradient(to right, #759b53 99%, #313a35 99%); }
.battle { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; padding: 17px 18px 15px; }
.battle-head, .battle-actions, .chart-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.battle-head h2 { font-size: 23px; line-height: 1.2; }
.back, .segment button, .pro-chart { color: var(--muted); border: 1px solid transparent; background: none; font-weight: 650; font-size: 11px; white-space: nowrap; border-radius: 3px; }
.back { padding: 4px 5px; }
.back:hover, .segment button:hover { color: var(--white); }
.segment { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--edge); border-radius: 5px; background: #181818; }
.segment button { padding: 4px 7px; }
.segment button[aria-pressed="true"] { background: #2a2a2a; color: var(--white); }
.chart-meta { min-height: 37px; color: var(--muted); font-size: 11px; gap: 6px; }
.pro-chart { color: var(--gold); border-color: #69532f; background: #241f16; display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; }
.pro-chart .icon { width: 13px; height: 13px; }
.chart { min-height: 0; min-width: 0; position: relative; }
#plot { display: block; width: 100%; height: 100%; overflow: visible; }
.plot-text { fill: var(--muted); font: 10px var(--mono); }
.plot-grid { stroke: #ffffff17; stroke-width: 1; shape-rendering: crispEdges; }
.plot-grid.vertical { stroke: #ffffff10; }
.plot-baseline { stroke: #ffffff39; stroke-width: 1; stroke-dasharray: 4 4; }
.plot-marker { cursor: pointer; outline: none; }
.plot-marker .marker-ring { stroke: #111416; stroke-width: 2; }
.plot-marker:focus-visible .marker-ring, .plot-marker:hover .marker-ring { stroke: var(--gold); }
.chart-tip { position: absolute; z-index: 4; width: max-content; max-width: calc(100% - 8px); border: 1px solid #414141; border-radius: 4px; background: #212121; padding: 8px 10px; font-size: 11px; box-shadow: 0 6px 20px #0008; pointer-events: none; }
.chart-tip div + div { margin-top: 3px; }
.tip-rows.is-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 9px; }
.tip-rows.is-comparison > div { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin: 0; white-space: nowrap; }
.tip-rows.is-comparison .tip-value { margin: 0; }
.tip-time { color: var(--muted); font: 10px var(--mono); margin-bottom: 4px; }
.tip-value { font: 750 11px var(--mono); margin-left: 9px; }
.tip-pro { color: var(--gold); max-width: 200px; border-top: 1px solid #69532f; padding-top: 5px; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--edge); margin-top: 6px; }
.legend-item { min-width: 0; padding: 11px 4px 1px 0; }
.legend-item + .legend-item { padding-left: 14px; border-left: 1px solid var(--edge); }
.legend-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.legend-label i { color: var(--series); width: 8px; height: 3px; }
.legend-data { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; margin-top: 4px; }
.legend-value { color: var(--series); font: 750 22px/1.15 var(--mono); white-space: nowrap; }
.legend-change { font: 650 11px var(--mono); white-space: nowrap; }
.legend.is-comparison { grid-template-columns: repeat(auto-fit, minmax(min(90px, 100%), 1fr)); gap: 5px; padding-top: 5px; }
.legend.is-comparison .legend-item { border-left: 2px solid var(--series); padding: 3px 4px 3px 6px; background: var(--surface); }
.legend.is-comparison .legend-label { gap: 0; }
.legend.is-comparison .legend-label i { display: none; }
.legend.is-comparison .legend-data { margin-top: 2px; column-gap: 4px; }
.legend.is-comparison .legend-value { font-size: 15px; }
.legend.is-comparison .legend-change { font-size: 10px; }
.positive { color: var(--human); }
.negative { color: var(--loss); }
.tape { border-left: 1px solid var(--edge); display: grid; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); }
.tape-head { padding: 17px 13px 12px; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #424242; border-radius: 4px; padding: 0; background: #242424; color: var(--muted); }
.icon-button:hover { color: var(--white); background: #303030; }
.tape-section { min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--edge); }
.tape-section h3 { margin: 0; padding: 8px 13px; background: #222222; border-bottom: 1px solid var(--edge); display: flex; gap: 5px; align-items: center; justify-content: space-between; font-size: 12px; }
.tape-section h3 small { font: 650 9px var(--mono); color: var(--quiet); margin-left: 4px; white-space: nowrap; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--human); box-shadow: 0 0 0 3px #b7ed7920; flex: none; }
.pulse.is-paused { background: var(--quiet); box-shadow: none; }
.tape-count { color: var(--muted); font: 650 10px var(--mono); }
.tape ol { list-style: none; padding: 0; margin: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #40484c transparent; }
.tape ol:focus-visible { outline-offset: -2px; }
.tape li { padding: 7px 13px; border-bottom: 1px solid var(--edge); border-inline-start: 2px solid var(--item); }
.tape-top, .tape-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.tape-top strong { font: 750 11px var(--mono); color: var(--item); }
.tape-top time { font: 10px var(--mono); color: var(--muted); white-space: nowrap; }
.tape-match { font-size: 12px; font-weight: 650; margin: 3px 0 1px; overflow-wrap: anywhere; }
.tape-bottom { color: var(--muted); font-size: 11px; }
.tape-bottom b { font: 750 11px var(--mono); white-space: nowrap; }
.tape li.flash-up { animation: flash-up 1.2s ease-out; }
.tape li.flash-down { animation: flash-down 1.2s ease-out; }
@keyframes flash-up { from { background: #35522c; } to { background: transparent; } }
@keyframes flash-down { from { background: #502b2c; } to { background: transparent; } }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--quiet); font-size: 11px; }
.foot i { color: var(--gold); width: 5px; height: 5px; margin-right: 4px; vertical-align: 2px; }
.foot b { margin: 0 3px; }
dialog { width: min(365px, calc(100% - 32px)); border: 1px solid #6e562f; border-radius: 6px; background: #171a1a; color: var(--white); padding: 22px; }
dialog::backdrop { background: #070809bf; }
dialog form { margin: 0; }
.close { position: absolute; top: 12px; right: 12px; }
.modal-icon { color: var(--gold); background: #2a2519; display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 12px; border: 1px solid #6e562f; border-radius: 4px; }
dialog h2 { margin-top: 8px; font-size: 23px; }
dialog p { color: var(--white); font-size: 13px; margin: 8px 0; }
dialog .modal-note { color: var(--muted); font-size: 11px; }
.modal-action { margin-top: 10px; background: var(--gold); color: #1b160e; border: 0; border-radius: 4px; padding: 7px 12px; font-weight: 750; }
@media (min-width: 1280px) {
  .duel-art { display: block; width: min(302px, calc(100% - var(--seats-space))); height: 101px; top: 50%; transform: translateY(-50%); }
  .ai-roster { --seats-space: 432px; }
  .human-roster { --seats-space: 348px; }
  .ai-roster .duel-art { inset-inline-start: 0; }
  .human-roster .duel-art { inset-inline-end: 0; }
}
@media (min-width: 1280px) and (max-width: 1450px) {
  .seats { grid-auto-columns: minmax(0, 64px); }
  .ai-roster { --seats-space: 362px; }
  .human-roster { --seats-space: 292px; }
}
@media (max-width: 1190px) {
  .shell { padding-inline: 18px; }
  .duel { grid-template-columns: minmax(0, 1.3fr) 185px minmax(0, 1fr); gap: 9px; }
  .seats { gap: 3px; }
  .score-number { font-size: 36px; }
}
@media (max-width: 1030px) {
  .shell { display: block; height: auto; min-height: 100vh; }
  .mast { min-height: 60px; }
  .duel { min-height: 110px; grid-template-columns: minmax(0, 1fr) 160px 184px; }
  .board { grid-template-columns: clamp(145px, 22%, 188px) minmax(0, 1fr); }
  .battle { min-height: 500px; }
  .tape { border-top: 1px solid var(--edge); border-left: 0; grid-column: 1 / -1; grid-template: auto 240px / 1fr 1fr; }
  .tape-head { grid-column: 1 / -1; }
  .tape-section + .tape-section { border-left: 1px solid var(--edge); }
  .foot { min-height: 40px; }
}
@media (max-width: 760px) {
  .shell { padding-inline: 10px; }
  .mast { min-height: 54px; }
  .mast-right { gap: 5px; }
  .season { display: none; }
  .duel { grid-template-columns: minmax(0, 1fr); padding: 10px 0 9px; gap: 6px; }
  .score { grid-row: 1; border: 0; display: flex; justify-content: center; flex-wrap: wrap; align-items: baseline; column-gap: 9px; }
  .score-number { font-size: 30px; }
  .score-number small { font-size: 15px; }
  .score > span { flex: 0 0 100%; margin: 0; }
  .roster-label { min-height: 26px; margin-bottom: 3px; }
  .roster { margin-block: 0; padding: 7px 8px; }
  .duel-art { display: block; top: 1px; inset-inline-end: 8px; width: 82px; height: 34px; }
  .ai-roster .roster-label, .ai-roster .seats { justify-content: start; }
  .seats { grid-auto-columns: minmax(0, 1fr); gap: 1px; }
  .seat { height: 30px; padding-inline: 2px; }
  .seat-name { font-size: 10px; }
  .board { display: block; }
  .rail { border-right: 0; border-bottom: 1px solid var(--edge); padding: 9px 8px; display: grid; grid-template-columns: 1fr; }
  .rail > .panel-kicker, .rail > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .metric-list { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; gap: 2px; }
  .metric { justify-content: center; gap: 3px; padding: 6px 1px; }
  .metric .icon { width: 13px; height: 13px; }
  .metric b { font-size: 11px; white-space: nowrap; }
  .metric small { display: none; }
  .scan { display: flex; align-items: center; gap: 5px; border: 0; padding: 0; margin-top: 7px; }
  .scan-heading { font-size: 10px; gap: 3px; }
  .scan-heading .icon, .scan-heading span, .scan-bar { display: none; }
  .scan dl { margin: 0; flex: 1; display: flex; justify-content: space-between; gap: 3px; }
  .scan dl > div { padding: 0; gap: 2px; }
  .scan dt, .scan dd { font-size: 10px; }
  .battle { min-height: 435px; grid-template-rows: auto auto minmax(250px, 1fr) auto; padding: 11px 8px; }
  .battle-head h2 { font-size: 19px; }
  .battle-actions { gap: 3px; }
  .segment button { padding: 4px; }
  .legend-value { font-size: 17px; }
  .legend-item + .legend-item { padding-left: 6px; }
  .tape { display: grid; grid-template: auto 239px 239px / minmax(0, 1fr); }
  .tape-section + .tape-section { border-left: 0; }
  .foot { min-height: 44px; flex-wrap: wrap; justify-content: flex-start; column-gap: 10px; row-gap: 0; padding: 5px 0; }
}
@media (max-width: 360px) {
  .seat-name { font-size: 9px; }
  .metric b { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; }
}

.seat:has(.seat-offline) { flex-direction: column; gap: 2px; }
.seat-offline { color: #b2b6bb; font-size: 9px; line-height: 1; white-space: nowrap; }
.tape li.tape-empty { padding: 12px; color: #a2adae; }
