@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@500;600;700;900&family=Space+Mono:wght@400;700&display=swap');

:root {
  --ink: #0a0917;
  --night: #100e28;
  --night-soft: #171332;
  --plum: #2a1b47;
  --red: #e04750;
  --red-soft: #ff8d83;
  --cream: #f4e6cf;
  --muted: #a698b6;
  --line: rgba(244, 230, 207, 0.16);
  --line-bright: rgba(244, 230, 207, 0.34);
  --mono: 'Space Mono', 'Cascadia Mono', Consolas, monospace;
  --serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(circle at 18% 16%, rgba(99, 42, 103, 0.28), transparent 27rem),
    radial-gradient(circle at 92% 82%, rgba(82, 26, 61, 0.32), transparent 29rem),
    var(--ink);
  font-family: var(--serif);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: '';
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

button {
  font: inherit;
}

.page-shell {
  width: min(100%, 1420px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 54px) clamp(14px, 4vw, 56px);
  display: grid;
  place-items: center;
}

.game-card {
  width: min(100%, 1250px);
  overflow: hidden;
  border: 1px solid var(--line-bright);
  background: rgba(16, 14, 40, 0.9);
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.42),
    0 0 0 8px rgba(244, 230, 207, 0.025),
    inset 0 0 0 1px rgba(224, 71, 80, 0.12);
}

.topbar,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  min-height: 78px;
  padding: 16px 24px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 9, 23, 0.4);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.seal {
  display: grid;
  place-items: center;
  color: var(--cream);
  border: 1px solid var(--red);
  background: rgba(224, 71, 80, 0.15);
  font-family: var(--serif);
  font-weight: 900;
}

.brand-mark {
  width: 38px;
  height: 38px;
  font-size: 21px;
  transform: rotate(-5deg);
}

.eyebrow,
.brand-name,
.topbar-note,
.card-footer,
.progress-label,
.control-heading,
.control-row,
.stat-cell dt,
.button-key {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red-soft);
  font-size: 9px;
  line-height: 1.2;
}

.brand-name {
  margin: 0;
  color: var(--cream);
  font-size: 12px;
  letter-spacing: 0.2em;
}

.topbar-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 9px;
}

.topbar-ost-link {
  margin-left: 6px;
  padding-left: 12px;
  color: var(--red-soft);
  border-left: 1px solid var(--line);
  transition: color 160ms ease;
}

.topbar-ost-link:hover,
.topbar-ost-link:focus-visible {
  color: var(--cream);
}

.signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 13px var(--red);
  animation: signal-pulse 1.8s ease-in-out infinite;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 0;
}

.stage-column {
  min-width: 0;
  padding: clamp(18px, 3vw, 38px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 34%),
    rgba(9, 8, 23, 0.58);
}

.stage-frame {
  position: relative;
  width: min(100%, 540px);
  margin: 0 auto;
  padding: 9px;
  background: #080817;
  box-shadow:
    0 0 0 1px rgba(244, 230, 207, 0.3),
    0 0 0 5px rgba(224, 71, 80, 0.1),
    0 25px 60px rgba(0, 0, 0, 0.45);
}

.stage-frame::before,
.stage-frame::after {
  position: absolute;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-color: var(--red-soft);
  border-style: solid;
  content: '';
  pointer-events: none;
}

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

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

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  cursor: crosshair;
  background: #0e0d25;
  image-rendering: pixelated;
  touch-action: none;
}

.mobile-hud {
  display: none;
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 5;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  padding: 6px;
  border: 1px solid rgba(244, 230, 207, 0.25);
  background: rgba(9, 8, 23, 0.84);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.mobile-hud div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 4px 5px;
  background: rgba(244, 230, 207, 0.05);
}

.mobile-hud span,
.mobile-hud p {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.mobile-hud strong {
  overflow: hidden;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-hud div:nth-child(1) strong {
  color: var(--red-soft);
}

.mobile-hud p {
  grid-column: 1 / -1;
  overflow: hidden;
  margin: 2px 4px 0;
  color: var(--red-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scanlines,
.canvas-vignette {
  position: absolute;
  inset: 9px;
  pointer-events: none;
}

.scanlines {
  z-index: 2;
  opacity: 0.16;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(255, 255, 255, 0.08) 4px);
  mix-blend-mode: screen;
}

.canvas-vignette {
  z-index: 1;
  box-shadow: inset 0 0 52px rgba(0, 0, 0, 0.55);
}

.stage-ribbon {
  position: absolute;
  z-index: 4;
  top: 24px;
  color: rgba(244, 230, 207, 0.76);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  writing-mode: vertical-rl;
  pointer-events: none;
}

.stage-ribbon-left {
  left: -25px;
}

.stage-ribbon-right {
  right: -25px;
  color: var(--red-soft);
}

.side-panel {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 36px 28px 26px;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 100% 0%, rgba(224, 71, 80, 0.12), transparent 19rem),
    linear-gradient(180deg, rgba(42, 27, 71, 0.38), rgba(10, 9, 23, 0.48));
}

.side-heading h1 {
  margin: 12px 0 3px;
  color: var(--cream);
  font-size: clamp(50px, 5.8vw, 76px);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 0.83;
  text-shadow: 4px 5px 0 rgba(224, 71, 80, 0.2);
}

.side-heading h1 em {
  color: var(--red-soft);
  font-style: normal;
}

.subtitle {
  margin: 17px 0 19px;
  color: var(--red-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.stage-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 15px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stage-caption span:first-child {
  color: var(--cream);
}

.stage-caption span:nth-child(2) {
  color: var(--red-soft);
  text-align: right;
}

.stage-caption span:nth-child(3) {
  color: var(--muted);
  text-align: right;
}

.heading-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.rule-mark {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 24px 0 21px;
}

.rule-mark span {
  height: 1px;
  flex: 1;
  background: var(--line);
}

.rule-mark i {
  color: var(--red-soft);
  font-size: 12px;
  font-style: normal;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.stat-cell {
  min-height: 65px;
  padding: 12px 12px 10px;
  background: rgba(10, 9, 23, 0.48);
}

.stat-wide {
  grid-column: 1 / -1;
  min-height: 76px;
  background: rgba(224, 71, 80, 0.08);
}

.stat-cell dt {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 8px;
}

.stat-cell dd {
  margin: 0;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.04em;
}

.stat-wide dd {
  color: var(--red-soft);
  font-size: 25px;
  letter-spacing: 0.12em;
}

.hearts,
.bombs {
  color: var(--red-soft) !important;
  font-size: 13px !important;
  letter-spacing: 0.18em !important;
}

.progress-block {
  margin: 22px 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 8px;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  background: rgba(244, 230, 207, 0.11);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--red-soft));
  box-shadow: 0 0 15px rgba(224, 71, 80, 0.8);
  transition: width 0.18s ease-out;
}

.status-copy {
  min-height: 18px;
  margin: 9px 0 0;
  color: var(--red-soft);
  font-size: 12px;
}

.difficulty-card {
  margin: 0 0 16px;
  padding: 11px 10px 10px;
  border: 1px solid var(--line);
  background: rgba(10, 9, 23, 0.42);
}

.difficulty-card legend,
.audio-heading,
.audio-toggle,
.volume-row {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.difficulty-card legend {
  padding: 0 5px;
  color: var(--red-soft);
  font-size: 8px;
}

.difficulty-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.difficulty-option {
  display: block;
  cursor: pointer;
}

.difficulty-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.difficulty-option span {
  display: flex;
  min-height: 42px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border: 1px solid transparent;
  background: rgba(244, 230, 207, 0.045);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.difficulty-option strong {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.difficulty-option small {
  color: rgba(166, 152, 182, 0.72);
  font-size: 9px;
}

.difficulty-option input:checked + span,
.difficulty-option:hover span {
  border-color: var(--red);
  background: rgba(224, 71, 80, 0.14);
}

.difficulty-option input:checked + span strong,
.difficulty-option:hover strong {
  color: var(--cream);
}

.difficulty-option input:focus-visible + span {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.difficulty-lunatic input:checked + span {
  border-color: var(--red-soft);
  background: rgba(224, 71, 80, 0.26);
  box-shadow: inset 0 -2px 0 var(--red-soft);
}

.difficulty-lunatic strong {
  color: var(--red-soft);
}

.difficulty-copy {
  min-height: 15px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.launch-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 10px 13px;
  color: var(--cream);
  border: 1px solid var(--red);
  background: var(--red);
  box-shadow: 5px 5px 0 rgba(111, 30, 54, 0.54);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.launch-button:hover {
  background: #f15a61;
  box-shadow: 3px 3px 0 rgba(111, 30, 54, 0.54);
  transform: translate(2px, 2px);
}

.launch-button:active {
  box-shadow: 0 0 0 rgba(111, 30, 54, 0.54);
  transform: translate(5px, 5px);
}

.launch-button:focus-visible,
.touch-key:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.button-glyph {
  font-size: 21px;
  line-height: 1;
}

#launchLabel {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
}

.button-key {
  opacity: 0.7;
  font-size: 8px;
}

.audio-card {
  margin-top: 20px;
  padding: 14px 0 2px;
  border-top: 1px solid var(--line);
}

.soundtrack-link {
  display: block;
  margin-top: 13px;
  color: var(--red-soft);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-align: right;
  transition: color 160ms ease;
}

.soundtrack-link:hover,
.soundtrack-link:focus-visible {
  color: var(--cream);
}

.audio-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
  color: var(--red-soft);
  font-size: 8px;
}

.audio-heading span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.audio-toggle {
  min-height: 29px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(244, 230, 207, 0.045);
  cursor: pointer;
  font-size: 8px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.audio-toggle:hover,
.audio-toggle:focus-visible,
.audio-toggle.is-on {
  color: var(--cream);
  border-color: var(--red);
  background: rgba(224, 71, 80, 0.12);
}

.audio-toggle:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.volume-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 8px;
}

.volume-row output {
  min-width: 22px;
  color: var(--red-soft);
  font-family: var(--mono);
  font-size: 8px;
  text-align: right;
}

.volume-row input[type='range'] {
  width: 100%;
  height: 3px;
  accent-color: var(--red-soft);
  cursor: pointer;
}

.control-card {
  margin-top: 28px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.control-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  color: var(--red-soft);
  font-size: 8px;
}

.control-heading span:last-child {
  color: var(--muted);
}

.control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 27px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
}

kbd {
  display: inline-grid;
  min-width: 34px;
  min-height: 20px;
  padding: 3px 5px;
  place-items: center;
  color: var(--cream);
  border: 1px solid var(--line-bright);
  background: rgba(244, 230, 207, 0.06);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.side-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 26px;
}

.seal {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  font-size: 17px;
  transform: rotate(7deg);
}

.side-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.side-footer p span {
  color: rgba(166, 152, 182, 0.7);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-view {
  position: relative;
  min-height: 700px;
  padding: clamp(42px, 7vw, 86px) clamp(20px, 9vw, 150px) 50px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 22%, rgba(224, 71, 80, 0.17), transparent 20rem),
    linear-gradient(135deg, rgba(42, 27, 71, 0.42), rgba(10, 9, 23, 0.68));
  text-align: center;
}

.result-view::before,
.result-view::after {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255, 141, 131, 0.22);
  content: '';
  transform: rotate(45deg);
  pointer-events: none;
}

.result-view::before {
  top: -92px;
  left: -92px;
}

.result-view::after {
  right: -92px;
  bottom: -92px;
}

.result-ornament {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(100%, 480px);
  margin: 0 auto 24px;
}

.result-ornament span {
  height: 1px;
  flex: 1;
  background: var(--line-bright);
}

.result-ornament i {
  color: var(--red-soft);
  font-size: 16px;
  font-style: normal;
}

.result-view h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--cream);
  font-size: clamp(60px, 9vw, 105px);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 0.95;
  text-shadow: 5px 6px 0 rgba(224, 71, 80, 0.18);
}

.result-view h2 span {
  color: var(--red-soft);
}

.result-lead {
  margin: 22px auto 27px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.result-stamp {
  position: absolute;
  top: 54px;
  right: clamp(25px, 8vw, 118px);
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  color: var(--red-soft);
  border: 1px solid var(--red);
  transform: rotate(8deg);
}

.result-stamp::before {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 141, 131, 0.5);
  content: '';
}

.result-stamp span {
  z-index: 1;
  font-family: var(--mono);
  font-size: 29px;
  font-weight: 700;
}

.result-stamp small {
  position: absolute;
  bottom: 9px;
  z-index: 1;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.15em;
}

.result-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  width: min(100%, 720px);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--line);
  text-align: left;
}

.result-metric {
  min-height: 76px;
  padding: 13px 14px 11px;
  background: rgba(10, 9, 23, 0.55);
}

.result-metric span,
.result-route-heading,
.result-stage-entry,
.result-track {
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-metric span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 8px;
}

.result-metric strong {
  color: var(--cream);
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.05em;
}

.result-score {
  grid-column: span 2;
  background: rgba(224, 71, 80, 0.1);
}

.result-score strong {
  color: var(--red-soft);
  font-size: 25px;
  letter-spacing: 0.12em;
}

.result-route {
  width: min(100%, 720px);
  margin: 26px auto 0;
  text-align: left;
}

.result-route-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 8px;
}

.result-route-heading span:first-child {
  color: var(--red-soft);
}

.result-stage-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.result-stage-entry {
  display: flex;
  min-height: 54px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  color: var(--cream);
  border: 1px solid var(--line);
  background: rgba(244, 230, 207, 0.045);
  font-size: 8px;
}

.result-stage-entry strong {
  color: var(--red-soft);
  font-family: var(--serif);
  font-size: 16px;
}

.result-stage-entry small {
  color: var(--muted);
  font-size: 7px;
}

.result-track {
  margin: 24px auto 19px;
  color: var(--muted);
  font-size: 8px;
}

.result-button {
  width: min(100%, 320px);
  margin: 0 auto;
  text-align: left;
}

.secondary-button {
  display: flex;
  width: min(100%, 320px);
  min-height: 44px;
  align-items: center;
  gap: 9px;
  margin: 12px auto 0;
  padding: 9px 13px;
  color: var(--red-soft);
  border: 1px solid var(--red);
  background: rgba(224, 71, 80, 0.08);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  color: var(--cream);
  background: rgba(224, 71, 80, 0.2);
  transform: translateY(-2px);
}

.secondary-button:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.secondary-button span:nth-child(2) {
  flex: 1;
}

.secondary-button small {
  color: var(--muted);
  font-size: 7px;
}

.practice-open-button {
  margin-top: 12px;
}

.practice-panel {
  margin-top: 12px;
  padding: 16px 14px 14px;
  border: 1px solid rgba(255, 141, 131, 0.42);
  background:
    linear-gradient(135deg, rgba(224, 71, 80, 0.12), transparent 54%),
    rgba(10, 9, 23, 0.55);
}

.practice-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.practice-heading .eyebrow {
  margin-bottom: 5px;
}

.practice-heading h2 {
  margin: 0;
  color: var(--cream);
  font-size: 22px;
}

.practice-close {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(244, 230, 207, 0.04);
  font-size: 18px;
  line-height: 1;
}

.practice-close:hover,
.practice-close:focus-visible {
  color: var(--cream);
  border-color: var(--red-soft);
}

.practice-copy {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.practice-field {
  display: grid;
  gap: 6px;
  margin-top: 11px;
  color: var(--red-soft);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.practice-field select {
  width: 100%;
  min-height: 35px;
  padding: 6px 8px;
  color: var(--cream);
  border: 1px solid var(--line-bright);
  border-radius: 0;
  outline: none;
  background: #171332;
  font-family: var(--serif);
  font-size: 11px;
}

.practice-field select:focus-visible {
  border-color: var(--red-soft);
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.practice-infinite {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 9px;
  color: var(--cream);
  border: 1px solid var(--line);
  background: rgba(244, 230, 207, 0.04);
  cursor: pointer;
}

.practice-infinite input {
  width: 15px;
  height: 15px;
  accent-color: var(--red-soft);
}

.infinite-mark {
  color: var(--red-soft);
  font-family: var(--mono);
  font-size: 22px;
  line-height: 1;
}

.practice-infinite span:last-child {
  display: grid;
  gap: 3px;
}

.practice-infinite strong {
  font-size: 11px;
}

.practice-infinite small {
  color: var(--muted);
  font-size: 9px;
}

.practice-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  margin-top: 14px;
}

.practice-actions .launch-button {
  min-height: 43px;
  box-shadow: 3px 3px 0 rgba(111, 30, 54, 0.54);
}

.practice-actions .launch-button span:nth-child(2) {
  flex: 1;
  font-size: 13px;
}

.practice-actions .launch-button small {
  color: rgba(244, 230, 207, 0.74);
  font-family: var(--mono);
  font-size: 7px;
}

.practice-cancel {
  min-width: 62px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(244, 230, 207, 0.04);
  font-family: var(--mono);
  font-size: 8px;
}

.practice-cancel:hover,
.practice-cancel:focus-visible {
  color: var(--cream);
  border-color: var(--red-soft);
}

.card-footer {
  min-height: 43px;
  padding: 11px 24px;
  border-top: 1px solid var(--line);
  color: rgba(166, 152, 182, 0.76);
  font-size: 8px;
}

.touch-controls {
  display: none;
}

@keyframes signal-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

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

  .side-heading h1 {
    font-size: clamp(50px, 11vw, 76px);
  }

  .side-footer {
    margin-top: 30px;
  }
}

@media (max-width: 600px) {
  .page-shell {
    padding: 0;
  }

  .game-card {
    border-right: 0;
    border-left: 0;
  }

  .topbar {
    min-height: 67px;
    padding: 13px 16px;
  }

  .topbar-note {
    display: none;
  }

  .stage-column {
    padding: 15px 10px 11px;
  }

  .stage-frame {
    padding: 6px;
  }

  .scanlines,
  .canvas-vignette {
    inset: 6px;
  }

  .stage-ribbon {
    display: none;
  }

  .mobile-hud {
    display: grid;
  }

  .touch-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 480px;
    margin: 18px auto 0;
  }

  .d-pad {
    position: relative;
    width: 118px;
    height: 94px;
  }

  .action-pad {
    display: flex;
    align-items: flex-end;
    gap: 8px;
  }

  .touch-key {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    color: var(--cream);
    border: 1px solid var(--line-bright);
    background: rgba(244, 230, 207, 0.06);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
  }

  .touch-key:active,
  .touch-key.is-held {
    color: var(--ink);
    background: var(--red-soft);
  }

  .d-pad .touch-key {
    position: absolute;
  }

  .touch-up { top: 0; left: 40px; }
  .touch-left { top: 40px; left: 0; }
  .touch-right { top: 40px; right: 0; }
  .touch-down { bottom: 0; left: 40px; }
  .action-focus { color: var(--red-soft); }
  .action-shoot { width: 46px; height: 46px; color: var(--red-soft); border-color: var(--red); }
  .action-bomb { width: 40px; height: 40px; }

  .side-panel {
    padding: 24px 15px 20px;
  }

  .side-heading h1 {
    margin-top: 9px;
    font-size: clamp(42px, 14vw, 58px);
  }

  .heading-copy {
    font-size: 11px;
    line-height: 1.7;
  }

  .rule-mark {
    margin: 18px 0 15px;
  }

  .stat-cell {
    min-height: 57px;
    padding: 9px 9px 8px;
  }

  .stat-wide {
    min-height: 65px;
  }

  .stat-cell dd {
    font-size: 14px;
  }

  .stat-wide dd {
    font-size: 20px;
  }

  .hearts,
  .bombs {
    font-size: 11px !important;
  }

  .progress-block {
    margin: 17px 0;
  }

  .stage-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .stage-caption span:nth-child(2),
  .stage-caption span:nth-child(3) {
    text-align: left;
  }

  .difficulty-options {
    gap: 3px;
  }

  .difficulty-option strong {
    font-size: 7px;
  }

  .difficulty-option small {
    font-size: 8px;
  }

  .practice-panel {
    padding: 14px 11px 12px;
  }

  .result-view {
    min-height: 760px;
    padding: 40px 16px 34px;
  }

  .result-stamp {
    position: relative;
    top: auto;
    right: auto;
    margin: 22px auto 0;
  }

  .result-lead {
    margin-bottom: 0;
  }

  .result-metrics {
    grid-template-columns: 1fr 1fr;
    margin-top: 24px;
  }

  .result-score {
    grid-column: 1 / -1;
  }

  .result-stage-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 14px 16px;
  }
}

@media (max-width: 380px) {
  .brand-name {
    font-size: 10px;
    letter-spacing: 0.13em;
  }

  .mobile-hud {
    right: 7px;
    bottom: 7px;
    left: 7px;
    padding: 4px;
  }

  .mobile-hud strong {
    font-size: 9px;
  }

  .difficulty-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .difficulty-option span {
    min-height: 36px;
  }

  .practice-actions {
    grid-template-columns: 1fr;
  }

  .practice-cancel {
    min-height: 36px;
  }
}

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