:root {
  --bg: #0b1220;
  --panel: #111a2c;
  --panel-2: #16223a;
  --line: #22314f;
  --text: #e6ecf7;
  --muted: #8b9ab8;
  --accent: #36d6c3;
  --accent-2: #ffd23f;
  --warn: #ff6b6b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, "PingFang SC", system-ui, sans-serif; }
body { padding: 20px clamp(16px, 3vw, 36px) 40px; max-width: 1480px; margin: 0 auto; }

.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.brand { display: flex; gap: 14px; align-items: center; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 18px var(--accent-2); flex: none; }
h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.tag { font-size: 12px; font-weight: 600; color: var(--bg); background: var(--accent); padding: 2px 8px; border-radius: 999px; vertical-align: 3px; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 110px; }
.stat b { display: block; font-family: "JetBrains Mono", monospace; font-size: 16px; color: var(--text); }
.stat span { font-size: 12px; color: var(--muted); }

.picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.picker[hidden] { display: none; }
.chip { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-size: 13px; min-width: 104px; }
.chip span { font-size: 11px; color: var(--muted); }
.chip.pass span::before, .chip.partial span::before, .chip.fail span::before { content: "●"; margin-right: 5px; }
.chip.pass span::before { color: var(--accent); }
.chip.partial span::before { color: var(--accent-2); }
.chip.fail { opacity: 0.45; cursor: not-allowed; }
.chip.fail span::before { color: var(--warn); }
.chip.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.failed { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.failed summary { cursor: pointer; padding: 4px 0; }
.failed ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.7; }
.failed b { color: var(--text); font-weight: 600; margin-right: 8px; }
.quality ul { list-style: none; padding: 0; margin: 0; }
.quality li { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding: 4px 0; color: var(--text); }
.quality li i { font-style: normal; width: 18px; text-align: center; font-weight: 700; }
.quality li.ok i { color: var(--accent); }
.quality li.bad i { color: var(--accent-2); }
.quality li em { font-style: normal; color: var(--muted); margin-left: auto; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.quality h2 .pass { color: var(--accent); }
.quality h2 .partial { color: var(--accent-2); }

.stage { display: grid; grid-template-columns: minmax(240px, 0.42fr) 1fr; gap: 16px; }
body.landscape .stage { grid-template-columns: 1fr 1fr; }
body.landscape .video-wrap { max-height: none; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; margin-bottom: 10px; gap: 8px; }
.toggle { font-weight: 500; color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.toggle input { accent-color: var(--accent); }

.video-wrap { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 404 / 720; max-height: 72vh; margin: 0 auto; width: 100%; }
.video-wrap video, .video-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.video-wrap video { object-fit: contain; }
.hint { color: var(--muted); font-size: 12px; margin: 10px 2px 0; line-height: 1.5; }

.scene-wrap { position: relative; flex: 1; min-height: 420px; border-radius: 10px; overflow: hidden; background: #0d1626; }
.scene-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.rally { position: absolute; left: 12px; top: 12px; font-family: "JetBrains Mono", monospace; font-size: 13px; background: rgba(11,18,32,.72); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); }
.event { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--accent-2); min-height: 1em; transition: opacity .3s; }
.cams { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cams button, .speeds button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font: 500 13px Inter, "PingFang SC", sans-serif; cursor: pointer; }
.cams button.active, .speeds button.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.controls { display: flex; align-items: center; gap: 14px; margin: 16px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; flex-wrap: wrap; }
.play { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--accent); color: var(--bg); font-size: 16px; cursor: pointer; flex: none; }
#scrub { flex: 1; min-width: 160px; accent-color: var(--accent); }
.clock { font-family: "JetBrains Mono", monospace; font-size: 14px; color: var(--muted); min-width: 64px; }
.speeds { display: flex; gap: 6px; }

.notes { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.notes > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.notes h2 { font-size: 15px; margin: 0 0 8px; }
.notes li { color: var(--muted); font-size: 13px; line-height: 1.65; margin-bottom: 4px; }
.notes b { color: var(--text); font-weight: 600; }

@media (max-width: 860px) {
  body { padding: 14px 16px 32px; }
  .stage, body.landscape .stage { grid-template-columns: 1fr; }
  body.landscape .video-wrap { height: auto; width: 100%; }
  .video-wrap { height: 52vh; max-height: none; width: auto; max-width: 100%; }
  .scene-wrap { min-height: 360px; }
  .notes { grid-template-columns: 1fr; }
}
