:root {
  color-scheme:dark;
  --bg:#101114;
  --panel:#17191d;
  --line:#2a2c31;
  --muted:#777b86;
  --text:#f5f6f3;
  --lime:#d5ff60;
  --pink:#ff7299;
  --cyan:#76e7e7;
  font-family:"Segoe UI Variable","Segoe UI","Malgun Gothic",Arial,sans-serif;
  font-synthesis:none;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}

button,a,input {
  -webkit-tap-highlight-color:transparent;
}

button {
  font:inherit;
  cursor:pointer;
}

button:focus-visible,a:focus-visible,input:focus-visible {
  outline:2px solid var(--lime);
  outline-offset:5px;
}

button {
  color:inherit;
}

button:disabled {
  cursor:default;
}

button svg {
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

button:active {
  transform:translateY(1px);
}

[hidden] {
  display:none!important;
}

a {
  color:inherit;
  text-decoration:none;
}

.lime {
  color:var(--lime);
}

.app {
  max-width:1520px;
  margin:auto;
  padding:0 46px;
}

.topbar {
  height:106px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  gap:28px;
}

.brand {
  display:flex;
  gap:12px;
  align-items:center;
}

.brand-icon {
  width:42px;
  height:46px;
  background:var(--lime);
  display:grid;
  place-items:center;
  border-radius:11px;
  transform:rotate(-7deg);
}

.brand-icon svg {
  width:29px;
  height:29px;
  fill:#171b11;
  transform:rotate(7deg);
}

.brand-name {
  font-size:20px;
  font-weight:900;
  letter-spacing:-.8px;
}

.brand-caption {
  display:block;
  font-size:8px;
  letter-spacing:3.1px;
  font-weight:500;
  color:#878b91;
  margin-top:5px;
}

.top-status {
  font:10px monospace;
  letter-spacing:1.4px;
  display:flex;
  gap:9px;
  align-items:center;
  color:#a3a69e;
}

.status-dot {
  width:5px;
  height:5px;
  background:var(--lime);
  border-radius:50%;
  box-shadow:0 0 9px #d5ff6030;
  display:inline-block;
  flex-shrink:0;
}

.top-actions {
  display:flex;
  align-items:center;
  gap:12px;
}

.personal-best {
  display:flex;
  flex-direction:column;
  gap:6px;
  text-align:right;
  margin-right:9px;
}

.personal-best>span {
  font-size:8px;
  letter-spacing:1.5px;
  color:#85898c;
}

.personal-best strong {
  font:700 17px monospace;
  letter-spacing:2px;
  color:#dbe0d2;
}

.nav-divider {
  width:1px;
  height:31px;
  background:var(--line);
  margin:0 6px;
}

.icon-button {
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  width:36px;
  height:36px;
  border-radius:50%;
  background:transparent;
  color:#acafb6;
  transition:background .2s,color .2s;
}

.icon-button:hover {
  background:#26292d;
  color:var(--lime);
}

.sound-waves {
  display:none;
}

.sound-on .sound-waves {
  display:initial;
}

.sound-on .sound-off {
  display:none;
}

.section-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  margin:32px 0 23px;
}

.eyebrow {
  font:9px monospace;
  letter-spacing:2px;
  color:var(--muted);
}

h1 {
  font-size:23px;
  letter-spacing:-1px;
  margin:8px 0 0;
  font-weight:600;
}

.version-label {
  font:9px monospace;
  letter-spacing:1px;
  color:var(--muted);
  padding-bottom:4px;
  display:flex;
  align-items:center;
  gap:8px;
}

.version-label>span {
  height:6px;
  width:6px;
  border:1px solid #8a8e83;
  border-radius:50%;
}

.arena {
  position:relative;
  isolation:isolate;
  overflow:hidden;
  height:clamp(450px,60vh,700px);
  min-height:450px;
  background:#111619;
  border:1px solid #30373a;
  border-radius:18px;
  box-shadow:0 20px 60px #00000015;
  touch-action:none;
}

.arena canvas {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
}

.arena-vignette {
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(90deg,#101516dc 0%,#10151670 38%,#10151600 62%),linear-gradient(0deg,#10151677,transparent 30%,transparent 75%,#10151666);
  z-index:1;
}

.arena.playing .arena-vignette {
  background:linear-gradient(0deg,#10151680,transparent 18%,transparent 78%,#10151688);
}

.arena-hud {
  position:absolute;
  top:25px;
  left:27px;
  right:27px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  z-index:2;
  pointer-events:none;
}

.sector {
  display:flex;
  gap:9px;
  align-items:center;
}

.sector-cross {
  width:29px;
  height:29px;
  border:1px solid #45504b;
  border-radius:7px;
  display:grid;
  place-items:center;
  color:#aabda9;
  font-size:20px;
}

.sector>div {
  display:flex;
  flex-direction:column;
  gap:4px;
}

.sector>div>span {
  font:10px monospace;
  letter-spacing:1.5px;
  color:#bac9b3;
}

.sector small {
  font:8px monospace;
  letter-spacing:1px;
  color:#62786c;
}

.run-clock {
  display:flex;
  gap:12px;
  align-items:center;
  font:10px monospace;
  color:#8fa096;
  letter-spacing:1px;
  padding-top:9px;
}

.clock-divider {
  height:10px;
  width:1px;
  background:#3a4540;
}

.score-block {
  text-align:right;
  display:flex;
  flex-direction:column;
  gap:5px;
}

.score-block>span:first-child {
  font:8px monospace;
  letter-spacing:2px;
  color:#8fa096;
}

.score-block>strong {
  font:500 27px monospace;
  letter-spacing:1px;
  line-height:1;
}

.combo-label {
  font:7px monospace;
  letter-spacing:1px;
  color:#667d6c;
  min-height:10px;
}

.combo-label.active {
  color:var(--lime);
  font-size:10px;
}

.intro {
  position:absolute;
  z-index:3;
  left:6%;
  top:50%;
  transform:translateY(-45%);
  width:49%;
  max-width:500px;
}

.intro-kicker {
  display:flex;
  align-items:center;
  gap:8px;
  font:9px monospace;
  letter-spacing:2px;
  color:#b4c5a4;
}

.tiny-bolt {
  display:grid;
  place-items:center;
  border:1px solid #617946;
  border-radius:4px;
  width:18px;
  height:18px;
  font:14px Arial;
  color:var(--lime);
}

.intro h2 {
  font-family:Impact,"Arial Black",Arial,sans-serif;
  font-size:clamp(60px,6.7vw,105px);
  line-height:.92;
  letter-spacing:1px;
  font-weight:900;
  margin:21px 0 20px;
  position:relative;
  width:max-content;
}

.intro h2>span:first-of-type {
  color:var(--lime);
}

.title-star {
  position:absolute;
  right:-72px;
  bottom:5px;
  font:80px Arial;
  color:var(--lime);
  transform:rotate(10deg);
}

.intro p {
  font-size:12px;
  line-height:1.9;
  color:#92a096;
  letter-spacing:-.2px;
  margin-bottom:24px;
}

.primary-button {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:40px;
  min-height:51px;
  border:0;
  background:var(--lime);
  color:#1a2112;
  padding:0 22px;
  border-radius:7px;
  font-size:13px;
  font-weight:800;
  transition:background .2s,box-shadow .2s;
}

.primary-button:hover {
  background:#e2ff92;
  box-shadow:0 0 30px #d5ff6017;
}

.intro .primary-button {
  width:220px;
}

.button-arrow {
  font-size:24px;
  font-weight:400;
}

.start-hint {
  display:flex;
  align-items:center;
  gap:6px;
  color:#6d7e73;
  font-size:9px;
  margin-top:14px;
  white-space:nowrap;
}

.start-hint>span {
  padding:0 2px;
}

kbd {
  font:9px monospace;
  display:inline-grid;
  place-items:center;
  min-width:19px;
  height:18px;
  border:1px solid #3b4040;
  background:#1e2520;
  border-radius:4px;
  padding:1px 4px;
  color:#a4b39f;
  vertical-align:middle;
}

.start-hint kbd {
  font-size:8px;
  height:17px;
}

.preview-caption {
  position:absolute;
  z-index:2;
  right:33px;
  bottom:33px;
  display:flex;
  align-items:center;
  gap:13px;
  font:9px monospace;
  line-height:1.7;
  letter-spacing:1.3px;
  color:#6d7c74;
}

.preview-caption strong {
  color:#9cac94;
  font-weight:400;
}

.caption-line {
  width:29px;
  height:1px;
  background:#729354;
}

.level-progress {
  position:absolute;
  left:26px;
  right:26px;
  bottom:17px;
  z-index:2;
  display:none;
  align-items:center;
  gap:12px;
  color:#b1c0a5;
  font:9px monospace;
  pointer-events:none;
}

.arena.playing .level-progress {
  display:flex;
}

.level-progress>div {
  height:3px;
  background:#303b2d;
  flex:1;
  border-radius:4px;
  overflow:hidden;
}

.level-progress i {
  height:100%;
  width:0;
  display:block;
  background:var(--lime);
  transition:width .15s;
}

.pause-button {
  position:absolute;
  left:50%;
  top:57px;
  transform:translateX(-50%);
  z-index:3;
  background:#1b2627b3;
  border:1px solid #3b4844;
  border-radius:50%;
  height:29px;
  width:29px;
  display:grid;
  place-items:center;
  color:#95a496;
}

.pause-button svg {
  width:12px;
  height:12px;
  stroke-width:3;
}

.pause-button:active {
  transform:translateX(-50%);
}

.wave-announcement {
  position:absolute;
  left:50%;
  top:24%;
  transform:translate(-50%,-10px);
  z-index:3;
  pointer-events:none;
  color:var(--lime);
  font:700 26px monospace;
  letter-spacing:4px;
  opacity:0;
  transition:opacity .3s,transform .3s;
  text-align:center;
  white-space:nowrap;
  text-shadow:0 0 30px #d5ff6050;
}

.wave-announcement.show {
  opacity:1;
  transform:translate(-50%,0);
}

.wave-announcement small {
  display:block;
  font:9px Arial;
  letter-spacing:1px;
  color:#acb79e;
  margin-top:9px;
}

.instrument-bar {
  margin-top:12px;
  display:grid;
  grid-template-columns:1fr 1fr 1.15fr;
  gap:12px;
}

.instrument {
  display:flex;
  align-items:center;
  gap:15px;
  background:#191b1f;
  border:1px solid var(--line);
  border-radius:10px;
  padding:16px 20px;
  min-height:77px;
}

.instrument-icon {
  width:35px;
  height:35px;
  display:grid;
  place-items:center;
  flex-shrink:0;
  border-radius:9px;
  background:#22262b;
  font:28px Arial;
  color:#a4b1bf;
}

.heart-icon {
  color:var(--pink);
  background:#2c222a;
  font-size:28px;
}

.energy-icon {
  color:var(--lime);
  background:#252c1d;
  font:34px Georgia;
}

.instrument-content {
  flex:1;
  min-width:0;
}

.instrument-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  font:9px monospace;
  letter-spacing:.9px;
  color:#acafb5;
  margin-bottom:10px;
}

.instrument-heading>span:first-child {
  display:flex;
  gap:8px;
  align-items:center;
}

.instrument-heading>span:last-child {
  font-size:8px;
  letter-spacing:.5px;
}

.instrument-heading kbd {
  font-size:7px;
  height:14px;
  min-width:15px;
  padding:0 4px;
  background:#272a2e;
  color:#747983;
  border-color:#3a3e45;
}

.health-pips {
  display:flex;
  gap:5px;
  height:5px;
}

.health-pips i {
  display:block;
  flex:1;
  border-radius:2px;
  background:var(--pink);
  transition:background .2s;
}

.health-pips i.empty {
  background:#343039;
}

.meter {
  height:5px;
  background:#2d3238;
  border-radius:2px;
  overflow:hidden;
}

.meter i {
  display:block;
  height:100%;
  transition:width .1s;
}

.dash-fill {
  background:#b3c5d9;
  width:100%;
}

.energy-fill {
  background:var(--lime);
  width:0;
}

.overdrive-instrument.charged {
  border-color:#7b9c37;
  box-shadow:inset 0 0 30px #d5ff6008;
}

.overdrive-instrument.charged .energy-icon {
  box-shadow:0 0 20px #d5ff6020;
}

.bottom-info {
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:14px;
  font-size:9px;
  color:#636972;
}

.live-tip {
  display:flex;
  align-items:center;
  gap:8px;
  color:#9a9f97;
}

.live-tip .status-dot {
  width:4px;
  height:4px;
}

.guide-row {
  display:grid;
  grid-template-columns:1fr 1fr 1.15fr;
  gap:24px;
  padding:30px 0 27px;
}

.guide-item {
  display:flex;
  gap:14px;
  align-items:flex-start;
}

.guide-number {
  color:#62686b;
  font:10px monospace;
  margin-top:3px;
}

.guide-item h3 {
  font-size:12px;
  margin:0 0 9px;
  font-weight:600;
  letter-spacing:-.3px;
  color:#c6c9c3;
}

.guide-item p {
  font-size:9px;
  color:#767c82;
  margin:0;
  line-height:1.6;
  white-space:nowrap;
}

.guide-item kbd {
  height:16px;
  min-width:16px;
  font-size:8px;
  margin-right:2px;
  background:#1c1f23;
  border-color:#33383d;
  color:#a1a5ac;
}

.page-foot {
  border-top:1px solid var(--line);
  padding:19px 0 24px;
  display:flex;
  justify-content:space-between;
  font:8px monospace;
  letter-spacing:1.6px;
  color:#5e626b;
}

.page-foot .lime {
  font-size:12px;
}

.overlay {
  position:absolute;
  inset:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  background:#0b1014e0;
  backdrop-filter:blur(12px);
}

.overlay h2 {
  font-size:35px;
  letter-spacing:-1.5px;
  margin:15px 0 12px;
}

.overlay p {
  font-size:12px;
  color:#8f9c91;
  line-height:1.8;
}

.modal-eyebrow {
  font:8px monospace;
  letter-spacing:2px;
  color:#92a578;
}

.upgrade-modal {
  text-align:center;
  width:100%;
  max-width:810px;
}

.upgrade-choices {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin:25px 0 20px;
}

.upgrade-card {
  text-align:left;
  border:1px solid #3e4936;
  background:linear-gradient(140deg,#222a20,#1b2020);
  padding:22px 20px;
  border-radius:12px;
  transition:border-color .15s,transform .15s;
  position:relative;
  min-height:185px;
}

.upgrade-card:hover,.upgrade-card:focus-visible {
  border-color:var(--lime);
  transform:translateY(-5px);
  background:#28311f;
}

.upgrade-symbol {
  display:grid;
  place-items:center;
  width:39px;
  height:39px;
  background:#303d24;
  color:var(--lime);
  font:26px Arial;
  border-radius:10px;
  margin-bottom:17px;
}

.upgrade-card strong {
  display:block;
  font-size:15px;
  font-weight:700;
}

.upgrade-card p {
  font-size:11px;
  margin:8px 0 0;
  color:#a5b19c;
}

.upgrade-card kbd {
  position:absolute;
  top:15px;
  right:15px;
}

.upgrade-card .upgrade-tier {
  font:8px monospace;
  letter-spacing:1px;
  color:#7e9364;
  display:block;
  margin-top:13px;
}

.modal-footnote {
  font-size:9px;
  color:#63715e;
}

.pause-modal {
  text-align:center;
  width:350px;
}

.pause-modal .primary-button,.results-modal .primary-button {
  width:100%;
  margin-top:24px;
}

.text-button {
  background:none;
  border:0;
  color:#a0aaa0;
  font-size:11px;
  padding:14px 20px;
  margin-top:5px;
}

.text-button:hover {
  color:#fff;
}

.results-modal {
  text-align:center;
  width:350px;
}

.results-modal h2 {
  font:58px Impact,"Arial Black",sans-serif;
  letter-spacing:1px;
  margin:12px 0 23px;
}

.result-score-label {
  font:8px monospace;
  letter-spacing:2px;
  color:#778577;
}

.result-score {
  display:block;
  font:42px monospace;
  color:#e2ebd7;
  margin:7px 0 21px;
  letter-spacing:2px;
}

.result-stats {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  border:1px solid #343e30;
  border-radius:9px;
  padding:16px 6px;
  background:#1a211b;
}

.result-stats>div {
  display:flex;
  flex-direction:column;
  gap:8px;
}

.result-stats>div+div {
  border-left:1px solid #343e30;
}

.result-stats span {
  font-size:9px;
  color:#829077;
}

.result-stats strong {
  font:16px monospace;
  color:#dce8d0;
}

.help-dialog {
  background:#1a1f1d;
  color:var(--text);
  border:1px solid #48533a;
  border-radius:16px;
  padding:38px;
  width:min(540px,calc(100% - 30px));
  max-height:90dvh;
}

.help-dialog::backdrop {
  background:#080c0dde;
  backdrop-filter:blur(7px);
}

.help-dialog h2 {
  font-size:24px;
  letter-spacing:-1px;
  margin:16px 0;
}

.help-dialog p {
  font-size:12px;
  line-height:1.9;
  color:#a0ab9b;
}

.close-help {
  position:absolute;
  right:15px;
  top:15px;
  font-size:23px;
}

.help-dialog dl {
  margin:24px 0;
}

.help-dialog dl>div {
  display:grid;
  grid-template-columns:150px 1fr;
  gap:10px;
  padding:13px 0;
  border-bottom:1px solid #343e2e;
  align-items:center;
}

.help-dialog dt {
  font-size:11px;
  color:#6e7a67;
}

.help-dialog dd {
  margin:0;
  font-size:11px;
  color:#b3bdae;
  line-height:1.6;
}

.help-dialog .help-note {
  font-size:11px;
}

.help-dialog .primary-button {
  width:100%;
  margin-top:24px;
}

.settings-toggle {
  display:flex;
  gap:10px;
  align-items:center;
  color:#a5b099;
  font-size:11px;
  margin-top:22px;
}

.settings-toggle input {
  accent-color:var(--lime);
  width:15px;
  height:15px;
}

.touch-controls {
  position:absolute;
  inset:0;
  z-index:4;
  pointer-events:none;
  display:none;
}

.joystick {
  position:absolute;
  bottom:45px;
  left:24px;
  width:112px;
  height:112px;
  border:1px solid #a7c38133;
  background:#a7c38107;
  border-radius:50%;
  pointer-events:auto;
  touch-action:none;
}

.joystick:before,.joystick:after {
  content:"";
  position:absolute;
  background:#a7c38120;
  top:50%;
  left:12%;
  width:76%;
  height:1px;
}

.joystick:after {
  transform:rotate(90deg);
}

.joystick span {
  position:absolute;
  width:42px;
  height:42px;
  left:34px;
  top:34px;
  border:1px solid #c3e18a66;
  background:#bded5c18;
  border-radius:50%;
  z-index:1;
}

.touch-actions {
  position:absolute;
  right:19px;
  bottom:47px;
  display:flex;
  gap:13px;
  align-items:flex-end;
}

.touch-actions button {
  border:1px solid #bad57a60;
  color:var(--lime);
  background:#243019a8;
  border-radius:50%;
  width:67px;
  height:67px;
  font:25px Arial;
  pointer-events:auto;
  touch-action:none;
}

.touch-actions button:first-child {
  height:53px;
  width:53px;
  font-size:17px;
  color:var(--cyan);
  border-color:#76e7e744;
  background:#172e2aa8;
}

.touch-actions button:disabled {
  opacity:.4;
}

.touch-actions button span {
  display:block;
  font:8px Arial;
  margin-top:1px;
}

.arena.hit {
  border-color:#ff7299;
}

.arena.overdriving {
  border-color:#d5ff6090;
  box-shadow:0 0 40px #d5ff600c;
}

.arena.paused canvas {
  filter:saturate(.45);
}

@media(min-width:1600px) {
  .app {
    padding:0 52px;
  }
  .section-heading {
    margin-top:36px;
  }
  .intro h2 {
    font-size:112px;
  }
}

@media(max-width:1100px) {
  .app {
    padding:0 27px;
  }
  .topbar {
    height:88px;
  }
  .top-status {
    display:none;
  }
  .intro {
    left:5%;
  }
  .intro h2 {
    font-size:80px;
  }
  .title-star {
    font-size:63px;
    right:-58px;
  }
  .instrument {
    padding:14px;
    gap:11px;
  }
  .instrument-heading {
    letter-spacing:.3px;
  }
  .guide-row {
    gap:15px;
  }
  .guide-item {
    gap:9px;
  }
  .guide-item p {
    font-size:8px;
  }
  .guide-item kbd {
    font-size:7px;
    padding:1px 3px;
    min-width:13px;
  }
  .arena {
    height:clamp(450px,61vh,650px);
  }
}

@media(max-width:720px) {
  .app {
    padding:0 18px;
  }
  .topbar {
    height:79px;
    gap:10px;
  }
  .brand-icon {
    height:36px;
    width:34px;
    border-radius:8px;
  }
  .brand-icon svg {
    width:25px;
    height:25px;
  }
  .brand {
    gap:9px;
  }
  .brand-name {
    font-size:17px;
  }
  .brand-caption {
    font-size:6px;
    letter-spacing:2.5px;
  }
  .top-actions {
    gap:7px;
  }
  .personal-best {
    margin:0;
  }
  .personal-best>span {
    font-size:6px;
    letter-spacing:.7px;
  }
  .personal-best strong {
    font-size:13px;
    letter-spacing:1px;
  }
  .nav-divider {
    display:none;
  }
  .icon-button {
    height:31px;
    width:31px;
  }
  .icon-button svg {
    width:16px;
    height:16px;
  }
  .section-heading {
    margin:24px 0 17px;
  }
  .eyebrow {
    font-size:8px;
  }
  h1 {
    font-size:19px;
  }
  .version-label {
    font-size:7px;
    letter-spacing:.5px;
  }
  .arena {
    height:590px;
    min-height:0;
    border-radius:14px;
  }
  .arena-hud {
    left:19px;
    right:19px;
    top:20px;
  }
  .sector-cross {
    width:25px;
    height:25px;
  }
  .sector>div>span {
    font-size:8px;
  }
  .sector small {
    font-size:7px;
  }
  .run-clock {
    font-size:8px;
    gap:7px;
    padding-top:7px;
  }
  .score-block>strong {
    font-size:22px;
  }
  .score-block>span:first-child {
    font-size:7px;
  }
  .combo-label {
    font-size:6px;
    max-width:100px;
  }
  .intro {
    left:8%;
    top:44%;
    width:85%;
    transform:translateY(-40%);
  }
  .intro h2 {
    font-size:clamp(58px,20vw,85px);
  }
  .intro-kicker {
    font-size:8px;
  }
  .intro p {
    font-size:11px;
  }
  .intro .primary-button {
    width:220px;
  }
  .intro .start-hint {
    font-size:8px;
  }
  .title-star {
    right:-62px;
  }
  .arena-vignette {
    background:linear-gradient(90deg,#101516cb,#10151655),linear-gradient(0deg,#10151600,#10151633);
  }
  .preview-caption {
    font-size:8px;
    bottom:24px;
    right:23px;
  }
  .instrument-bar {
    gap:7px;
    grid-template-columns:1fr 1fr 1fr;
    margin-top:9px;
  }
  .instrument {
    padding:12px 10px;
    gap:0;
    min-height:65px;
    border-radius:9px;
  }
  .instrument-icon {
    display:none;
  }
  .instrument-heading {
    font-size:8px;
    margin-bottom:9px;
    letter-spacing:0;
  }
  .instrument-heading>span:last-child {
    font-size:7px;
  }
  .instrument-heading kbd {
    display:none;
  }
  .health-pips {
    gap:3px;
  }
  .bottom-info {
    font-size:8px;
    line-height:1.6;
    margin-top:11px;
  }
  .bottom-info>span:last-child {
    font-size:7px;
  }
  .guide-row {
    grid-template-columns:1fr;
    gap:17px;
    padding:26px 2px;
  }
  .guide-item {
    gap:15px;
  }
  .guide-item h3 {
    font-size:11px;
    margin-bottom:5px;
  }
  .guide-item p {
    font-size:10px;
  }
  .guide-item kbd {
    font-size:8px;
    min-width:16px;
    height:17px;
  }
  .page-foot {
    font-size:6px;
    letter-spacing:1px;
    padding-bottom:20px;
  }
  .wave-announcement {
    font-size:20px;
    letter-spacing:2px;
    top:24%;
  }
  .overlay {
    padding:22px 17px;
  }
  .overlay h2 {
    font-size:26px;
    margin:10px 0;
  }
  .upgrade-choices {
    grid-template-columns:1fr;
    gap:9px;
    margin:18px 0 14px;
  }
  .upgrade-card {
    padding:14px 14px 13px 72px;
    min-height:89px;
  }
  .upgrade-symbol {
    position:absolute;
    top:22px;
    left:17px;
    width:36px;
    height:36px;
    margin:0;
    font-size:23px;
  }
  .upgrade-card strong {
    font-size:13px;
    padding-right:20px;
  }
  .upgrade-card p {
    font-size:10px;
    margin:5px 0 0;
    padding-right:12px;
  }
  .upgrade-card .upgrade-tier {
    font-size:7px;
    margin-top:7px;
  }
  .upgrade-card kbd {
    top:12px;
    right:12px;
  }
  .upgrade-card:hover {
    transform:translateY(-2px);
  }
  .modal-eyebrow {
    font-size:7px;
    letter-spacing:1px;
  }
  .pause-modal,.results-modal {
    max-width:300px;
  }
  .results-modal h2 {
    font-size:55px;
  }
  .result-score {
    font-size:38px;
  }
  .help-dialog {
    padding:31px 23px;
  }
  .help-dialog h2 {
    font-size:21px;
  }
  .help-dialog dl>div {
    grid-template-columns:115px 1fr;
    gap:7px;
  }
  .help-dialog dd {
    font-size:10px;
  }
  .level-progress {
    left:18px;
    right:18px;
    bottom:16px;
    font-size:8px;
  }
  .pause-button {
    top:48px;
  }
}

@media(pointer:coarse) {
  .arena.playing .touch-controls {
    display:block;
  }
  .arena.playing {
    height:min(670px,76dvh);
    min-height:460px;
  }
  .guide-item:first-child p {
    font-size:0;
  }
  .guide-item:first-child p:after {
    content:"조이스틱으로 이동 · 좌우 배치 변경 가능";
    font-size:10px;
  }
  .guide-item:first-child p kbd {
    display:none;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    scroll-behavior:auto!important;
    transition:none!important;
  }
}

.arena {
  user-select:none;
}

@media(max-width:720px) {
  .arena.playing .touch-controls {
    display:block;
  }
  .arena.playing {
    height:min(670px,76dvh);
    min-height:460px;
  }
  .intro h2 {
    font-size:clamp(50px,18vw,80px);
  }
  .title-star {
    right:8px;
    bottom:3px;
    font-size:55px;
  }
}

@media(max-width:380px) {
  .app {
    padding:0 14px;
  }
  .brand-name {
    font-size:14px;
    white-space:nowrap;
  }
  .brand-icon {
    width:29px;
    height:32px;
  }
  .brand-icon svg {
    width:22px;
    height:22px;
  }
  .brand {
    gap:7px;
  }
  .brand-caption {
    font-size:5px;
    letter-spacing:1.9px;
  }
  .top-actions {
    gap:5px;
  }
  .personal-best strong {
    font-size:12px;
  }
  .personal-best>span {
    font-size:5px;
    letter-spacing:.4px;
  }
  .icon-button {
    width:28px;
    height:28px;
  }
  .topbar {
    gap:8px;
  }
  h1 {
    font-size:16px;
  }
  .version-label {
    font-size:6px;
  }
  .run-clock {
    font-size:7px;
    gap:4px;
  }
  .score-block>strong {
    font-size:20px;
  }
  .sector>div>span {
    font-size:7px;
  }
}

/* V.02 — cores, relics and the Luck Lab use the same arena and native controls. */
:root { --gold:#f3c977; }
.gold { color:var(--gold); }
.collection-button { padding:9px 12px; margin:0; border:1px solid var(--line); border-radius:7px; white-space:nowrap; }
.collection-button span { color:var(--lime); margin-left:5px; font:10px monospace; }
.overlay { overflow:auto; overscroll-behavior:contain; }
.overlay>div { margin:auto 0; flex-shrink:0; }
.overlay button:disabled { opacity:.4; transform:none; }
.core-modal { width:100%; max-width:950px; }
.core-modal>h2,.core-modal>p { text-align:center; }
.core-modal>.modal-eyebrow { display:block; text-align:center; }
.core-choices { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-top:28px; }
.core-card { --core-color:var(--lime); border:1px solid #3a423d; border-radius:13px; background:linear-gradient(155deg,#242c25,#14191c); padding:22px; text-align:left; transition:transform .2s,border-color .2s; }
.core-card:hover,.core-card:focus-visible { border-color:var(--core-color); transform:translateY(-5px); }
.core-mark { display:block; font:62px Georgia,serif; color:var(--core-color); margin:0 0 17px; text-shadow:0 0 30px color-mix(in srgb,var(--core-color) 30%,transparent); }
.core-card h3 { margin:0; font:28px Impact,'Arial Black',sans-serif; letter-spacing:2px; color:var(--core-color); }
.core-card>strong { display:block; font-size:11px; margin:6px 0 14px; color:#e0e8db; }
.core-card p { min-height:44px; font-size:11px; }
.core-recipe { border-top:1px solid #354034; margin-top:17px; padding-top:13px; font-size:10px; color:#b4c2aa; line-height:1.9; }
.core-recipe b { color:var(--core-color); }
.core-card small { display:block; margin-top:14px; font:9px monospace; color:#8c9a82; }
.core-bottom { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:18px; color:#97a88c; font-size:10px; }
.build-bar { display:flex; align-items:center; gap:20px; padding:17px 21px; border:1px solid var(--line); border-top:0; background:#171d18; }
.build-identity { display:flex; flex-direction:column; gap:7px; min-width:140px; }
.build-identity strong { font:11px monospace; letter-spacing:1px; }
.build-identity>span { font:10px monospace; color:var(--gold); }
.relic-slots { display:flex; gap:7px; }
.relic-slot { width:39px; height:39px; border:1px solid #45523a; border-radius:8px; background:#273122; color:var(--lime); font:23px Arial; display:grid; place-items:center; padding:0; }
.relic-slot.empty { color:#4e5946; border-style:dashed; background:transparent; }
.relic-slot:hover { border-color:var(--lime); }
.evolution-status { max-width:420px; margin-left:auto; flex:1; font-size:10px; color:#b5c1a9; line-height:1.8; }
.evolution-status .meter { margin-top:7px; height:3px; }
#evolution-fill { display:block; background:var(--gold); height:100%; width:0; transition:width .3s; }
.skip-upgrade { display:block; margin:8px auto 0; padding:9px 16px; }
.upgrade-card.relic-card { border-color:#716041; background:linear-gradient(140deg,#302b1e,#1b2020); }
.relic-card .upgrade-symbol { color:var(--gold); background:#443921; }
.relic-card .upgrade-tier { color:var(--gold); }
.replace-choices { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:25px 0; }
.replace-choices .upgrade-card { padding:17px; }
.pit-modal { width:100%; max-width:820px; }
.pit-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:20px; }
.pit-heading h2 { margin-bottom:0; font-size:31px; }
.chip-wallet { text-align:right; }
.chip-wallet>span { font:8px monospace; letter-spacing:2px; color:#a69471; }
.chip-wallet strong { display:block; font:32px monospace; color:var(--gold); margin-top:7px; }
.pit-layout { display:grid; grid-template-columns:270px 1fr; gap:35px; }
.roulette-section { text-align:center; }
.wheel-wrap { width:238px; height:238px; margin:0 auto 8px; position:relative; }
#wheel-canvas { display:block; width:100%; height:100%; border:5px solid #594b32; border-radius:50%; box-shadow:0 0 0 1px #b59958,0 14px 40px #0008; }
.wheel-pointer { position:absolute; top:-10px; left:50%; transform:translateX(-50%); width:0; height:0; border-left:10px solid transparent; border-right:10px solid transparent; border-top:22px solid var(--gold); z-index:2; filter:drop-shadow(0 2px 3px #000); }
.wheel-hub { position:absolute; width:67px; height:67px; top:50%; left:50%; transform:translate(-50%,-50%); border-radius:50%; background:#20241e; border:2px solid #baa165; box-shadow:0 2px 12px #0009; display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--gold); font:22px Impact,sans-serif; letter-spacing:2px; pointer-events:none; }
.wheel-hub span { font:5px monospace; letter-spacing:1px; margin-top:5px; }
.wheel-result { min-height:43px; display:flex; align-items:center; justify-content:center; font-size:12px; color:#dfd4bb; line-height:1.7; }
.wheel-result.jackpot { color:var(--gold); font-weight:700; }
.gold-button { background:var(--gold); color:#272013; }
.gold-button:hover { background:#ffdea2; }
.roulette-section .primary-button { width:100%; min-height:46px; padding:13px 18px; font-size:12px; }
.overlay .wheel-odds { font:10px/1.8 monospace; color:#bbac8b; margin:12px 0 5px; }
.overlay .roulette-note { font-size:9px; color:#8a8e7d; margin:0; }
.shop-heading { display:flex; justify-content:space-between; align-items:center; margin:2px 0 12px; }
.shop-heading strong { font-size:15px; }
.shop-heading>span { font-size:10px; color:#a5ae9e; }
.shop-choices { display:grid; gap:9px; }
.shop-card { position:relative; display:grid; grid-template-columns:35px 1fr auto; align-items:center; column-gap:11px; padding:14px; border:1px solid #46503d; border-radius:9px; background:#20291f; text-align:left; }
.shop-card:hover { border-color:var(--lime); background:#2a3524; }
.shop-card .shop-icon { grid-row:span 2; font:28px Arial; color:var(--gold); text-align:center; }
.shop-card strong { font-size:12px; }
.shop-card p { grid-column:2; margin:4px 0 0; font-size:10px; color:#aab8a0; line-height:1.6; }
.shop-card .price { grid-column:3; grid-row:1 / 3; color:var(--gold); font:10px monospace; white-space:nowrap; }
.repair-button { width:100%; display:flex; justify-content:space-between; align-items:center; border:1px solid #433837; background:#2c2222; color:#f4b6bd; font-size:11px; padding:12px 15px; margin-top:10px; border-radius:8px; }
.pit-build { margin-top:14px; font-size:10px; color:#849078; }
.pit-build>div { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.relic-tag { padding:5px 7px; background:#2b3024; color:#b5c6a0; border:1px solid #414a34; border-radius:5px; font-size:9px; }
.pit-footer { display:flex; align-items:center; justify-content:space-between; gap:20px; border-top:1px solid #384032; padding-top:16px; margin-top:20px; }
.pit-footer>span { font-size:10px; color:#929e86; line-height:1.6; }
.pit-footer .primary-button { min-width:200px; padding:14px 19px; min-height:45px; font-size:12px; }
.results-modal { width:min(430px,100%); }
.results-modal h2 { font-size:48px; margin:8px 0 12px; }
.results-modal .result-score { margin:5px 0 13px; font-size:35px; }
.results-modal .result-stats { padding:11px 5px; }
.results-modal .primary-button { margin-top:12px; min-height:45px; padding:13px 20px; font-size:12px; }
.result-links { display:flex; justify-content:center; }
.result-links .text-button { font-size:10px; padding:12px; }
.seed-label { display:block; font:8px monospace; color:#758068; letter-spacing:1px; }
.damage-report { margin-top:16px; text-align:left; }
.damage-report>span { display:block; font:8px monospace; letter-spacing:1px; color:#8b987f; margin-bottom:10px; }
.damage-row { display:grid; grid-template-columns:82px 1fr 40px; align-items:center; gap:12px; margin:7px 0; font-size:10px; color:#c0cbb8; }
.damage-row .meter { height:4px; }
.damage-row i { height:100%; display:block; background:var(--lime); }
.damage-row b { font:10px monospace; color:var(--lime); text-align:right; }
.overlay .result-recipe { font-size:10px; line-height:1.8; color:#d0be98; padding:10px 12px; background:#332d1d77; border-radius:6px; margin:14px 0 4px; }
.collection-dialog { width:min(840px,calc(100% - 30px)); }
.collection-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:22px 0; }
.collection-item { padding:16px; border:1px solid #48543d; border-radius:9px; background:#232b22; }
.collection-item.undiscovered { background:#191e1a; border-style:dashed; opacity:.75; }
.collection-item>span { display:block; font:25px Arial; color:var(--gold); margin-bottom:10px; }
.collection-item strong { font-size:12px; }
.collection-item p { font-size:10px; line-height:1.7; margin-bottom:10px; }
.collection-item small { font-size:9px; color:var(--lime); }
.evolution-recipes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.recipe-card { padding:12px; border-left:2px solid var(--lime); background:#252d20; }
.recipe-card strong { font-size:11px; }
.recipe-card p { font-size:10px; line-height:1.7; margin:7px 0 0; }
#load-button { display:block; padding:10px 0 0; margin-top:2px; color:var(--gold); }
#save-home { display:block; margin:5px auto 0; }
@media(max-width:1000px) { .core-card { padding:17px; } .core-card h3 { font-size:25px; } .build-bar { gap:13px; padding:15px; } .build-identity { min-width:100px; } .evolution-status { font-size:9px; } }
@media(max-width:720px) {
  .top-actions .personal-best { display:none; }
  .collection-button { font-size:9px; padding:7px; }
  .collection-button span { font-size:8px; margin-left:2px; }
  .overlay { padding:22px 16px; }
  .overlay h2 { font-size:25px; letter-spacing:-1px; }
  .core-choices { grid-template-columns:1fr; gap:10px; margin-top:18px; }
  .core-card { padding:15px; display:grid; grid-template-columns:54px 1fr; column-gap:12px; }
  .core-mark { grid-row:1 / 5; font-size:48px; margin:5px 0 0; }
  .core-card h3 { font-size:23px; }
  .core-card>strong { margin:3px 0 0; font-size:10px; }
  .core-card p { grid-column:2; min-height:0; margin:5px 0; font-size:10px; }
  .core-recipe { grid-column:2; padding-top:6px; margin-top:5px; font-size:9px; }
  .core-card small { grid-column:2; margin-top:7px; font-size:8px; }
  .core-bottom { margin-top:8px; font-size:9px; }
  .core-bottom .text-button { padding:9px; white-space:nowrap; }
  .build-bar { flex-wrap:wrap; gap:12px; padding:13px; }
  .build-identity { flex:1; }
  .build-identity strong { font-size:10px; }
  .relic-slot { width:33px; height:33px; font-size:21px; }
  .relic-slots { gap:5px; }
  .evolution-status { flex:0 0 100%; max-width:none; }
  .evolution-status .meter { margin-top:5px; }
  .pit-layout { grid-template-columns:1fr; gap:24px; }
  .pit-heading { gap:8px; margin-bottom:22px; }
  .pit-heading h2 { font-size:26px; }
  .chip-wallet strong { font-size:25px; }
  .chip-wallet>span { font-size:7px; letter-spacing:1px; }
  .wheel-wrap { width:214px; height:214px; }
  .roulette-section .primary-button { max-width:280px; margin:auto; }
  .pit-footer { align-items:stretch; flex-direction:column; gap:10px; }
  .pit-footer .primary-button { width:100%; }
  .replace-choices { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .replace-choices .upgrade-card { min-height:155px; }
  .replace-choices .upgrade-symbol { position:static; margin-bottom:10px; }
  .replace-choices .upgrade-card strong,.replace-choices .upgrade-card p { margin-left:0; }
  .collection-dialog { padding:28px 20px; }
  .collection-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .collection-item { padding:12px; }
  .evolution-recipes { grid-template-columns:1fr; gap:8px; }
  .results-modal h2 { font-size:43px; }
  .intro p { max-width:280px; font-size:11px; }
  #load-button { font-size:10px; }
}

/* V3: the viewport is the arena; world space never depends on screen edges. */
body.in-run { overflow:hidden; overscroll-behavior:none; }
.in-run .topbar,.in-run .section-heading,.in-run .guide-row,.in-run .page-foot,.in-run .bottom-info { visibility:hidden; }
.in-run .arena { position:fixed; inset:0; width:100%; height:100vh; height:100dvh; min-height:0; max-height:none; border:0; border-radius:0; z-index:20; }
.in-run .arena-hud { top:max(20px,env(safe-area-inset-top)); left:max(22px,env(safe-area-inset-left)); right:max(84px,calc(env(safe-area-inset-right) + 72px)); }
.in-run .arena-vignette { background:linear-gradient(#101619cc,transparent 19%,transparent 70%,#101619b0); }
.in-run .run-clock { position:absolute; left:50%; transform:translateX(-50%); white-space:nowrap; }
.in-run .pause-button { top:max(16px,env(safe-area-inset-top)); right:max(16px,env(safe-area-inset-right)); left:auto; transform:none; width:44px; height:44px; }
.in-run .pause-button:active { transform:none; }
.flow-hud { position:absolute; top:85px; left:max(22px,env(safe-area-inset-left)); width:220px; z-index:2; pointer-events:none; display:flex; flex-direction:column; gap:15px; color:#a5bcb0; font:10px monospace; }
.tempo-readout,.reactor-readout { display:grid; grid-template-columns:1fr auto; gap:7px; }
.tempo-readout strong { color:var(--lime); }.reactor-readout strong { color:var(--cyan); }
.tempo-track,.reactor-readout .meter { grid-column:1/-1; height:3px; background:#b6dec21c; border-radius:3px; overflow:hidden; }
.tempo-track i,#reactor-fill { display:block; height:100%; width:0; background:var(--lime); transition:width .12s linear; }
#reactor-fill { background:var(--cyan); box-shadow:0 0 14px #76e7e7; }
.arena[data-beat="rush"] .tempo-readout strong { color:#ffb77b; }.arena[data-beat="rush"] #tempo-fill { background:#ffb77b; }
.arena[data-beat="recover"] .tempo-readout strong { color:var(--cyan); }.arena[data-beat="recover"] #tempo-fill { background:var(--cyan); }
.play-toolbar { display:flex; position:absolute; top:85px; right:max(22px,env(safe-area-inset-right)); gap:7px; z-index:4; }
.play-toolbar button { min-width:44px; height:44px; padding:0 12px; border:1px solid #76918445; border-radius:9px; background:#111d20df; color:#d2dfd0; font:12px Arial,sans-serif; white-space:nowrap; flex-shrink:0; }
.play-toolbar button:not(:first-child) { font-size:23px; padding:0; }
.play-toolbar button:hover { border-color:var(--lime); }
.in-run .instrument-bar { position:fixed; bottom:max(18px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:min(570px,calc(100% - 32px)); gap:9px; margin:0; z-index:21; pointer-events:none; }
.in-run .instrument { min-height:54px; padding:10px 12px; background:#10191cdf; border-color:#8aaf7c22; gap:8px; border-radius:8px; }
.in-run .instrument-icon { display:none; }.in-run .instrument-heading { font-size:9px; margin-bottom:8px; }.in-run .instrument-heading>span:last-child { font-size:9px; }.in-run .instrument-heading kbd { display:none; }
.in-run .build-bar { position:fixed; bottom:84px; left:50%; transform:translateX(-50%); width:min(570px,calc(100% - 32px)); z-index:21; padding:7px 9px; gap:12px; border:0; border-radius:8px; background:#10191cc9; }
.in-run .build-identity { min-width:110px; gap:4px; }.in-run .build-identity strong,.in-run .build-identity>span { font-size:9px; }
.in-run .relic-slot { width:30px; height:30px; font-size:20px; }.in-run .relic-slots { gap:5px; }
.in-run .evolution-status { font-size:8px; }
.in-run .level-progress { bottom:132px; left:50%; right:auto; transform:translateX(-50%); width:min(550px,calc(100% - 40px)); }
.in-run .wave-announcement { top:27%; width:calc(100% - 36px); white-space:normal; font-size:clamp(18px,3vw,32px); line-height:1.3; letter-spacing:2px; }
.in-run .wave-announcement small { font-size:11px; letter-spacing:.3px; line-height:1.6; }
.in-run .overlay { padding:max(28px,env(safe-area-inset-top)) max(22px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(22px,env(safe-area-inset-left)); }
.in-run.menu-open .instrument-bar,.in-run.menu-open .build-bar,.menu-open .flow-hud,.menu-open .play-toolbar,.menu-open .level-progress,.menu-open .arena-hud,.menu-open .touch-controls { visibility:hidden; }
.in-run.menu-open .arena-vignette { opacity:.5; }
.in-run .joystick { bottom:max(85px,calc(env(safe-area-inset-bottom) + 70px)); left:max(22px,env(safe-area-inset-left)); background:#101d218f; border-color:#9bbd7055; }
.in-run .touch-actions { right:max(22px,env(safe-area-inset-right)); bottom:max(93px,calc(env(safe-area-inset-bottom) + 78px)); gap:12px; }
.in-run .touch-actions button { width:76px; height:76px; background:#20321bd9; }.in-run .touch-actions button:first-child { width:66px; height:66px; background:#162c2bdf; }.in-run .touch-actions button span { font-size:10px; }
.in-run .touch-actions button.ready { opacity:1; border-color:var(--cyan); box-shadow:0 0 24px #76e7e740,inset 0 0 12px #76e7e720; color:#e2ffff; }
body[data-controls="right"] .joystick { left:auto; right:max(22px,env(safe-area-inset-right)); }
body[data-controls="right"] .touch-actions { right:auto; left:max(22px,env(safe-area-inset-left)); flex-direction:row-reverse; }
.settings-layout { display:block; width:100%; padding:14px 8px; border:1px solid #485541; border-radius:8px; color:var(--lime); font-size:12px; line-height:1.5; }
@media(max-width:720px) {
  .in-run .arena-hud { left:16px; right:72px; top:max(18px,env(safe-area-inset-top)); }
  .in-run .sector-cross { display:none; }.in-run .score-block strong { font-size:24px; }.in-run .combo-label { font-size:7px; }
  .in-run .run-clock { left:47%; font-size:9px; gap:6px; top:27px; padding:0; }
  .in-run .run-clock #wave-label { display:none; }
  .flow-hud { top:max(83px,calc(env(safe-area-inset-top) + 64px)); left:16px; width:calc(100% - 32px); flex-direction:row; gap:24px; font-size:9px; }
  .tempo-readout,.reactor-readout { flex:1; }
  .in-run .play-toolbar { top:max(126px,calc(env(safe-area-inset-top) + 106px)); bottom:auto; left:50%; right:auto; transform:translateX(-50%); }
  .in-run .instrument-bar { bottom:max(12px,env(safe-area-inset-bottom)); }
  .in-run .instrument { min-height:49px; padding:10px 8px; }.in-run .instrument-heading { font-size:8px; }.in-run .instrument-heading>span:last-child { font-size:8px; }
  .in-run .build-bar { bottom:69px; padding:0; background:transparent; }.in-run .build-identity { min-width:0; flex:1; }.in-run .build-identity>span { font-size:10px; }.in-run .evolution-status { display:none; }.in-run .relic-slot { width:26px; height:26px; }
  .in-run .level-progress { bottom:111px; }
  .in-run .joystick { bottom:129px; width:106px; height:106px; }.in-run .joystick span { left:31px; top:31px; }
  .in-run .touch-actions { bottom:135px; gap:8px; }
  .in-run .touch-actions button { width:65px; height:65px; }.in-run .touch-actions button:first-child { width:59px; height:59px; }
  .in-run .wave-announcement { top:calc(24% + 42px); }
}
@media(max-width:380px) {
  .in-run .joystick { left:14px; width:96px; height:96px; }.in-run .joystick span { left:26px; top:26px; }
  .in-run .touch-actions { right:14px; gap:6px; }.in-run .touch-actions button { width:59px; height:59px; }.in-run .touch-actions button:first-child { width:54px; height:54px; }
  body[data-controls="right"] .joystick { right:14px; left:auto; }body[data-controls="right"] .touch-actions { left:14px; right:auto; }
}
@media(max-height:540px) and (min-width:600px) {
  .in-run .flow-hud { top:75px; width:180px; gap:10px; }.in-run .play-toolbar { top:75px; bottom:auto; left:auto; right:16px; transform:none; }
  .in-run .build-bar { display:none; }.in-run .instrument-bar { width:340px; bottom:10px; }.in-run .level-progress { width:320px; bottom:75px; }
  .in-run .touch-controls { display:block; }.in-run .joystick { bottom:24px; }.in-run .touch-actions { bottom:32px; }
  .in-run .wave-announcement { top:42%; font-size:20px; }.in-run .arena-hud { top:16px; }.in-run .run-clock #wave-label { display:inline; }
}

/* V4: flight preparation, destination routes, and a quiet mission readout. */
:root { --sector:var(--lime); }
body.menu-open { overflow:hidden; }
.menu-open .intro,.menu-open .preview-caption,.menu-open .mission-strip,.menu-open .wave-announcement,.menu-open .pause-button { visibility:hidden; }
#core-panel { position:fixed; z-index:40; padding:32px max(24px,env(safe-area-inset-right)); background:radial-gradient(ellipse at 70% 10%,#193332e8,#0b1014f5 70%); }
.core-modal { max-width:960px; }
.core-modal>h2 { font-size:36px; margin:10px 0 24px; }
.intro h2 { font-size:clamp(54px,6.1vw,90px); letter-spacing:-1px; }
.intro p { margin-bottom:16px; }
.content-counts { display:flex; gap:24px; margin-bottom:22px; color:#91a59e; font-size:10px; }
.content-counts b { color:#e2ebe5; font:18px monospace; margin-right:5px; }
#load-button { display:flex; padding:15px 18px; margin:0 0 9px; color:#131c0b; font-size:12px; }
.intro.has-save #start-button { border:1px solid #82947860; background:#16211be0; color:#b6c5aa; min-height:40px; padding:8px 18px; font-size:11px; }
.intro.has-save .start-hint { display:none; }
.mode-choices,.route-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.mode-choice,.mission-choice,.route-choice { border:1px solid #45605b; border-radius:10px; background:#142225; text-align:left; padding:16px 18px; transition:background .18s,border-color .18s; }
.mode-choice:hover,.mission-choice:hover,.route-choice:hover { background:#203532; border-color:#8bada0; }
.mode-choice[aria-pressed="true"],.mission-choice[aria-pressed="true"],.route-choice[aria-pressed="true"] { border-color:var(--lime); background:linear-gradient(120deg,#30432b,#172b2b); box-shadow:inset 3px 0 var(--lime); }
.mode-choice { display:grid; grid-template-columns:1fr auto; column-gap:12px; }
.mode-choice strong,.route-choice strong { font-size:15px; }
.mode-choice span,.route-choice span { display:block; font-size:11px; line-height:1.7; color:#b0c1b8; margin-top:6px; }
.mode-choice b { grid-column:2; grid-row:1/3; align-self:center; font:36px Impact,"Arial Black",sans-serif; letter-spacing:2px; color:#688e81; }
.mode-choice[aria-pressed="true"] b { color:var(--lime); text-shadow:0 0 24px #d5ff6030; }
.launch-section-label { display:flex; justify-content:space-between; gap:12px; margin:21px 0 10px; color:#d1dfd3; font-size:11px; }
.launch-section-label span { color:#899f97; font-size:10px; }
.mission-choices { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.mission-choice { padding:13px 15px; }
.mission-choice strong { font-size:12px; display:block; }
.mission-choice span { display:block; font-size:11px; color:#b0c1b8; margin:6px 0; }
.mission-choice small { font-size:10px; color:var(--gold); }
.core-choices { margin-top:0; gap:12px; }
.core-card { padding:17px 20px; background:radial-gradient(ellipse at 100% 0,color-mix(in srgb,var(--core-color) 10%,transparent),transparent 70%),#152125; }
.core-mark { font-size:44px; margin:0 0 10px; line-height:1; }
.core-card h3 { font-size:27px; }
.core-card>strong { margin:5px 0 9px; }
.core-card p { min-height:36px; margin:0; }
.core-recipe { margin-top:11px; padding-top:10px; }
.core-card small { color:var(--core-color); margin-top:12px; }
.core-card:hover,.core-card:focus-visible { transform:translateY(-3px); box-shadow:0 8px 26px #0005,0 0 20px color-mix(in srgb,var(--core-color) 8%,transparent); }
.core-bottom { margin-top:16px; line-height:1.7; }
.mission-strip { position:absolute; top:173px; left:max(22px,env(safe-area-inset-left)); z-index:2; width:220px; display:grid; grid-template-columns:1fr auto; gap:8px; font:10px "Segoe UI","Malgun Gothic",sans-serif; color:#b3c8bc; pointer-events:none; }
.mission-strip strong { color:var(--gold); font:10px monospace; }
.mission-strip .meter { grid-column:1/-1; height:2px; background:#b6dec21c; }
#mission-fill { display:block; height:100%; background:var(--gold); transition:width .3s; }
.mission-strip.complete { opacity:.65; }.mission-strip.complete strong { color:var(--cyan); }.mission-strip.complete #mission-fill { background:var(--cyan); }
.arena[data-beat="boss"] .mission-strip { visibility:hidden; }
.route-heading { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:22px 0 10px; font-size:11px; color:#b4c5b6; }
.route-heading strong { font:10px "Segoe UI",sans-serif; color:var(--gold); }
.route-choice { padding:13px 15px; }.route-choice strong { font-size:12px; }.route-choice span { font-size:10px; }
.journey-track { display:flex; gap:10px; margin:20px 0 0; padding:0 0 6px; overflow:auto; }
.journey-node { flex:1; min-width:80px; border-top:1px solid #627d7460; padding-top:10px; color:#9aac9f; }
.journey-node b { display:block; font:14px monospace; margin-bottom:7px; color:var(--sector); }
.journey-node span { display:block; font-size:9px; white-space:nowrap; }.journey-node.complete { border-color:var(--sector); }.journey-node.complete b { text-shadow:0 0 12px var(--sector); }
.score-block,.run-clock,.chip-wallet,.mission-strip { font-variant-numeric:tabular-nums; }
@media(max-width:720px) {
  #core-panel { padding:24px 16px; }
  .core-modal>h2 { font-size:27px; margin-bottom:20px; }
  .intro h2 { font-size:clamp(47px,12vw,76px); }
  .intro { transform:translateY(-42%); }
  .content-counts { gap:18px; margin-bottom:17px; }.content-counts b { font-size:16px; }
  .mode-choices { gap:8px; }.mode-choice { padding:12px; column-gap:5px; }.mode-choice strong { font-size:13px; }.mode-choice span { font-size:10px; }.mode-choice b { font-size:25px; }
  .launch-section-label { margin-top:18px; flex-wrap:wrap; gap:4px; }
  .mission-choices { grid-template-columns:1fr; gap:7px; }
  .mission-choice { display:grid; grid-template-columns:1fr auto; column-gap:8px; padding:11px 13px; }
  .mission-choice strong { font-size:11px; }.mission-choice span { grid-column:1; margin-bottom:0; font-size:10px; }.mission-choice small { grid-column:2; grid-row:1/3; align-self:center; font-size:9px; max-width:114px; text-align:right; line-height:1.7; }
  .core-choices { gap:9px; }.core-card { padding:14px; grid-template-columns:40px 1fr; gap:0 10px; }.core-card h3 { font-size:24px; }.core-mark { font-size:34px; margin-top:4px; }
  .core-card p { min-height:0; margin-top:5px; }.core-card>strong { margin:4px 0 0; }.core-recipe { margin-top:6px; padding-top:6px; }
  .core-bottom { align-items:flex-start; }.core-bottom .text-button { min-height:44px; }
  .mission-strip { top:max(183px,calc(env(safe-area-inset-top) + 166px)); left:16px; width:calc(100% - 32px); gap:6px; font-size:9px; }.mission-strip strong { font-size:9px; }
  .in-run .wave-announcement { top:calc(50% - 64px); font-size:21px; }
  .route-choices { grid-template-columns:1fr; gap:8px; }
  .journey-node { min-width:72px; }
}
@media(max-height:540px) and (min-width:600px) {
  .mission-strip { top:154px; left:22px; width:180px; font-size:9px; }
  .in-run .wave-announcement { top:42%; font-size:20px; }
}
@media(prefers-reduced-motion:reduce) { .core-card,.mode-choice,.mission-choice,.route-choice,#mission-fill { transition:none; } }
