/* =========================================================
   STEEL FRONT — interface layer
   ========================================================= */
:root {
  --ink: #050b09;
  --ink-soft: #07100e;
  --panel: #0a1412;
  --panel-raised: #0e1a17;
  --line: rgba(128, 218, 190, 0.15);
  --line-strong: rgba(128, 218, 190, 0.3);
  --mint: #63f5c3;
  --mint-dim: #2a8d72;
  --amber: #ffb84d;
  --danger: #ff6157;
  --text: #dff3ea;
  --muted: #7f9c91;
  --font-display: "Bahnschrift", "DIN Alternate", "Arial Narrow", "Microsoft YaHei", sans-serif;
  --font-body: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100dvh;
  margin: 0;
  padding: 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button {
  font: inherit;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 60% at 50% 47%, rgba(32, 77, 60, 0.24), transparent 70%),
    radial-gradient(ellipse 30% 40% at 8% 96%, rgba(255, 184, 77, 0.07), transparent 70%),
    radial-gradient(ellipse 35% 35% at 96% 8%, rgba(99, 245, 195, 0.06), transparent 70%),
    #050b09;
}

.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 245, 195, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 245, 195, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 74%);
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ---------------- shell ---------------- */
.game-shell {
  position: relative;
  width: min(1180px, calc(100vw - 40px), calc((100dvh - 142px) * 1.6));
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  box-shadow:
    0 44px 100px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.game-shell::before,
.game-shell::after {
  content: "";
  position: absolute;
  top: 0;
  width: 70px;
  height: 1px;
  z-index: 3;
  background: var(--mint);
  box-shadow: 0 0 14px var(--mint);
}

.game-shell::before {
  left: 24px;
}

.game-shell::after {
  right: 24px;
  opacity: 0.45;
}

/* ---------------- top HUD ---------------- */
.hud {
  position: relative;
  z-index: 4;
  min-height: 67px;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent),
    rgba(6, 14, 12, 0.96);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  color: var(--mint);
  border: 1px solid rgba(99, 245, 195, 0.3);
  background: rgba(99, 245, 195, 0.055);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
}

.brand-mark svg {
  width: 28px;
  fill: currentColor;
  filter: drop-shadow(0 0 7px rgba(99, 245, 195, 0.4));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-kicker {
  color: var(--muted);
  font: 500 7px/1.2 var(--font-mono);
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.brand-name {
  font: 700 19px/1 var(--font-display);
  letter-spacing: 0.075em;
  white-space: nowrap;
}

.brand-name em {
  color: var(--amber);
  font-style: normal;
}

.readouts {
  margin-left: auto;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.readout {
  min-width: 84px;
  padding: 1px 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 1px solid var(--line);
}

.readout span {
  color: var(--muted);
  font: 500 7.5px/1 var(--font-mono);
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.readout strong {
  color: var(--text);
  font: 600 17px/1.05 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.readout:first-child strong {
  color: var(--mint);
}

.readout.best strong {
  color: var(--amber);
}

.hud-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(99, 245, 195, 0.06);
}

.icon-btn:focus-visible,
.primary-btn:focus-visible,
.ghost-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn .sound-cross,
.icon-btn.muted .sound-wave {
  display: none;
}

.icon-btn.muted .sound-cross {
  display: block;
}

.icon-btn.muted {
  color: var(--danger);
}

.icon-btn .play-triangle {
  display: none;
}

.icon-btn.is-paused .pause-bars {
  display: none;
}

.icon-btn.is-paused .play-triangle {
  display: block;
}

/* ---------------- battlefield ---------------- */
.battlefield {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #06100d;
  touch-action: none;
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: none;
}

.battlefield:not(.is-playing) #game {
  cursor: default;
}

.screen-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 48%, rgba(1, 5, 4, 0.54) 118%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.095) 0, rgba(0, 0, 0, 0.095) 1px, transparent 1px, transparent 3px);
  opacity: 0.72;
}

.screen-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(190, 255, 235, 0.018) 49%, transparent 55%);
}

.field-tag {
  position: absolute;
  top: 15px;
  left: 17px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(185, 222, 209, 0.52);
  font: 500 clamp(8px, 0.86vw, 10px)/1 var(--font-mono);
  letter-spacing: 0.17em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.field-tag .slash {
  color: rgba(99, 245, 195, 0.35);
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
  animation: livePulse 2.2s ease-in-out infinite;
}

/* vitals */
.vitals {
  position: absolute;
  left: 17px;
  bottom: 15px;
  z-index: 3;
  width: clamp(148px, 19vw, 218px);
  padding: 9px 11px 10px;
  border-left: 2px solid rgba(99, 245, 195, 0.7);
  background: linear-gradient(90deg, rgba(4, 13, 10, 0.78), rgba(4, 13, 10, 0.28));
  backdrop-filter: blur(3px);
  pointer-events: none;
}

.vital-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.vital-head > span {
  color: var(--muted);
  font: 500 8px/1 var(--font-mono);
  letter-spacing: 0.12em;
}

.vital-head strong {
  color: var(--mint);
  font: 600 15px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.vital-head small {
  margin-left: 1px;
  font-size: 8px;
  opacity: 0.65;
}

.hp-track {
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
  transform: skewX(-18deg);
}

.hp-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--mint-dim), var(--mint));
  box-shadow: 0 0 10px rgba(99, 245, 195, 0.55);
  transition: width 180ms ease, background 260ms ease;
}

.vitals.is-warning .vital-head strong {
  color: var(--amber);
}

.vitals.is-warning .hp-track i {
  background: linear-gradient(90deg, #b27320, var(--amber));
  box-shadow: 0 0 10px rgba(255, 184, 77, 0.55);
}

.vitals.is-critical .vital-head strong {
  color: var(--danger);
}

.vitals.is-critical .hp-track i {
  background: linear-gradient(90deg, #8f2d29, var(--danger));
  box-shadow: 0 0 12px rgba(255, 97, 87, 0.62);
}

.buffs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 180ms ease, margin-top 180ms ease;
}

.buffs:not(:empty) {
  margin-top: 7px;
  max-height: 24px;
}

.buff {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--mint);
  background: rgba(99, 245, 195, 0.08);
  font: 600 7.5px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.buff.rapid { color: var(--amber); background: rgba(255, 184, 77, 0.08); }
.buff.spread { color: #ffd76a; background: rgba(255, 215, 106, 0.08); }
.buff.shield { color: #7dbbff; background: rgba(125, 187, 255, 0.08); }

/* combo */
.combo {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 3;
  min-width: 100px;
  padding: 7px 10px 8px;
  text-align: right;
  border-right: 2px solid var(--amber);
  background: linear-gradient(270deg, rgba(5, 12, 10, 0.7), transparent);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.combo.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.combo-label {
  display: block;
  color: var(--muted);
  font: 500 7px/1 var(--font-mono);
  letter-spacing: 0.23em;
}

.combo strong {
  color: var(--amber);
  font: 700 22px/1 var(--font-display);
  letter-spacing: 0.04em;
  text-shadow: 0 0 16px rgba(255, 184, 77, 0.3);
}

.combo-track {
  width: 100%;
  height: 2px;
  margin-top: 5px;
  background: rgba(255, 255, 255, 0.08);
}

.combo-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--amber);
  transform-origin: right center;
}

/* wave banner */
.wave-banner {
  position: absolute;
  top: 17%;
  left: 50%;
  z-index: 8;
  width: min(84%, 460px);
  padding: 14px 22px 16px;
  color: var(--text);
  text-align: center;
  border-top: 1px solid rgba(99, 245, 195, 0.38);
  border-bottom: 1px solid rgba(99, 245, 195, 0.18);
  background: linear-gradient(90deg, transparent, rgba(4, 13, 10, 0.82) 23%, rgba(4, 13, 10, 0.82) 77%, transparent);
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
}

.wave-banner.is-visible {
  animation: bannerReveal 2.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wave-banner.is-danger {
  border-top-color: rgba(255, 97, 87, 0.55);
  border-bottom-color: rgba(255, 97, 87, 0.2);
}

.wave-banner span {
  display: block;
  color: var(--mint);
  font: 600 8px/1 var(--font-mono);
  letter-spacing: 0.38em;
}

.wave-banner.is-danger span {
  color: var(--danger);
}

.wave-banner strong {
  display: block;
  margin: 4px 0 3px;
  font: 700 clamp(28px, 4.2vw, 50px)/1 var(--font-display);
  letter-spacing: 0.1em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.65);
}

.wave-banner em {
  display: block;
  color: rgba(211, 239, 227, 0.63);
  font: 400 clamp(9px, 1vw, 11px)/1.4 var(--font-body);
  font-style: normal;
  letter-spacing: 0.12em;
}

/* crosshair */
.crosshair {
  --crosshair-color: rgba(130, 255, 215, 0.9);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9;
  width: 30px;
  height: 30px;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 120ms ease, width 100ms ease, height 100ms ease;
  pointer-events: none;
  will-change: left, top;
  mix-blend-mode: screen;
}

.crosshair.is-visible {
  opacity: 1;
}

.crosshair.is-firing {
  width: 38px;
  height: 38px;
}

.crosshair i {
  position: absolute;
  background: var(--crosshair-color);
  box-shadow: 0 0 6px rgba(130, 255, 215, 0.55);
}

.crosshair i:nth-child(1),
.crosshair i:nth-child(2) {
  width: 1px;
  height: 7px;
  left: 50%;
}

.crosshair i:nth-child(1) { top: 0; }
.crosshair i:nth-child(2) { bottom: 0; }

.crosshair i:nth-child(3),
.crosshair i:nth-child(4) {
  width: 7px;
  height: 1px;
  top: 50%;
}

.crosshair i:nth-child(3) { left: 0; }
.crosshair i:nth-child(4) { right: 0; }

.crosshair b {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--crosshair-color);
  transform: translate(-50%, -50%);
}

/* ---------------- overlays ---------------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 46px);
  background: rgba(3, 8, 7, 0.62);
  backdrop-filter: blur(2px);
  animation: screenIn 240ms ease both;
}

.screen[hidden] {
  display: none !important;
}

.screen-start {
  justify-content: flex-start;
  background:
    linear-gradient(90deg, rgba(3, 8, 7, 0.975) 0%, rgba(3, 8, 7, 0.94) 38%, rgba(3, 8, 7, 0.82) 55%, rgba(3, 8, 7, 0.38) 76%, rgba(3, 8, 7, 0.16) 100%),
    radial-gradient(ellipse at 78% 52%, transparent, rgba(3, 8, 7, 0.2));
  padding-left: clamp(24px, 6.4%, 74px);
  backdrop-filter: none;
}

.battlefield.is-menu .vitals,
.battlefield.is-menu .field-tag {
  opacity: 0;
}

.start-card {
  width: min(540px, 56%);
  animation: cardRise 600ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--mint);
  font: 600 9px/1 var(--font-mono);
  letter-spacing: 0.27em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 23px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.eyebrow.danger {
  color: var(--danger);
}

.start-card h1 {
  margin: 15px 0 0;
  color: #effff8;
  font: 800 clamp(58px, 7.2vw, 102px)/0.82 var(--font-display);
  letter-spacing: -0.045em;
  text-shadow: 0 4px 38px rgba(0, 0, 0, 0.55);
}

.start-card h1 span {
  position: relative;
  display: inline-block;
  color: var(--mint);
  margin-left: 0.035em;
}

.start-card h1 span::after {
  content: "";
  position: absolute;
  left: 3%;
  right: -2%;
  bottom: -7px;
  height: 3px;
  background: linear-gradient(90deg, var(--mint), transparent);
  opacity: 0.55;
  transform: skewX(-30deg);
}

.english-title {
  margin: 15px 0 0;
  color: var(--amber);
  font: 500 clamp(8px, 1vw, 11px)/1 var(--font-mono);
  letter-spacing: 0.27em;
}

.lead {
  max-width: 430px;
  margin: 21px 0 22px;
  color: #b1c9bf;
  font-size: clamp(11px, 1.16vw, 13.5px);
  line-height: 1.8;
  letter-spacing: 0.025em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.72);
}

.control-grid {
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 24px;
}

.control {
  min-width: 0;
  padding: 9px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(128, 218, 190, 0.16);
  background: rgba(4, 12, 10, 0.58);
  backdrop-filter: blur(5px);
}

.control b {
  color: #93aca2;
  font: 500 clamp(8px, 0.8vw, 9px)/1 var(--font-mono);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.touch-only,
.touch-guide {
  display: none;
}

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

.touch-stick-icon {
  position: relative;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  border: 1px solid rgba(99, 245, 195, 0.42);
  border-radius: 50%;
}

.touch-stick-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(99, 245, 195, 0.7);
  transform: translate(-50%, -50%);
}

.touch-stick-icon.aim {
  border-color: rgba(255, 184, 77, 0.46);
}

.touch-stick-icon.aim::before {
  background: rgba(255, 184, 77, 0.78);
}

.keys {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 22px;
}

kbd {
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(215, 239, 230, 0.23);
  border-bottom-color: rgba(215, 239, 230, 0.38);
  border-radius: 2px;
  color: #d2e8df;
  background: rgba(255, 255, 255, 0.045);
  font: 500 8px/1 var(--font-mono);
}

kbd.wide {
  min-width: 48px;
  letter-spacing: 0.04em;
}

.mouse-key {
  position: relative;
  width: 15px;
  height: 21px;
  border: 1px solid rgba(215, 239, 230, 0.35);
  border-radius: 8px 8px 6px 6px;
}

.mouse-key::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 9px;
  left: 50%;
  width: 1px;
  background: rgba(215, 239, 230, 0.2);
}

.mouse-key i {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 1px;
  height: 5px;
  background: var(--mint);
  transform: translateX(-50%);
}

.primary-btn,
.ghost-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  height: 49px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font: 600 12px/1 var(--font-body);
  letter-spacing: 0.15em;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.primary-btn {
  min-width: 196px;
  color: #04120d;
  background: var(--mint);
  box-shadow: 0 7px 28px rgba(99, 245, 195, 0.13);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
}

.primary-btn svg {
  width: 18px;
  transition: transform 160ms ease;
}

.primary-btn:hover {
  background: #88fbd5;
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(99, 245, 195, 0.22);
}

.primary-btn:hover svg {
  transform: translateX(4px);
}

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

.primary-btn.small {
  min-width: 156px;
  height: 43px;
}

.ghost-btn {
  min-width: 135px;
  height: 43px;
  color: var(--muted);
  border-color: rgba(128, 218, 190, 0.2);
  background: rgba(255, 255, 255, 0.015);
}

.ghost-btn:hover {
  color: var(--text);
  border-color: rgba(128, 218, 190, 0.42);
  background: rgba(99, 245, 195, 0.04);
}

.fine-print {
  margin: 12px 0 0;
  color: #5f786e;
  font: 400 clamp(8px, 0.85vw, 10px)/1.6 var(--font-body);
  letter-spacing: 0.045em;
}

.start-meta {
  position: absolute;
  right: 22px;
  bottom: 15px;
  display: flex;
  gap: 17px;
  color: rgba(163, 197, 184, 0.28);
  font: 500 7.5px/1 var(--font-mono);
  letter-spacing: 0.15em;
}

.start-meta span + span::before {
  content: "/";
  margin-right: 17px;
  color: rgba(99, 245, 195, 0.18);
}

.compact-card {
  position: relative;
  width: min(490px, 100%);
  padding: clamp(27px, 4vw, 42px);
  border: 1px solid rgba(128, 218, 190, 0.22);
  background:
    linear-gradient(135deg, rgba(99, 245, 195, 0.035), transparent 45%),
    rgba(8, 18, 15, 0.95);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  animation: cardRise 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.compact-card::before,
.compact-card::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--mint);
  border-style: solid;
  opacity: 0.62;
}

.compact-card::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.compact-card::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1px 1px 0;
}

.over-card::before,
.over-card::after {
  border-color: var(--danger);
}

.compact-card h2 {
  margin: 14px 0 10px;
  font: 700 clamp(33px, 4vw, 46px)/1 var(--font-display);
  letter-spacing: 0.02em;
}

.compact-card > p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.result-grid > div {
  padding: 14px 10px 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.result-grid > div + div {
  border-left: 1px solid var(--line);
}

.result-grid span {
  color: var(--muted);
  font: 500 8px/1.2 var(--font-mono);
  letter-spacing: 0.1em;
}

.result-grid strong {
  color: var(--amber);
  font: 600 23px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
}

.over-card .eyebrow {
  animation: dangerPulse 1.8s ease-in-out infinite;
}

/* ---------------- touch ---------------- */
.touch-controls {
  position: absolute;
  inset: auto 0 0;
  z-index: 7;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 22px 18px;
  pointer-events: none;
}

.stick-zone {
  width: 116px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  touch-action: none;
}

.stick-zone > span {
  color: rgba(211, 239, 227, 0.48);
  font: 500 8px/1 var(--font-mono);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.stick {
  position: relative;
  width: 102px;
  height: 102px;
  border: 1px solid rgba(128, 218, 190, 0.23);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(99, 245, 195, 0.075), rgba(4, 13, 10, 0.54) 64%),
    rgba(4, 13, 10, 0.3);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(2px);
}

.stick::before,
.stick::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: rgba(128, 218, 190, 0.12);
  transform: translate(-50%, -50%);
}

.stick::before { width: 64%; height: 1px; }
.stick::after { width: 1px; height: 64%; }

.stick i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(99, 245, 195, 0.42);
  border-radius: 50%;
  background: rgba(99, 245, 195, 0.12);
  box-shadow: 0 0 20px rgba(99, 245, 195, 0.08);
  transform: translate(-50%, -50%);
}

.stick.aim i {
  border-color: rgba(255, 184, 77, 0.45);
  background: rgba(255, 184, 77, 0.1);
}

/* ---------------- footer ---------------- */
.footer {
  min-height: 32px;
  padding: 8px 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  background: rgba(5, 12, 10, 0.92);
  color: rgba(127, 156, 145, 0.52);
  font: 500 7.5px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
}

.footer b {
  color: rgba(99, 245, 195, 0.4);
  font-weight: 400;
}

.footer-hint {
  flex: 1;
  text-align: center;
  letter-spacing: 0.045em;
}

/* ---------------- motion ---------------- */
@keyframes livePulse {
  0%, 100% { opacity: 0.45; box-shadow: 0 0 4px var(--mint); }
  50% { opacity: 1; box-shadow: 0 0 10px var(--mint); }
}

@keyframes bannerReveal {
  0% { opacity: 0; transform: translate(-50%, -12px) scale(0.985); }
  12%, 76% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, 6px) scale(1); }
}

@keyframes screenIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes dangerPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@media (hover: none), (pointer: coarse) {
  .touch-controls {
    display: flex;
  }

  .control-grid:not(.touch-guide) {
    display: none;
  }

  .touch-guide {
    display: grid;
  }

  .desktop-only {
    display: none;
  }

  .touch-only {
    display: inline;
  }

  .battlefield.is-playing .vitals {
    top: 39px;
    bottom: auto;
  }

  .field-tag {
    top: 15px;
  }

  .crosshair {
    display: none;
  }

  #game {
    cursor: default;
  }
}

@media (max-width: 820px) {
  body {
    padding: 10px;
  }

  .game-shell {
    width: min(calc(100vw - 20px), calc((100dvh - 106px) * 1.6));
    border-radius: 8px;
  }

  .hud {
    min-height: 57px;
    padding: 8px 10px;
    gap: 10px;
  }

  .brand {
    gap: 7px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand-mark svg {
    width: 23px;
  }

  .brand-kicker {
    display: none;
  }

  .brand-name {
    font-size: 15px;
  }

  .readout {
    min-width: 52px;
    padding: 1px 8px;
  }

  .readout.best {
    display: none;
  }

  .readout span {
    font-size: 6.5px;
    letter-spacing: 0.04em;
  }

  .readout strong {
    font-size: 13px;
  }

  .icon-btn {
    width: 29px;
    height: 29px;
  }

  .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .footer {
    display: none;
  }

  .screen {
    padding: 16px;
  }

  .screen-start {
    justify-content: center;
    padding: 18px 20px 22px;
    background: linear-gradient(90deg, rgba(3, 8, 7, 0.9), rgba(3, 8, 7, 0.7));
  }

  .start-card {
    width: min(480px, 100%);
  }

  .start-card h1 {
    font-size: clamp(48px, 12vw, 74px);
    line-height: 0.86;
  }

  .lead {
    margin: 14px 0 15px;
    max-width: 380px;
    line-height: 1.65;
  }

  .control-grid {
    margin-bottom: 16px;
  }

  .primary-btn {
    height: 43px;
    min-width: 168px;
  }

  .fine-print {
    display: none;
  }

  .start-meta,
  .field-tag {
    display: none;
  }

  .compact-card {
    padding: 24px;
  }

  .result-grid strong {
    font-size: 18px;
  }
}

@media (max-width: 560px) {
  .readouts .readout:nth-child(3) {
    display: none;
  }

  .readout {
    padding: 1px 7px;
    min-width: 45px;
  }

  .lead {
    font-size: 10.5px;
  }

  .control-grid {
    gap: 5px;
  }

  .control {
    padding: 7px 4px;
  }

  .control b {
    font-size: 7.5px;
    letter-spacing: 0.03em;
  }

  .wave-banner {
    top: 22%;
  }

  .button-row {
    flex-direction: column;
  }

  .primary-btn.small,
  .ghost-btn {
    width: 100%;
  }

  .stick-zone {
    width: 96px;
  }

  .stick {
    width: 84px;
    height: 84px;
  }

  .stick i {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  body {
    padding: 8px;
  }

  .game-shell {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    border-radius: 8px;
  }

  .battlefield {
    height: calc(100dvh - 73px);
    aspect-ratio: auto;
  }

  #game {
    top: 50%;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: auto;
    transform: translateY(-50%);
  }

  .screen {
    overflow-y: auto;
  }

  .screen-start {
    justify-content: center;
    padding: 24px 20px;
    background:
      linear-gradient(180deg, rgba(3, 8, 7, 0.94), rgba(3, 8, 7, 0.78) 55%, rgba(3, 8, 7, 0.93)),
      rgba(3, 8, 7, 0.86);
  }

  .start-card {
    width: min(390px, 100%);
  }

  .start-card h1 {
    margin-top: 12px;
    font-size: clamp(46px, 13.5vw, 64px);
  }

  .english-title {
    margin-top: 12px;
  }

  .lead {
    margin: 15px 0 17px;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 17px;
  }

  .control {
    flex-direction: row;
    justify-content: flex-start;
    gap: 13px;
    padding: 8px 13px;
  }

  .control b {
    font-size: 9px;
  }

  .primary-btn {
    width: 100%;
  }

  .fine-print {
    display: block;
  }

  .battlefield.is-playing .vitals {
    top: 14px;
  }

  .wave-banner {
    top: 10%;
  }

  .start-meta,
  .field-tag {
    display: none;
  }

  .touch-controls {
    padding-bottom: 24px;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  body {
    padding: 6px;
  }

  .game-shell {
    width: min(calc(100vw - 12px), calc((100dvh - 74px) * 1.6));
  }

  .hud {
    min-height: 44px;
    padding: 4px 10px;
  }

  .brand-mark {
    width: 27px;
    height: 27px;
  }

  .brand-name {
    font-size: 14px;
  }

  .footer {
    min-height: 24px;
    padding: 5px 12px;
  }

  .vitals {
    padding: 6px 9px;
  }

  .screen {
    padding: 12px 18px;
  }

  .start-card h1 {
    font-size: clamp(42px, 9vh, 70px);
    margin-top: 8px;
  }

  .lead {
    display: none;
  }

  .control-grid {
    margin: 12px 0 14px;
  }

  .eyebrow {
    font-size: 7px;
  }

  .english-title {
    margin-top: 10px;
  }
}

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