/* NOT ALONE — Phase 1 UI. Flat, atmospheric, rain-soaked cinematic theme. */
:root {
  --accent: #59d6ff;
  --bg: #070b14;
  --panel: rgba(13, 21, 38, 0.82);
  --panel-border: rgba(89, 214, 255, 0.22);
  --text: #e7f1ff;
  --text-dim: #8ba2c4;
  --danger: #ff6b6b;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

html,
body,
#root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The Phaser canvas mounts here — MUST have an explicit size or it renders 0x0. */
#game-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
#game-container canvas {
  display: block;
}

/* Living City ambient backdrop — sits above the Phaser canvas, below the
   React overlays (z 20). pointer-events: none so it never steals clicks. */
.na-ambience {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s ease;
}

/* ---------------------------------- overlays ---------------------------------- */
.na-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(12, 22, 44, 0.55) 0%, rgba(4, 7, 14, 0.9) 100%);
  animation: na-fade 0.5s ease both;
}
.na-overlay--dim {
  background: rgba(4, 7, 14, 0.78);
  backdrop-filter: blur(6px);
}
.na-overlay--solid {
  background: var(--bg);
}

@keyframes na-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.na-panel {
  position: relative;
  z-index: 2;
  width: min(92vw, 560px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 34px 30px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-align: center;
  animation: na-rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.na-panel--title {
  width: min(94vw, 640px);
}
.na-panel--credits {
  margin-top: 4px;
}

@keyframes na-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* rain / mist backdrop on title + character select */
.na-rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background:
    repeating-linear-gradient(105deg, rgba(150, 190, 240, 0.05) 0px, rgba(150, 190, 240, 0.05) 1px, transparent 2px, transparent 26px);
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  animation: na-rainmove 0.7s linear infinite;
}
@keyframes na-rainmove {
  from { background-position: 0 0; }
  to { background-position: -60px 120px; }
}

/* ---------------------------------- typography --------------------------------- */
.na-logo {
  font-size: clamp(44px, 9vw, 84px);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 0.95;
  color: var(--text);
  text-shadow: 0 0 24px rgba(89, 214, 255, 0.35), 0 0 60px rgba(89, 214, 255, 0.15);
}
.na-logo__gap {
  display: inline-block;
  width: 0.35em;
}
.na-title-sm {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text);
  margin-bottom: 14px;
}
.na-tag {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 15px;
  letter-spacing: 0.02em;
}
.na-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 18px;
}
.na-credits {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 20px;
}
.na-footnote {
  margin-top: 22px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(139, 162, 196, 0.6);
}

/* ------------------------------------ buttons ---------------------------------- */
.na-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
  align-items: stretch;
}
.na-menu--tight {
  margin-top: 18px;
}
.na-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text);
  background: rgba(20, 32, 56, 0.7);
  border: 1px solid rgba(139, 162, 196, 0.25);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.na-btn:hover {
  border-color: var(--accent);
  background: rgba(28, 46, 78, 0.85);
  transform: translateY(-1px);
}
.na-btn:active {
  transform: translateY(1px);
}
.na-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.na-btn--primary {
  color: #04121d;
  background: linear-gradient(180deg, var(--accent), #34b6e6);
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(89, 214, 255, 0.28);
}
.na-btn--primary:hover {
  background: linear-gradient(180deg, #74e0ff, #45c4f0);
  box-shadow: 0 12px 36px rgba(89, 214, 255, 0.4);
}

/* -------------------------------- character select ------------------------------ */
.na-chars {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.na-char {
  --char: var(--accent);
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px 18px;
  color: var(--text);
  font-family: var(--font);
  background: rgba(16, 26, 46, 0.6);
  border: 1px solid rgba(139, 162, 196, 0.2);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.na-char:hover,
.na-char:focus-visible {
  transform: translateY(-4px);
  border-color: var(--char);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5), 0 0 28px color-mix(in srgb, var(--char) 40%, transparent);
  outline: none;
}
.na-char__sil {
  color: var(--char);
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--char) 55%, transparent));
  margin-bottom: 4px;
}
.na-char__name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--char);
}
.na-char__tag {
  font-size: 13px;
  font-style: italic;
  color: var(--text-dim);
}
.na-char__traits {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(139, 162, 196, 0.8);
  text-transform: uppercase;
}

.na-whisper {
  min-height: 26px;
  margin: 4px 0 14px;
  font-size: 15px;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  opacity: 0;
  filter: blur(6px);
  transform: translateY(6px);
  transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
}
.na-whisper--on {
  opacity: 0.9;
  filter: blur(0);
  transform: translateY(0);
}

/* ------------------------------------- HUD ------------------------------------- */
.na-hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 44px);
}
.na-hud__top {
  display: flex;
  align-items: center;
  gap: 16px;
}
.na-hud__act {
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.na-hud__mem {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(89, 214, 255, 0.5);
}
.na-hud__pause {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: rgba(13, 21, 38, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.na-hud__pause:hover {
  border-color: var(--accent);
  background: rgba(28, 46, 78, 0.9);
}
.na-hud__hint {
  align-self: center;
  margin-bottom: 8px;
  padding: 8px 18px;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: rgba(7, 11, 20, 0.5);
  border-radius: 999px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  animation: na-fade 0.8s ease both;
}

/* ----------------------------------- settings ---------------------------------- */
.na-bus {
  margin: 16px 0;
  text-align: left;
}
.na-bus__row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.na-bus__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text);
  min-width: 64px;
}
.na-bus__value {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-dim);
  min-width: 34px;
  text-align: right;
}
.na-bus__mute,
.na-bus__preview {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: rgba(20, 32, 56, 0.7);
  border: 1px solid rgba(139, 162, 196, 0.25);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.na-bus__mute:hover,
.na-bus__preview:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.na-bus__preview {
  color: var(--accent);
}

.na-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(89, 214, 255, 0.15));
  outline: none;
  cursor: pointer;
}
.na-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(89, 214, 255, 0.5);
  cursor: pointer;
}
.na-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(89, 214, 255, 0.5);
  cursor: pointer;
}

/* --------------------------------- mobile tweaks -------------------------------- */
@media (max-width: 600px) {
  .na-panel {
    padding: 26px 18px;
  }
  .na-chars {
    gap: 12px;
  }
  .na-char {
    min-width: 140px;
    padding: 16px 10px 14px;
  }
  .na-hud {
    padding: 16px 14px;
  }
}

/* ============================ MOBILE TOUCH CONTROLS ============================ */
.na-touch {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 clamp(16px, 5vw, 48px) clamp(20px, 6vh, 48px);
  pointer-events: none; /* only the controls themselves capture input */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.na-touch__left,
.na-touch__right {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  pointer-events: auto;
}
.na-touch__right {
  flex-direction: row;
}

/* ---- Virtual joystick ---- */
.na-joystick-base {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(89, 214, 255, 0.12), rgba(13, 21, 38, 0.55));
  border: 2px solid var(--panel-border);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45), 0 0 18px rgba(89, 214, 255, 0.12);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  touch-action: none;
  display: grid;
  place-items: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.na-joystick-base--active {
  border-color: var(--accent);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45), 0 0 26px rgba(89, 214, 255, 0.35);
}
.na-joystick-knob {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(231, 241, 255, 0.95), rgba(139, 162, 196, 0.7));
  border: 2px solid var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 14px rgba(89, 214, 255, 0.4);
  will-change: transform;
}
.na-joystick-hint {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  animation: na-hint-pulse 2.4s ease-in-out infinite;
}
@keyframes na-hint-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ---- Action buttons ---- */
.na-touch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  color: var(--text);
  background: radial-gradient(circle at 50% 35%, rgba(13, 21, 38, 0.7), rgba(13, 21, 38, 0.5));
  border: 2px solid var(--panel-border);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;
  touch-action: none;
  transition: transform 0.08s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.na-touch-btn--jump {
  width: 92px;
  height: 92px;
  border-color: rgba(89, 214, 255, 0.4);
}
.na-touch-btn--action {
  color: var(--accent);
}
.na-touch-btn--fight {
  color: #ffe0d6;
  border-color: rgba(255, 90, 78, 0.78);
  background: radial-gradient(circle at 50% 35%, rgba(64, 16, 18, 0.84), rgba(24, 8, 10, 0.62));
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45), 0 0 26px rgba(255, 90, 78, 0.6);
  animation: na-fight-pulse 0.7s ease-in-out infinite;
}
.na-touch-btn--fight .na-touch-btn__label {
  color: #ff8a70;
  font-weight: 700;
  letter-spacing: 0.14em;
}
@keyframes na-fight-pulse {
  0%, 100% { box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45), 0 0 22px rgba(255, 90, 78, 0.5); }
  50% { box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45), 0 0 34px rgba(255, 90, 78, 0.85); }
}
/* ---- 3D runner HUD: run stats + light meter + dash prompt ---- */
.na-hud__run {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-top: 8px;
  font-family: var(--font);
  letter-spacing: 0.08em;
}
.na-hud__dist {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 14px rgba(89, 214, 255, 0.55);
}
.na-hud__speed {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.12em;
}
.na-hud__orbs {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fbbf24;
  font-size: 13px;
}
.na-dash-prompt {
  position: absolute;
  left: 50%;
  bottom: 26%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 26px;
  border: 2px solid #fbbf24;
  border-radius: 999px;
  background: rgba(20, 14, 4, 0.78);
  color: #fbbf24;
  font-family: var(--font);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.8);
  animation: na-dash-pulse 0.5s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 5;
}
@keyframes na-dash-pulse {
  from { transform: translateX(-50%) scale(0.96); opacity: 0.85; }
  to { transform: translateX(-50%) scale(1.06); opacity: 1; }
}
.na-touch-btn.active {
  transform: scale(0.92);
  border-color: var(--accent);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.4), 0 0 22px rgba(89, 214, 255, 0.5);
}
.na-touch-btn__icon {
  display: grid;
  place-items: center;
  line-height: 0;
}
.na-touch-btn__label {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

/* Hide touch controls entirely on fine-pointer (desktop) devices. */
@media (pointer: fine) {
  .na-touch {
    display: none;
  }
}

/* ==========================================================================
   LIGHT RUNNER ACROSS NIGERIA — .lr-* UI classes
   ========================================================================== */
.lr-root {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
}
.lr-canvas-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.lr-canvas-wrap canvas {
  display: block;
}

/* ---------------------------------- HUD ---------------------------------- */
.lr-hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px clamp(14px, 3vw, 32px);
}
.lr-hud-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.lr-distance {
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.lr-distance-num {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 14px rgba(143, 244, 255, 0.5);
}
.lr-distance-unit {
  font-size: 13px;
  color: var(--text-dim);
}
.lr-hud-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lr-charges {
  display: flex;
  gap: 6px;
}
.lr-charge {
  filter: drop-shadow(0 0 6px currentColor);
}
.lr-pause-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: rgba(13, 21, 38, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.lr-pause-btn:hover {
  border-color: var(--accent);
}

/* QA fix: .lr-toast / .lr-swipe-hint had no rules — the toast rendered
   unstyled in normal flow BEHIND the canvas (invisible feedback) and the
   touch swipe hint was an unstyled block. Both are now floating overlays
   with pointer-events: none so they never steal canvas swipes. */
.lr-toast {
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f4e9c8;
  background: rgba(7, 11, 20, 0.78);
  border: 1px solid rgba(143, 244, 255, 0.35);
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}
.lr-swipe-hint {
  position: absolute;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 14px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(223, 239, 255, 0.75);
  background: rgba(7, 11, 20, 0.45);
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}
.lr-swipe-hint span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lr-hud-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lr-shards {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lr-shard-ico {
  filter: drop-shadow(0 0 6px rgba(255, 215, 107, 0.6));
}
.lr-shard-num {
  font-size: 18px;
  font-weight: 700;
  color: #ffd76b;
}
.lr-shard-next {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 6px;
}
.lr-speed {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

/* --------------------------------- toast --------------------------------- */
.lr-toast {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(7, 11, 20, 0.85);
  border: 1px solid rgba(143, 244, 255, 0.3);
  border-radius: 999px;
  animation: lr-toast-in 0.3s ease both;
  pointer-events: none;
}
@keyframes lr-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ------------------------------- countdown ------------------------------- */
.lr-countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 35;
  font-size: clamp(64px, 14vw, 110px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px rgba(143, 244, 255, 0.7), 0 0 60px rgba(143, 244, 255, 0.3);
  animation: lr-count-pop 0.5s ease both;
  pointer-events: none;
}
@keyframes lr-count-pop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ------------------------------- overlays -------------------------------- */
.lr-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(12, 22, 44, 0.6) 0%, rgba(4, 7, 14, 0.92) 100%);
  animation: lr-fade 0.4s ease both;
}
@keyframes lr-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --------------------------------- menu ---------------------------------- */
.lr-menu {
  background: radial-gradient(130% 100% at 50% 20%, rgba(11, 28, 51, 0.7) 0%, rgba(4, 7, 14, 0.95) 100%);
}
.lr-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.lr-logo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lr-logo-glow {
  position: absolute;
  top: -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 107, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.lr-logo h1 {
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 20px rgba(143, 244, 255, 0.4);
}
.lr-logo h1 span {
  color: #ffd76b;
  text-shadow: 0 0 20px rgba(255, 215, 107, 0.5);
}
.lr-logo-sub {
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  margin-top: 6px;
}
.lr-backstory {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 340px;
}
.lr-backstory em {
  color: #ffd76b;
  font-style: normal;
}
.lr-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  min-height: 52px;
  padding: 14px 24px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #04121d;
  background: linear-gradient(180deg, #ffd76b, #f0a832);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(255, 215, 107, 0.3);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.lr-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(255, 215, 107, 0.45);
}
.lr-cta:active {
  transform: translateY(1px);
}
.lr-cta-sm {
  min-height: 46px;
  font-size: 14px;
}
.lr-hint {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}
.lr-stats {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}
.lr-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.lr-stat-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.lr-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: #ffd76b;
}
.lr-menu-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.lr-ghost {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  background: rgba(13, 21, 38, 0.6);
  border: 1px solid rgba(139, 162, 196, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.lr-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* --------------------------------- panel --------------------------------- */
.lr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(92vw, 380px);
  padding: 30px 26px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: lr-rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes lr-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.lr-panel h2 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.lr-panel-sub {
  font-size: 13px;
  color: var(--text-dim);
}
.lr-panel-row {
  display: flex;
  gap: 12px;
}
.lr-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 280px;
  min-height: 44px;
  padding: 12px 20px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  background: rgba(20, 32, 56, 0.7);
  border: 1px solid rgba(139, 162, 196, 0.25);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.lr-secondary:hover {
  border-color: var(--accent);
  background: rgba(28, 46, 78, 0.85);
}

/* ------------------------------- game over ------------------------------- */
.lr-over {
  cursor: pointer;
}
.lr-over-title {
  color: #ff6b6b;
  text-shadow: 0 0 16px rgba(255, 107, 107, 0.4);
}
.lr-record {
  font-size: 14px;
  font-weight: 700;
  color: #ffd76b;
  letter-spacing: 0.1em;
  animation: lr-record-pulse 1s ease-in-out infinite alternate;
}
@keyframes lr-record-pulse {
  from { opacity: 0.7; }
  to { opacity: 1; text-shadow: 0 0 12px rgba(255, 215, 107, 0.6); }
}
.lr-over-grid {
  display: flex;
  gap: 24px;
}
.lr-over-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.lr-over-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.lr-over-val {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

/* ------------------------------- settings -------------------------------- */
.lr-settings .lr-panel {
  gap: 16px;
}
.lr-controls-help {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-dim);
  text-align: left;
}
.lr-controls-help b {
  color: var(--text);
}

/* ----------------------------- swipe hint -------------------------------- */
.lr-swipe-hint {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(7, 11, 20, 0.5);
  border-radius: 999px;
  pointer-events: none;
  animation: lr-fade 1s ease both;
  white-space: nowrap;
}
.lr-swipe-hint span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.lr-sh-lane { color: var(--text-dim); }
.lr-sh-jump { color: #ff8a3d; }
.lr-sh-slide { color: #59d6ff; }

/* --------------------- universal affordance legend ---------------------- */
.lr-affordance-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
}
.lr-aff {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(13, 21, 38, 0.55);
  border: 1px solid rgba(139, 162, 196, 0.16);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  text-align: left;
}
.lr-aff b {
  font-weight: 800;
  letter-spacing: 0.08em;
}
.lr-aff-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
}
.lr-aff-jump { border-left: 3px solid #ff8a3d; }
.lr-aff-jump .lr-aff-ico { color: #ff8a3d; background: rgba(255, 138, 61, 0.14); }
.lr-aff-jump b { color: #ffb066; }
.lr-aff-slide { border-left: 3px solid #59d6ff; }
.lr-aff-slide .lr-aff-ico { color: #59d6ff; background: rgba(89, 214, 255, 0.14); }
.lr-aff-slide b { color: #8fe6ff; }
.lr-aff-lane { border-left: 3px solid #ffd76b; }
.lr-aff-lane .lr-aff-ico { color: #ffd76b; background: rgba(255, 215, 107, 0.14); }
.lr-aff-lane b { color: #ffe28f; }

/* Hide swipe hint on desktop */
@media (pointer: fine) {
  .lr-swipe-hint {
    display: none;
  }
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .lr-panel {
    padding: 24px 18px;
  }
  .lr-stats {
    gap: 14px;
  }
  .lr-over-grid {
    gap: 16px;
  }
}

/* ==========================================================================
   ARCADE RUNNER HUD REDESIGN — corner-anchored HUD, gold/white palette,
   heavy-outline condensed typography, vignette framing, eased slides.
   ========================================================================== */

/* ---- corner-anchored HUD containers (center lane stays 100% clear) ---- */
.lr-hud-tl,
.lr-hud-tr,
.lr-hud-bl,
.lr-hud-br {
  position: absolute;
  display: flex;
  pointer-events: none;
  z-index: 11;
}
.lr-hud-tl {
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: clamp(12px, 3vw, 28px);
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.lr-hud-tr {
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: clamp(12px, 3vw, 28px);
}
.lr-hud-bl {
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: clamp(12px, 3vw, 28px);
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.lr-hud-br {
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  right: clamp(12px, 3vw, 28px);
  align-items: center;
  gap: 8px;
}

/* ---- bold condensed heavy-outline typography (gold & white only) ---- */
.lr-hud-tl .lr-distance-num,
.lr-hud-br .lr-shard-num {
  font-family: "Arial Narrow", "Helvetica Neue Condensed", var(--font);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: 0.04em;
  -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.9);
  paint-order: stroke fill;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95), 0 0 12px rgba(255, 215, 0, 0.5);
}
.lr-hud-tl .lr-distance-num {
  font-size: clamp(26px, 6vw, 34px);
  color: #ffffff;
}
.lr-hud-tl .lr-distance-unit {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #ffe57f;
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.85);
  paint-order: stroke fill;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}
/* chapter progress bar — gold/white, docked under the top-left cluster */
.lr-hud-tl .lr-chapter-bar {
  margin-top: 6px;
  width: clamp(120px, 30vw, 180px);
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 215, 0, 0.35);
  overflow: hidden;
}

/* ---- glowing shard score (bottom-right) ---- */
.lr-hud-br .lr-shard-ico {
  color: #ffd700;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.85)) drop-shadow(0 0 18px rgba(255, 215, 0, 0.4));
  animation: lr-shard-glow 1.6s ease-in-out infinite alternate;
}
@keyframes lr-shard-glow {
  from { filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 14px rgba(255, 215, 0, 0.3)); }
  to { filter: drop-shadow(0 0 10px rgba(255, 229, 127, 0.95)) drop-shadow(0 0 22px rgba(255, 215, 0, 0.5)); }
}
.lr-hud-br .lr-shard-num {
  font-size: clamp(22px, 5vw, 28px);
  color: #ffe57f;
  min-width: 2.5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- shield pips (bottom-left) ---- */
.lr-shields {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lr-shield-pip {
  display: inline-flex;
  color: #ffd700;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.7)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
  transition: opacity 0.25s ease, filter 0.25s ease;
}
.lr-shield-pip--on {
  animation: lr-pip-pulse 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.lr-shield-pip--off {
  color: rgba(255, 215, 0, 0.55);
  opacity: 0.2;
  filter: none;
}
@keyframes lr-pip-pulse {
  0% { transform: scale(1.35); filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.95)); }
  100% { transform: scale(1); }
}
.lr-shield-next {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffe57f;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

/* ---- small translucent pause button (top-right, 36px visual) ---- */
.lr-hud-tr .lr-pause-btn {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform 0.08s ease-out, border-color 0.2s ease, background 0.2s ease;
}
.lr-hud-tr .lr-pause-btn svg {
  width: 24px;
  height: 24px;
}
.lr-hud-tr .lr-pause-btn:hover {
  border-color: #ffe57f;
  background: rgba(0, 0, 0, 0.5);
}
.lr-hud-tr .lr-pause-btn:active {
  transform: scale(0.92);
}

/* ---- soft vignette + arcade corner brackets ---- */
.arcade-vignette {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.32) 88%, rgba(0, 0, 0, 0.55) 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
}
.arcade-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  z-index: 9;
  pointer-events: none;
  opacity: 0.55;
}
.arcade-corner-tl { top: 8px; left: 8px; border-top: 2px solid rgba(255, 215, 0, 0.7); border-left: 2px solid rgba(255, 215, 0, 0.7); }
.arcade-corner-tr { top: 8px; right: 8px; border-top: 2px solid rgba(255, 215, 0, 0.7); border-right: 2px solid rgba(255, 215, 0, 0.7); }
.arcade-corner-bl { bottom: 8px; left: 8px; border-bottom: 2px solid rgba(255, 215, 0, 0.7); border-left: 2px solid rgba(255, 215, 0, 0.7); }
.arcade-corner-br { bottom: 8px; right: 8px; border-bottom: 2px solid rgba(255, 215, 0, 0.7); border-right: 2px solid rgba(255, 215, 0, 0.7); }

/* ---- eased slide transitions for overlays & panels ---- */
.lr-overlay {
  animation: arcadeFadeIn 0.35s ease both;
}
.lr-overlay .lr-panel,
.lr-overlay .lr-menu-inner {
  animation: arcadeSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.lr-pause .lr-panel {
  animation-name: arcadeSlideDown;
}
.lr-over .lr-panel {
  animation-name: arcadeSlideIn;
}
@keyframes arcadeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes arcadeSlideIn {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes arcadeSlideDown {
  from { opacity: 0; transform: translateY(-28px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- tactile scale-down on every interactive button ---- */
.lr-cta,
.lr-secondary,
.lr-ghost,
.lr-pause-btn {
  transition: transform 0.08s ease-out, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.lr-cta:active,
.lr-secondary:active {
  transform: scale(0.94);
}
.lr-ghost:active {
  transform: scale(0.92);
}

/* ---- gold/white-only enforcement on game-over title (never red) ---- */
.lr-over-title {
  color: #ffd700 !important;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.55), 0 2px 4px rgba(0, 0, 0, 0.9) !important;
}