:root {
  color-scheme: dark;
  --void: #02040a;
  --panel: rgba(5, 10, 19, .92);
  --line: rgba(79, 151, 198, .28);
  --cyan: #23eaff;
  --magenta: #ff33d1;
  --acid: #8dff3f;
  --orange: #ff7417;
  --red: #ff3158;
  --text: #dffbff;
  --muted: #698698;
  --mono: "Lucida Console", Monaco, ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(24, 99, 158, .2), transparent 34rem),
    linear-gradient(180deg, #040712, var(--void));
  font-family: var(--mono);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(72, 170, 230, .18) .6px, transparent .7px);
  background-size: 18px 18px;
  opacity: .28;
  mask-image: radial-gradient(ellipse, #000 20%, transparent 78%);
}

.rotate-device { display: none; }

.wreck-app {
  width: min(1660px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(5px, .8vw, 12px);
  display: grid;
  place-items: center;
}

.game-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: rgba(2, 5, 12, .96);
  border: 1px solid rgba(62, 131, 181, .46);
  clip-path: polygon(0 13px, 13px 0, calc(100% - 13px) 0, 100% 13px, 100% calc(100% - 13px), calc(100% - 13px) 100%, 13px 100%, 0 calc(100% - 13px));
  box-shadow: 0 0 45px rgba(0, 0, 0, .72), inset 0 0 35px rgba(35, 234, 255, .035);
}

.game-card::before {
  content: "";
  position: absolute;
  z-index: 20;
  inset: 4px;
  pointer-events: none;
  border: 1px solid rgba(35, 234, 255, .08);
  clip-path: inherit;
}

.hud {
  position: relative;
  z-index: 6;
  height: clamp(62px, 6.4vw, 88px);
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  padding: 8px clamp(14px, 2vw, 32px);
  background: linear-gradient(180deg, rgba(8, 15, 28, .98), rgba(3, 7, 14, .88));
  border-bottom: 1px solid rgba(35, 234, 255, .23);
}

.hud::after {
  content: "";
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: -1px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.hud-cluster { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); min-width: 0; }
.hud-right { justify-content: flex-end; text-align: right; }
.stat { display: grid; gap: 3px; min-width: 0; }
.stat span, .rail-label, .boss-signal > span, .objective-chip > span { color: var(--cyan); font-size: clamp(7px, .68vw, 10px); letter-spacing: .18em; }
.stat strong { color: #e9fdff; font-size: clamp(15px, 1.55vw, 24px); line-height: 1; letter-spacing: .05em; text-shadow: 0 0 14px rgba(212, 249, 255, .36); white-space: nowrap; }
.level-stat strong { color: var(--acid); }
.lives-stat strong { color: var(--magenta); font-size: clamp(12px, 1.25vw, 19px); }
.scrap-stat strong { color: var(--orange); font-size: clamp(12px, 1.2vw, 18px); text-shadow: 0 0 12px rgba(255, 122, 25, .6); }

.campaign-nav { display: flex; gap: 5px; }
.campaign-nav button {
  width: 27px;
  height: 23px;
  padding: 0;
  color: #526d80;
  border: 1px solid #213d55;
  background: #050b14;
  font: 800 8px/1 var(--mono);
  cursor: pointer;
}
.campaign-nav button:hover, .campaign-nav button:focus-visible { color: var(--cyan); border-color: var(--cyan); outline: 0; }
.campaign-nav button.active { color: #041008; background: var(--acid); border-color: #dfff9d; box-shadow: 0 0 11px rgba(141, 255, 63, .65); }
.campaign-nav .forge-button { color: var(--magenta); border-color: rgba(255, 51, 209, .5); }
.campaign-nav .forge-button:hover, .campaign-nav .forge-button:focus-visible { color: #fff; border-color: var(--magenta); box-shadow: 0 0 12px rgba(255, 51, 209, .65); }
.campaign-nav .forge-button.active { color: #fff; background: #561044; border-color: var(--magenta); box-shadow: 0 0 13px var(--magenta); }

.hud-center { display: grid; place-items: center; gap: 3px; }
.brand-lockup { display: flex; align-items: center; color: #aebdca; font: 900 clamp(18px, 2.15vw, 34px)/.9 Impact, "Arial Black", sans-serif; letter-spacing: .055em; text-shadow: 0 0 12px rgba(172, 223, 244, .22); }
.brand-lockup i {
  position: relative;
  width: clamp(19px, 2.05vw, 32px);
  aspect-ratio: 1;
  margin: 0 .04em;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff, #a7efff 15%, #41677c 35%, #141b26 67%, #02040a 72%);
  box-shadow: 0 0 13px rgba(35, 234, 255, .65), inset -4px -4px 8px #000;
}
.brand-lockup i::before, .brand-lockup i::after { content: ""; position: absolute; width: 9px; height: 1px; background: #8399aa; transform-origin: right; }
.brand-lockup i::before { left: -7px; top: 3px; transform: rotate(28deg); }
.brand-lockup i::after { right: -7px; bottom: 5px; transform: rotate(32deg); }
.combo-readout { display: flex; align-items: baseline; gap: 6px; }
.combo-readout strong { color: var(--cyan); font-size: clamp(14px, 1.3vw, 21px); text-shadow: 0 0 13px var(--cyan); }
.combo-readout span { color: #7f99a8; font-size: 7px; letter-spacing: .15em; }

.arena-shell { display: grid; grid-template-columns: clamp(62px, 6vw, 94px) minmax(0, 1fr); background: #01030a; }

.wreck-rail {
  position: relative;
  z-index: 7;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  background: linear-gradient(90deg, rgba(6, 12, 23, .98), rgba(3, 7, 14, .84));
  border-right: 1px solid rgba(35, 234, 255, .18);
}
.rail-label { writing-mode: vertical-rl; transform: rotate(180deg); opacity: .65; font-size: 6px; }
.wreck-letters { display: grid; gap: 5px; }
.wreck-letters i {
  display: grid;
  place-items: center;
  width: clamp(31px, 3.35vw, 48px);
  aspect-ratio: 1;
  color: #53636b;
  border: 1px solid #263944;
  background: linear-gradient(145deg, #17232d, #05090e);
  border-radius: 7px;
  font: normal 900 clamp(14px, 1.5vw, 22px)/1 var(--mono);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .8);
}
.wreck-letters i.charged { color: #9dff6c; border-color: #4b912d; background: #10230d; text-shadow: 0 0 10px var(--acid); box-shadow: 0 0 12px rgba(141, 255, 63, .15), inset 0 0 12px rgba(141, 255, 63, .13); }
.wreck-letters i:last-child { color: #fff; border-color: var(--magenta); text-shadow: 0 0 10px #fff; }
.wreck-mode .wreck-letters i { color: #fff; border-color: var(--magenta); background: #3a0a32; box-shadow: 0 0 16px var(--magenta), inset 0 0 12px rgba(255, 51, 209, .45); }
.wreck-mode .hud, .wreck-mode .power-dock { opacity: .58; }
.wreck-mode .stage { box-shadow: inset 0 0 70px rgba(255, 51, 209, .16); }
.wreck-rail > strong { width: 100%; overflow: hidden; color: var(--acid); font-size: clamp(6px, .55vw, 9px); text-align: center; text-overflow: ellipsis; text-shadow: 0 0 8px var(--acid); white-space: nowrap; }
.meter { width: 5px; height: 64px; overflow: hidden; display: flex; align-items: flex-end; background: #111b25; }
.meter-fill { width: 100%; height: 0; background: linear-gradient(0deg, var(--cyan), var(--acid), var(--orange), var(--magenta)); box-shadow: 0 0 12px var(--cyan); transition: height 100ms linear; }

.stage {
  position: relative;
  min-width: 0;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #01030a;
  touch-action: none;
  box-shadow: inset 0 0 40px rgba(35, 234, 255, .06);
}
canvas { display: block; width: 100%; height: 100%; }
.scanlines { position: absolute; z-index: 3; inset: 0; pointer-events: none; opacity: .12; background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, .52) 4px); mix-blend-mode: multiply; }
.stage::before { content: ""; position: absolute; z-index: 2; inset: 0; pointer-events: none; border: 1px solid rgba(35, 234, 255, .12); box-shadow: inset 0 0 22px rgba(35, 234, 255, .08); }

.boss-signal, .objective-chip {
  position: absolute;
  z-index: 4;
  top: 12px;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  background: linear-gradient(90deg, rgba(2, 5, 11, .78), rgba(2, 5, 11, .18));
  opacity: .82;
  pointer-events: none;
}
.boss-signal { left: 12px; min-width: 190px; }
.boss-signal strong { color: #e6faff; font-size: clamp(8px, .75vw, 11px); letter-spacing: .12em; }
.boss-health { width: 142px; height: 5px; background: #25101b; }
.boss-health i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, var(--red), var(--orange)); box-shadow: 0 0 8px var(--red); }
.boss-signal b { position: absolute; right: 8px; bottom: 6px; color: var(--red); font-size: 8px; }
.objective-chip { right: 12px; text-align: right; background: linear-gradient(-90deg, rgba(2, 5, 11, .78), rgba(2, 5, 11, .18)); }
.objective-chip strong { color: #b1c3ce; font-size: clamp(7px, .7vw, 10px); }
.objective-chip b { color: var(--acid); font-size: 8px; }

.launch-hint {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 58px;
  display: grid;
  gap: 5px;
  min-width: 250px;
  padding: 9px 16px;
  color: #9fb7c4;
  text-align: center;
  background: rgba(2, 7, 15, .76);
  border: 1px solid rgba(35, 234, 255, .34);
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.launch-hint b { color: var(--cyan); font-size: 10px; letter-spacing: .16em; text-shadow: 0 0 9px var(--cyan); }
.launch-hint span { font-size: 7px; letter-spacing: .1em; }
.game-card.aiming .launch-hint { opacity: 1; transform: translate(-50%, 0); }

.overlay {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle, rgba(2, 5, 13, .34), rgba(1, 3, 9, .88));
  transition: opacity 180ms ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }
.overlay-kicker { margin: 0 0 8px; color: var(--acid); font-size: clamp(7px, .7vw, 10px); font-weight: 900; letter-spacing: .18em; text-shadow: 0 0 10px var(--acid); }
.overlay h1 { margin: 0; color: #f3fdff; font: 900 clamp(36px, 5.5vw, 88px)/.86 Impact, "Arial Black", sans-serif; letter-spacing: -.02em; text-shadow: 3px 3px 0 #14283c, -2px -2px 0 var(--magenta), 0 0 28px rgba(35, 234, 255, .35); }
.overlay > p:not(.overlay-kicker):not(.controls) { margin: 14px 0 20px; color: #a1b8c4; font-size: clamp(9px, .85vw, 13px); }
.boost-shop { display: none; width: min(520px, 88%); margin: -5px 0 18px; padding: 9px; background: rgba(3, 9, 18, .9); border: 1px solid rgba(35, 234, 255, .3); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.42); }
.overlay.shop-enabled .boost-shop { display: grid; gap: 8px; }
.boost-shop header { display: flex; justify-content: space-between; color: var(--cyan); font-size: 8px; letter-spacing: .13em; }
.boost-shop header b { color: #91a9b5; }.boost-shop header i { color: var(--orange); font-style: normal; }
.boost-shop > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.boost-shop button { position: relative; display: grid; gap: 3px; padding: 8px 24px 8px 9px; color: #c9f8ff; text-align: left; background: linear-gradient(145deg, #102032, #050913); border: 1px solid #31516a; border-radius: 7px; cursor: pointer; }
.boost-shop button b { font: 900 8px/1 var(--mono); letter-spacing: .06em; }.boost-shop button span { color: var(--acid); font: 700 7px/1 var(--mono); }
.boost-shop button em { position: absolute; top: 50%; right: 7px; display: grid; place-items: center; width: 17px; height: 17px; color: #061007; background: var(--acid); border-radius: 50%; font: normal 900 8px/1 var(--mono); transform: translateY(-50%); }
.boost-shop button:hover:not(:disabled), .boost-shop button:focus-visible { border-color: var(--cyan); box-shadow: 0 0 12px rgba(35,234,255,.32); outline: 0; }
.boost-shop button:disabled { opacity: .35; cursor: not-allowed; }.boost-shop button.queued { border-color: var(--acid); box-shadow: inset 0 0 12px rgba(141,255,63,.12); }
.boost-shop small { color: #587585; font-size: 6px; letter-spacing: .11em; }
.impact-button { position: relative; padding: 4px; border: 1px solid #c4fdff; border-radius: 9px; background: #07121d; cursor: pointer; box-shadow: 0 0 0 2px var(--cyan), 6px 6px 0 var(--magenta), 0 0 20px rgba(35, 234, 255, .48); }
.impact-button span { display: block; padding: 12px 24px; color: #061007; border-radius: 5px; background: linear-gradient(180deg,#c7ff68,var(--acid)); font: 900 11px/1 var(--mono); letter-spacing: .12em; box-shadow: inset 0 3px 0 rgba(255,255,255,.38), inset 0 -3px 0 rgba(31,94,8,.22); }
.impact-button:hover { transform: translate(-2px, -2px); box-shadow: 0 0 0 2px var(--cyan), 9px 9px 0 var(--magenta), 0 0 26px rgba(35, 234, 255, .65); }
.impact-button:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
.controls { margin: 20px 0 0; color: #5c7686; font-size: clamp(6px, .52vw, 8px); letter-spacing: .13em; }

.power-dock {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-height: 57px;
  padding: 5px clamp(8px, 1vw, 16px);
  background: linear-gradient(180deg, rgba(6, 12, 22, .96), rgba(3, 6, 13, .99));
  border-top: 1px solid rgba(35, 234, 255, .22);
}
.power-chip { position: relative; min-width: 0; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 6px clamp(6px, .8vw, 12px); color: #526978; border-right: 1px solid rgba(56, 97, 126, .2); transition: color 140ms, background 140ms; }
.power-chip:last-child { border: 0; }
.power-chip .power-icon { display: grid; place-items: center; width: 27px; height: 27px; color: currentColor; border: 2px solid currentColor; border-radius: 8px; background: linear-gradient(145deg,#121d2b,#03070d); font: 900 14px/1 sans-serif; box-shadow: 0 3px 0 #010308; }
.power-chip b { overflow: hidden; font-size: clamp(7px, .65vw, 10px); letter-spacing: .06em; text-overflow: ellipsis; }
.power-chip strong { color: currentColor; font-size: 9px; }
.power-chip > i { position: absolute; left: 39px; right: 11px; bottom: 7px; height: 2px; overflow: hidden; background: #121d27; }
.power-chip em { display: block; width: 0; height: 100%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.power-fire.power-active { color: var(--orange); }.power-piercing.power-active { color: var(--acid); }.power-multiball.power-active { color: var(--cyan); }.power-wide.power-active { color: var(--magenta); }.power-magnet.power-active { color: #78ffb0; }.power-gun.power-active { color: var(--red); }.power-shield.power-active { color: #4d8fff; }
.power-chip.power-active { background: linear-gradient(180deg, rgba(25, 43, 57, .28), transparent); text-shadow: 0 0 9px currentColor; }
.power-chip.power-active .power-icon { box-shadow: 0 0 11px currentColor, inset 0 0 8px currentColor; }

.mission-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 29px; padding: 6px 14px; color: #526b7b; background: #03070e; border-top: 1px solid rgba(50, 89, 117, .26); font-size: clamp(6px, .52vw, 8px); letter-spacing: .1em; }
.mission-bar b { color: #a4bdc8; }.live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); }
.system-id { opacity: .6; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.campaign-nav .records-button { color: #fff36a; border-color: rgba(255, 243, 106, .45); }
.campaign-nav .records-button:hover, .campaign-nav .records-button:focus-visible { color: #071018; background: #fff36a; border-color: #fff; box-shadow: 0 0 13px rgba(255, 243, 106, .7); }
.record-center {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: clamp(9px, 1.2vw, 16px);
  padding: clamp(14px, 2.1vw, 30px);
  color: #dffaff;
  background:
    linear-gradient(rgba(35, 234, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 234, 255, .025) 1px, transparent 1px),
    radial-gradient(circle at 82% 12%, rgba(255, 51, 209, .15), transparent 30%),
    rgba(2, 5, 12, .985);
  background-size: 34px 34px, 34px 34px, auto, auto;
}
body.records-open { overflow: hidden; }
.record-center.open { display: grid; }
.record-header { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 18px; padding-bottom: 12px; border-bottom: 1px solid rgba(35, 234, 255, .28); }
.record-header span, .record-table-shell > header span { color: var(--cyan); font-size: 7px; letter-spacing: .2em; }
.record-header h2 { margin: 3px 0 0; color: #fff; font: 900 clamp(24px, 3vw, 46px)/.9 Impact, "Arial Black", sans-serif; letter-spacing: .04em; text-shadow: -2px 0 var(--magenta), 0 0 20px rgba(35, 234, 255, .3); }
.record-scope { display: flex; gap: 5px; padding: 4px; background: #050a12; border: 1px solid #203a50; border-radius: 7px; }
.record-scope button, .record-close { color: #668093; background: #08111d; border: 1px solid transparent; font: 900 8px/1 var(--mono); cursor: pointer; }
.record-scope button { padding: 8px 10px; border-radius: 4px; }
.record-scope button.active { color: #041008; background: var(--acid); box-shadow: 0 0 10px rgba(141,255,63,.45); }
.record-scope button:disabled { opacity: .42; cursor: not-allowed; }
.record-close { width: 36px; height: 36px; color: #fff; border-color: #436176; border-radius: 7px; font-size: 22px; }
.record-close:hover, .record-close:focus-visible { color: #071018; background: var(--magenta); border-color: #fff; outline: 0; box-shadow: 0 0 15px var(--magenta); }
.record-note { margin: 0; color: #597687; font-size: 7px; letter-spacing: .13em; }
.record-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(6px, .8vw, 11px); }
.record-card { position: relative; min-width: 0; padding: clamp(9px, 1.1vw, 15px); overflow: hidden; background: linear-gradient(145deg, rgba(13, 31, 48, .96), rgba(4, 9, 17, .96)); border: 1px solid #25455d; border-radius: 9px; box-shadow: inset 0 0 18px rgba(35,234,255,.025); }
.record-card::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: linear-gradient(90deg, var(--cyan), var(--magenta)); opacity: .72; }
.record-card span { display: block; min-height: 2.3em; color: #688494; font-size: clamp(6px, .52vw, 8px); line-height: 1.25; letter-spacing: .09em; }
.record-card strong { display: block; margin-top: 7px; overflow: hidden; color: #fff; font-size: clamp(16px, 1.65vw, 26px); line-height: 1; text-overflow: ellipsis; text-shadow: 0 0 12px rgba(35,234,255,.35); white-space: nowrap; }
.record-card:nth-child(2n) strong { color: var(--acid); }.record-card:nth-child(3n) strong { color: #fff36a; }
.record-table-shell { min-height: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); background: rgba(3, 9, 17, .9); border: 1px solid rgba(35, 234, 255, .3); border-radius: 10px; }
.record-table-shell > header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(11, 25, 39, .8); border-bottom: 1px solid #203b50; }
.record-table-shell > header div { display: grid; gap: 3px; }.record-table-shell > header b { color: #688494; font-size: 7px; letter-spacing: .08em; }
.record-table-shell > header strong { color: var(--acid); font-size: 8px; letter-spacing: .12em; }
.record-table-scroll { position: relative; min-height: 0; overflow: auto; scrollbar-color: #28627a #07101a; }
.record-table-scroll table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.record-table-scroll th { position: sticky; z-index: 1; top: 0; padding: 9px 12px; color: #4e7185; text-align: right; background: #050c15; border-bottom: 1px solid #193246; font-size: 7px; letter-spacing: .1em; }
.record-table-scroll th:first-child { width: 30%; text-align: left; }
.record-table-scroll td { padding: 10px 12px; color: #a7c3cf; text-align: right; border-bottom: 1px solid rgba(37,69,93,.45); font-size: clamp(7px, .68vw, 10px); }
.record-table-scroll td:first-child { text-align: left; }.record-table-scroll tr:hover td { background: rgba(35,234,255,.04); }
.record-level-name { display: block; overflow: hidden; color: #eefcff; font-size: 9px; letter-spacing: .06em; text-overflow: ellipsis; white-space: nowrap; }
.record-level-id { display: block; margin-top: 3px; color: var(--magenta); font-size: 6px; letter-spacing: .09em; }
.record-best { color: var(--cyan) !important; text-shadow: 0 0 8px rgba(35,234,255,.4); }
.record-empty { margin: 0; padding: 42px 20px; color: #567182; text-align: center; font-size: 8px; letter-spacing: .12em; }

/* Once the player takes control, the arena becomes the interface. */
body.play-mode {
  min-width: 0;
  overflow: hidden;
  background: #01030a;
}
.play-mode .wreck-app {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  place-items: center;
}
.play-mode .game-card {
  width: min(100vw, calc(100dvh * 1.6));
  height: min(100dvh, calc(100vw / 1.6));
  border: 0;
  clip-path: none;
  box-shadow: 0 0 70px #000;
}
.play-mode .game-card::before { inset: 0; border-color: rgba(35, 234, 255, .12); clip-path: none; }
.play-mode .hud {
  position: absolute;
  z-index: 10;
  inset: 0 0 auto;
  height: clamp(38px, 7dvh, 54px);
  grid-template-columns: 1fr auto 1fr;
  padding: max(5px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 5px max(10px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(1, 4, 10, .82), rgba(1, 4, 10, .28), transparent);
  border: 0;
  pointer-events: none;
}
.play-mode .hud::after,
.play-mode .campaign-nav,
.play-mode .brand-lockup,
.play-mode .scrap-stat,
.play-mode .stat span,
.play-mode .combo-readout span { display: none; }
.play-mode .hud-center { order: 2; }
.play-mode .hud-left { order: 1; }
.play-mode .hud-right { order: 3; }
.play-mode .stat strong,
.play-mode .combo-readout strong { font-size: clamp(12px, 2.8dvh, 22px); }
.play-mode .arena-shell { height: 100%; grid-template-columns: minmax(0, 1fr); }
.play-mode .wreck-rail,
.play-mode .power-dock,
.play-mode .mission-bar { display: none; }
.play-mode .stage { width: 100%; height: 100%; aspect-ratio: auto; }
.play-mode .boss-signal,
.play-mode .objective-chip { top: clamp(42px, 8dvh, 62px); }
.play-mode .launch-hint { bottom: clamp(28px, 8dvh, 58px); }

@media (max-width: 1100px) and (orientation: portrait) and (pointer: coarse) {
  .rotate-device {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px;
    color: var(--text);
    text-align: center;
    background:
      radial-gradient(circle at 50% 42%, rgba(35, 234, 255, .16), transparent 34%),
      #02040a;
  }
  .rotate-device-icon {
    position: relative;
    width: 76px;
    height: 52px;
    border: 3px solid var(--cyan);
    border-radius: 9px;
    box-shadow: 0 0 24px rgba(35, 234, 255, .4);
    transform: rotate(-14deg);
    animation: rotate-device 1.8s ease-in-out infinite alternate;
  }
  .rotate-device-icon i { position: absolute; right: 5px; top: 50%; width: 4px; height: 4px; border-radius: 50%; background: var(--magenta); transform: translateY(-50%); box-shadow: 0 0 7px var(--magenta); }
  .rotate-device strong { color: var(--cyan); font-size: clamp(15px, 5vw, 24px); letter-spacing: .1em; text-shadow: 0 0 14px rgba(35, 234, 255, .65); }
  .rotate-device small { color: #86a3b3; font-size: clamp(9px, 3vw, 13px); letter-spacing: .08em; }
}

@keyframes rotate-device {
  from { transform: rotate(-14deg) scale(.96); }
  to { transform: rotate(0deg) scale(1.03); }
}

@media (min-width: 1120px) and (min-height: 820px) {
  body:not(.play-mode) .game-card { width: min(100%, calc(160svh - 227px)); }
}

@media (max-width: 820px) {
  .wreck-app { place-items: start center; padding: 4px; }
  .hud { grid-template-columns: 1fr auto 1fr; padding-inline: 9px; }
  .brand-lockup { font-size: clamp(15px, 3.7vw, 25px); }
  .combo-readout span, .score-stat span, .lives-stat span, .scrap-stat span, .campaign-nav { display: none; }
  .hud-cluster { gap: 8px; }
  .arena-shell { grid-template-columns: 45px minmax(0, 1fr); }
  .wreck-rail { gap: 4px; padding: 6px 4px; }
  .rail-label, .wreck-rail > strong, .meter { display: none; }
  .wreck-letters { gap: 3px; }
  .wreck-letters i { width: 28px; font-size: 12px; }
  .power-dock { grid-template-columns: repeat(4, 1fr); }
  .power-chip:nth-child(4) { border-right: 0; }
  .power-chip:nth-child(-n+4) { border-bottom: 1px solid rgba(56, 97, 126, .2); }
  .mission-bar span:nth-child(4), .system-id { display: none; }
  .boost-shop { width: min(470px, 96%); margin-bottom: 10px; }.boost-shop small { display: none; }
  .record-center { padding: 10px; }.record-cards { grid-template-columns: repeat(3, 1fr); }.record-header { gap: 8px; }.record-header h2 { font-size: 25px; }.record-scope button { padding: 6px; }.record-table-scroll th, .record-table-scroll td { padding: 7px; }
}

@media (max-width: 540px) {
  .hud { height: 57px; }
  .hud-right { gap: 5px; }
  .score-stat strong { font-size: 12px; }
  .lives-stat strong { font-size: 9px; }
  .arena-shell { grid-template-columns: 36px minmax(0, 1fr); }
  .wreck-letters i { width: 23px; font-size: 10px; }
  .boss-signal { left: 5px; top: 5px; min-width: 132px; padding: 5px; }
  .boss-health { width: 92px; }
  .objective-chip { right: 5px; top: 5px; padding: 5px; }
  .objective-chip strong { max-width: 112px; }
  .power-dock { grid-template-columns: repeat(2, 1fr); }
  .power-chip:nth-child(4) { border-right: 0; }
  .power-chip:nth-child(even) { border-right: 0; }
  .power-chip:nth-child(-n+6) { border-bottom: 1px solid rgba(56, 97, 126, .2); }
  .mission-bar span:nth-child(3) { display: none; }
  .controls { max-width: 260px; line-height: 1.7; }
  .record-scope { display: none; }.record-cards { grid-template-columns: repeat(2, 1fr); }.record-card:nth-child(n+5) { display: none; }.record-table-scroll th:nth-child(4), .record-table-scroll td:nth-child(4), .record-table-scroll th:nth-child(6), .record-table-scroll td:nth-child(6) { display: none; }.record-table-scroll th:first-child { width: 40%; }
}

@media (prefers-color-scheme: light) {
  body { background: radial-gradient(circle at 50% 0, rgba(32, 96, 160, .2), transparent 38rem), #d8e0e8; }
  .game-card { box-shadow: 0 20px 50px rgba(20, 38, 54, .32); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .scanlines { display: none; }
  .rotate-device-icon { animation: none; }
}
