/* ============================================================
   RUN FROM CHANDAN — interface styling
   ============================================================ */

:root {
  --ink: #070b16;
  --panel: rgba(9, 14, 26, 0.82);
  --panel-solid: #0d1424;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --gold: #ffc44d;
  --gold-deep: #ff8a3d;
  --cyan: #4dd0ff;
  --pink: #ff5ea8;
  --violet: #a97bff;
  --danger: #ff4d6d;
  --green: #4ade80;
  --text: #eaf0ff;
  --muted: #93a1bf;
  --radius: 20px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --font: "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Arial Black", "Segoe UI Black", Impact, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #05080f;
  color: var(--text);
  font-family: var(--font);
  overscroll-behavior: none;
  touch-action: none;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 40%, transparent 45%, rgba(3, 6, 14, 0.55) 100%),
    linear-gradient(to bottom, rgba(3, 6, 14, 0.35), transparent 25%, transparent 70%, rgba(3, 6, 14, 0.6));
  mix-blend-mode: multiply;
  z-index: 1;
}

.flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 6;
  background: radial-gradient(circle at 50% 60%, rgba(255, 77, 109, 0.55), rgba(255, 77, 109, 0) 70%);
  transition: opacity 0.35s ease-out;
}
.flash.is-on {
  opacity: 1;
  transition: opacity 0.05s;
}
.flash.is-gold {
  background: radial-gradient(circle at 50% 60%, rgba(255, 196, 77, 0.45), rgba(255, 196, 77, 0) 70%);
}

#ui {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

#ui button,
#ui input,
#ui .screen,
#ui .panel,
#ui .scroll-area {
  pointer-events: auto;
}

/* ---------------------------- screens ---------------------------- */

.screen {
  position: absolute;
  inset: 0;
  display: none;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  animation: screen-in 0.35s ease both;
}
.screen.is-active {
  display: flex;
}
.screen--center {
  align-items: center;
  justify-content: center;
  background: radial-gradient(80% 60% at 50% 50%, rgba(4, 9, 20, 0.55), rgba(4, 9, 20, 0.88));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------- loader ---------------------------- */

.loader {
  text-align: center;
}
.loader h2 {
  font-family: var(--display);
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  letter-spacing: 0.16em;
  margin: 24px 0 6px;
}
.loader p {
  color: var(--muted);
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.loader__ring {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--gold);
  border-right-color: var(--gold-deep);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------- menu ---------------------------- */

[data-screen="menu"] {
  flex-direction: column;
  justify-content: center;
  padding: 4vh 5vw;
  background: linear-gradient(100deg, rgba(4, 8, 18, 0.86) 0%, rgba(4, 8, 18, 0.35) 48%, rgba(4, 8, 18, 0) 78%);
}

.menu-top {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  display: flex;
  gap: 10px;
}

.menu-brand {
  max-width: 620px;
  margin-top: 4vh;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: clamp(0.6rem, 1.4vw, 0.75rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
}
.eyebrow.danger {
  color: var(--danger);
}

.logo {
  font-family: var(--display);
  font-size: clamp(2.6rem, 8.2vw, 5.4rem);
  line-height: 0.86;
  margin: 0;
  letter-spacing: -0.03em;
  transform: skewX(-6deg);
  text-transform: uppercase;
}
.logo span {
  display: block;
  background: linear-gradient(180deg, #ffffff 10%, #cfe0ff 55%, #7f9dd0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35));
}
.logo span:last-child {
  background: linear-gradient(180deg, #fff2c9 5%, var(--gold) 45%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 28px rgba(255, 150, 60, 0.45)) drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35));
}
.logo em {
  display: block;
  font-family: var(--font);
  font-style: italic;
  font-weight: 900;
  font-size: 0.24em;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin: 6px 0 6px 0.4em;
  transform: skewX(6deg);
}

.tagline {
  color: #b9c6e2;
  font-size: clamp(0.85rem, 1.7vw, 1rem);
  margin: 14px 0 26px;
  max-width: 34ch;
  line-height: 1.5;
}

.menu-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.menu-links {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu-side {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 330px;
}

.daily {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(100deg, rgba(255, 196, 77, 0.16), rgba(255, 138, 61, 0.06));
  border: 1px solid rgba(255, 196, 77, 0.32);
  backdrop-filter: blur(10px);
}
.daily b {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
}
.daily span {
  font-size: 0.72rem;
  color: var(--muted);
}
.daily.is-claimed {
  opacity: 0.55;
}

.runner-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  padding-left: 4px;
}
.runner-note b {
  color: var(--text);
}

.controls-hint {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  display: flex;
  gap: 14px;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: rgba(200, 214, 240, 0.72);
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 44vw;
}
.controls-hint b {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}
.mobile-only {
  display: none;
}

/* ---------------------------- buttons ---------------------------- */

.btn {
  font-family: var(--font);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}
.btn--primary {
  background: linear-gradient(160deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #2a1503;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 30px rgba(255, 136, 48, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn--primary:hover {
  background: linear-gradient(160deg, #ffd46d 0%, #ff9a4f 100%);
}
.btn--xl {
  font-family: var(--display);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  letter-spacing: 0.08em;
  padding: 18px 54px;
  border-radius: 16px;
}
.btn--ghost {
  background: rgba(10, 16, 30, 0.55);
}
.btn--gold {
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  color: #2a1503;
  border-color: rgba(255, 255, 255, 0.45);
}
.btn--danger {
  border-color: rgba(255, 77, 109, 0.55);
  color: #ffd7de;
  background: rgba(255, 77, 109, 0.16);
}
.btn--pill {
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.68rem;
}
.btn--sm {
  padding: 8px 14px;
  font-size: 0.66rem;
  border-radius: 10px;
}
.btn--tiny {
  padding: 4px 8px;
  font-size: 0.58rem;
  border-radius: 7px;
  letter-spacing: 0.1em;
}
.btn--icon {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10, 16, 30, 0.6);
  border: 1px solid var(--line);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  backdrop-filter: blur(10px);
}
.pill b {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #fff;
}
.pill__icon {
  color: var(--gold);
  font-size: 0.9rem;
}
.pill--ghost {
  color: var(--muted);
}

/* ---------------------------- panels ---------------------------- */

.panel {
  position: relative;
  width: min(1080px, 96vw);
  max-height: 94vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}
.panel--narrow {
  width: min(620px, 96vw);
}
.panel__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.panel__head h2 {
  font-family: var(--display);
  font-size: clamp(0.9rem, 2.2vw, 1.2rem);
  letter-spacing: 0.14em;
  margin: 0;
  flex: 1;
}
.panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.spacer {
  width: 42px;
}
.scroll-area {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.enemy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: #ffb3c1;
}
.enemy-note .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* ---------------------------- character select ---------------------------- */

.char-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.1fr);
  gap: 18px;
  padding: 18px;
  overflow: hidden;
  min-height: 0;
  flex: 1;
}

.char-preview {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: radial-gradient(80% 70% at 50% 25%, rgba(77, 208, 255, 0.16), rgba(5, 9, 18, 0.9) 70%);
  display: flex;
  flex-direction: column;
  min-height: 300px;
  overflow: hidden;
}
#preview-canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  display: block;
  min-height: 220px;
  touch-action: pan-y;
}
.char-preview__meta {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  background: rgba(6, 10, 20, 0.7);
}
.char-preview__meta h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  letter-spacing: 0.1em;
  font-size: 1.1rem;
}
.char-preview__meta p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.drag-hint {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.42);
  text-transform: uppercase;
}
.char-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.char-stats .stat {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}
.char-stats .stat b {
  display: block;
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.char-stats .stat i {
  display: block;
  height: 4px;
  width: 64px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  margin-top: 5px;
  overflow: hidden;
}
.char-stats .stat i s {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

.char-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
  touch-action: pan-y;
}

.char-card {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
  text-align: left;
  color: var(--text);
  font-family: var(--font);
}
.char-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
}
.char-card.is-selected {
  border-color: var(--gold);
  background: linear-gradient(100deg, rgba(255, 196, 77, 0.16), rgba(255, 196, 77, 0.02));
  box-shadow: 0 0 0 1px rgba(255, 196, 77, 0.35) inset;
}
.char-card img {
  width: 74px;
  height: 74px;
  border-radius: 10px;
  object-fit: cover;
  background: radial-gradient(circle at 50% 30%, #1b2942, #0a1120);
}
.char-card__body b {
  display: block;
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.char-card__body span {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.4;
}
.char-card__cta {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-strong);
  white-space: nowrap;
  font-weight: 800;
}
.char-card.is-selected .char-card__cta {
  background: var(--gold);
  color: #2a1503;
  border-color: transparent;
}
.char-card.is-locked .char-card__cta {
  background: rgba(255, 196, 77, 0.16);
  border-color: rgba(255, 196, 77, 0.4);
  color: var(--gold);
}

/* ---------------------------- shop & achievements ---------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.item__name {
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}
.item__sub {
  font-size: 0.66rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.swatches {
  display: flex;
  gap: 6px;
}
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.ach {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 10px;
}
.ach.is-done {
  border-color: rgba(74, 222, 128, 0.45);
  background: linear-gradient(100deg, rgba(74, 222, 128, 0.12), rgba(74, 222, 128, 0.02));
}
.ach__name {
  font-weight: 800;
  font-size: 0.84rem;
}
.ach__desc {
  font-size: 0.72rem;
  color: var(--muted);
}
.ach__reward {
  align-self: center;
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.ach__bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.ach__bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
}

/* ---------------------------- settings ---------------------------- */

.setting {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.setting:last-of-type {
  border-bottom: none;
}
.setting label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 800;
}
.setting--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.setting--row label {
  margin: 0;
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.segmented button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  padding: 10px 18px;
  cursor: pointer;
}
.segmented button.is-active {
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  color: #2a1503;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #1a1005;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #1a1005;
  cursor: pointer;
}
.toggle {
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dfe6f5;
  transition: transform 0.2s;
}
.toggle.is-on {
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  border-color: transparent;
}
.toggle.is-on i {
  transform: translateX(24px);
  background: #2a1503;
}

.muted {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
  margin: 0;
}
.tiny {
  font-size: 0.68rem;
  margin-top: 12px;
}

/* ---------------------------- HUD ---------------------------- */

.hud {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.hud.is-active {
  display: block;
}
.hud__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.hud__score {
  background: linear-gradient(100deg, rgba(6, 10, 20, 0.7), rgba(6, 10, 20, 0.25));
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 6px 14px 8px;
  min-width: 148px;
}
.hud__label {
  display: block;
  font-size: 0.56rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  font-weight: 800;
}
.hud__score b {
  font-family: var(--display);
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  letter-spacing: 0.02em;
  line-height: 1;
}
.hud__mult {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--cyan);
}
.hud__right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hud__coin {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 10, 20, 0.6);
  border: 1px solid rgba(255, 196, 77, 0.35);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 900;
}
.hud__coin span {
  color: var(--gold);
}
.hud__coin b {
  font-size: 0.95rem;
}

.hud__chase {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(240px, 34vw);
  text-align: center;
}
.chase__label {
  font-size: 0.5rem;
  letter-spacing: 0.4em;
  color: #ff9aad;
  font-weight: 900;
  margin-bottom: 4px;
  text-shadow: 0 0 12px rgba(255, 77, 109, 0.8);
}
.chase__bar {
  height: 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.chase__bar i {
  display: block;
  height: 100%;
  width: 18%;
  border-radius: 5px;
  background: linear-gradient(90deg, #ffd166, #ff4d6d 60%, #9b1030);
  transition: width 0.25s ease;
}
.hud__chase.is-hot .chase__label {
  animation: pulse 0.7s infinite;
}

.hud__bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.hud__dist {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: rgba(230, 240, 255, 0.85);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.hud__dist b {
  font-size: 1.5rem;
}

.powerups {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 8px;
  border-radius: 999px;
  background: rgba(6, 10, 20, 0.66);
  border: 1px solid var(--line-strong);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  position: relative;
  overflow: hidden;
}
.chip i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.85;
}
.chip__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.chip--magnet {
  color: #ff6b6b;
}
.chip--jetpack {
  color: #ffa94d;
}
.chip--sneakers {
  color: #4dd0ff;
}
.chip--multiplier {
  color: #a97bff;
}
.chip--shield {
  color: #63e6be;
}

/* ---------------------------- cards / modals ---------------------------- */

.card {
  width: min(460px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: card-in 0.4s cubic-bezier(0.2, 1.3, 0.5, 1) both;
}
.card--over {
  border-color: rgba(255, 77, 109, 0.3);
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
}
.card__title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  margin: 0 0 18px;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff, #b9c9e6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card__actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 8px;
}
.card__actions .btn {
  width: 100%;
  padding: 14px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stats > div {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  text-align: left;
}
.stats span {
  display: block;
  font-size: 0.56rem;
  letter-spacing: 0.24em;
  color: var(--muted);
  margin-bottom: 4px;
}
.stats b {
  font-family: var(--display);
  font-size: 1.3rem;
}
.over-note {
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0 0 14px;
  min-height: 1em;
}

/* ---------------------------- toasts ---------------------------- */

.toasts {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  z-index: 9;
  width: min(420px, 92vw);
}
.toast {
  background: rgba(10, 16, 30, 0.92);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.3s ease both;
  width: 100%;
  text-align: center;
}
.toast.is-out {
  animation: toast-out 0.35s ease forwards;
}
.toast b {
  color: var(--gold);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ---------------------------- responsive ---------------------------- */

@media (max-width: 820px) {
  [data-screen="menu"] {
    justify-content: flex-start;
    padding-top: 12vh;
    background: linear-gradient(180deg, rgba(4, 8, 18, 0.85) 0%, rgba(4, 8, 18, 0.45) 55%, rgba(4, 8, 18, 0.9) 100%);
  }
  .controls-hint {
    display: none;
  }
  .mobile-only {
    display: inline;
  }
  .menu-brand {
    margin-top: 0;
  }
  .menu-links {
    position: static;
    margin-top: 22px;
    justify-content: flex-start;
  }
  .menu-side {
    position: static;
    margin-top: 18px;
    max-width: none;
  }
  [data-screen="menu"] {
    display: none;
  }
  [data-screen="menu"].is-active {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  .char-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .char-preview {
    min-height: 260px;
  }
  .char-list {
    overflow: visible;
  }
  .char-card {
    grid-template-columns: 62px 1fr auto;
  }
  .char-card img {
    width: 62px;
    height: 62px;
  }
  .panel {
    max-height: 96vh;
  }
  .panel__head {
    padding: 12px 14px;
  }
  .hud__chase {
    top: auto;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 52px);
    width: 46vw;
  }
  .hud__score {
    min-width: 112px;
  }
}

@media (max-width: 520px) {
  .logo {
    font-size: clamp(2.4rem, 15vw, 3.6rem);
  }
  .menu-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .menu-actions .btn {
    width: 100%;
  }
  .char-layout,
  .scroll-area {
    padding: 12px;
  }
  .card {
    padding: 20px;
  }
  .stats b {
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
