* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #fff; color: #000;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; }
button { font: inherit; color: #000; background: #fff; border: 1px solid #000;
  border-radius: 0; padding: 6px 14px; cursor: pointer;
  transition: background .15s, color .15s, transform .15s; }
button:hover { background: #000; color: #fff; }
button:active { transform: scale(.97); }
@keyframes up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- home ---------- */
#home { justify-content: center; overflow-y: auto; padding: 24px 0; }
.brand { text-align: center; }
h1 { font-weight: 300; font-size: 30px; letter-spacing: 14px; margin: 0 0 14px 14px; }
.rule { width: 0; height: 1px; background: #000; margin: 0 auto 40px;
  animation: rule .7s .1s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes rule { to { width: 160px; } }
.primary { font-size: 15px; letter-spacing: 4px; padding: 9px 42px; margin-bottom: 34px;
  opacity: 0; animation: up .5s .35s ease forwards; }
.homecards { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 440px; }
.hcard { width: 96px; height: 92px; border: 1px solid #e2e2e2; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; cursor: pointer; background: #fff;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  opacity: 0; animation: up .45s ease forwards; }
.hcard:hover { border-color: #000; transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.09); }
.hcard svg { width: 30px; height: 30px; stroke: #000; fill: none; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round; }
.hcard span { font-size: 12px; letter-spacing: 2px; }
#hist { margin-top: 30px; font-size: 12px; color: #888; font-variant-numeric: tabular-nums;
  text-align: center; line-height: 1.9; letter-spacing: .5px; }

/* ---------- play ---------- */
#top { width: 100%; height: 46px; flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 14px; border-bottom: 1px solid #f0f0f0; background: #fff; z-index: 2; }
#quit { border: none; padding: 2px 6px; font-size: 13px; color: #999; }
#quit:hover { background: #fff; color: #000; }
#bar { flex: 1; height: 1px; background: #eaeaea; }
#bar i { display: block; height: 1px; background: #000; width: 0; transition: width .5s cubic-bezier(.2,.8,.2,1); }
#prog { font-size: 12px; color: #999; font-variant-numeric: tabular-nums; min-width: 54px; text-align: right; }

#stream { flex: 1; width: 100%; overflow-y: auto; padding: 28px 16px 40vh; scroll-behavior: smooth; }
.level { width: 100%; max-width: 840px; margin: 0 auto 28px; padding: 14px 20px 12px;
  border: 1px solid #e8e8e8; background: #fff; animation: up .45s cubic-bezier(.2,.8,.2,1) both;
  transition: border-color .3s, box-shadow .3s; }
.level.done { border-color: #000; box-shadow: 0 4px 18px rgba(0,0,0,.06); }
.lhead { display: flex; align-items: baseline; gap: 10px; }
.lidx { font-size: 11px; color: #bbb; font-variant-numeric: tabular-nums; }
.lname { font-size: 14px; letter-spacing: 3px; }
.lround { font-size: 11px; color: #bbb; font-variant-numeric: tabular-nums; }
.lscore { margin-left: auto; font-size: 24px; font-weight: 300; font-variant-numeric: tabular-nums; min-height: 28px; }
.ldesc { font-size: 12px; color: #999; letter-spacing: .5px; margin: 2px 0 10px; }
.stage { width: 100%; display: flex; justify-content: center; }
.stage canvas { display: block; width: 100%; max-width: 800px; aspect-ratio: 2 / 1;
  touch-action: none; cursor: crosshair; }
.level.done .stage canvas { cursor: default; }
.lfoot { display: flex; align-items: center; gap: 12px; min-height: 30px; margin-top: 6px; }
.lmetrics { flex: 1; font-size: 11px; color: #999; font-variant-numeric: tabular-nums;
  display: flex; flex-wrap: wrap; gap: 0 14px; }
.lmetrics b { font-weight: 400; color: #000; }
.ldone { font-size: 12px; padding: 4px 16px; letter-spacing: 2px; animation: up .3s ease both; }

/* ---------- inline result ---------- */
.summary { width: 100%; max-width: 840px; margin: 10px auto 0; padding: 26px 20px 30px;
  border-top: 1px solid #000; display: flex; flex-direction: column; align-items: center;
  animation: up .5s ease both; }
#avg { font-size: 72px; font-weight: 200; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 4px; }
#radar { width: min(420px, 86vw); height: min(420px, 86vw); }
#detail { display: grid; grid-template-columns: auto 54px; gap: 3px 26px; font-size: 12px;
  font-variant-numeric: tabular-nums; margin: 4px 0 24px; }
#detail span:nth-child(odd) { color: #999; letter-spacing: 1px; }
#detail span:nth-child(even) { text-align: right; }
.summary .row { display: flex; gap: 10px; }
