/* ==========================================================================
   靶场神枪手 · 军训打靶小游戏
   视觉风格：深橄榄绿 + 沙色 + 琥珀警示色，带军用训练终端质感
   ========================================================================== */

:root {
  --bg: #08110b;
  --bg-deep: #050b07;
  --panel: rgba(14, 23, 16, 0.94);
  --panel-soft: rgba(20, 32, 23, 0.82);
  --cream: #eee5cf;
  --cream-dim: #cac4ae;
  --muted: #99a48f;
  --olive: #78894f;
  --olive-light: #b9ca80;
  --olive-dark: #37452c;
  --amber: #f2b84b;
  --amber-light: #ffda8a;
  --red: #e35a45;
  --red-deep: #9e3528;
  --danger: #ff6a51;
  --line: rgba(231, 223, 196, 0.15);
  --line-strong: rgba(231, 223, 196, 0.3);
  --font-display: "Bahnschrift Condensed", "DIN Condensed", "Impact", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-body: "Bahnschrift", "DIN Alternate", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   游戏画布与全屏特效
   -------------------------------------------------------------------------- */

.game-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-deep);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

body.is-playing #gameCanvas {
  cursor: none;
}

.fx {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.fx--scanlines {
  opacity: 0.24;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.032) 0,
    rgba(255, 255, 255, 0.032) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: overlay;
}

.fx--grain {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
}

.fx--frame {
  inset: 10px;
  border: 1px solid rgba(238, 229, 207, 0.075);
}

.fx--frame::before,
.fx--frame::after {
  content: "";
  position: absolute;
  width: 44px;
  height: 44px;
  border-color: rgba(242, 184, 75, 0.35);
  border-style: solid;
}

.fx--frame::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.fx--frame::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1px 1px 0;
}

/* --------------------------------------------------------------------------
   HUD 抬头显示
   -------------------------------------------------------------------------- */

.hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hud.is-active {
  opacity: 1;
  visibility: visible;
}

.hud__grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: start;
  gap: 16px;
  width: min(1240px, calc(100% - 40px));
  margin: max(16px, env(safe-area-inset-top)) auto 0;
}

.hud-panel {
  position: relative;
  width: 210px;
  padding: 12px 16px 13px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(238, 229, 207, 0.055), transparent 55%),
    rgba(7, 14, 9, 0.74);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(9px);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.hud-panel__kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--olive-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--olive-light);
  box-shadow: 0 0 0 0 rgba(185, 202, 128, 0.45);
  animation: livePulse 1.8s infinite;
}

.timer-readout {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 3px;
  line-height: 1;
}

#timeValue {
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.timer-unit {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.timer-track {
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  background: rgba(238, 229, 207, 0.12);
}

.timer-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--olive-light), var(--amber));
  transform-origin: left center;
  transition: transform 0.18s linear, background 0.25s ease;
}

.hud.is-danger .hud-panel--timer {
  border-color: rgba(255, 106, 81, 0.5);
  animation: dangerPulse 0.9s ease-in-out infinite;
}

.hud.is-danger #timeValue {
  color: var(--danger);
}

.hud.is-danger .timer-fill {
  background: var(--danger);
}

.hud.is-danger .live-dot {
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(255, 106, 81, 0.5);
}

.score-panel {
  position: relative;
  min-width: 214px;
  padding: 10px 28px 11px;
  text-align: center;
  border-top: 1px solid rgba(242, 184, 75, 0.3);
  border-bottom: 1px solid rgba(242, 184, 75, 0.18);
  background:
    linear-gradient(90deg, transparent, rgba(7, 14, 9, 0.86) 14%, rgba(7, 14, 9, 0.86) 86%, transparent);
}

.score-panel::before,
.score-panel::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 184, 75, 0.5));
}

.score-panel::before {
  right: 100%;
}

.score-panel::after {
  left: 100%;
  transform: scaleX(-1);
}

.score-panel__label {
  display: block;
  color: var(--olive-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
}

.score-panel__value {
  display: block;
  margin-top: 1px;
  color: var(--amber-light);
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.045em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 26px rgba(242, 184, 75, 0.22);
}

.score-panel__value.is-bump {
  animation: scoreBump 0.22s ease-out;
}

.combo-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(238, 229, 207, 0.12);
  background: rgba(0, 0, 0, 0.18);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.combo-badge.is-hot {
  color: var(--amber-light);
  border-color: rgba(242, 184, 75, 0.45);
  background: rgba(242, 184, 75, 0.09);
}

.combo-badge.is-pop {
  animation: comboPop 0.28s var(--ease-out);
}

.hud-actions {
  display: flex;
  justify-self: end;
  align-items: stretch;
  gap: 8px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 74px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: rgba(7, 14, 9, 0.68);
  backdrop-filter: blur(9px);
}

.mini-stat span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.mini-stat strong {
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.icon-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 56px;
  padding: 8px 10px;
  color: var(--cream-dim);
  cursor: pointer;
  pointer-events: auto;
  border: 1px solid var(--line);
  background: rgba(7, 14, 9, 0.78);
  backdrop-filter: blur(9px);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.icon-button:hover {
  color: var(--amber-light);
  border-color: rgba(242, 184, 75, 0.42);
  background: rgba(25, 36, 24, 0.9);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: translateY(0);
}

.icon-button span {
  font-size: 9px;
  letter-spacing: 0.08em;
}

.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sound-off {
  display: none;
}

.icon-button.is-muted .icon--sound-on {
  display: none;
}

.icon-button.is-muted .icon--sound-off {
  display: block;
}

.hint-bar {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  color: rgba(238, 229, 207, 0.72);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  border: 1px solid rgba(238, 229, 207, 0.1);
  background: rgba(5, 11, 7, 0.55);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out), visibility 0.4s;
  pointer-events: none;
}

.hint-bar.is-active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.hint-bar.is-faded {
  opacity: 0;
  transform: translate(-50%, 6px);
}

.hint-bar__cross {
  position: relative;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(242, 184, 75, 0.7);
  border-radius: 50%;
}

.hint-bar__cross::before,
.hint-bar__cross::after {
  content: "";
  position: absolute;
  background: rgba(242, 184, 75, 0.8);
}

.hint-bar__cross::before {
  top: 5px;
  left: -4px;
  width: 18px;
  height: 1px;
}

.hint-bar__cross::after {
  top: -4px;
  left: 5px;
  width: 1px;
  height: 18px;
}

.hint-sep {
  color: rgba(242, 184, 75, 0.55);
}

/* --------------------------------------------------------------------------
   通用屏幕与按钮
   -------------------------------------------------------------------------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: clamp(14px, 3vw, 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.34s ease, visibility 0.34s ease;
}

.screen.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.screen--start {
  background:
    radial-gradient(circle at 77% 25%, rgba(242, 184, 75, 0.12), transparent 31%),
    radial-gradient(circle at 18% 82%, rgba(117, 134, 79, 0.11), transparent 36%),
    linear-gradient(100deg, rgba(3, 8, 5, 0.97) 0%, rgba(4, 10, 6, 0.88) 46%, rgba(4, 9, 6, 0.62) 100%);
  backdrop-filter: blur(5px);
}

.screen--modal {
  z-index: 24;
  align-items: flex-start;
  background: rgba(2, 7, 4, 0.72);
  backdrop-filter: blur(11px);
}

.eyebrow {
  margin: 0;
  color: var(--olive-light);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1.5;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 56px;
  padding: 0 28px;
  overflow: hidden;
  color: var(--bg-deep);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  background: transparent;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: transform 0.22s var(--ease-out), filter 0.22s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: inherit;
}

.btn--primary {
  background: var(--amber);
  box-shadow: 0 12px 34px rgba(242, 184, 75, 0.18);
}

.btn--primary::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -70%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
}

.btn--primary:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.btn--primary:hover::before {
  left: 125%;
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--ghost {
  color: var(--cream);
  background: rgba(238, 229, 207, 0.04);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn--ghost:hover {
  background: rgba(238, 229, 207, 0.09);
  transform: translateY(-2px);
}

.btn--text {
  min-height: 48px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  background: transparent;
}

.btn--text:hover {
  color: var(--cream);
}

.btn__arrow {
  font-family: var(--font-mono);
  font-size: 20px;
  transition: transform 0.22s var(--ease-out);
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   开始页
   -------------------------------------------------------------------------- */

.start-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(340px, 0.84fr);
  column-gap: clamp(28px, 4vw, 66px);
  row-gap: 24px;
  width: min(1180px, 100%);
  margin: auto;
  padding: clamp(25px, 3.7vw, 50px);
  padding-top: calc(clamp(25px, 3.7vw, 50px) + 3px);
  border: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.028), transparent 28%),
    linear-gradient(145deg, rgba(18, 29, 20, 0.96), rgba(6, 12, 8, 0.93));
  box-shadow:
    0 44px 110px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 30px 100%, 0 calc(100% - 30px));
}

.start-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 30px;
  left: 0;
  height: 3px;
  background: repeating-linear-gradient(120deg, var(--amber) 0 16px, transparent 16px 30px);
  opacity: 0.65;
}

.start-panel::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 14px rgba(227, 90, 69, 0.75);
}

.start-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.platform-line {
  margin: 0 0 22px;
}

.platform-badge {
  display: inline-block;
  padding: 5px 9px 4px;
  color: var(--olive-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  border: 1px solid rgba(185, 202, 128, 0.18);
  background: rgba(185, 202, 128, 0.045);
}

.game-title {
  margin: 15px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(66px, 9.2vw, 126px);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.055em;
}

.game-title__main {
  display: block;
  color: var(--cream);
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.game-title__accent {
  position: relative;
  display: block;
  width: max-content;
  margin-top: 0.07em;
  margin-left: 0.42em;
  color: var(--amber);
  color: transparent;
  font-size: 0.84em;
  letter-spacing: 0.015em;
  -webkit-text-stroke: 1.8px var(--amber);
  text-stroke: 1.8px var(--amber);
  filter: drop-shadow(0 0 22px rgba(242, 184, 75, 0.12));
}

.game-title__accent::before {
  content: "";
  position: absolute;
  top: 0.1em;
  bottom: 0.04em;
  left: -0.17em;
  width: 3px;
  background: var(--red);
  transform: skewY(-14deg);
}

.hero-lead {
  max-width: 34em;
  margin: 0;
  color: var(--cream-dim);
  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 1.85;
  letter-spacing: 0.015em;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.tag {
  padding: 5px 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  border: 1px solid rgba(238, 229, 207, 0.12);
  background: rgba(0, 0, 0, 0.12);
}

.tag--amber {
  color: var(--amber-light);
  border-color: rgba(242, 184, 75, 0.34);
  background: rgba(242, 184, 75, 0.07);
}

.start-actions {
  display: flex;
  align-items: stretch;
  gap: 22px;
  margin-top: clamp(26px, 3vw, 40px);
}

.start-actions .btn {
  min-width: 188px;
  min-height: 62px;
}

.best-record {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.best-record span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.best-record strong {
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.control-line {
  margin: 19px 0 0;
  color: rgba(153, 164, 143, 0.78);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.control-line span {
  margin: 0 5px;
  color: rgba(242, 184, 75, 0.55);
}

.rules-panel {
  min-width: 0;
  padding-left: clamp(24px, 3vw, 48px);
  border-left: 1px solid var(--line);
}

.rules-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}

.rules-head h2 {
  margin: 0;
  color: var(--cream);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.rules-head span {
  color: var(--olive-light);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.15em;
}

.rule-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(231, 223, 196, 0.1);
}

.rule-index {
  padding-top: 2px;
  color: rgba(242, 184, 75, 0.65);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.rule-list h3 {
  margin: 0 0 4px;
  color: var(--cream);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.rule-list p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.score-legend {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 30px);
  margin-top: 19px;
  padding: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(242, 184, 75, 0.045), transparent 70%),
    rgba(0, 0, 0, 0.13);
}

.target-mini {
  position: relative;
  flex: 0 0 auto;
  width: 88px;
  aspect-ratio: 1;
  border: 3px solid #3c382a;
  border-radius: 50%;
  background:
    radial-gradient(circle,
      #e15038 0 12%,
      #f0e5cd 12% 25%,
      #bf4333 25% 40%,
      #f2e7cf 40% 55%,
      #b83f30 55% 70%,
      #e8dcc0 70% 84%,
      #c3b48c 84% 100%);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.3),
    inset 5px 7px 12px rgba(255, 255, 255, 0.16),
    inset -5px -8px 14px rgba(0, 0, 0, 0.25);
  animation: targetFloat 5s ease-in-out infinite;
}

.target-mini::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #342d21;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.target-mini__cross {
  position: absolute;
  top: 50%;
  left: 50%;
  background: rgba(44, 38, 27, 0.35);
  transform: translate(-50%, -50%);
}

.target-mini__cross--h {
  width: 82%;
  height: 1px;
}

.target-mini__cross--v {
  width: 1px;
  height: 82%;
}

.legend-list {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0;
}

.legend-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(238, 229, 207, 0.08);
}

.legend-list dt {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.legend-list dd {
  margin: 0;
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.legend-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-dot--bull {
  background: var(--amber);
  box-shadow: 0 0 7px rgba(242, 184, 75, 0.5);
}

.legend-dot--inner {
  background: var(--red);
}

.legend-dot--outer {
  background: #c9b88f;
}

.legend-dot--miss {
  background: #5a5e52;
}

.combo-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 13px 0 0;
  color: rgba(185, 202, 128, 0.8);
  font-size: 10px;
  line-height: 1.5;
}

.combo-note__mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--bg-deep);
  font-family: var(--font-mono);
  font-weight: 900;
  background: var(--olive-light);
}

.start-footer {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  color: rgba(153, 164, 143, 0.64);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   暂停 / 结算弹窗
   -------------------------------------------------------------------------- */

.modal-card {
  position: relative;
  width: min(680px, 100%);
  margin: auto;
  padding: clamp(28px, 4.4vw, 56px);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 32%),
    linear-gradient(145deg, rgba(19, 30, 21, 0.98), rgba(6, 12, 8, 0.98));
  box-shadow: 0 42px 100px rgba(0, 0, 0, 0.55);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
}

.modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 26px;
  left: 0;
  height: 2px;
  background: repeating-linear-gradient(120deg, var(--amber) 0 14px, transparent 14px 26px);
  opacity: 0.6;
}

.modal-card--pause {
  width: min(610px, 100%);
  text-align: center;
}

.modal-title {
  margin: 14px 0 8px;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: clamp(52px, 7vw, 82px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.035em;
}

.modal-copy {
  max-width: 30em;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.modal-actions .btn {
  min-width: 148px;
}

.modal-hint {
  margin: 20px 0 0;
  color: rgba(153, 164, 143, 0.55);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
}

.result-card {
  width: min(900px, 100%);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.new-record {
  padding: 4px 9px;
  color: var(--bg-deep);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: var(--amber);
  animation: recordBlink 1.3s steps(2, end) infinite;
}

.result-hero {
  display: flex;
  align-items: center;
  gap: clamp(28px, 5vw, 58px);
  margin: 26px 0 30px;
}

.rank-badge {
  --rank-color: #b9ca80;
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 150px;
  aspect-ratio: 1;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--rank-color) 55%, transparent);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rank-color) 15%, transparent), transparent 64%),
    rgba(0, 0, 0, 0.25);
  box-shadow:
    0 0 0 6px rgba(238, 229, 207, 0.025),
    0 0 38px color-mix(in srgb, var(--rank-color) 11%, transparent),
    inset 0 0 25px rgba(0, 0, 0, 0.25);
}

.rank-badge::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed color-mix(in srgb, var(--rank-color) 35%, transparent);
  border-radius: 50%;
  animation: slowSpin 26s linear infinite;
}

.rank-badge[data-rank="expert"] {
  --rank-color: #ffd477;
}

.rank-badge[data-rank="excellent"] {
  --rank-color: #b9ca80;
}

.rank-badge[data-rank="qualified"] {
  --rank-color: #d2b88a;
}

.rank-badge[data-rank="trainee"] {
  --rank-color: #8e9986;
}

.rank-badge__star {
  position: relative;
  z-index: 1;
  color: var(--rank-color);
  font-size: 23px;
  line-height: 1;
  text-shadow: 0 0 18px color-mix(in srgb, var(--rank-color) 55%, transparent);
}

.rank-badge strong {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  color: var(--rank-color);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.rank-badge > span:last-child {
  position: relative;
  z-index: 1;
  margin-top: 3px;
  color: rgba(238, 229, 207, 0.45);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.16em;
}

.final-score-wrap {
  min-width: 0;
}

.final-score-label {
  display: block;
  color: var(--olive-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.final-score {
  display: block;
  margin: 3px 0 7px;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: clamp(66px, 9vw, 105px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 34px rgba(242, 184, 75, 0.1);
}

.result-message {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-stat {
  padding: 17px 14px 16px;
  border-right: 1px solid var(--line);
}

.result-stat:last-child {
  border-right: 0;
}

.result-stat span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.result-stat strong {
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.modal-actions--result {
  margin-top: 26px;
}

.result-footnote {
  margin: 22px 0 0;
  color: rgba(153, 164, 143, 0.46);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  text-align: center;
}

/* --------------------------------------------------------------------------
   倒计时
   -------------------------------------------------------------------------- */

.countdown-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: radial-gradient(circle at center, rgba(3, 8, 5, 0.08), rgba(3, 8, 5, 0.46));
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.countdown-screen.is-open {
  opacity: 1;
  visibility: visible;
}

.countdown-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-kicker {
  margin: 0 0 18px;
  color: var(--amber-light);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.countdown-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 182px;
  aspect-ratio: 1;
  border: 2px solid rgba(242, 184, 75, 0.85);
  border-radius: 50%;
  background: rgba(5, 11, 7, 0.38);
  box-shadow:
    0 0 0 11px rgba(242, 184, 75, 0.055),
    0 0 60px rgba(242, 184, 75, 0.16),
    inset 0 0 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
}

.countdown-ring::before,
.countdown-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.countdown-ring::before {
  inset: 12px;
  border: 1px dashed rgba(242, 184, 75, 0.4);
  animation: slowSpin 9s linear infinite;
}

.countdown-ring::after {
  inset: -23px;
  border: 1px solid rgba(238, 229, 207, 0.12);
}

#countdownValue {
  color: var(--amber-light);
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: 0 0 34px rgba(242, 184, 75, 0.32);
}

#countdownValue.is-pop {
  animation: countdownPop 0.46s var(--ease-out);
}

.countdown-screen.is-fire #countdownValue {
  font-family: var(--font-body);
  font-size: 46px;
  letter-spacing: 0.1em;
}

.countdown-screen.is-fire .countdown-ring {
  border-color: var(--cream);
  box-shadow:
    0 0 0 14px rgba(238, 229, 207, 0.06),
    0 0 70px rgba(242, 184, 75, 0.25),
    inset 0 0 40px rgba(0, 0, 0, 0.25);
  animation: fireFlash 0.4s ease-out;
}

.countdown-label {
  margin: 20px 0 0;
  color: rgba(238, 229, 207, 0.65);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

/* --------------------------------------------------------------------------
   开始页入场动画
   -------------------------------------------------------------------------- */

.screen--start.is-open .start-hero > * {
  animation: fadeUp 0.66s var(--ease-out) both;
}

.screen--start.is-open .start-hero > :nth-child(1) { animation-delay: 0.04s; }
.screen--start.is-open .start-hero > :nth-child(2) { animation-delay: 0.09s; }
.screen--start.is-open .start-hero > :nth-child(3) { animation-delay: 0.14s; }
.screen--start.is-open .start-hero > :nth-child(4) { animation-delay: 0.19s; }
.screen--start.is-open .start-hero > :nth-child(5) { animation-delay: 0.24s; }
.screen--start.is-open .start-hero > :nth-child(6) { animation-delay: 0.29s; }
.screen--start.is-open .start-hero > :nth-child(7) { animation-delay: 0.34s; }
.screen--start.is-open .start-hero > :nth-child(8) { animation-delay: 0.39s; }

.screen--modal.is-open .modal-card {
  animation: modalIn 0.46s var(--ease-out) both;
}

.screen--result.is-open .rank-badge {
  animation: rankIn 0.7s 0.1s var(--ease-out) both;
}

/* --------------------------------------------------------------------------
   动画关键帧
   -------------------------------------------------------------------------- */

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 202, 128, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(185, 202, 128, 0); }
}

@keyframes dangerPulse {
  0%, 100% { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2); }
  50% { box-shadow: 0 0 26px rgba(255, 106, 81, 0.15); }
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.14); color: #fff4d0; }
  100% { transform: scale(1); }
}

@keyframes comboPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes targetFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1deg); }
}

@keyframes slowSpin {
  to { transform: rotate(360deg); }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rankIn {
  from {
    opacity: 0;
    transform: scale(0.82) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes countdownPop {
  0% {
    opacity: 0;
    transform: scale(1.5);
  }
  42% {
    opacity: 1;
    transform: scale(0.94);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fireFlash {
  0% { transform: scale(0.92); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes recordBlink {
  50% { opacity: 0.55; }
}

/* --------------------------------------------------------------------------
   响应式布局
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .hud__grid {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .hud-panel {
    width: 160px;
    padding: 9px 12px 10px;
  }

  #timeValue {
    font-size: 28px;
  }

  .timer-track {
    margin-top: 6px;
  }

  .score-panel {
    min-width: 170px;
    padding: 8px 16px 9px;
    justify-self: center;
  }

  .score-panel__value {
    font-size: 34px;
  }

  .mini-stat {
    display: none;
  }

  .icon-button {
    min-width: 48px;
    padding: 7px 8px;
  }

  .start-panel {
    grid-template-columns: 1fr;
    gap: 28px;
    width: min(760px, 100%);
  }

  .rules-panel {
    padding-top: 26px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .start-footer {
    flex-direction: column;
    gap: 5px;
  }

  .result-hero {
    gap: 28px;
  }

  .rank-badge {
    width: 126px;
  }

  .result-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .result-stat {
    border-bottom: 1px solid var(--line);
  }

  .result-stat:nth-child(3n) {
    border-right: 0;
  }

  .result-stat:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  .screen {
    padding: 10px;
  }

  .start-panel {
    padding: 24px 20px 20px;
    padding-top: 27px;
  }

  .platform-line {
    margin-bottom: 16px;
  }

  .platform-badge {
    font-size: 8px;
    letter-spacing: 0.06em;
  }

  .game-title {
    margin-top: 12px;
    font-size: clamp(58px, 20vw, 86px);
  }

  .game-title__accent {
    -webkit-text-stroke-width: 1.4px;
  }

  .hero-lead {
    font-size: 13px;
    line-height: 1.75;
  }

  .start-actions {
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
  }

  .start-actions .btn {
    flex: 1 1 100%;
    min-width: 0;
  }

  .best-record {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    padding-left: 0;
    border-left: 0;
  }

  .best-record strong {
    font-size: 22px;
  }

  .control-line {
    font-size: 9px;
    line-height: 1.7;
  }

  .rule-list li {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
    padding: 12px 0;
  }

  .score-legend {
    gap: 16px;
    padding: 12px;
  }

  .target-mini {
    width: 72px;
  }

  .legend-list {
    gap: 6px 12px;
  }

  .hud__grid {
    width: calc(100% - 16px);
    margin-top: max(8px, env(safe-area-inset-top));
  }

  .hud-panel {
    width: 102px;
    padding: 7px 9px 8px;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  }

  .hud-panel__kicker {
    font-size: 7.5px;
    letter-spacing: 0.06em;
  }

  .hud-panel__kicker .live-dot {
    display: none;
  }

  #timeValue {
    font-size: 24px;
  }

  .timer-unit {
    font-size: 9px;
  }

  .score-panel {
    min-width: 0;
    padding: 7px 8px 8px;
  }

  .score-panel__label {
    font-size: 7.5px;
    letter-spacing: 0.08em;
  }

  .score-panel__value {
    font-size: 27px;
  }

  .combo-badge {
    margin-top: 2px;
    padding: 1px 5px;
    font-size: 7.5px;
  }

  .hud-actions {
    gap: 4px;
  }

  .icon-button {
    min-width: 38px;
    padding: 5px 6px;
  }

  .icon-button span {
    display: none;
  }

  .icon {
    width: 17px;
    height: 17px;
  }

  .hint-bar {
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 7px;
    padding: 7px 12px;
    font-size: 8.5px;
  }

  .modal-card {
    padding: 30px 22px 24px;
  }

  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .result-head {
    align-items: flex-start;
  }

  .result-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    margin: 22px 0 24px;
  }

  .rank-badge {
    width: 112px;
  }

  .rank-badge strong {
    font-size: 16px;
  }

  .final-score {
    font-size: 72px;
  }

  .result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-stat:nth-child(2n) {
    border-right: 0;
  }

  .result-stat:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .result-stat:nth-child(2n) {
    border-right: 0;
  }

  .result-stat:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .result-stat:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
    border-right: 0;
  }

  .countdown-ring {
    width: 146px;
  }

  #countdownValue {
    font-size: 76px;
  }

  .countdown-screen.is-fire #countdownValue {
    font-size: 38px;
  }
}

@media (max-height: 680px) and (min-width: 981px) {
  .start-panel {
    padding-top: 26px;
    padding-bottom: 24px;
  }

  .platform-line {
    margin-bottom: 12px;
  }

  .game-title {
    font-size: clamp(60px, 8vw, 100px);
    margin: 10px 0 12px;
  }

  .hero-tags {
    margin-top: 14px;
  }

  .start-actions {
    margin-top: 20px;
  }

  .start-actions .btn {
    min-height: 54px;
  }

  .rule-list li {
    padding: 10px 0;
  }

  .score-legend {
    margin-top: 12px;
    padding: 10px;
  }

  .target-mini {
    width: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .screen--start.is-open .start-hero > * {
    animation-delay: 0s !important;
  }
}
