:root {
  color-scheme: dark;
  --bg: #0b1016;
  --panel: #121c25;
  --line: #293c49;
  --text: #eef8fa;
  --muted: #a2b5bf;
  --accent: #52f1ca;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 80% 0%, #13302f, transparent 46%), var(--bg);
  color: var(--text);
  font: 16px/1.55 "Microsoft YaHei UI", "Segoe UI", sans-serif;
}
.shell { width: min(1120px, calc(100% - 48px)); margin: auto; }
.topbar, .section-head, .toolbar, .stats { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.topbar, .section-head { justify-content: space-between; }
.topbar { min-height: 72px; border-bottom: 1px solid var(--line); }
.brand { font-size: 20px; font-weight: 800; letter-spacing: .04em; }
.logo, .icon, .accent { color: var(--accent); }
.logo { margin-right: 8px; }
.hero { padding: clamp(36px, 7vw, 80px) 0 26px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 6vw, 64px); line-height: 1.18; }
h2 { font-size: 21px; }
p { color: var(--muted); }
.hero p { margin: 8px 0; }
.hero .accent { font-weight: 700; }
button, select {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
}
button { cursor: pointer; transition: border-color .16s, background-color .16s, transform .16s; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--accent); color: #07241d; font-weight: 800; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card {
  display: grid;
  gap: 8px;
  text-align: left;
  padding: 22px;
  background: linear-gradient(145deg, #192b35, var(--panel));
}
.card:hover { transform: translateY(-3px); }
.card strong { font-size: 20px; }
.card span { color: var(--muted); }
.card .accent, .card .icon { color: var(--accent); }
.icon { font-size: 28px; line-height: 1; }
.history { background: #101923; border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-top: 22px; }
#best, #empty-history, #storage-status { margin-top: 12px; }
#chart { display: block; width: 100%; height: 190px; margin-top: 8px; }
#records { margin: 0; padding-left: 25px; color: var(--muted); font-size: 14px; }
#training { padding-top: 22px; }
#training h1 { font-size: clamp(25px, 4vw, 40px); }
.toolbar, .stats { margin: 14px 0; }
.stats span { border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-variant-numeric: tabular-nums; }
.arena {
  position: relative;
  overflow: hidden;
  height: clamp(240px, 55vh, 620px);
  border: 1px solid #345060;
  border-radius: 12px;
  background: radial-gradient(circle, #35505d 1px, transparent 1px) center / 24px 24px, #101b24;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}
.arena.waiting { background: #572e40; }
.arena.signal { background: #45e8b6; color: #05251c; }
.arena-message { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 6px; text-align: center; padding: 16px; pointer-events: none; }
.arena-message strong { font-size: clamp(22px, 4vw, 42px); }
.arena-message span { opacity: .86; }
.target {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #d3fff4;
  background: #28cba7;
  box-shadow: 0 0 14px #46f4c960, inset 0 0 0 3px #167762;
}
.target::after { content: ""; width: 23%; aspect-ratio: 1; border-radius: 50%; background: #e5fff9; pointer-events: none; }
.result { margin-top: 12px; color: var(--accent); }
footer { padding: 18px 0 24px; font-size: 13px; color: var(--muted); }
@media (max-width: 720px) {
  .shell { width: calc(100% - 24px); }
  .modes { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  .card:hover { transform: none; }
}
