:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, sans-serif;
  color: #faf1ff;
  background: #0b0915;
  --paper: #faf1ff;
  --ink: #0b0915;
  --muted: #c8bddc;
  --rose: #ff94de;
  --cyan: #a0f8f1;
  --gold: #ffd893;
  --line: rgb(202 165 248 / 29%);
  --panel: rgb(16 12 31 / 91%);
  --gutter: clamp(1.2rem, 5.1vw, 5.75rem);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, #game { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { overscroll-behavior: none; }
#game { isolation: isolate; position: relative; min-height: 15rem; }
#arena { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
.button, .icon-button {
  border: 1px solid var(--line);
  border-radius: .36rem;
  background: #1b142e;
  color: var(--paper);
  min-height: 2.8rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: .65rem 1.15rem;
  font-size: .9rem;
  font-weight: 700;
}
.button:hover, .icon-button:hover { border-color: var(--rose); }
.button:active, .icon-button:active { transform: translateY(1px); }
.button:disabled, .icon-button:disabled { opacity: .5; }
.button-primary {
  color: #200d26;
  background: linear-gradient(125deg, #ffc8ee, #fc8cde 58%, #eaa2ff);
  border-color: #ffc8ee;
}
.button-primary:hover { background: #ffd6f3; }
.button-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.icon-button { display: grid; place-items: center; width: 2.85rem; padding: 0; font-size: 1.1rem; }

.lobby {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.lobby::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(10 8 21 / 94%), rgb(10 8 21 / 78%) 27%, rgb(10 8 21 / 13%) 59%, transparent 83%),
    linear-gradient(0deg, rgb(10 8 21 / 88%), transparent 27%, transparent 78%, rgb(10 8 21 / 49%));
}
.lobby-header, .lobby-footer {
  align-self: stretch;
  margin-inline: var(--gutter);
  display: flex;
  align-items: center;
}
.lobby-header {
  justify-content: space-between;
  margin-top: max(.95rem, env(safe-area-inset-top));
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.platform-mark {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0;
  color: #e8dff6;
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.gravity-mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 1.35rem;
  height: .95rem;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  transform: rotate(-32deg);
}
.gravity-mark::after {
  content: "";
  width: .32rem;
  height: .32rem;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.audio-link { pointer-events: auto; font-size: .81rem; min-height: 2.55rem; }
.launch {
  margin-inline: var(--gutter);
  padding: 1.4rem 0 2.25rem;
  max-width: calc(100vw - 2 * var(--gutter));
}
.launch h1 {
  margin: 0 0 .88rem;
  color: var(--paper);
  font-family: "Arial Black", system-ui, sans-serif;
  font-size: clamp(2.65rem, 9.55vw, 9.5rem);
  font-weight: 900;
  letter-spacing: -.095em;
  line-height: .85;
  text-transform: uppercase;
  text-shadow: 0 .045em 0 #743966, 0 0 .52em rgb(252 126 210 / 33%);
}
.tagline {
  margin: 0;
  color: var(--rose);
  font-size: clamp(1.13rem, 2.3vw, 2rem);
  font-weight: 680;
  letter-spacing: -.035em;
}
.premise {
  max-width: 25rem;
  margin: .85rem 0 0;
  color: var(--muted);
  font-size: clamp(.94rem, 1.4vw, 1.09rem);
  line-height: 1.52;
  text-wrap: pretty;
}
.launch-actions, .interrupt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .62rem; margin-top: 1.4rem; }
.launch-button {
  justify-content: space-between;
  min-width: 10.25rem;
  min-height: 3.18rem;
  box-shadow: 0 .25rem 2rem rgb(253 116 216 / 30%);
}
.launch-button::after {
  content: "";
  border-radius: 50%;
  width: .68rem;
  height: .68rem;
  background: #5a184f;
  box-shadow: 0 0 0 .22rem #68196430;
}
.launch button { pointer-events: auto; }
.lobby-footer {
  flex-wrap: wrap;
  gap: .62rem clamp(.95rem, 3.1vw, 2.65rem);
  margin-bottom: max(1.5rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  padding-top: .87rem;
}
.control-hint { display: flex; align-items: center; gap: .48rem; color: #ded2ef; font-size: .74rem; font-weight: 550; }
.hint-alternative { color: var(--muted); margin-inline: .15rem; }
kbd {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: .2rem;
  padding: .12rem .31rem;
  background: rgb(28 20 43 / 85%);
  color: #f8eaff;
  font: 600 .7rem/1.25 ui-monospace, monospace;
  vertical-align: .03rem;
}
kbd + kbd { margin-left: .12rem; }
.touch-hint { display: none; }
.touch-glyph { color: var(--cyan); font-size: .95rem; }

.hud {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(11rem, 1fr) auto;
  align-items: start;
  gap: .8rem;
  position: absolute;
  inset: max(.83rem, env(safe-area-inset-top)) max(.85rem, env(safe-area-inset-right)) auto max(.85rem, env(safe-area-inset-left));
  pointer-events: none;
}
.vitals, .objective, .boss, .hud-stats, .ability {
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--panel);
}
.vitals { display: grid; gap: .42rem; padding: .57rem .68rem .65rem; }
.health-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .45rem;
  color: #e5d6f1;
  font-size: .72rem;
  font-weight: 660;
}
#health-value, #boss-value, #xp-value { color: var(--paper); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-meter { height: .32rem; overflow: hidden; border-radius: 2rem; background: #403151; }
.hud-meter span { display: block; width: 100%; height: 100%; }
.health-track span { background: linear-gradient(90deg, #e75dba, #ffb4ef); box-shadow: 0 0 .7rem #ff86ce; }
.xp { display: grid; gap: .32rem; margin-top: .18rem; }
.xp-track { height: .22rem; background: #213748; }
.xp-track span { width: 0; background: linear-gradient(90deg, #59c7d3, #a6fff7); }
#level { color: var(--cyan); }
.hud-center { display: grid; justify-self: center; gap: .38rem; width: min(23rem, 100%); }
.objective { padding: .52rem .72rem .55rem; text-align: center; border-top-color: #cd8aff99; }
.objective-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  color: var(--cyan);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.objective time { color: var(--paper); font: 720 .86rem/1.1 ui-monospace, monospace; letter-spacing: 0; }
.objective strong { display: block; margin-top: .16rem; font-size: clamp(.86rem, 1.25vw, 1.09rem); line-height: 1.16; }
.hud[data-final="true"] .objective-line { color: var(--gold); }
.hud[data-final="true"] .objective { border-top-color: var(--gold); }
.boss { display: grid; gap: .35rem; padding: .42rem .68rem .5rem; border-color: #ef79975c; }
.boss-hint { margin: 0; color: #e3c8e7; font-size: .67rem; line-height: 1.25; text-align: center; }
.boss[data-recovering="true"] { border-color: var(--gold); }
.boss[data-recovering="true"] .boss-hint { color: var(--gold); font-weight: 720; }
.boss-track span { background: linear-gradient(90deg, #d84575, #ff8b9d, #ffb998); }
.hud-right { display: flex; gap: .58rem; align-items: flex-start; }
.hud-stats { display: flex; }
.hud-stat { display: flex; min-width: 4.5rem; flex-direction: column; align-items: center; gap: .1rem; padding: .39rem .48rem .43rem; }
.hud-stat + .hud-stat { border-left: 1px solid var(--line); }
.hud-stat span { color: #d9cce9; font-size: .68rem; font-weight: 620; }
.hud-stat strong, .hud-stat time { font: 720 .87rem/1.2 ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.hud .icon-button { pointer-events: auto; }
.pause-glyph { width: .68rem; height: .92rem; border-inline: .15rem solid #f4deff; }

.wave-notice {
  position: absolute;
  left: 50%;
  top: 23%;
  transform: translateX(-50%);
  width: min(31rem, calc(100vw - 2rem));
  padding: .72rem 1rem .86rem;
  pointer-events: none;
  text-align: center;
  background: linear-gradient(90deg, transparent, #18102aed 33%, #18102aed 67%, transparent);
  border-block: 1px solid #de9aff69;
  animation: wave-enter .29s ease-out both;
}
.wave-notice span { display: block; color: var(--cyan); font-size: .76rem; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
.wave-notice strong { display: block; color: var(--paper); font-size: clamp(1.2rem, 4vw, 2.45rem); line-height: 1.13; letter-spacing: -.045em; }
.wave-notice[data-final="true"] { border-color: #ffd8938c; }
.wave-notice[data-final="true"] span { color: var(--gold); }
@keyframes wave-enter {
  from { opacity: 0; transform: translate(-50%, -.45rem); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.controls-dock {
  position: absolute;
  inset: auto .9rem max(.9rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.abilities { display: flex; gap: .38rem; }
.ability {
  --ability-accent: var(--rose);
  --recharge: 0%;
  position: relative;
  display: grid;
  grid-template-columns: 1.4rem auto auto;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  min-height: 3.3rem;
  padding: .35rem .55rem .45rem;
  text-align: left;
  pointer-events: auto;
}
.ability[data-ability="pulse"] { --ability-accent: var(--cyan); }
.ability[data-ability="collapse"] { --ability-accent: #c3a9ff; }
.ability:not(:disabled):hover { border-color: var(--ability-accent); }
.ability:disabled { background: #1d152edb; }
.ability:disabled .ability-icon { opacity: .56; }
.ability::after {
  content: "";
  position: absolute;
  height: .16rem;
  bottom: 0;
  left: .23rem;
  right: .23rem;
  border-radius: .12rem;
  background: linear-gradient(90deg, var(--ability-accent) var(--recharge), transparent var(--recharge));
  opacity: .9;
}
.ability-icon {
  position: relative;
  display: block;
  margin: auto;
  width: 1.2rem;
  height: 1.2rem;
  border: 1px solid var(--ability-accent);
  border-radius: 50%;
  color: var(--ability-accent);
}
.ability-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 .5rem currentColor;
}
.ability[data-ability="fling"] .ability-icon { border-width: 0 0 1px; border-radius: 0; transform: rotate(-32deg); }
.ability[data-ability="fling"] .ability-icon::before { border-radius: .06rem; transform: translate(-50%, -35%) rotate(45deg); }
.ability[data-ability="collapse"] .ability-icon { transform: rotate(45deg) scale(.78); border-radius: .16rem; }
.ability-text { display: grid; gap: .06rem; }
.ability-text strong { color: var(--paper); font-size: .83rem; line-height: 1.15; }
.ability-state { color: var(--muted); font: 650 .67rem/1.22 ui-monospace, monospace; white-space: nowrap; }
.ability[data-ready="true"] .ability-state { color: var(--ability-accent); }
.ability kbd { align-self: start; margin-top: .14rem; }
.joystick {
  display: none;
  place-items: center;
  width: clamp(3.65rem, 19vw, 5.75rem);
  height: clamp(3.65rem, 19vw, 5.75rem);
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  border: 1px solid #bfcaff85;
  border-radius: 50%;
  background: radial-gradient(circle, #9ff5f217 0 22%, transparent 23% 48%, #9ff5f219 49% 51%, transparent 52%), #17132ad9;
}
.joystick span {
  width: 36%;
  height: 36%;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  background: #9ff5f240;
  box-shadow: 0 0 1rem #9ff5f23a;
}

.surface {
  --surface-accent: var(--rose);
  width: min(31rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100% - 2rem);
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(1.1rem, 3.4vw, 1.85rem);
  background: radial-gradient(ellipse at 5% 0%, #382044 0, #181127 49%, #100d1e 100%);
  color: var(--paper);
  border: 1px solid #cc9cea70;
  border-top: 2px solid var(--surface-accent);
  border-radius: .55rem;
  box-shadow: 0 1rem 5rem #05030b, 0 0 2.5rem #3b225454;
}
.surface::backdrop { background: rgb(9 6 18 / 76%); }
.surface h2 { margin: 0; font-size: clamp(1.9rem, 6vw, 2.9rem); line-height: 1; letter-spacing: -.065em; }
.surface p { margin: .65rem 0 0; color: var(--muted); font-size: .93rem; line-height: 1.48; }
.surface[data-outcome="victory"] { --surface-accent: var(--cyan); background: radial-gradient(ellipse at 5% 0%, #174249, #171327 55%, #100d1e 100%); }
.surface[data-outcome="defeat"] { --surface-accent: #ff829d; }
.surface[data-outcome="victory"] h2 { color: #d1fffb; }
.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .4rem;
  margin: 1.2rem 0 0;
}
.summary-stats > div {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: .32rem;
  min-width: 0;
  padding: .57rem .2rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: #0f0c1b80;
}
.summary-stats dt { color: var(--muted); font-size: .69rem; }
.summary-stats dd { margin: 0; font: 700 clamp(.85rem, 3vw, 1.2rem)/1.2 ui-monospace, monospace; }
.draft { width: min(57rem, calc(100vw - 2rem)); --surface-accent: var(--cyan); }
.draft-level {
  display: block;
  margin-bottom: .47rem;
  color: var(--cyan);
  font: 760 .78rem/1.15 ui-monospace, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.draft-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-top: 1.35rem;
}
.upgrade-card {
  --rarity: #b9d3f0;
  position: relative;
  display: grid;
  align-content: start;
  gap: .55rem;
  min-height: 13.2rem;
  padding: .9rem .88rem 1rem;
  color: var(--paper);
  background: linear-gradient(150deg, color-mix(in srgb, var(--rarity) 16%, #161024), #140e23 61%, #100d1e);
  border: 1px solid color-mix(in srgb, var(--rarity) 42%, #2d1c3e);
  border-top: 2px solid var(--rarity);
  border-radius: .43rem;
  text-align: left;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.upgrade-card[data-rarity="common"] { --rarity: var(--cyan); }
.upgrade-card[data-rarity="uncommon"] { --rarity: #80dfff; }
.upgrade-card[data-rarity="rare"] { --rarity: #b8a1ff; }
.upgrade-card[data-rarity="epic"] { --rarity: #ff9ada; }
.upgrade-card[data-rarity="legendary"] { --rarity: var(--gold); }
.upgrade-card:hover {
  transform: translateY(-.15rem);
  background: linear-gradient(150deg, color-mix(in srgb, var(--rarity) 30%, #161024), #140e23 70%, #100d1e);
  box-shadow: 0 .36rem 1.25rem color-mix(in srgb, var(--rarity) 18%, transparent);
}
.choice-top { display: flex; justify-content: space-between; align-items: center; }
.choice-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.44rem;
  height: 2.44rem;
  color: var(--rarity);
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: .9;
}
.choice-icon::before, .choice-icon::after { content: ""; position: absolute; }
.choice-icon::before { width: .63rem; height: .63rem; border: 1px solid currentColor; transform: rotate(45deg); box-shadow: 0 0 .45rem currentColor; }
.choice-icon::after { width: 2.8rem; height: .95rem; border: 1px solid currentColor; border-radius: 50%; transform: rotate(-32deg); }
.upgrade-card:nth-child(2) .choice-icon { transform: rotate(56deg); }
.upgrade-card:nth-child(3) .choice-icon { transform: rotate(94deg); }
.choice-rarity {
  display: block;
  color: var(--rarity);
  font: 760 .68rem/1.22 ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.choice-name { display: block; font-size: 1.12rem; line-height: 1.12; letter-spacing: -.035em; }
.choice-effect, .choice-tradeoff { display: block; font-size: .87rem; line-height: 1.42; }
.choice-effect { color: #f1e9fc; }
.choice-tradeoff { color: #dec79e; }
.sound h2 { font-size: clamp(1.75rem, 6vw, 2.4rem); }
.volume-settings { display: grid; gap: .8rem; margin: 1.15rem 0 1.3rem; }
.volume-settings label { display: grid; grid-template-columns: 7.4rem minmax(4rem, 1fr); align-items: center; gap: .6rem; font-weight: 620; }
.volume-settings .audio-mute { display: flex; }
.volume-settings input { min-width: 0; accent-color: var(--rose); }
.volume-settings input[type="range"] { width: 100%; min-height: 2rem; }


.lab {
  position: absolute;
  top: max(4.3rem, calc(env(safe-area-inset-top) + 3.45rem));
  right: max(.85rem, env(safe-area-inset-right));
  bottom: max(.85rem, env(safe-area-inset-bottom));
  width: min(21rem, calc(100vw - 1.7rem));
  padding: .85rem;
  background: #110d21fa;
  border: 1px solid var(--line);
  border-radius: .35rem;
  overflow: auto;
  font-size: .75rem;
}
.lab-header { display: flex; justify-content: space-between; align-items: flex-start; }
.lab-header h2 { margin: 0; font-size: 1.07rem; }
.lab-header span { color: var(--muted); }
.lab .icon-button { min-height: 1.9rem; width: 1.9rem; }
.lab-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0; }
.lab .button { min-height: 1.85rem; padding: .2rem .55rem; font-size: .7rem; }
.lab-spawn { display: grid; grid-template-columns: 1fr 7rem; align-items: center; gap: .35rem .6rem; margin-bottom: .6rem; }
.vectors { display: flex; align-items: center; gap: .4rem; }
.vectors input { accent-color: var(--rose); }
.lab-status { color: var(--cyan); font-size: .72rem; }
.lab-status:empty { display: none; }
.telemetry { display: grid; grid-template-columns: minmax(7rem, 1fr) auto; align-items: baseline; gap: .24rem .7rem; margin-block: .62rem; padding: .5rem 0; border-block: 1px solid var(--line); }
.telemetry dd { margin: 0; text-align: right; font: .68rem/1.3 ui-monospace, monospace; color: var(--cyan); }
.tweaks { display: grid; grid-template-columns: 1fr 7rem; gap: .31rem .6rem; align-items: center; margin-top: .5rem; }
.tweaks input, .lab select { width: 100%; height: 1.6rem; border: 1px solid var(--line); border-radius: .2rem; background: #1d1630; color: var(--paper); font: inherit; }
.lab summary { cursor: pointer; color: var(--paper); }
.startup-error { position: fixed; inset: 1rem auto auto 1rem; padding: .7rem; background: var(--ink); color: var(--rose); }



@media (max-width: 740px) {
  .hud {
    grid-template-columns: minmax(9rem, 1fr) auto;
    gap: .38rem .55rem;
  }
  .hud-center { grid-column: 1 / -1; grid-row: 2; width: min(22rem, 100%); }
  .hud-right { grid-column: 2; grid-row: 1; }
  .hud-stat { min-width: 3.45rem; padding-inline: .34rem; }
  .wave-notice { top: 30%; }
  .lab { top: max(8.2rem, calc(env(safe-area-inset-top) + 7.35rem)); }
}
@media (max-width: 650px) {
  :root { --gutter: clamp(1rem, 5.4vw, 2.4rem); }
  .lobby::before {
    background: linear-gradient(0deg, #0b0915 3%, rgb(11 9 21 / 88%) 29%, rgb(11 9 21 / 16%) 64%, rgb(11 9 21 / 42%) 100%);
  }
  .launch { margin-top: auto; padding-bottom: 1.2rem; }
  .launch h1 { font-size: clamp(2rem, 11.9vw, 5rem); }
  .premise { max-width: 24rem; }
  .lobby-header { margin-top: max(.6rem, env(safe-area-inset-top)); }
  .lobby-footer { gap: .44rem .85rem; }
  .objective { padding-block: .31rem .39rem; }
  .vitals { padding: .46rem .5rem .52rem; }
  .ability kbd { display: none; }
  .ability { gap: .4rem; grid-template-columns: 1.2rem auto; }
  .draft-choices { grid-template-columns: 1fr; gap: .47rem; margin-top: .85rem; }
  .upgrade-card { min-height: auto; padding: .55rem .67rem .59rem; gap: .24rem; }
  .choice-top { display: contents; }
  .choice-icon { display: none; }
  .choice-top kbd { position: absolute; inset: .47rem .55rem auto auto; }
  .choice-effect, .choice-tradeoff { line-height: 1.3; }
  .choice-name { padding-right: 1.7rem; }
}
@media (max-width: 420px) {
  .hud { grid-template-columns: minmax(0, 1fr) auto; }
  .hud-right { gap: .3rem; }
  .hud-stat { min-width: 3rem; padding-inline: .25rem; }
  .hud-stat span { font-size: .61rem; }
  .hud .icon-button { width: 2.7rem; min-height: 2.7rem; }
  .health-label { font-size: .67rem; }
  .control-hint { font-size: .69rem; }
}
@media (max-width: 370px) {
  #time-stat { display: none; }
}
@media (pointer: coarse), (hover: none) {
  .controls-dock { justify-content: space-between; column-gap: .4rem; }
  .joystick { display: grid; flex: none; }
  .abilities { margin-left: auto; }
  .desktop-hint { display: none; }
  .touch-hint { display: flex; }
  .ability kbd, .choice-top kbd { display: none; }
  .ability {
    grid-template-columns: 1fr;
    gap: .25rem;
    justify-items: center;
    min-height: 3.72rem;
    min-width: clamp(3.35rem, 19vw, 5rem);
    padding: .32rem .31rem .46rem;
    text-align: center;
  }
  .ability-icon { height: 1.03rem; width: 1.03rem; }
  .ability-text { gap: .08rem; }
  .ability-text strong { font-size: .72rem; }
  .ability-state { font-size: .63rem; }
}
@media (max-height: 460px) {
  .lobby-header { margin-top: max(.25rem, env(safe-area-inset-top)); padding-bottom: .23rem; }
  .launch { padding-block: .5rem; }
  .launch h1 { font-size: clamp(2.05rem, 8.8vw, 5.25rem); margin-bottom: .35rem; }
  .premise { margin-top: .37rem; }
  .launch-actions { margin-top: .64rem; }
  .lobby-footer { margin-bottom: max(.5rem, env(safe-area-inset-bottom)); padding-top: .42rem; }
  .joystick { width: 3.85rem; height: 3.85rem; }
  .surface { padding: .75rem 1rem; }
  .draft-choices { margin-top: .65rem; }
  .upgrade-card { min-height: auto; padding-top: .5rem; gap: .3rem; }
  .choice-icon { display: none; }
  .choice-top { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
  button:active, .upgrade-card:hover { transform: none; }
}


/* ---- PewPew neon theme ------------------------------------------------------
   Monospace type, square panels, hard neon outlines and glow, matching the
   pixel renderer. Layout rules above are unchanged. */
:root {
  font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  color: #e8e6ff;
  background: #07020f;
  --paper: #e8e6ff;
  --ink: #07020f;
  --muted: #8a86b8;
  --rose: #ff4fd8;
  --cyan: #3df4ff;
  --gold: #ffe040;
  --lime: #7dff4a;
  --line: rgb(61 244 255 / 38%);
  --panel: rgb(10 4 24 / 92%);
}
body { background: #000; }
#arena { image-rendering: pixelated; }
button, input, select { font-family: inherit; }
.button, .icon-button, .vitals, .objective, .boss, .hud-stats, .ability, kbd, .surface, .summary-stats > div, .hud-meter, .upgrade-card {
  border-radius: 0 !important;
}
.button, .icon-button { background: #0a0418; border-color: var(--line); text-transform: uppercase; letter-spacing: .08em; }
.button:hover, .icon-button:hover { border-color: var(--cyan); box-shadow: 0 0 .7rem rgb(61 244 255 / 45%); }
.button-primary {
  color: #07020f;
  background: var(--cyan);
  border-color: #b8fbff;
  box-shadow: 0 0 1.1rem rgb(61 244 255 / 55%), inset 0 -.2rem 0 rgb(0 0 0 / 25%);
}
.button-primary:hover { background: #a6faff; }
.button-quiet { background: transparent; border-color: transparent; }
.launch h1 {
  font-family: inherit;
  font-weight: 900;
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 3px 3px 0 #ff4fd8, -2px -2px 0 #3df4ff, 0 0 .4em rgb(255 79 216 / 55%);
}
.tagline { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; text-shadow: 0 0 .5em rgb(255 224 64 / 50%); }
.premise { color: #c8c4ff; }
.launch-button { box-shadow: 0 0 1.6rem rgb(61 244 255 / 50%); }
.launch-button::after { border-radius: 0; background: #07020f; box-shadow: none; transform: rotate(45deg) scale(.8); }
.platform-mark, .control-hint, .health-label, .hud-stat span, .objective-line, .boss-hint, .choice-rarity, .ability-state, .wave-notice span {
  text-transform: uppercase;
  letter-spacing: .1em;
}
kbd { background: #07020f; border-color: var(--cyan); color: var(--cyan); }
.lobby::before {
  background:
    linear-gradient(90deg, rgb(7 2 15 / 92%), rgb(7 2 15 / 70%) 30%, rgb(7 2 15 / 10%) 60%, transparent 85%),
    linear-gradient(0deg, rgb(7 2 15 / 85%), transparent 28%, transparent 80%, rgb(7 2 15 / 45%));
}
.vitals, .objective, .boss, .hud-stats, .ability {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 0 .6rem rgb(61 244 255 / 14%);
}
.hud-meter { background: #1a0d2e; height: .4rem; }
.health-track span { background: var(--rose); box-shadow: 0 0 .6rem var(--rose); }
.xp-track span { background: var(--lime); box-shadow: 0 0 .6rem var(--lime); }
.boss-track span { background: linear-gradient(90deg, #ff3050, #ff4fd8); box-shadow: 0 0 .6rem #ff3050; }
#level { color: var(--lime); }
.objective-line { color: var(--cyan); }
.hud-stat strong, .hud-stat time, #health-value, #boss-value, #xp-value { color: #fff; text-shadow: 0 0 .4em rgb(61 244 255 / 60%); }
.wave-notice { background: linear-gradient(90deg, transparent, #0a0418f0 30%, #0a0418f0 70%, transparent); border-color: var(--cyan); }
.wave-notice strong { text-transform: uppercase; letter-spacing: .04em; color: #fff; text-shadow: 2px 2px 0 #ff4fd8, 0 0 .5em rgb(61 244 255 / 60%); }
.ability { --ability-accent: var(--cyan); }
.ability[data-ability="pulse"] { --ability-accent: var(--lime); }
.ability[data-ability="collapse"] { --ability-accent: var(--rose); }
.ability:disabled { background: #07020fdb; }
.ability::after { border-radius: 0; left: 0; right: 0; }
.ability-icon, .ability-icon::before { border-radius: 0 !important; }
.ability-icon { transform: rotate(45deg) scale(.8); }
.ability[data-ability="fling"] .ability-icon { border-width: 1px; transform: rotate(45deg) scale(.8); }
.ability-text strong { text-transform: uppercase; letter-spacing: .08em; }
.joystick, .joystick span { border-radius: 0 !important; }
.joystick { background: #07020fcc; border: 1px solid var(--line); }
.surface {
  background: #0a0418;
  border: 1px solid var(--cyan);
  box-shadow: 0 0 2rem rgb(61 244 255 / 25%), inset 0 0 0 1px rgb(255 79 216 / 25%);
}
.surface h2 { text-transform: uppercase; letter-spacing: .02em; color: #fff; text-shadow: 2px 2px 0 #ff4fd8; }
.surface[data-outcome="victory"] { background: #0a0418; border-color: var(--gold); }
.surface[data-outcome="victory"] h2 { color: var(--gold); }
.surface[data-outcome="defeat"] { background: #0a0418; border-color: #ff3050; }
.surface[data-outcome="defeat"] h2 { color: #ff3050; text-shadow: 2px 2px 0 #3a0010; }
.summary-stats > div { background: #07020f; }
.summary-stats dd { color: var(--cyan); }
.upgrade-card { background: #07020f !important; border: 1px solid var(--line) !important; }
.upgrade-card:hover, .upgrade-card:focus-visible { border-color: var(--cyan) !important; box-shadow: 0 0 1rem rgb(61 244 255 / 40%); }
.upgrade-card[data-rarity="rare"] { border-color: rgb(255 79 216 / 60%) !important; }
.upgrade-card[data-rarity="uncommon"] { border-color: rgb(125 255 74 / 55%) !important; }
.choice-name { text-transform: uppercase; letter-spacing: .04em; color: #fff; }
.choice-tradeoff { color: var(--muted); }

/* ---- survival clock, records and pointer steering ---------------------------- */
body[data-screen="run"] #arena { cursor: none; }
.objective { min-width: 11rem; }
#run-clock {
  display: block;
  margin: .12rem 0 .3rem;
  color: #fff;
  font: 800 clamp(1.5rem, 3.2vw, 2.2rem)/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-shadow: 2px 2px 0 #ff4fd8, 0 0 .5em rgb(61 244 255 / 60%);
}
.run-track { height: .3rem; }
.run-track span { display: block; height: 100%; width: 0; background: var(--cyan); box-shadow: 0 0 .6rem var(--cyan); }
.hud[data-endless="true"] .run-track span { background: var(--rose); box-shadow: 0 0 .6rem var(--rose); }
.hud[data-final="true"] #run-clock { color: var(--gold); }
.record { margin: .9rem 0 0; color: var(--gold); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 0 .5em rgb(255 224 64 / 45%); }
.new-record {
  margin: .9rem 0 0 !important;
  color: var(--gold) !important;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  animation: record-blink .6s steps(2) infinite;
}
@keyframes record-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .new-record { animation: none; } }
.wave-notice[data-kind="boss"] { border-color: var(--rose); }
.wave-notice[data-kind="boss"] span, .wave-notice[data-kind="elite"] span { color: #ff3050; }

/* ---- evolutions ---------------------------------------------------------------- */
.upgrade-card[data-rarity="evolution"] {
  border: 2px solid var(--gold) !important;
  background: linear-gradient(160deg, #2a2000, #07020f 60%) !important;
  box-shadow: 0 0 1.4rem rgb(255 224 64 / 45%);
  animation: evolution-glow 1.2s ease-in-out infinite alternate;
}
.upgrade-card[data-rarity="evolution"] .choice-rarity { color: var(--gold); }
.upgrade-card[data-rarity="evolution"] .choice-name { color: var(--gold); text-shadow: 2px 2px 0 #ff4fd8; }
@keyframes evolution-glow { to { box-shadow: 0 0 2.4rem rgb(255 224 64 / 75%); } }
@media (prefers-reduced-motion: reduce) { .upgrade-card[data-rarity="evolution"] { animation: none; } }

/* ---- online co-op and the daily run ------------------------------------------------ */
.pilot-name { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; pointer-events: auto; }
.pilot-name input, .online-code input {
  width: 11rem; padding: .45rem .6rem; border: 1px solid var(--line); background: #07020f; color: #fff;
  font: inherit; letter-spacing: .06em; text-transform: none;
}
.online-code input { width: 6.5rem; text-transform: uppercase; }
.pilot-name input:focus-visible, .online-code input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.daily-board { margin-top: 1.2rem; max-width: 24rem; padding: .7rem .9rem; border: 1px solid var(--line); background: var(--panel); pointer-events: auto; }
.daily-board h2 { margin: 0 0 .4rem; color: var(--gold); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.daily-board ol { margin: 0; padding: 0; list-style: none; display: grid; gap: .15rem; }
.daily-board li { display: grid; grid-template-columns: 1.6rem 1fr auto auto; gap: .6rem; font-size: .78rem; font-variant-numeric: tabular-nums; }
.daily-board li span:first-child { color: var(--muted); }
.daily-board li[data-you="true"] { color: var(--cyan); }
.daily-note { margin: .4rem 0 0; color: var(--muted); font-size: .72rem; }
.daily-result { margin: .8rem 0 0 !important; color: var(--cyan) !important; font-weight: 700; letter-spacing: .06em; }
.online p { color: var(--muted); }
.online-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1rem; }
.online-code { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.online-code-display strong { color: var(--gold); font-size: 1.8rem; letter-spacing: .2em; margin-left: .4rem; }
.online-members { margin: .8rem 0 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.online-members li { display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem; border: 1px solid var(--line); background: #07020f; }
.online-members li::before { content: ""; width: .7rem; height: .7rem; background: var(--slot); box-shadow: 0 0 .5rem var(--slot); }
.online-hint, .online-status { min-height: 1.2em; font-size: .85rem; }
.online-status { color: var(--rose) !important; }
.team {
  position: absolute; left: 0; top: calc(100% + .5rem); margin: 0; padding: .45rem .6rem; list-style: none;
  display: grid; gap: .3rem; min-width: 12rem; border: 1px solid var(--line); background: var(--panel);
}
.team li { display: grid; grid-template-columns: .6rem 1fr 4rem; align-items: center; gap: .5rem; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.team li::before { content: ""; width: .6rem; height: .6rem; background: var(--slot); }
.team li[data-down="true"] { color: #ff3050; }
.team .team-bar { height: .3rem; background: #1a0d2e; }
.team .team-bar span { display: block; height: 100%; background: var(--slot); }
.hud { position: absolute; }
.vitals { position: relative; }

/* ---- controller -------------------------------------------------------------------- */
.pad-label { display: none; }
body[data-input="pad"] .pad-label { display: inline; }
body[data-input="pad"] .key-label { display: none; }
body[data-input="pad"] :focus { outline: 3px solid var(--gold) !important; outline-offset: 3px; box-shadow: 0 0 1.2rem rgb(255 224 64 / 60%) !important; }
body[data-input="pad"] #arena { cursor: none; }
