/* ===== VIPER ARENA - styling =====
   Dark near-black canvas, neon cyan + orange accents. No purple.
   Big, bold, sharp. */

:root {
  --bg: #04070a;
  --panel: rgba(6, 12, 16, 0.72);
  --cyan: #7cf9ff;
  --cyan-dim: #2b8f96;
  --orange: #ff8a2b;
  --orange-hot: #ffc24b;
  --red: #ff4d6d;
  --ink: #dff6f8;
  --muted: #5c7378;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  cursor: crosshair;
}

canvas#game {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
}

.hidden { display: none !important; }

/* ===== HUD ===== */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  font-variant-numeric: tabular-nums;
}

.hud-top {
  position: absolute;
  top: 22px;
  left: 32px;
  right: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.hud-block { text-align: left; }
.hud-center { text-align: center; }
.hud-right { text-align: right; }

.hud-label {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.hud-value {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(124, 249, 255, 0.55);
  letter-spacing: 1px;
}

.hud-center .hud-value { color: var(--orange-hot); text-shadow: 0 0 18px rgba(255, 194, 75, 0.55); }
.hud-right .hud-value { color: var(--ink); text-shadow: none; }

.hud-combo {
  font-size: 16px;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: 2px;
  height: 18px;
  text-shadow: 0 0 12px rgba(255, 138, 43, 0.6);
}

/* wave banner */
.wave-banner {
  position: absolute;
  top: 34%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 68px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--cyan);
  text-shadow: 0 0 40px rgba(124, 249, 255, 0.7);
  animation: waveflash 0.4s ease-out;
}
@keyframes waveflash {
  from { transform: scale(1.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* bottom bars */
.hud-bottom {
  position: absolute;
  bottom: 26px;
  left: 32px;
  right: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.hud-health { width: 42%; max-width: 420px; }

.health-bar {
  margin-top: 6px;
  height: 20px;
  border: 2px solid rgba(124, 249, 255, 0.35);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.6) inset;
}

.health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #39ff9e, #7cf9ff);
  box-shadow: 0 0 20px rgba(57, 255, 158, 0.7);
  transition: width 0.12s linear, background 0.2s;
}
.health-fill.low { background: linear-gradient(90deg, #ff4d6d, #ff8a2b); box-shadow: 0 0 20px rgba(255, 77, 109, 0.8); }

.health-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin-top: 2px;
}

.stamina-bar {
  margin-top: 6px;
  height: 10px;
  border: 2px solid rgba(255, 196, 75, 0.35);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6) inset;
}

.stamina-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffc24b, #ff8a2b);
  box-shadow: 0 0 14px rgba(255, 194, 75, 0.7);
  transition: width 0.12s linear, background 0.2s;
}
.stamina-fill.empty { background: rgba(255, 255, 255, 0.12); box-shadow: none; }

.chip-row { display: flex; align-items: center; gap: 8px; }

.ability-chip {
  position: relative;
  overflow: hidden;
  margin-top: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(124, 249, 255, 0.35);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
}
.ability-chip i {
  position: absolute; inset: 0; width: 0%;
  background: rgba(124, 249, 255, 0.16);
  transition: width 0.15s linear;
}
.ability-chip span { position: relative; }
.ability-chip.ready { color: #7cf9ff; border-color: rgba(124, 249, 255, 0.8); }
.ability-chip.ready i { background: rgba(124, 249, 255, 0.22); }
.ability-chip.active { color: #06231f; background: #39ff9e; border-color: #39ff9e; }

.how-to-play {
  margin-top: 18px;
  border: 1px solid rgba(124, 249, 255, 0.25);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
}
.how-to-play summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 900;
  letter-spacing: 3px;
  font-size: 12px;
  color: #7cf9ff;
  list-style: none;
}
.how-to-play summary::before { content: '▸ '; }
.how-to-play[open] summary::before { content: '▾ '; }
.htp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  padding: 4px 16px 16px;
}
.htp-grid b { display: block; font-size: 10px; letter-spacing: 2px; color: #ffc24b; margin-bottom: 3px; }
.htp-grid p { margin: 0; font-size: 11px; line-height: 1.55; color: rgba(255, 255, 255, 0.75); }
@media (max-width: 620px) {
  .htp-grid { grid-template-columns: 1fr; }
}

/* Browser-first launcher: keep identity, loadouts and PLAY in the first viewport
   on common 1280x720/1440x900 laptop displays. */
@media (min-width: 861px) and (max-height: 850px) {
  .title-shell {
    min-height: calc(100% - 24px);
    width: min(1180px, calc(100% - 24px));
    margin-block: 12px;
  }

  .launch-panel { padding: 22px 32px; }
  .title-shell .logo { margin-top: 8px; font-size: clamp(52px, 6.1vw, 78px); }
  .title-shell .tagline { margin-top: 8px; margin-bottom: 14px; font-size: 11px; letter-spacing: 4px; }
  .username-field { gap: 5px; }
  .username-field input { min-height: 42px; }
  .field-error { min-height: 10px; margin-top: 4px; }
  .loadout-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
  .loadout-card { min-height: 70px; padding: 9px; grid-template-columns: 26px 1fr; gap: 7px; }
  .loadout-card svg { width: 25px; height: 25px; }
  .loadout-card span { gap: 4px; }
  .sound-picker, .level-picker { margin-top: 10px; }
  .level-chip { width: 34px; height: 34px; font-size: 13px; }
  .level-note { display: none; }
  .title-shell .btn { margin-top: 10px; }
  .btn-play { padding-block: 12px !important; font-size: 24px !important; }
  .title-shell .controls-hint { margin-top: 10px; gap: 12px; font-size: 9px; }
  .how-to-play { margin-top: 10px; }
  .how-to-play summary { padding: 8px 12px; }
  .leaderboard-panel { padding: 24px 30px; }
}

/* Cascade guard: chapter primitives intentionally override legacy level chips. */
.level-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 310px;
  overflow: auto;
}
.story-inner { width: min(760px, calc(100vw - 32px)); max-width: 760px; padding: 0 0 26px; }
@media (max-width: 760px) {
  .level-row { grid-template-columns: 1fr; max-height: 350px; }
}

/* Combat state language: Siege Mode must be impossible to miss. */
.hud.siege-active::before {
  content: "SIEGE MODE ONLINE · COLLISION LOCK";
  position: fixed;
  inset: 10px;
  z-index: 8;
  pointer-events: none;
  border: 4px solid #ffc24b;
  box-shadow: inset 0 0 90px rgba(255, 138, 43, .28), 0 0 28px rgba(255, 194, 75, .65);
  color: #ffc24b;
  padding: 18px;
  text-align: center;
  font: 900 15px/1 var(--font-mono, monospace);
  letter-spacing: .22em;
  animation: siege-pulse .42s steps(2, end) infinite;
}
.hud.siege-active .ability-chip {
  background: #ffc24b;
  color: #07090b;
  border-color: #fff1b8;
  box-shadow: 0 0 28px rgba(255, 194, 75, .72);
}
.weapon-slot kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  margin-right: 7px;
  font: 800 11px/1 var(--font-mono, monospace);
}
@keyframes siege-pulse { 50% { opacity: .72; } }

/* ===== V5 CINEMATIC LAUNCHER =====
   The generated gate is the screen. Live controls sit in its authored dark
   safe zone instead of rebuilding the old opaque application shell over it. */
#title {
  display: block;
  overflow-y: auto;
  background-position: center center;
}

#title .title-shell {
  position: relative;
  width: 100%;
  min-height: 100%;
  margin: 0;
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

#title .launch-panel {
  position: relative;
  z-index: 2;
  width: min(540px, 46vw);
  min-height: 100vh;
  padding: clamp(34px, 5vh, 70px) clamp(30px, 4vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 0;
  background:
    linear-gradient(90deg, rgba(1, 5, 10, .96) 0%, rgba(1, 5, 10, .88) 72%, rgba(1, 5, 10, 0) 100%);
}

#title .eyebrow { color: #ffc24b; }
#title .logo {
  margin-top: 14px;
  max-width: 480px;
  font-size: clamp(58px, 5.2vw, 94px);
  letter-spacing: 2px;
  line-height: .82;
}
#title .logo-accent { margin-top: 12px; }
#title .tagline {
  max-width: 460px;
  margin: 20px 0 24px;
  color: rgba(223, 246, 248, .58);
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 5px;
}

#title .username-field { max-width: 440px; gap: 6px; }
#title .username-field input {
  min-height: 46px;
  background: rgba(4, 10, 14, .72);
  border-color: rgba(124, 249, 255, .48);
  backdrop-filter: blur(12px);
}
#title .field-error { min-height: 12px; margin-top: 4px; }

#title .btn-play {
  width: min(440px, 100%);
  margin-top: 8px;
  padding: 16px 30px;
  color: #021112;
  background: linear-gradient(135deg, #7cf9ff 0%, #39ff9e 100%);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 2px;
  font-size: 24px;
  box-shadow: 0 0 30px rgba(57, 255, 158, .28), inset 0 1px rgba(255,255,255,.52);
}
#title .btn-play:hover {
  background: linear-gradient(135deg, #fff3a8 0%, #ff8a2b 100%);
  box-shadow: 0 0 38px rgba(255, 138, 43, .44);
}
.run-promise {
  width: min(440px, 100%);
  margin: 9px 0 12px;
  color: rgba(124, 249, 255, .54);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.7px;
  text-align: center;
}

.menu-drawer {
  width: min(440px, 100%);
  margin-top: 7px;
  border: 1px solid rgba(124, 249, 255, .22);
  background: rgba(3, 9, 13, .78);
  backdrop-filter: blur(16px);
}
.menu-drawer > summary {
  min-height: 46px;
  padding: 0 15px;
  display: grid;
  grid-template-columns: 92px 1fr 18px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
}
.menu-drawer > summary::-webkit-details-marker { display: none; }
.menu-drawer > summary span {
  color: var(--orange-hot);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
}
.menu-drawer > summary b {
  overflow: hidden;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-drawer > summary i {
  color: var(--cyan);
  font-size: 18px;
  font-style: normal;
  transition: transform 160ms ease;
}
.menu-drawer[open] > summary i { transform: rotate(45deg); }
.menu-drawer[open] { width: min(760px, calc(100vw - 72px)); }
.drawer-content {
  max-height: min(58vh, 560px);
  padding: 4px 14px 16px;
  overflow: auto;
  border-top: 1px solid rgba(124, 249, 255, .12);
}
.menu-drawer .loadout-picker {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.menu-drawer .loadout-card {
  min-height: 126px;
  grid-template-columns: 28px 1fr;
  padding: 11px;
  background: rgba(255,255,255,.022);
}
.menu-drawer .loadout-card span { gap: 5px; }
.menu-drawer .loadout-card small { line-height: 1.45; }
.menu-drawer .loadout-card em {
  color: var(--cyan);
  font-style: normal;
  font-weight: 900;
  letter-spacing: .7px;
}
.menu-drawer .sound-picker,
.menu-drawer .level-picker { margin-top: 14px; }

#title .controls-hint {
  width: min(440px, 100%);
  margin-top: 14px;
  justify-content: flex-start;
  gap: 8px 16px;
  font-size: 8px;
}
#title .how-to-play { width: min(440px, 100%); margin-top: 8px; }

#title .leaderboard-panel {
  position: fixed;
  z-index: 3;
  top: 24px;
  right: 24px;
  width: min(320px, 28vw);
  min-height: 0;
  max-height: calc(100vh - 48px);
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(124, 249, 255, .22);
  background: rgba(3, 8, 12, .62);
  box-shadow: 0 20px 70px rgba(0,0,0,.5);
  backdrop-filter: blur(16px);
}
#title .leaderboard-head h2 { font-size: 19px; }
#title .leaderboard-list { margin: 16px 0; gap: 5px; }
#title .leaderboard-list li { min-height: 34px; background: rgba(2,7,10,.56); }
#title .mission-preview { margin-top: 10px; padding-top: 12px; }
#title .mission-preview p { margin-top: 5px; font-size: 9px; }

/* Dedicated desktop monetisation safe zones. They remain empty and
   non-interactive until an approved ad provider is connected. */
.ad-rail {
  position: absolute;
  top: 148px;
  bottom: 148px;
  width: 96px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(124, 249, 255, .12);
  background: rgba(3, 8, 12, .42);
  pointer-events: none;
}
.ad-rail-left { left: 18px; }
.ad-rail-right { right: 18px; }
.ad-rail span {
  color: rgba(124, 249, 255, .24);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 2px;
  writing-mode: vertical-rl;
}

@media (min-width: 1180px) {
  #hud .hud-top { left: 132px; right: 132px; }
  #hud .hud-bottom { left: 132px; right: 132px; }
  #hud #minimap, #hud .sound-toggle, #hud .assist-toggle { right: 132px; }
}

/* ===== CHAPTER SELECT + COMPLETION CHECKPOINT ===== */
.level-picker { min-width: 0; }
.level-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 310px;
  padding-right: 5px;
  overflow: auto;
  scrollbar-color: rgba(124, 249, 255, .4) rgba(0, 0, 0, .22);
}
.chapter-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid rgba(124, 249, 255, .16);
  background: rgba(2, 9, 13, .76);
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.chapter-card:hover:not(.locked), .chapter-card:focus-within {
  border-color: rgba(124, 249, 255, .62);
  background: rgba(8, 29, 34, .9);
  transform: translateY(-1px);
}
.chapter-card.selected {
  border-color: var(--cyan);
  box-shadow: inset 3px 0 0 var(--cyan);
  background: rgba(38, 113, 121, .2);
}
.chapter-card.locked { opacity: .34; }
.chapter-select, .chapter-deploy {
  border: 0;
  border-radius: 0;
  color: #dff8ff;
  background: transparent;
  font: inherit;
}
.chapter-select {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}
.chapter-select > span:first-child {
  color: var(--orange);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
}
.chapter-select > span:last-child { display: grid; gap: 4px; min-width: 0; }
.chapter-select b {
  overflow: hidden;
  font-size: 10px;
  letter-spacing: 1.4px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chapter-select small {
  overflow: hidden;
  color: rgba(214, 241, 247, .48);
  font-size: 7px;
  letter-spacing: .8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chapter-deploy {
  min-width: 62px;
  padding: 8px;
  border-left: 1px solid rgba(124, 249, 255, .15);
  color: var(--cyan);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 1.2px;
  cursor: pointer;
}
.chapter-deploy:hover:not(:disabled) { background: var(--cyan); color: #031014; }
.chapter-select:focus-visible, .chapter-deploy:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.chapter-select:disabled, .chapter-deploy:disabled { cursor: not-allowed; }

.story-inner {
  width: min(760px, calc(100vw - 32px));
  padding: 0 0 26px;
  overflow: hidden;
  border: 1px solid rgba(124, 249, 255, .42);
  background: rgba(3, 9, 13, .96);
}
.story-inner > .eyebrow, .story-inner > .story-lines, .story-inner > .btn { margin-inline: 28px; }
.story-inner > .eyebrow { margin-top: 22px; }
.story-visual {
  display: block;
  width: 100%;
  height: clamp(150px, 26vh, 260px);
  margin: 0 0 22px;
  object-fit: cover;
  filter: saturate(.92) contrast(1.08);
  border-bottom: 1px solid rgba(124, 249, 255, .3);
}

.chapter-complete { z-index: 40; background: rgba(1, 4, 7, .9); backdrop-filter: blur(16px); }
.chapter-complete-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
  width: min(1040px, calc(100vw - 34px));
  max-width: none;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border: 1px solid rgba(124, 249, 255, .5);
  background: #050b0f;
  box-shadow: 0 28px 100px rgba(0, 0, 0, .72), 0 0 60px rgba(124, 249, 255, .08);
}
.chapter-complete-visual {
  width: 100%;
  height: 100%;
  min-height: 540px;
  object-fit: cover;
  filter: saturate(.92) contrast(1.1);
}
.chapter-complete-copy { align-self: center; padding: 36px; }
.chapter-complete-copy h2 {
  margin: 10px 0 8px;
  color: #f2fdff;
  font-size: clamp(32px, 4vw, 58px);
  line-height: .94;
  letter-spacing: -2px;
}
.chapter-complete-map { color: var(--orange); font-size: 10px; font-weight: 900; letter-spacing: 2px; }
.chapter-reward-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 28px 0 18px;
  border-block: 1px solid rgba(124, 249, 255, .2);
}
.chapter-reward-grid div { padding: 18px 8px; text-align: center; }
.chapter-reward-grid div + div { border-left: 1px solid rgba(124, 249, 255, .2); }
.chapter-reward-grid span { display: block; color: var(--cyan); font-size: 26px; font-weight: 900; }
.chapter-reward-grid small { color: rgba(221, 244, 249, .46); font-size: 7px; letter-spacing: 1.6px; }
.chapter-complete-note { color: rgba(221, 244, 249, .58); font-size: 11px; line-height: 1.6; }
.chapter-complete-actions { display: grid; gap: 9px; margin-top: 23px; }
.chapter-complete-actions .btn { width: 100%; font-size: 11px; letter-spacing: 2px; }
.btn-secondary { background: transparent !important; color: var(--cyan) !important; box-shadow: inset 0 0 0 1px rgba(124, 249, 255, .35) !important; }
.text-button {
  padding: 8px;
  border: 0;
  color: rgba(220, 242, 247, .55);
  background: transparent;
  font: inherit;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.6px;
  cursor: pointer;
}
.text-button:hover { color: #fff; }

@media (max-width: 760px) {
  .level-row { grid-template-columns: 1fr; max-height: 350px; }
  .chapter-complete-inner { grid-template-columns: 1fr; max-height: calc(100vh - 24px); overflow: auto; }
  .chapter-complete-visual { min-height: 0; height: 210px; }
  .chapter-complete-copy { padding: 24px; }
  .chapter-complete-copy h2 { font-size: 38px; }
  .story-inner > .eyebrow, .story-inner > .story-lines, .story-inner > .btn { margin-inline: 18px; }
}

@media (max-width: 1179px) {
  .ad-rail { display: none; }
}

@media (max-width: 860px) {
  #title { background-position: 62% center; }
  #title .title-shell { min-height: 100%; margin: 0; }
  #title .launch-panel {
    width: 100%;
    min-height: 100vh;
    padding: 32px 22px;
    background: linear-gradient(90deg, rgba(1,5,10,.96), rgba(1,5,10,.78));
  }
  #title .logo { font-size: clamp(52px, 15vw, 82px); }
  #title .leaderboard-panel {
    position: relative;
    top: auto;
    right: auto;
    width: calc(100% - 44px);
    max-height: none;
    margin: 0 22px 22px;
  }
  .menu-drawer[open] { width: 100%; }
  .menu-drawer .loadout-picker { grid-template-columns: 1fr; }
}

/* This final desktop rule intentionally comes last so the legacy three-column
   launcher cannot push PLAY below the initial viewport. */
@media (min-width: 861px) {
  .loadout-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .loadout-card { min-height: 78px; grid-template-columns: 28px 1fr; padding: 10px; }
  .loadout-card svg { width: 27px; height: 27px; }
}

@media (min-width: 861px) {
  .loadout-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .loadout-card { min-height: 88px; grid-template-columns: 28px 1fr; padding: 10px; }
  .loadout-card svg { width: 27px; height: 27px; }
}

.hud-weapon { text-align: right; }

.weapon-belt { display: flex; justify-content: flex-end; gap: 5px; margin-bottom: 8px; max-width: 560px; flex-wrap: wrap; }
.weapon-slot { min-width: 74px; padding: 5px 7px; border: 1px solid rgba(124,249,255,.22); background: rgba(4,10,14,.78); color: #91a8ad; font: 700 8px/1.2 inherit; letter-spacing: .8px; text-transform: uppercase; cursor: pointer; }
.weapon-slot b, .weapon-slot span { display: block; }
.weapon-slot span { margin-top: 2px; opacity: .7; }
.weapon-slot.active { border-color: var(--orange-hot); color: var(--orange-hot); box-shadow: 0 0 12px rgba(255,138,43,.25); }
.weapon-cycle-hint { margin-top: 5px; color: rgba(124,249,255,.55); font-size: 8px; letter-spacing: 1.5px; }

.weapon-name {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--orange-hot);
  text-shadow: 0 0 18px rgba(255, 194, 75, 0.55);
}

.weapon-ammo {
  font-size: 34px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}
.weapon-ammo.empty { color: var(--red); }

#minimap {
  position: absolute;
  top: 90px;
  right: 32px;
  width: 132px;
  height: 88px;
  opacity: .52;
  border: 2px solid rgba(124, 249, 255, 0.28);
  background: rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.5);
}

/* ===== OVERLAYS ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(124, 249, 255, 0.06), transparent 60%),
    rgba(2, 4, 6, 0.86);
  backdrop-filter: blur(4px);
}

#title {
  background:
    linear-gradient(90deg, rgba(1, 5, 10, 0.38) 0%, rgba(1, 5, 10, 0.12) 44%, rgba(1, 5, 10, 0.05) 100%),
    url('./assets/generated/ui/title-screen-background.webp') center / cover no-repeat;
  backdrop-filter: none;
}

.overlay-inner { text-align: center; padding: 40px; }

.pause-overlay {
  z-index: 40;
  background: rgba(2, 4, 6, 0.78);
}

.pause-inner {
  width: min(460px, calc(100% - 32px));
  border: 1px solid rgba(124, 249, 255, 0.38);
  background: rgba(3, 8, 12, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.7), 0 0 70px rgba(124, 249, 255, 0.12);
}

.pause-inner h2 {
  margin-top: 12px;
  color: var(--cyan);
  font-size: clamp(48px, 10vw, 86px);
  letter-spacing: 8px;
  text-shadow: 0 0 30px rgba(124, 249, 255, 0.5);
}

.pause-inner p:not(.eyebrow) { margin-top: 12px; color: var(--muted); }
.pause-inner small { display: block; margin-top: 18px; color: var(--muted); letter-spacing: 3px; }

.logo {
  font-size: clamp(56px, 12vw, 150px);
  font-weight: 900;
  letter-spacing: 6px;
  line-height: 0.92;
  color: var(--cyan);
  text-shadow: 0 0 50px rgba(124, 249, 255, 0.6), 0 0 4px rgba(124, 249, 255, 0.9);
}
.logo-accent {
  display: block;
  color: var(--orange);
  text-shadow: 0 0 50px rgba(255, 138, 43, 0.6);
}

.tagline {
  margin-top: 14px;
  font-size: 18px;
  letter-spacing: 8px;
  font-weight: 700;
  color: var(--muted);
}

.dead {
  font-size: clamp(48px, 10vw, 120px);
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--red);
  text-shadow: 0 0 50px rgba(255, 77, 109, 0.6);
}

.death-cause {
  margin-top: 8px;
  font-size: 20px;
  letter-spacing: 4px;
  font-weight: 700;
  color: var(--orange);
}

.final-stats {
  margin: 34px 0;
  display: flex;
  gap: 46px;
  justify-content: center;
}
.final-stats div { display: flex; flex-direction: column; }
.stat-num {
  font-size: 52px;
  font-weight: 900;
  color: var(--cyan);
  line-height: 1;
  text-shadow: 0 0 20px rgba(124, 249, 255, 0.5);
}
.stat-lbl { font-size: 12px; letter-spacing: 4px; color: var(--muted); margin-top: 6px; font-weight: 700; }

.btn {
  margin-top: 30px;
  pointer-events: auto;
  cursor: pointer;
  font-family: inherit;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 6px;
  padding: 16px 64px;
  color: var(--bg);
  background: var(--cyan);
  border: none;
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(124, 249, 255, 0.5);
  transition: transform 0.08s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { background: var(--orange-hot); box-shadow: 0 0 40px rgba(255, 194, 75, 0.7); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.controls-hint {
  margin-top: 40px;
  display: flex;
  gap: 34px;
  justify-content: center;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--muted);
}
.controls-hint b { color: var(--cyan); font-weight: 800; }

/* ===== V3 PROFILE + LOADOUT LAUNCHER ===== */
button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.overlay {
  overflow: auto;
  overscroll-behavior: contain;
}

.title-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: min(760px, calc(100% - 40px));
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.75fr);
  align-items: stretch;
  border: 1px solid rgba(124, 249, 255, 0.24);
  background: rgba(3, 8, 12, 0.74);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 0 80px rgba(124, 249, 255, 0.06);
  backdrop-filter: blur(18px);
}

.launch-panel {
  padding: clamp(28px, 4.5vw, 64px);
  border-right: 1px solid rgba(124, 249, 255, 0.18);
}

.eyebrow {
  color: var(--orange-hot);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 4px;
}

.title-shell .logo {
  margin-top: 18px;
  font-size: clamp(54px, 8vw, 112px);
  text-align: left;
}

.title-shell .tagline {
  text-align: left;
  margin-bottom: 30px;
}

.username-field {
  display: grid;
  gap: 9px;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
}

.username-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(124, 249, 255, 0.05);
  border: 1px solid rgba(124, 249, 255, 0.38);
  border-radius: 3px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  user-select: text;
}

.username-field input::placeholder {
  color: rgba(92, 115, 120, 0.72);
}

.field-error {
  min-height: 20px;
  margin-top: 8px;
  text-align: left;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.loadout-picker {
  margin-top: 16px;
  border: 0;
  text-align: left;
}

.loadout-picker legend,
.sound-picker > span {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
}

.loadout-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.loadout-picker legend {
  grid-column: 1 / -1;
}

.loadout-card {
  min-height: 116px;
  padding: 13px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: start;
  gap: 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(124, 249, 255, 0.15);
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.loadout-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 249, 255, 0.58);
}

.loadout-card.selected {
  background: rgba(124, 249, 255, 0.09);
  border-color: var(--cyan);
  box-shadow: inset 0 -3px 0 var(--cyan);
}

.loadout-card:nth-of-type(2).selected {
  background: rgba(255, 194, 75, 0.08);
  border-color: var(--orange-hot);
  box-shadow: inset 0 -3px 0 var(--orange-hot);
}

.loadout-card:nth-of-type(3).selected {
  background: rgba(255, 77, 157, 0.08);
  border-color: #ff4d9d;
  box-shadow: inset 0 -3px 0 #ff4d9d;
}

.loadout-card:nth-of-type(4).selected {
  background: rgba(255, 138, 43, 0.08);
  border-color: #ff8a2b;
  box-shadow: inset 0 -3px 0 #ff8a2b;
}

.loadout-card:nth-of-type(5).selected {
  background: rgba(140, 255, 107, 0.08);
  border-color: #8cff6b;
  box-shadow: inset 0 -3px 0 #8cff6b;
}

.loadout-card:nth-of-type(6).selected {
  background: rgba(194, 178, 233, 0.1);
  border-color: #c2b2e9;
  box-shadow: inset 0 -3px 0 #c2b2e9;
}

.loadout-card svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
}

.loadout-card span {
  display: grid;
  gap: 8px;
}

.loadout-card b {
  font-size: 11px;
  letter-spacing: 1.3px;
}

.loadout-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.sound-picker {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.sound-picker > span {
  margin: 0 auto 0 0;
}

.sound-picker button,
.sound-toggle,
.assist-toggle {
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(124, 249, 255, 0.18);
  border-radius: 2px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.sound-picker button.selected {
  color: var(--bg);
  background: var(--cyan);
  border-color: var(--cyan);
}

.title-shell .btn {
  width: 100%;
  margin-top: 20px;
}

.title-shell .controls-hint {
  margin-top: 20px;
  flex-wrap: wrap;
}

.leaderboard-panel {
  padding: clamp(26px, 3.5vw, 46px);
  display: flex;
  flex-direction: column;
  text-align: left;
  background:
    linear-gradient(rgba(124, 249, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 249, 255, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

.leaderboard-head span,
.mission-preview > span {
  color: var(--cyan-dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
}

.leaderboard-head h2 {
  margin-top: 8px;
  font-size: 25px;
  letter-spacing: 4px;
}

.leaderboard-list {
  margin: 24px 0 32px;
  display: grid;
  gap: 8px;
  list-style: none;
  counter-reset: none;
}

.leaderboard-list li {
  min-height: 42px;
  padding: 0 11px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  background: rgba(4, 7, 10, 0.72);
  border-left: 2px solid rgba(124, 249, 255, 0.34);
  font-size: 11px;
  letter-spacing: 1px;
}

.leaderboard-list li > span:first-child {
  color: var(--cyan);
}

.leaderboard-list li strong {
  color: var(--orange-hot);
  font-size: 13px;
}

.leaderboard-list .leaderboard-empty {
  display: grid;
  grid-template-columns: 1fr;
  color: var(--muted);
  line-height: 1.5;
}

.mission-preview {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid rgba(124, 249, 255, 0.16);
}

.mission-preview p {
  margin-top: 13px;
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.mission-preview b {
  color: var(--orange-hot);
}

/* ===== V3 HUD ===== */
.hud-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

#hud-progress {
  font-size: clamp(26px, 3vw, 42px);
}

#hud-mission {
  max-width: 360px;
  color: var(--orange-hot);
}

.loadout-chip {
  --loadout-color: var(--cyan);
  width: fit-content;
  margin-top: 5px;
  padding: 5px 8px;
  color: var(--loadout-color);
  border: 1px solid color-mix(in srgb, var(--loadout-color) 58%, transparent);
  background: rgba(0, 0, 0, 0.45);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.boss-meter {
  position: absolute;
  top: 102px;
  left: 50%;
  width: min(520px, calc(100% - 420px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.boss-portrait {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 1px solid rgba(255, 77, 157, 0.7);
  background: rgba(0, 0, 0, 0.64);
  box-shadow: 0 0 22px rgba(255, 77, 157, 0.28);
  border-radius: 50%;
}

.boss-meter-content {
  min-width: 0;
}

.boss-meter-line {
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  color: #ff7ab4;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
}

.boss-bar {
  height: 10px;
  padding: 2px;
  border: 1px solid rgba(255, 77, 157, 0.72);
  background: rgba(0, 0, 0, 0.58);
}

.boss-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff4d6d, #ff8a2b);
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.72);
  transition: width 100ms linear;
}

.sound-toggle {
  position: absolute;
  top: 224px;
  right: 32px;
  z-index: 4;
  pointer-events: auto;
  color: var(--cyan);
  background: rgba(4, 7, 10, 0.84);
}

.assist-toggle {
  position: absolute;
  top: 266px;
  right: 32px;
  z-index: 4;
  pointer-events: auto;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(4, 7, 10, 0.84);
  border: 1px solid rgba(124, 249, 255, 0.24);
  border-radius: 2px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
}
.assist-toggle.active {
  color: var(--bg);
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(124, 249, 255, .42);
}

.rank-result {
  margin-top: 18px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
}

.gameover-inner {
  max-width: 760px;
}

.touch-controls {
  display: none;
}

@media (max-width: 860px) {
  .title-shell {
    width: min(680px, calc(100% - 24px));
    min-height: auto;
    margin: 12px auto;
    grid-template-columns: 1fr;
  }

  .launch-panel {
    border-right: 0;
    border-bottom: 1px solid rgba(124, 249, 255, 0.18);
  }

  .leaderboard-panel {
    min-height: 380px;
  }

  .mission-preview {
    margin-top: 16px;
  }

  .boss-meter {
    top: 88px;
    width: min(420px, calc(100% - 48px));
  }
}

@media (max-width: 620px) {
  .launch-panel,
  .leaderboard-panel {
    padding: 24px 18px;
  }

  .title-shell .logo {
    font-size: clamp(48px, 18vw, 78px);
  }

  .title-shell .tagline {
    font-size: 11px;
    letter-spacing: 4px;
  }

  .loadout-picker {
    grid-template-columns: 1fr;
  }

  .loadout-card {
    min-height: 74px;
  }

  .sound-picker {
    flex-wrap: wrap;
  }

  .sound-picker > span {
    flex-basis: 100%;
  }

  .btn {
    padding-inline: 18px;
    font-size: 18px;
  }

  .controls-hint {
    gap: 12px;
    font-size: 10px;
  }

  .hud-top {
    top: 12px;
    left: 14px;
    right: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .hud-top .hud-center {
    position: absolute;
    top: 62px;
    left: 50%;
    width: min(220px, 60vw);
    transform: translateX(-50%);
  }

  .hud-value {
    font-size: 28px;
  }

  .hud-label {
    font-size: 8px;
    letter-spacing: 2px;
  }

  .hud-meta {
    font-size: 8px;
  }

  .boss-meter {
    top: 138px;
    width: calc(100% - 28px);
  }

  #minimap {
    top: 88px;
    right: 14px;
    width: 104px;
    height: 72px;
  }

  .sound-toggle {
    top: 168px;
    right: 14px;
    padding: 6px 8px;
    font-size: 8px;
  }
  .assist-toggle {
    top: 204px;
    right: 14px;
    padding: 6px 8px;
    font-size: 8px;
  }

  .wave-banner {
    top: 28%;
    padding: 0 18px;
    font-size: 36px;
    letter-spacing: 4px;
  }

  .hud-bottom {
    left: 14px;
    right: 14px;
    bottom: 112px;
  }

  .hud-health {
    width: 56%;
  }

  .health-bar {
    height: 14px;
  }

  .health-num {
    font-size: 15px;
  }

  .weapon-name {
    font-size: 18px;
  }

  .weapon-ammo {
    font-size: 25px;
  }

  .loadout-chip {
    max-width: 150px;
    font-size: 7px;
  }

  .final-stats {
    gap: 20px;
  }

  .stat-num {
    font-size: 36px;
  }

  .death-cause {
    padding: 0 16px;
    font-size: 14px;
  }
}

@media (pointer: coarse), (max-width: 760px) {
  html,
  body {
    cursor: default;
    touch-action: none;
  }

  .touch-controls {
    position: absolute;
    z-index: 6;
    right: 14px;
    bottom: 14px;
    left: 14px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    pointer-events: none;
  }

  .touch-controls button {
    pointer-events: auto;
    touch-action: none;
    color: var(--ink);
    background: rgba(4, 7, 10, 0.82);
    border: 1px solid rgba(124, 249, 255, 0.52);
    border-radius: 50%;
    font-weight: 900;
    -webkit-tap-highlight-color: transparent;
  }

  .touch-controls button.pressed {
    color: var(--bg);
    background: var(--cyan);
  }

  .touch-dpad {
    width: 138px;
    height: 92px;
    display: grid;
    grid-template: repeat(2, 44px) / repeat(3, 44px);
    gap: 4px;
  }

  .touch-dpad button {
    width: 44px;
    height: 44px;
    font-size: 19px;
  }

  .touch-dpad [data-touch-key="up"] { grid-area: 1 / 2; }
  .touch-dpad [data-touch-key="left"] { grid-area: 2 / 1; }
  .touch-dpad [data-touch-key="down"] { grid-area: 2 / 2; }
  .touch-dpad [data-touch-key="right"] { grid-area: 2 / 3; }

  .touch-fire {
    width: 74px;
    height: 74px;
    border-color: rgba(255, 138, 43, 0.8) !important;
    color: var(--orange-hot) !important;
    letter-spacing: 1px;
  }

  .touch-fire.pressed {
    color: var(--bg) !important;
    background: var(--orange-hot) !important;
  }

  .touch-actions {
    display: flex;
    align-items: end;
    gap: 12px;
    pointer-events: none;
  }

  .touch-swap { width: 52px; height: 52px; color: #7cf9ff !important; border-color: rgba(124,249,255,.65) !important; font-size: 9px; }

  .touch-boost {
    width: 60px;
    height: 60px;
    border-color: rgba(255, 196, 75, 0.8) !important;
    color: #ffc24b !important;
    font-size: 11px;
    letter-spacing: 0.5px;
  }

  .touch-ability {
    width: 56px;
    height: 56px;
    border-color: rgba(124, 249, 255, 0.8) !important;
    color: #7cf9ff !important;
    font-size: 9px;
    letter-spacing: 0.5px;
  }

  .touch-ability.pressed {
    color: var(--bg) !important;
    background: #7cf9ff !important;
  }

  .touch-boost.pressed {
    color: var(--bg) !important;
    background: #ffc24b !important;
  }
}

@media (max-width: 430px) and (pointer: coarse), (max-width: 430px) {
  .touch-controls { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .touch-actions {
    width: 132px;
    display: grid;
    grid-template-columns: 54px 70px;
    grid-template-rows: 46px 62px;
    align-items: end;
    justify-items: end;
    gap: 5px 8px;
  }
  .touch-swap { width: 46px; height: 46px; }
  .touch-ability { width: 50px; height: 50px; }
  .touch-boost { width: 56px; height: 56px; }
  .touch-fire { width: 66px; height: 66px; grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

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

/* ===== v6: play button, levels, reload, currency, story, revive ===== */
.btn-play {
  font-size: 34px !important;
  letter-spacing: 8px;
  padding-block: 20px !important;
  background: linear-gradient(180deg, #7cf9ff, #39ff9e) !important;
  color: #04070a !important;
  box-shadow: 0 0 44px rgba(57, 255, 158, .45);
}
.btn-play:hover { filter: brightness(1.08); }

.level-picker { margin-top: 16px; border: 0; text-align: left; }
.level-picker legend {
  font-size: 10px; letter-spacing: 3px; color: rgba(255,255,255,.55); padding: 0 0 6px;
}
.level-row { display: flex; flex-wrap: wrap; gap: 8px; }
.level-chip {
  width: 46px; height: 46px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(124,249,255,.3); background: rgba(0,0,0,.45);
  color: #cfefff; font-weight: 900; font-size: 16px; font-family: inherit;
}
.level-chip:hover:not(:disabled) { border-color: var(--cyan); }
.level-chip.selected { background: rgba(124,249,255,.16); border-color: var(--cyan); color: #fff; }
.level-chip.locked, .level-chip:disabled { opacity: .32; cursor: not-allowed; }
.level-note { margin-top: 8px; font-size: 10px; color: rgba(255,255,255,.4); }

.purse { display: flex; gap: 10px; margin-top: 5px; }
.coin-chip, .fang-chip { font-size: 12px; font-weight: 800; letter-spacing: 1px; }
.coin-chip { color: #ffc24b; }
.coin-chip::before { content: '\25CF '; }
.fang-chip { color: #7cf9ff; }
.fang-chip::before { content: '\25C6 '; }

.reload-wrap, .spin-wrap {
  position: relative; overflow: hidden; margin-top: 6px;
  width: 190px; height: 20px; border-radius: 3px;
  border: 1px solid rgba(255,138,43,.55); background: rgba(0,0,0,.6);
  font-size: 9px; font-weight: 800; letter-spacing: 2px; line-height: 18px; text-align: center;
  color: #ffd7a8;
}
.spin-wrap { border-color: rgba(194,178,233,.6); color: #d9d0f2; }
.reload-wrap i, .spin-wrap i {
  position: absolute; inset: 0; width: 0%; background: rgba(255,138,43,.35); transition: width .06s linear;
}
.spin-wrap i { background: rgba(194,178,233,.35); }
.reload-wrap span, .spin-wrap span { position: relative; }

.story-ticker {
  position: absolute; z-index: 7; left: 50%; top: 108px; transform: translateX(-50%);
  max-width: min(720px, 88vw); padding: 10px 20px; text-align: center;
  border-left: 3px solid var(--cyan); background: rgba(4,7,10,.86);
  color: #d8f2ff; font-size: 14px; font-style: italic; line-height: 1.5;
}

.story-inner { max-width: 640px; text-align: left; }
.story-lines p {
  margin: 0 0 14px; font-size: 19px; line-height: 1.6; color: #dff2ff;
  border-left: 2px solid rgba(124,249,255,.4); padding-left: 16px;
}

.revive-panel {
  margin: 18px auto 4px; padding: 18px; max-width: 420px;
  border: 1px solid rgba(124,249,255,.4); border-radius: 8px; background: rgba(124,249,255,.06);
}
.revive-copy { margin: 0 0 12px; font-size: 14px; color: #cfeaff; }
.btn-revive {
  width: 100%; padding: 14px; border-radius: 6px; cursor: pointer;
  border: 0; background: linear-gradient(180deg, #7cf9ff, #4fd8e8); color: #04070a;
  font-family: inherit; font-weight: 900; font-size: 16px; letter-spacing: 2px;
}
.btn-revive:disabled { opacity: .4; cursor: not-allowed; }
.revive-note { margin: 10px 0 0; font-size: 11px; color: rgba(255,255,255,.5); }

@media (max-width: 620px) {
  .btn-play { font-size: 26px !important; letter-spacing: 5px; }
  .level-chip { width: 40px; height: 40px; font-size: 14px; }
  .story-ticker { top: 92px; font-size: 12px; padding: 8px 14px; }
  .story-lines p { font-size: 15px; }
  .reload-wrap, .spin-wrap { width: 140px; height: 17px; line-height: 15px; font-size: 8px; }
}

@media (min-width: 861px) {
  .loadout-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .loadout-card { min-height: 78px; grid-template-columns: 28px 1fr; padding: 10px; }
  .loadout-card svg { width: 27px; height: 27px; }
}

@media (min-width: 861px) and (max-height: 850px) {
  .title-shell { min-height: calc(100% - 24px); width: min(1180px, calc(100% - 24px)); margin-block: 12px; }
  .launch-panel { padding: 22px 32px; }
  .title-shell .logo { margin-top: 8px; font-size: clamp(52px, 6.1vw, 78px); }
  .title-shell .tagline { margin-top: 8px; margin-bottom: 14px; font-size: 11px; letter-spacing: 4px; }
  .username-field { gap: 5px; }
  .username-field input { min-height: 42px; }
  .field-error { min-height: 10px; margin-top: 4px; }
  .loadout-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
  .loadout-card { min-height: 70px; padding: 9px; grid-template-columns: 26px 1fr; gap: 7px; }
  .loadout-card svg { width: 25px; height: 25px; }
  .loadout-card span { gap: 4px; }
  .sound-picker, .level-picker { margin-top: 10px; }
  .level-chip { width: 34px; height: 34px; font-size: 13px; }
  .level-note { display: none; }
  .title-shell .btn { margin-top: 10px; }
  .btn-play { padding-block: 12px !important; font-size: 24px !important; }
  .title-shell .controls-hint { margin-top: 10px; gap: 12px; font-size: 9px; }
  .how-to-play { margin-top: 10px; }
  .how-to-play summary { padding: 8px 12px; }
  .leaderboard-panel { padding: 24px 30px; }
}
