:root {
  --void: #05060a;
  --panel: rgba(12, 14, 24, 0.72);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: #f4f6ff;
  --muted: rgba(244, 246, 255, 0.55);
  --accent: #7cf7ff;
  --accent-2: #ff7a18;
  --glow: 0 0 40px rgba(124, 247, 255, 0.22);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--void);
  color: var(--text);
  font-family: "Outfit", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow: hidden;
  /* Avoid scroll chaining / rubber-band fighting the inner `.screen` scroller on phones. */
  overscroll-behavior: none;
}

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

#c {
  display: block;
  width: 100%;
  height: 100%;
}

/* Hide gameplay WebGL (last frame + Shiba) whenever the start menu is shown. */
#app:not(.game-active) #c {
  visibility: hidden;
  pointer-events: none;
}

/* Nitro: wide circular rim of heavy blur + soft vignette (speed tunnel read). */
.nitro-speed-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
  /* Small clear bullseye; long soft ramp so blur covers most of the view in a circle. */
  -webkit-mask-image: radial-gradient(
    circle farthest-corner at 50% 50%,
    transparent 0%,
    transparent 14%,
    rgba(0, 0, 0, 0.35) 42%,
    rgba(0, 0, 0, 0.82) 78%,
    #000 100%
  );
  mask-image: radial-gradient(
    circle farthest-corner at 50% 50%,
    transparent 0%,
    transparent 14%,
    rgba(0, 0, 0, 0.35) 42%,
    rgba(0, 0, 0, 0.82) 78%,
    #000 100%
  );
  backdrop-filter: blur(27px) saturate(1.08);
  -webkit-backdrop-filter: blur(27px) saturate(1.08);
  background: rgba(2, 6, 16, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(124, 247, 255, 0.12),
    inset 0 0 96px rgba(124, 247, 255, 0.05),
    inset 0 0 220px 100px rgba(0, 0, 0, 0.5);
}

.nitro-speed-vignette.nitro-speed-vignette--reduced {
  -webkit-mask-image: radial-gradient(
    circle farthest-corner at 50% 50%,
    transparent 0%,
    transparent 12%,
    rgba(0, 0, 0, 0.45) 40%,
    rgba(0, 0, 0, 0.92) 76%,
    #000 100%
  );
  mask-image: radial-gradient(
    circle farthest-corner at 50% 50%,
    transparent 0%,
    transparent 12%,
    rgba(0, 0, 0, 0.45) 40%,
    rgba(0, 0, 0, 0.92) 76%,
    #000 100%
  );
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(124, 247, 255, 0.1),
    inset 0 0 140px 64px rgba(0, 0, 0, 0.62),
    inset 0 0 280px 120px rgba(2, 5, 14, 0.42);
}

.casino-closed-banner,
.care-closed-banner,
.shop-closed-banner,
.health-closed-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 14;
  pointer-events: none;
  max-width: min(92vw, 520px);
  padding: 12px 18px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.95rem, 4.2vw, 1.38rem);
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1.32;
  color: rgba(200, 214, 240, 0.95);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 0, 0, 0.4);
}

.minimap-wrap {
  /* Same palette as #minimap radar-bg gradient + rings (single source for HUD bars). */
  --radar-cyan: 124, 247, 255;
  --radar-blue-mid: 21, 35, 68;
  --radar-blue-dark: 8, 14, 28;
  position: absolute;
  top: calc(94px + var(--safe-top));
  left: max(10px, env(safe-area-inset-left));
  right: auto;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.minimap {
  width: min(38vw, 152px);
  height: min(38vw, 152px);
  display: block;
  box-sizing: border-box;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(var(--radar-cyan), 0.32);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.5),
    inset 0 0 28px rgba(var(--radar-cyan), 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(var(--radar-cyan), 0.14);
  filter: drop-shadow(0 0 6px rgba(var(--radar-cyan), 0.12));
}

.hud-health-wrap {
  width: min(38vw, 152px);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hud-stat-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Match coords / shiba count: monospace, size, color */
.hud-stat-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.56rem, 2.34vw, 0.68rem);
  font-weight: 500;
  color: rgba(200, 214, 240, 0.88);
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.hud-stat-sub {
  font-size: 0.68em;
  font-weight: 500;
  vertical-align: baseline;
  position: relative;
  bottom: -0.08em;
}

.hud-stat-row--points {
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 1px;
}

.hud-stat-row--points .hud-stat-label,
.hud-stat-row--coins .hud-stat-label {
  font-size: clamp(0.67rem, 2.81vw, 0.82rem);
}

.hud-points-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.79rem, 3.12vw, 0.98rem);
  font-weight: 600;
  color: rgba(var(--radar-cyan), 0.95);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6), 0 0 10px rgba(var(--radar-cyan), 0.18);
  font-variant-numeric: tabular-nums;
}

.hud-points-value--dead {
  color: rgba(212, 212, 220, 0.9);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.hud-stat-row--coins {
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 1px;
}

.hud-coins-value {
  color: rgba(255, 215, 86, 0.95);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6),
    0 0 10px rgba(255, 215, 86, 0.22);
}

.minimap-wrap .hud-health-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(var(--radar-cyan), 0.18);
  /* Echo radar-bg: mid blue → outer dark (see #radar-bg stops). */
  background: linear-gradient(
    180deg,
    rgba(var(--radar-blue-mid), 0.38) 0%,
    rgba(var(--radar-blue-dark), 0.92) 100%
  );
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.42);
}

.minimap-wrap .hud-health-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  /* Filled segment: cyan like minimap ring / sweep, not a separate gray. */
  background: linear-gradient(
    90deg,
    rgba(var(--radar-cyan), 0.2) 0%,
    rgba(var(--radar-cyan), 0.38) 100%
  );
  box-shadow: inset 0 1px 0 rgba(var(--radar-cyan), 0.35), 0 0 10px rgba(var(--radar-cyan), 0.18);
  transition: width 80ms linear;
}

.minimap-wrap .hud-nitro-fill {
  background: linear-gradient(
    90deg,
    rgba(255, 200, 120, 0.35) 0%,
    rgba(255, 184, 74, 0.72) 55%,
    rgba(255, 236, 180, 0.55) 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.45), 0 0 12px rgba(255, 184, 74, 0.28);
}

.hud-stat-row--laser {
  gap: 4px;
}

.hud-laser-mag {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  width: 100%;
}

.hud-laser-seg {
  display: block;
  height: 7px;
  border-radius: 2px;
  background: rgba(12, 20, 32, 0.92);
  border: 1px solid rgba(124, 247, 255, 0.14);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.45);
  transition: background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.hud-laser-seg.is-filled {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(210, 235, 255, 0.88) 100%
  );
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 0 8px rgba(220, 245, 255, 0.45);
}

.hud-laser-seg.is-buffering {
  animation: hud-laser-buffer 0.42s ease-in-out infinite alternate;
  background: linear-gradient(
    90deg,
    rgba(124, 247, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(124, 247, 255, 0.25) 100%
  );
  background-size: 200% 100%;
}

@keyframes hud-laser-buffer {
  from {
    background-position: 0% 50%;
    opacity: 0.65;
  }
  to {
    background-position: 100% 50%;
    opacity: 1;
  }
}

.hud-laser-reload {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(8, 14, 24, 0.85);
  border: 1px solid rgba(124, 247, 255, 0.1);
  opacity: 0;
  transition: opacity 160ms ease;
}

.hud-laser-reload.is-active {
  opacity: 1;
}

.hud-laser-reload-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(124, 247, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.92) 55%,
    rgba(200, 230, 255, 0.7) 100%
  );
  box-shadow: 0 0 10px rgba(220, 245, 255, 0.35);
  transition: width 60ms linear;
}

/* Mobile: radar + resource bars ~40% smaller; live PTS/COIN values stay readable. */
@media (max-width: 768px) {
  .minimap-wrap {
    top: calc(72px + var(--safe-top));
    gap: 2px;
  }

  .minimap-wrap .minimap {
    width: min(23vw, 91px);
    height: min(23vw, 91px);
    border-width: 1px;
    box-shadow:
      inset 0 0 11px rgba(0, 0, 0, 0.5),
      inset 0 0 17px rgba(var(--radar-cyan), 0.06),
      0 0 0 1px rgba(0, 0, 0, 0.45),
      0 5px 14px rgba(0, 0, 0, 0.55),
      0 0 13px rgba(var(--radar-cyan), 0.14);
  }

  .minimap-wrap .hud-health-wrap {
    width: min(23vw, 91px);
    gap: 3px;
  }

  .minimap-wrap .hud-stat-row:not(.hud-stat-row--points):not(.hud-stat-row--coins) {
    gap: 1px;
  }

  .minimap-wrap
    .hud-stat-row:not(.hud-stat-row--points):not(.hud-stat-row--coins)
    .hud-stat-label {
    font-size: clamp(0.34rem, 1.4vw, 0.41rem);
  }

  .minimap-wrap .hud-health-track {
    height: 5px;
  }

  .minimap-wrap .hud-stat-row--laser {
    gap: 2px;
  }

  .minimap-wrap .hud-laser-mag {
    gap: 2px;
  }

  .minimap-wrap .hud-laser-seg {
    height: 4px;
    border-radius: 1px;
  }

  .minimap-wrap .hud-laser-reload {
    height: 2px;
  }
}

.minimap-bg {
  stroke: rgba(var(--radar-cyan), 0.24);
  stroke-width: 0.022;
}

.minimap-grid-line {
  stroke: rgba(var(--radar-cyan), 0.1);
  stroke-width: 0.012;
  stroke-linecap: round;
}

.minimap-grid-line--diag {
  stroke: rgba(var(--radar-cyan), 0.05);
  stroke-width: 0.008;
}

.minimap-ring {
  fill: none;
  stroke: rgba(var(--radar-cyan), 0.42);
  stroke-width: 0.026;
  stroke-linecap: round;
  filter: url(#radar-glow-soft);
}

.minimap-ring--mid {
  stroke: rgba(var(--radar-cyan), 0.16);
  stroke-width: 0.014;
  stroke-dasharray: 0.04 0.06;
}

.minimap-ring--inner {
  stroke: rgba(var(--radar-cyan), 0.28);
  stroke-width: 0.02;
  stroke-dasharray: 0.08 0.05;
}

.minimap-compass-ticks .minimap-tick {
  stroke: rgba(var(--radar-cyan), 0.38);
  stroke-width: 0.018;
  stroke-linecap: round;
}

.minimap-sweep-ambient {
  transform-origin: 0 0;
  animation: minimap-sweep-spin 7s linear infinite;
}

.minimap-sweep-ambient-wedge {
  fill: rgba(var(--radar-cyan), 0.07);
  stroke: rgba(var(--radar-cyan), 0.14);
  stroke-width: 0.01;
  stroke-linejoin: round;
}

.minimap-sweep-forward {
  transform-origin: 0 0;
}

.minimap-sweep {
  stroke: rgba(var(--radar-cyan), 0.55);
  stroke-width: 0.016;
  stroke-linejoin: round;
  filter: url(#radar-glow-soft);
}

.minimap-sweep-trail {
  fill: rgba(var(--radar-cyan), 0.06);
  stroke: none;
  transform: scale(0.72);
  transform-origin: 0 0;
  opacity: 0.65;
}

@keyframes minimap-sweep-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.minimap-vignette {
  pointer-events: none;
}

.minimap-bezel {
  stroke: rgba(var(--radar-cyan), 0.38);
  stroke-width: 0.022;
  filter: url(#radar-glow-soft);
}

.minimap-bezel--outer {
  stroke: rgba(var(--radar-cyan), 0.12);
  stroke-width: 0.014;
  filter: none;
}

/* Hub / portal spawn landmark on radar (position updated in JS, same projection as dots). */
.minimap-spawn-cross {
  pointer-events: none;
  filter: url(#radar-glow-soft);
}

.minimap-spawn-cross-arm {
  stroke: rgba(168, 85, 247, 0.95);
  stroke-width: 0.028;
  stroke-linecap: round;
}

.minimap-landmark-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.092px;
  font-weight: 600;
  letter-spacing: 0.07em;
  fill: rgba(220, 234, 255, 0.94);
  paint-order: stroke fill;
  stroke: rgba(4, 8, 18, 0.82);
  stroke-width: 0.02px;
  pointer-events: none;
  filter: url(#radar-glow-soft);
}

.minimap-landmark-label--casino {
  fill: rgba(255, 214, 120, 0.96);
  stroke: rgba(28, 18, 4, 0.78);
}

.minimap-landmark-label--shop {
  fill: rgba(255, 196, 108, 0.94);
  stroke: rgba(24, 16, 4, 0.76);
}

.minimap-landmark-label--pulse {
  fill: rgba(232, 168, 255, 0.95);
  stroke: rgba(18, 8, 28, 0.78);
}

.minimap-landmark-label--care {
  font-size: 0.084px;
  fill: rgba(148, 236, 196, 0.92);
  stroke: rgba(6, 18, 14, 0.76);
  letter-spacing: 0.05em;
}

.minimap-self {
  fill: rgba(255, 255, 255, 0.28);
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 0.032;
  filter: url(#radar-glow-dot);
  animation: minimap-self-pulse 2.4s ease-in-out infinite;
}

@keyframes minimap-self-pulse {
  0%,
  100% {
    opacity: 1;
    stroke-width: 0.032;
  }
  50% {
    opacity: 0.82;
    stroke-width: 0.038;
  }
}

.minimap-compass-ring {
  transform-origin: 0 0;
}

.minimap-dir {
  fill: rgba(232, 241, 255, 0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.15px;
  text-anchor: middle;
  dominant-baseline: middle;
  letter-spacing: 0.04em;
  font-weight: 700;
  paint-order: stroke fill;
  stroke: rgba(4, 8, 18, 0.7);
  stroke-width: 0.014px;
}

.dir-n {
  fill: #ffffff;
  filter: drop-shadow(0 0 6px rgba(var(--radar-cyan), 0.45));
}

.minimap-dot {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 0.022;
  filter: url(#radar-glow-dot);
}


.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(16px + var(--safe-top)) 18px calc(22px + var(--safe-bottom));
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Prefer vertical pan for this scroller so momentum scroll stays smooth on mobile. */
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  /* Own compositor layer: smoother iOS/Android scroll over full-screen canvas. */
  transform: translate3d(0, 0, 0);
  background: radial-gradient(120% 80% at 50% 0%, rgba(124, 247, 255, 0.08), transparent 55%),
    radial-gradient(90% 60% at 80% 100%, rgba(255, 122, 24, 0.07), transparent 50%), var(--void);
  z-index: 5;
}

.screen.overlay {
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(10px);
  justify-content: center;
}

/* Game over: translucent world behind; compact popup + main menu. */
.screen.game-over-screen {
  z-index: 28;
  justify-content: center;
  align-items: center;
  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));
  background: rgba(5, 6, 10, 0.38);
  backdrop-filter: blur(5px) saturate(1.05);
  -webkit-backdrop-filter: blur(5px) saturate(1.05);
  pointer-events: auto;
}

.game-over-card {
  width: min(100%, 300px);
  margin: 0 auto;
  padding: 18px 20px 16px;
  border: 1px solid rgba(124, 247, 255, 0.22);
  background: rgba(10, 14, 26, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 16px 48px rgba(0, 0, 0, 0.5);
}

.game-over-title {
  margin: 0 0 6px;
  font-family: "Syne", "Outfit", sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: clamp(1.15rem, 4.2vw, 1.35rem);
  color: rgba(255, 184, 120, 0.95);
  text-shadow: 0 0 20px rgba(255, 140, 70, 0.35);
}

.game-over-score {
  margin: 0 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(200, 220, 255, 0.92);
}

.game-over-status {
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(180, 210, 240, 0.82);
}

.game-over-status--best {
  color: #7cf7ff;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(124, 247, 255, 0.35);
}

.game-over-status--error {
  color: rgba(255, 170, 130, 0.95);
}

.tournament-lobby-screen,
.tournament-results-screen {
  z-index: 29;
  align-items: center;
  justify-content: center;
  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));
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(124, 247, 255, 0.14), transparent 55%),
    rgba(5, 6, 10, 0.56);
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
}

.tournament-lobby-card,
.tournament-results-card {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 20px 20px 18px;
  border: 1px solid rgba(124, 247, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(14, 20, 36, 0.94), rgba(7, 10, 19, 0.9));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 20px 56px rgba(0, 0, 0, 0.48);
}

.tournament-card-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(124, 247, 255, 0.82);
}

.tournament-card-title {
  margin: 0;
  font-family: "Syne", "Outfit", sans-serif;
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #f6fbff;
}

.tournament-card-copy {
  margin: 0;
  color: rgba(205, 219, 241, 0.82);
  line-height: 1.55;
}

.tournament-lobby-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tournament-lobby-stat {
  display: grid;
  gap: 6px;
  padding: 12px 12px 11px;
  border-radius: 14px;
  border: 1px solid rgba(124, 247, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.tournament-lobby-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(124, 247, 255, 0.72);
}

.tournament-lobby-stat-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.02rem;
  font-weight: 700;
  color: #f6fbff;
}

.tournament-lobby-roster-wrap,
.tournament-results-list {
  display: grid;
  gap: 10px;
}

.tournament-lobby-roster-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  justify-content: space-between;
}

.tournament-lobby-roster-label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #f1f6ff;
}

.tournament-lobby-roster-hint {
  font-size: 0.74rem;
  color: rgba(205, 219, 241, 0.64);
}

.tournament-lobby-roster {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding-right: 2px;
}

.tournament-lobby-player,
.tournament-results-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(124, 247, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

.tournament-lobby-player-main,
.tournament-results-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: left;
}

.tournament-lobby-player-name,
.tournament-results-row-name {
  font-weight: 700;
  color: #f5f9ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tournament-lobby-player-meta,
.tournament-results-row-meta {
  font-size: 0.78rem;
  color: rgba(205, 219, 241, 0.66);
}

.tournament-lobby-player-chip,
.tournament-results-row-chip {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7cf7ff;
  background: rgba(124, 247, 255, 0.1);
  border: 1px solid rgba(124, 247, 255, 0.18);
}

.tournament-lobby-player-chip.is-self {
  color: #101522;
  background: linear-gradient(135deg, #7cf7ff, #5b6dff);
}

.tournament-results-row-chip.is-rank-1 {
  color: #0f1020;
  background: linear-gradient(135deg, #ffd36b, #ff8f4d);
  border-color: rgba(255, 205, 107, 0.42);
}

.tournament-results-row-chip.is-rank-2 {
  color: #eef4ff;
  background: rgba(177, 205, 255, 0.16);
  border-color: rgba(177, 205, 255, 0.3);
}

.tournament-results-row-chip.is-rank-3 {
  color: #ffeada;
  background: rgba(255, 166, 112, 0.14);
  border-color: rgba(255, 166, 112, 0.28);
}

.tournament-results-self {
  margin: 0;
  color: rgba(205, 219, 241, 0.82);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.tournament-lobby-empty,
.tournament-results-empty {
  margin: 0;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(124, 247, 255, 0.18);
  color: rgba(205, 219, 241, 0.66);
  text-align: center;
}

.instructions-manual-body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: clamp(14px, 3vw, 28px);
  flex: 1 1 auto;
  min-height: min(52vh, 440px);
  min-width: 0;
}

@media (max-width: 680px) {
  .instructions-manual-body {
    flex-direction: column;
    min-height: 0;
  }

  .tournament-lobby-stats {
    grid-template-columns: 1fr;
  }

  /* In a column flex container, % flex-basis is height — avoid distorted media/text rows. */
  .instructions-manual-figure {
    flex: 0 0 auto;
    width: 100%;
    align-self: stretch;
  }

  .instructions-manual-text {
    flex: 0 0 auto;
    width: 100%;
    align-self: stretch;
  }
}

/* Tutorials: stacked topic blocks inside the start-menu card */
.tutorials-all-slides {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vw, 32px);
  min-width: 0;
  outline: none;
}

#menu-panel-tutorials .tutorial-slide-block.instructions-manual-body {
  min-height: 0;
  flex: 0 0 auto;
}

#menu-panel-tutorials .tutorial-slide-block .instructions-manual-figure {
  --instructions-media-max-h: min(40vh, 320px);
  --instructions-media-min-h: min(28vh, 220px);
}

.instructions-manual-figure {
  --instructions-media-max-h: min(62vh, 560px);
  --instructions-media-min-h: min(44vh, 360px);
  margin: 0;
  flex: 1 1 46%;
  min-width: 0;
  height: auto;
  min-height: min(var(--instructions-media-min-h), var(--instructions-media-max-h));
  max-height: var(--instructions-media-max-h);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border: none;
  outline: none;
  border-radius: 0;
  background: transparent;
}

.instructions-manual-image {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: var(--instructions-media-max-h);
  object-fit: contain;
  object-position: center;
  display: block;
  border: none;
  outline: none;
  box-shadow: none;
}

.instructions-manual-image-fallback {
  box-sizing: border-box;
  width: 100%;
  min-height: min(var(--instructions-media-min-h), var(--instructions-media-max-h));
  max-height: var(--instructions-media-max-h);
  display: grid;
  place-items: center;
  border: none;
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(190, 210, 240, 0.76);
}

.instructions-manual-text {
  margin: 0;
  flex: 1 1 50%;
  min-width: 0;
  min-height: 40px;
  align-self: center;
  color: rgba(232, 238, 252, 0.95);
  font-size: 0.93rem;
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

.app-loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background:
    radial-gradient(ellipse 100% 70% at 50% -10%, rgba(168, 247, 255, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(124, 247, 255, 0.08) 0%, transparent 50%),
    linear-gradient(168deg, #0f1a32 0%, #080d1a 40%, #05050f 100%);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.app-loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Netflix-style Astroverse profile gate (before main menu). */
.profile-picker-screen {
  /* Grid: +30% vs prior mobile baseline; same tokens on all breakpoints. */
  --profile-picker-grid-line: rgba(124, 247, 255, 0.078);
  --profile-picker-grid-opacity: 0.86;
  z-index: 12;
  justify-content: center;
  align-items: center;
  padding: calc(20px + var(--safe-top)) 20px calc(28px + var(--safe-bottom));
  overflow: hidden;
  background:
    radial-gradient(ellipse 100% 70% at 50% -10%, rgba(168, 247, 255, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(124, 247, 255, 0.08) 0%, transparent 50%),
    linear-gradient(168deg, #0f1a32 0%, #080d1a 40%, #05050f 100%);
}

.profile-picker-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.profile-picker-bg__glow {
  position: absolute;
  left: 50%;
  top: 38%;
  width: min(92vw, 720px);
  height: min(52vh, 420px);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(124, 247, 255, 0.16) 0%, transparent 68%);
  animation: profile-picker-pulse 5.5s ease-in-out infinite;
}

.profile-picker-bg__grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(var(--profile-picker-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--profile-picker-grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 74% 58% at 50% 45%, #000 12%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 74% 58% at 50% 45%, #000 12%, transparent 70%);
  opacity: var(--profile-picker-grid-opacity);
}

.profile-picker-bg__stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(200, 252, 255, 0.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 24%, rgba(200, 252, 255, 0.75) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 34% 62%, rgba(124, 247, 255, 0.85) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 72%, rgba(200, 252, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 82%, rgba(124, 247, 255, 0.65) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 56% 12%, rgba(200, 252, 255, 0.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 64% 44%, rgba(124, 247, 255, 0.55) 50%, transparent 51%);
  opacity: 0.75;
  animation: profile-picker-drift 18s linear infinite;
}

@keyframes profile-picker-pulse {
  0%,
  100% {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

@keyframes profile-picker-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-24px, -12px, 0);
  }
}

/* Minimal wallet status chip (top-right on profile gate). */
.profile-picker-wallet {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: max(14px, env(safe-area-inset-right, 14px));
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(92vw, 280px);
  margin: 0;
  padding: 7px 11px 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 12, 16, 0.78);
  color: rgba(255, 255, 255, 0.88);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  appearance: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.profile-picker-wallet:hover,
.profile-picker-wallet:focus-visible {
  transform: translateY(-1px);
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(12, 14, 18, 0.84);
}

.profile-picker-wallet--disconnected:hover,
.profile-picker-wallet--disconnected:focus-visible {
  border-color: rgba(255, 255, 255, 0.3);
}

.profile-picker-wallet--connected {
  border-color: rgba(86, 193, 128, 0.42);
  background: rgba(10, 16, 13, 0.8);
  color: rgba(224, 245, 233, 0.95);
}

.profile-picker-wallet--connected:hover,
.profile-picker-wallet--connected:focus-visible {
  border-color: rgba(104, 206, 143, 0.52);
  background: rgba(12, 18, 15, 0.86);
}

.profile-picker-wallet__led {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a6acb3;
}

.profile-picker-wallet--connected .profile-picker-wallet__led {
  background: #56c180;
}

.profile-picker-wallet__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.profile-picker-wallet--disconnected .profile-picker-wallet__label {
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  text-transform: none;
}

.profile-picker-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 560px);
  text-align: center;
}

.profile-picker-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
}

.profile-picker-logo {
  display: block;
  width: clamp(88px, 22vw, 128px);
  height: auto;
  margin: 0 0 14px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(124, 247, 255, 0.35)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

.profile-picker-eyebrow {
  margin: 0 0 6px;
  font-family: "Syne", "Outfit", sans-serif;
  font-size: clamp(2.16rem, 4.7vw, 1.88rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: none;
  color: rgba(124, 247, 255, 0.9);
}

.profile-picker-title {
  margin: 0 0 8px;
  font-family: "Syne", "Outfit", sans-serif;
  font-size: clamp(0.36rem, 1.88vw, 1.04rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(242, 254, 255, 0.92);
  text-shadow: 0 0 20px rgba(124, 247, 255, 0.2);
}

.profile-picker-tagline {
  margin: 0 0 12px;
  max-width: 28rem;
  font-size: clamp(0.88rem, 2.4vw, 1rem);
  font-weight: 500;
  line-height: 1.45;
  color: rgba(124, 247, 255, 0.88);
  text-align: center;
}

@media (min-width: 700px) {
  .profile-picker-tagline {
    max-width: none;
    white-space: nowrap;
    font-size: clamp(0.82rem, 1.35vw, 0.98rem);
  }
}

.profile-picker-features {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-self: center;
  align-items: flex-start;
  gap: 6px;
  width: fit-content;
  max-width: 22rem;
  font-size: clamp(0.78rem, 2.1vw, 0.88rem);
  line-height: 1.35;
  color: rgba(200, 214, 240, 0.82);
  text-align: left;
}

.profile-picker-features li {
  position: relative;
  padding-left: 1.1em;
}

.profile-picker-features li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: rgba(124, 247, 255, 0.65);
}

.profile-picker-subtitle {
  margin: 18px 0 0;
  color: rgba(200, 214, 240, 0.78);
  font-size: 0.92rem;
  text-align: center;
}

.profile-picker-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(18px, 4vw, 36px);
  width: 100%;
  margin-bottom: 0;
}

.profile-picker-profile {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(220, 236, 255, 0.92);
  font-family: "Outfit", system-ui, sans-serif;
  transition: transform 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.profile-picker-profile:hover,
.profile-picker-profile:focus-visible {
  transform: scale(1.06);
  outline: none;
}

.profile-picker-profile:focus-visible .profile-picker-avatar {
  box-shadow:
    0 0 28px rgba(124, 247, 255, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.45);
}

.profile-picker-profile--locked {
  cursor: default;
}

.profile-picker-profile--locked:hover,
.profile-picker-profile--locked:focus-visible {
  transform: none;
}

.profile-picker-avatar {
  display: grid;
  place-items: center;
  width: clamp(88px, 18vw, 118px);
  height: clamp(88px, 18vw, 118px);
  border-radius: 8px;
  border: 2px solid rgba(124, 247, 255, 0.38);
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.14), transparent 52%),
    linear-gradient(155deg, rgba(18, 32, 58, 0.95), rgba(6, 10, 22, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 28px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(124, 247, 255, 0.12);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.profile-picker-profile:hover .profile-picker-avatar,
.profile-picker-profile:focus-visible .profile-picker-avatar {
  border-color: rgba(168, 247, 255, 0.72);
}

.profile-picker-avatar--astro img,
.profile-picker-avatar--pepe img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picker-avatar--pepe img {
  transform: scale(1.3);
  transform-origin: center center;
}

.profile-picker-avatar--astro {
  border-color: rgba(124, 247, 255, 0.45);
}

.profile-picker-avatar--astro img {
  filter: drop-shadow(0 0 10px rgba(124, 247, 255, 0.28));
}

.profile-picker-avatar--pepe {
  border-color: rgba(86, 220, 124, 0.45);
}

.profile-picker-avatar--add {
  border-style: dashed;
  border-color: rgba(124, 247, 255, 0.42);
  background: rgba(8, 14, 28, 0.55);
}

.profile-picker-add-icon {
  font-size: 2.6rem;
  font-weight: 300;
  line-height: 1;
  color: rgba(168, 247, 255, 0.9);
}

.profile-picker-name {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.profile-picker-status {
  min-height: 1.25rem;
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: rgba(200, 214, 240, 0.72);
}

.profile-picker-status.is-warn {
  color: #ffb84a;
}

@media (min-width: 700px) {
  .profile-picker-grid {
    gap: 32px 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-picker-bg__glow,
  .profile-picker-bg__stars {
    animation: none;
  }

  .profile-picker-wallet--connected .profile-picker-wallet__led {
    animation: none;
  }
}

/* Web3 wallet picker modal (profile gate + connect flows). */
body.wallet-picker-open {
  overflow: hidden;
}

.wallet-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
}

.wallet-picker-modal.hidden {
  display: none;
}

.wallet-picker-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(4, 6, 14, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.wallet-picker-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(82dvh, 640px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px 16px;
  border-radius: 16px;
  border: 1px solid rgba(124, 247, 255, 0.28);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(124, 247, 255, 0.12), transparent 55%),
    linear-gradient(168deg, rgba(14, 22, 42, 0.98), rgba(6, 10, 22, 0.99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.wallet-picker-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wallet-picker-modal__title {
  margin: 0;
  font-family: "Syne", "Outfit", sans-serif;
  font-size: 1.12rem;
  letter-spacing: 0.04em;
  color: #f2feff;
}

.wallet-picker-modal__close {
  appearance: none;
  border: none;
  background: rgba(124, 247, 255, 0.1);
  color: rgba(220, 240, 255, 0.92);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.wallet-picker-modal__subtitle {
  margin: 0;
  font-size: 0.84rem;
  color: rgba(198, 216, 238, 0.82);
  line-height: 1.4;
}

.wallet-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 0 0;
}

.wallet-picker-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(124, 247, 255, 0.16);
  background: rgba(8, 14, 28, 0.72);
  color: rgba(230, 244, 255, 0.95);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.16s ease;
}

.wallet-picker-option:hover,
.wallet-picker-option:focus-visible {
  border-color: rgba(124, 247, 255, 0.42);
  background: rgba(12, 22, 40, 0.9);
  outline: none;
  transform: translateY(-1px);
}

.wallet-picker-option__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: center / 22px 22px no-repeat rgba(255, 255, 255, 0.06);
  background-size: contain;
}

.wallet-picker-option__icon--metamask {
  background-color: rgba(255, 255, 255, 0.06);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-image: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM1NSIgdmlld0JveD0iMCAwIDM5NyAzNTUiIHdpZHRoPSIzOTciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMSAtMSkiPjxwYXRoIGQ9Im0xMTQuNjIyNjQ0IDMyNy4xOTU0NzIgNTIuMDA0NzE3IDEzLjgxMDE5OHYtMTguMDU5NDlsNC4yNDUyODMtNC4yNDkyOTJoMjkuNzE2OTgydjIxLjI0NjQ1OSAxNC44NzI1MjNoLTMxLjgzOTYyNGwtMzkuMjY4ODY4LTE2Ljk5NzE2OXoiIGZpbGw9IiNjZGJkYjIiLz48cGF0aCBkPSJtMTk5LjUyODMwNSAzMjcuMTk1NDcyIDUwLjk0MzM5NyAxMy44MTAxOTh2LTE4LjA1OTQ5bDQuMjQ1MjgzLTQuMjQ5MjkyaDI5LjcxNjk4MXYyMS4yNDY0NTkgMTQuODcyNTIzaC0zMS44Mzk2MjNsLTM5LjI2ODg2OC0xNi45OTcxNjl6IiBmaWxsPSIjY2RiZGIyIiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgMSA0ODMuOTYyMjcgMCkiLz48cGF0aCBkPSJtMTcwLjg3MjY0NCAyODcuODg5NTIzLTQuMjQ1MjgzIDM1LjA1NjY1NyA1LjMwNjYwNC00LjI0OTI5Mmg1NS4xODg2OGw2LjM2NzkyNSA0LjI0OTI5Mi00LjI0NTI4NC0zNS4wNTY2NTctOC40OTA1NjUtNS4zMTE2MTUtNDIuNDUyODMyIDEuMDYyMzIzeiIgZmlsbD0iIzM5MzkzOSIvPjxwYXRoIGQ9Im0xNDIuMjE2OTg0IDUwLjk5MTUwMjIgMjUuNDcxNjk4IDU5LjQ5MDA4NTggMTEuNjc0NTI4IDE3My4xNTg2NDNoNDEuMzkxNTExbDEyLjczNTg0OS0xNzMuMTU4NjQzIDIzLjM0OTA1Ni01OS40OTAwODU4eiIgZmlsbD0iI2Y4OWMzNSIvPjxwYXRoIGQ9Im0zMC43NzgzMDIzIDE4MS42NTcyMjYtMjkuNzE2OTgxNTMgODYuMDQ4MTYxIDc0LjI5MjQ1MzkzLTQuMjQ5MjkzaDQ3Ljc1OTQzNDN2LTM3LjE4MTMwM2wtMi4xMjI2NDEtNzYuNDg3MjUzLTEwLjYxMzIwOCA4LjQ5ODU4M3oiIGZpbGw9IiNmODlkMzUiLz48cGF0aCBkPSJtODcuMDI4MzAzMiAxOTEuMjE4MTM0IDg3LjAyODMwMjggMi4xMjQ2NDYtOS41NTE4ODYgNDQuNjE3NTYzLTQxLjM5MTUxMS0xMC42MjMyMjl6IiBmaWxsPSIjZDg3YzMwIi8+PHBhdGggZD0ibTg3LjAyODMwMzIgMTkyLjI4MDQ1NyAzNi4wODQ5MDU4IDMzLjk5NDMzNHYzMy45OTQzMzR6IiBmaWxsPSIjZWE4ZDNhIi8+PHBhdGggZD0ibTEyMy4xMTMyMDkgMjI3LjMzNzExNCA0Mi40NTI4MzEgMTAuNjIzMjI5IDEzLjc5NzE3IDQ1LjY3OTg4OC05LjU1MTg4NiA1LjMxMTYxNS00Ni42OTgxMTUtMjcuNjIwMzk4eiIgZmlsbD0iI2Y4OWQzNSIvPjxwYXRoIGQ9Im0xMjMuMTEzMjA5IDI2MS4zMzE0NDgtOC40OTA1NjUgNjUuODY0MDI0IDU2LjI1LTM5LjMwNTk0OXoiIGZpbGw9IiNlYjhmMzUiLz48cGF0aCBkPSJtMTc0LjA1NjYwNiAxOTMuMzQyNzggNS4zMDY2MDQgOTAuMjk3NDUxLTE1LjkxOTgxMi00Ni4yMTEwNDl6IiBmaWxsPSIjZWE4ZTNhIi8+PHBhdGggZD0ibTc0LjI5MjQ1MzkgMjYyLjM5Mzc3MSA0OC44MjA3NTUxLTEuMDYyMzIzLTguNDkwNTY1IDY1Ljg2NDAyNHoiIGZpbGw9IiNkODdjMzAiLz48cGF0aCBkPSJtMjQuNDEwMzc3NyAzNTUuODc4MTkzIDkwLjIxMjI2NjMtMjguNjgyNzIxLTQwLjMzMDE5MDEtNjQuODAxNzAxLTczLjIzMTEzMzEzIDUuMzExNjE2eiIgZmlsbD0iI2ViOGYzNSIvPjxwYXRoIGQ9Im0xNjcuNjg4NjgyIDExMC40ODE1ODgtNDUuNjM2NzkzIDM4LjI0MzYyNy0zNS4wMjM1ODU4IDQyLjQ5MjkxOSA4Ny4wMjgzMDI4IDMuMTg2OTY5eiIgZmlsbD0iI2U4ODIxZSIvPjxwYXRoIGQ9Im0xMTQuNjIyNjQ0IDMyNy4xOTU0NzIgNTYuMjUtMzkuMzA1OTQ5LTQuMjQ1MjgzIDMzLjk5NDMzNHYxOS4xMjE4MTNsLTM4LjIwNzU0OC03LjQzNjI2eiIgZmlsbD0iI2RmY2VjMyIvPjxwYXRoIGQ9Im0yMjkuMjQ1Mjg2IDMyNy4xOTU0NzIgNTUuMTg4NjgtMzkuMzA1OTQ5LTQuMjQ1MjgzIDMzLjk5NDMzNHYxOS4xMjE4MTNsLTM4LjIwNzU0OC03LjQzNjI2eiIgZmlsbD0iI2RmY2VjMyIgdHJhbnNmb3JtPSJtYXRyaXgoLTEgMCAwIDEgNTEzLjY3OTI1MiAwKSIvPjxwYXRoIGQ9Im0xMzIuNjY1MDk2IDIxMi40NjQ1OTMtMTEuNjc0NTI4IDI0LjQzMzQyNyA0MS4zOTE1MS0xMC42MjMyMjl6IiBmaWxsPSIjMzkzOTM5IiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgMSAyODMuMzcyNjQ2IDApIi8+PHBhdGggZD0ibTIzLjM0OTA1NyAxLjA2MjMyMjk2IDE0NC4zMzk2MjUgMTA5LjQxOTI2NTA0LTI0LjQxMDM3OC01OS40OTAwODU4eiIgZmlsbD0iI2U4OGYzNSIvPjxwYXRoIGQ9Im0yMy4zNDkwNTcgMS4wNjIzMjI5Ni0xOS4xMDM3NzM5MiA1OC40Mjc3NjI5NCAxMC42MTMyMDc3MiA2My43MzkzNzgxLTcuNDI5MjQ1NDEgNC4yNDkyOTIgMTAuNjEzMjA3NzEgOS41NjA5MDYtOC40OTA1NjYxNyA3LjQzNjI2MSAxMS42NzQ1Mjg0NyAxMC42MjMyMjktNy40MjkyNDU0IDYuMzczOTM4IDE2Ljk4MTEzMjMgMjEuMjQ2NDU5IDc5LjU5OTA1NzctMjQuNDMzNDI4YzM4LjkxNTA5Ni0zMS4xNjE0NzMgNTguMDE4ODY5LTQ3LjA5NjMxOCA1Ny4zMTEzMjItNDcuODA0NTMzLS43MDc1NDgtLjcwODIxNS00OC44MjA3NTYtMzcuMTgxMzAzNi0xNDQuMzM5NjI1LTEwOS40MTkyNjUwNHoiIGZpbGw9IiM4ZTVhMzAiLz48ZyB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgMSAzOTkuMDU2NjExIDApIj48cGF0aCBkPSJtMzAuNzc4MzAyMyAxODEuNjU3MjI2LTI5LjcxNjk4MTUzIDg2LjA0ODE2MSA3NC4yOTI0NTM5My00LjI0OTI5M2g0Ny43NTk0MzQzdi0zNy4xODEzMDNsLTIuMTIyNjQxLTc2LjQ4NzI1My0xMC42MTMyMDggOC40OTg1ODN6IiBmaWxsPSIjZjg5ZDM1Ii8+PHBhdGggZD0ibTg3LjAyODMwMzIgMTkxLjIxODEzNCA4Ny4wMjgzMDI4IDIuMTI0NjQ2LTkuNTUxODg2IDQ0LjYxNzU2My00MS4zOTE1MTEtMTAuNjIzMjI5eiIgZmlsbD0iI2Q4N2MzMCIvPjxwYXRoIGQ9Im04Ny4wMjgzMDMyIDE5Mi4yODA0NTcgMzYuMDg0OTA1OCAzMy45OTQzMzR2MzMuOTk0MzM0eiIgZmlsbD0iI2VhOGQzYSIvPjxwYXRoIGQ9Im0xMjMuMTEzMjA5IDIyNy4zMzcxMTQgNDIuNDUyODMxIDEwLjYyMzIyOSAxMy43OTcxNyA0NS42Nzk4ODgtOS41NTE4ODYgNS4zMTE2MTUtNDYuNjk4MTE1LTI3LjYyMDM5OHoiIGZpbGw9IiNmODlkMzUiLz48cGF0aCBkPSJtMTIzLjExMzIwOSAyNjEuMzMxNDQ4LTguNDkwNTY1IDY1Ljg2NDAyNCA1NS4xODg2OC0zOC4yNDM2MjZ6IiBmaWxsPSIjZWI4ZjM1Ii8+PHBhdGggZD0ibTE3NC4wNTY2MDYgMTkzLjM0Mjc4IDUuMzA2NjA0IDkwLjI5NzQ1MS0xNS45MTk4MTItNDYuMjExMDQ5eiIgZmlsbD0iI2VhOGUzYSIvPjxwYXRoIGQ9Im03NC4yOTI0NTM5IDI2Mi4zOTM3NzEgNDguODIwNzU1MS0xLjA2MjMyMy04LjQ5MDU2NSA2NS44NjQwMjR6IiBmaWxsPSIjZDg3YzMwIi8+PHBhdGggZD0ibTI0LjQxMDM3NzcgMzU1Ljg3ODE5MyA5MC4yMTIyNjYzLTI4LjY4MjcyMS00MC4zMzAxOTAxLTY0LjgwMTcwMS03My4yMzExMzMxMyA1LjMxMTYxNnoiIGZpbGw9IiNlYjhmMzUiLz48cGF0aCBkPSJtMTY3LjY4ODY4MiAxMTAuNDgxNTg4LTQ1LjYzNjc5MyAzOC4yNDM2MjctMzUuMDIzNTg1OCA0Mi40OTI5MTkgODcuMDI4MzAyOCAzLjE4Njk2OXoiIGZpbGw9IiNlODgyMWUiLz48cGF0aCBkPSJtMTMyLjY2NTA5NiAyMTIuNDY0NTkzLTExLjY3NDUyOCAyNC40MzM0MjcgNDEuMzkxNTEtMTAuNjIzMjI5eiIgZmlsbD0iIzM5MzkzOSIgdHJhbnNmb3JtPSJtYXRyaXgoLTEgMCAwIDEgMjgzLjM3MjY0NiAwKSIvPjxwYXRoIGQ9Im0yMy4zNDkwNTcgMS4wNjIzMjI5NiAxNDQuMzM5NjI1IDEwOS40MTkyNjUwNC0yNC40MTAzNzgtNTkuNDkwMDg1OHoiIGZpbGw9IiNlODhmMzUiLz48cGF0aCBkPSJtMjMuMzQ5MDU3IDEuMDYyMzIyOTYtMTkuMTAzNzczOTIgNTguNDI3NzYyOTQgMTAuNjEzMjA3NzIgNjMuNzM5Mzc4MS03LjQyOTI0NTQxIDQuMjQ5MjkyIDEwLjYxMzIwNzcxIDkuNTYwOTA2LTguNDkwNTY2MTcgNy40MzYyNjEgMTEuNjc0NTI4NDcgMTAuNjIzMjI5LTcuNDI5MjQ1NCA2LjM3MzkzOCAxNi45ODExMzIzIDIxLjI0NjQ1OSA3OS41OTkwNTc3LTI0LjQzMzQyOGMzOC45MTUwOTYtMzEuMTYxNDczIDU4LjAxODg2OS00Ny4wOTYzMTggNTcuMzExMzIyLTQ3LjgwNDUzMy0uNzA3NTQ4LS43MDgyMTUtNDguODIwNzU2LTM3LjE4MTMwMzYtMTQ0LjMzOTYyNS0xMDkuNDE5MjY1MDR6IiBmaWxsPSIjOGU1YTMwIi8+PC9nPjwvZz48L3N2Zz4=");
}

.wallet-picker-option__icon--coinbase {
  background-color: #0052ff;
  background-image: url("/vendor/github/cbw.svg");
}

.wallet-picker-option__icon--trust {
  background-color: #3375bb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 3l7 3v5c0 4.5-2.7 7.6-7 10-4.3-2.4-7-5.5-7-10V6z'/%3E%3Cpath fill='%233375bb' d='M12 6l4 1.8v3.1c0 2.9-1.7 5-4 6.5-2.3-1.5-4-3.6-4-6.5V7.8z'/%3E%3C/svg%3E");
}

.wallet-picker-option__icon--phantom {
  background-color: #ab9ff2;
  background-image: url("/vendor/phantom.svg");
}

.wallet-picker-option__icon--generic {
  background-color: rgba(124, 247, 255, 0.2);
}

.wallet-picker-option__copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.wallet-picker-option__name {
  font-weight: 700;
  font-size: 0.92rem;
}

.wallet-picker-option__meta {
  font-size: 0.72rem;
  color: rgba(180, 202, 228, 0.78);
}

.wallet-picker-option__badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  color: rgba(180, 202, 228, 0.85);
  background: rgba(255, 255, 255, 0.06);
}

.wallet-picker-option__badge--ready {
  color: #9dffd0;
  background: rgba(62, 232, 138, 0.14);
}

.wallet-picker-modal__hint {
  margin: 0;
  min-height: 1.1rem;
  font-size: 0.78rem;
  color: rgba(200, 214, 240, 0.82);
  line-height: 1.35;
}

/* Fullscreen bridge when launching from Game Modes (separate from first-load screen). */
.enter-game-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 65;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 100% 70% at 50% -10%, rgba(168, 247, 255, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(124, 247, 255, 0.08) 0%, transparent 50%),
    linear-gradient(168deg, #0f1a32 0%, #080d1a 40%, #05050f 100%);
}

.enter-game-overlay.hidden {
  display: none !important;
}

.game-controls-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: clamp(14px, 3.2vh, 32px);
  z-index: 24;
  pointer-events: none;
  text-align: center;
  padding: 0 18px;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.game-controls-hint.hidden {
  display: none !important;
}

.game-controls-hint.is-visible {
  opacity: 0.68;
}

.game-controls-hint.is-fading {
  opacity: 0;
}

.game-controls-hint p {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.7rem, 2.5vw, 0.86rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.72);
}

@media (max-width: 720px) {
  .game-controls-hint {
    bottom: clamp(88px, 14vh, 120px);
  }
}

.enter-game-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    rgba(124, 247, 255, 0.95) 0%,
    rgba(200, 252, 255, 1) 45%,
    rgba(124, 247, 255, 0.85) 100%
  );
  box-shadow: 0 0 12px rgba(124, 247, 255, 0.45);
  transition: width 0.42s ease;
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.progress-bar-container {
  width: 200px;
  height: 2px;
  background: rgba(124, 247, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(124, 247, 255, 0.12);
  position: relative;
  overflow: hidden;
}

#progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(124, 247, 255, 0.95) 0%, rgba(200, 252, 255, 1) 45%, rgba(124, 247, 255, 0.85) 100%);
  box-shadow: 0 0 12px rgba(124, 247, 255, 0.45);
  transition: width 0.1s ease;
}

.loading-label {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35em 0.5em;
  white-space: nowrap;
  font-size: 0.75rem;
  font-family: "Syne", "Outfit", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 4px;
  color: #f2feff;
  text-transform: uppercase;
}

.loading-percent {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f2feff;
  min-width: 3.2ch;
  text-align: right;
}

.loading-dots {
  display: inline-grid;
  grid-template-columns: 1ch 1ch 1ch;
  width: 3ch;
  min-width: 3ch;
  justify-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  letter-spacing: 0;
}

.loading-dot {
  display: block;
  opacity: 0;
  line-height: 1;
  animation-duration: 1.15s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.loading-dot:nth-child(1) { animation-name: loading-dot-1; }
.loading-dot:nth-child(2) { animation-name: loading-dot-2; }
.loading-dot:nth-child(3) { animation-name: loading-dot-3; }

@keyframes loading-dot-1 {
  0%, 9% { opacity: 0; }
  10%, 64% { opacity: 1; }
  65%, 100% { opacity: 0; }
}
@keyframes loading-dot-2 {
  0%, 24% { opacity: 0; }
  25%, 64% { opacity: 1; }
  65%, 100% { opacity: 0; }
}
@keyframes loading-dot-3 {
  0%, 39% { opacity: 0; }
  40%, 64% { opacity: 1; }
  65%, 100% { opacity: 0; }
}

#screen-start .brand {
  max-width: min(520px, 94vw);
}

.brand {
  text-align: center;
  max-width: 420px;
}

.brand-mark {
  display: block;
  width: clamp(3.5rem, 12vw, 4.75rem);
  height: auto;
  margin: 0 auto 6px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(124, 247, 255, 0.42));
}

.brand h1 {
  font-family: "Syne", "Outfit", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  margin: 0 0 8px;
  line-height: 1.05;
}

#screen-start .brand h1 {
  font-size: clamp(1.5rem, 4.55vw, 2.1rem);
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

#screen-start .tagline {
  font-size: 1.05rem;
}

.asset-preload-wrap {
  margin: 6px 0 10px;
  width: 100%;
}

.asset-preload-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(124, 247, 255, 0.35);
  background: rgba(18, 28, 45, 0.55);
}

.asset-preload-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7cf7ff, #b3fff1);
  box-shadow: 0 0 14px rgba(124, 247, 255, 0.42);
  transition: width 180ms ease-out;
}

.asset-preload-text {
  margin-top: 6px;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: rgba(216, 236, 255, 0.78);
}

.card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
}

#screen-start .card {
  width: min(520px, 100%);
  padding: 24px 22px 20px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

/* Main menu outer panel — full grid column width (not capped like legacy start card). */
#screen-start .card.start-menu-panel-host {
  width: 100%;
  max-width: none;
  background: rgba(4, 7, 14, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#screen-start .field {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

#screen-start .field input[type="text"],
#screen-start .field input[type="password"],
#screen-start .field input[type="number"] {
  padding: 14px 14px;
  font-size: 1.08rem;
}

.telegram-toggle {
  margin: -4px 0 12px;
}

.telegram-login-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin-top: 0.5rem;
}

.telegram-auth-status {
  margin: 0;
  width: 100%;
  max-width: min(44rem, 100%);
  line-height: 1.45;
}

.telegram-auth-status.is-error {
  color: #ffb4a8;
}

.telegram-auth-status.is-ok {
  color: rgba(124, 247, 255, 0.92);
}

.field-heading {
  display: flex;
  align-items: center;
}

.field-heading label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
}

.login-bridge-icons {
  /* Mobile/tablet arrow spacing controls (edit these values). */
  --login-gap-logo-arrow: -10px; /* Shiba -> first arrow */
  --login-gap-arrow1-tg: 6px; /* First arrow -> TG */
  --login-gap-tg-arrow2: 5px; /* TG -> second arrow */
  --login-gap-arrow2-eth: 5px; /* Second arrow -> ETH */
  /* Shift Astroverse + arrows + TG + ETH row left (negative = left). */
  --login-bridge-shift-x: -20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2.2vw, 14px);
  margin: 6px 0 14px;
  flex-wrap: nowrap;
  transform: translateX(var(--login-bridge-shift-x));
}

.login-bridge-icons__img {
  display: block;
  height: clamp(68px, 18vw, 104px);
  width: auto;
  max-width: min(200px, 52vw);
  object-fit: contain;
  flex: 0 1 auto;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.32));
}

.login-bridge-icons__img--logo {
  height: clamp(75px, 19.87vw, 115px);
  max-width: min(221px, 57.41vw);
}

.login-bridge-icons__img--tg {
  border-radius: 0;
  height: clamp(40px, 10.8vw, 62px);
  max-width: min(120px, 31.2vw);
}

.login-bridge-icons__img--eth {
  height: clamp(44px, 11.68vw, 68px);
  max-width: min(130px, 33.72vw);
}

.login-bridge-icons__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.login-bridge-icons__arrow:first-of-type {
  margin-left: var(--login-gap-logo-arrow);
  margin-right: var(--login-gap-arrow1-tg);
}

.login-bridge-icons__arrow:last-of-type {
  margin-left: var(--login-gap-tg-arrow2);
  margin-right: var(--login-gap-arrow2-eth);
}

.login-bridge-icons__arrow svg {
  width: clamp(32px, 9vw, 52px);
  height: auto;
  display: block;
}

@keyframes login-bridge-arrow-glow {
  0% {
    opacity: 0.28;
    filter: drop-shadow(0 0 0 transparent);
  }
  45% {
    opacity: 1;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.75));
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.5));
  }
}

.login-bridge-icons__arrow:first-of-type svg,
.login-bridge-icons__arrow:last-of-type svg {
  animation: login-bridge-arrow-glow 0.65s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .login-bridge-icons__arrow:first-of-type svg,
  .login-bridge-icons__arrow:last-of-type svg {
    animation: none;
    opacity: 1;
    filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.5));
  }
}

.telegram-id-control {
  position: relative;
  display: flex;
  align-items: center;
}

#screen-start .telegram-id-control input[type="text"] {
  width: 100%;
  min-width: 0;
  padding-right: 112px;
  border-color: rgba(124, 247, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025)),
    rgba(6, 8, 15, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(0, 0, 0, 0.18);
}

#screen-start .telegram-id-control input[type="text"]:focus {
  border-color: rgba(77, 187, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(77, 187, 255, 0.22),
    0 0 20px rgba(53, 168, 255, 0.12);
}

.telegram-get-id-btn {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 34px;
  padding: 8px 13px;
  border: 1px solid rgba(119, 210, 255, 0.58);
  border-radius: 10px;
  color: #f4fbff;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.2), transparent 46%),
    linear-gradient(160deg, #46bbff 0%, #177bde 58%, #0c4f9f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 0 16px rgba(53, 168, 255, 0.26);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.telegram-get-id-btn:hover,
.telegram-get-id-btn:focus-visible {
  border-color: rgba(207, 240, 255, 0.86);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.26), transparent 48%),
    linear-gradient(160deg, #64c8ff 0%, #238cea 58%, #1060b9 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 0 22px rgba(53, 168, 255, 0.34);
  outline: none;
}

.telegram-get-id-btn:active {
  transform: translateY(-50%) scale(0.97);
}

.telegram-get-id-btn[data-link-ready="false"] {
  opacity: 0.9;
}

#screen-start .btn.primary.telegram-verify-btn {
  display: block;
  margin: 0 auto;
  width: auto;
  min-width: 0;
  padding: 10px 24px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

#screen-start .btn.primary.telegram-verify-btn.hidden {
  display: none;
}

#screen-start .btn.primary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: "Syne", "Outfit", system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-color: rgba(124, 247, 255, 0.35);
  color: #f2feff;
  background: linear-gradient(168deg, rgba(26, 52, 92, 0.98) 0%, rgba(13, 27, 56, 0.98) 100%);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(168, 247, 255, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(124, 247, 255, 0.16),
    0 10px 24px rgba(0, 0, 0, 0.42),
    0 0 18px rgba(124, 247, 255, 0.26);
  /* Static “tubelight” on letters only — no motion. */
  text-shadow:
    0 0 6px rgba(186, 252, 255, 0.95),
    0 0 14px rgba(124, 247, 255, 0.55),
    0 0 22px rgba(124, 247, 255, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.35);
}

#screen-start .btn.primary:hover,
#screen-start .btn.primary:focus-visible {
  background: linear-gradient(168deg, rgba(33, 64, 112, 0.98) 0%, rgba(16, 34, 67, 0.98) 100%);
  border-color: rgba(124, 247, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(168, 247, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(124, 247, 255, 0.2),
    0 0 14px rgba(124, 247, 255, 0.24),
    0 10px 24px rgba(0, 0, 0, 0.42),
    0 0 22px rgba(124, 247, 255, 0.32);
  outline: none;
}

/* Match ENTER ASTROVERSE X CTA on game-over main menu (outside #screen-start). */
#screen-game-over .btn.primary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: "Syne", "Outfit", system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-color: rgba(124, 247, 255, 0.35);
  color: #f2feff;
  background: linear-gradient(168deg, rgba(26, 52, 92, 0.98) 0%, rgba(13, 27, 56, 0.98) 100%);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(168, 247, 255, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(124, 247, 255, 0.16),
    0 10px 24px rgba(0, 0, 0, 0.42),
    0 0 18px rgba(124, 247, 255, 0.26),
    var(--glow);
  text-shadow:
    0 0 6px rgba(186, 252, 255, 0.95),
    0 0 14px rgba(124, 247, 255, 0.55),
    0 0 22px rgba(124, 247, 255, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.35);
}

#screen-game-over .btn.primary:hover,
#screen-game-over .btn.primary:focus-visible {
  background: linear-gradient(168deg, rgba(33, 64, 112, 0.98) 0%, rgba(16, 34, 67, 0.98) 100%);
  border-color: rgba(124, 247, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(168, 247, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(124, 247, 255, 0.2),
    0 0 14px rgba(124, 247, 255, 0.24),
    0 10px 24px rgba(0, 0, 0, 0.42),
    0 0 22px rgba(124, 247, 255, 0.32),
    var(--glow);
  outline: none;
}

.mode-picker {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-picker > legend {
  margin: -2px 0 10px;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(236, 244, 255, 0.96);
}

.mode-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.mode-card--reverse {
  flex-direction: row-reverse;
}

.mode-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-card-media {
  flex: 0 0 auto;
  align-self: center;
  width: 140px;
  min-width: 140px;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
  object-position: center;
  border: 1px solid rgba(124, 247, 255, 0.22);
  background: rgba(10, 14, 24, 0.55);
}

.mode-card-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.79rem;
  line-height: 1.34;
  color: rgba(230, 240, 255, 0.84);
}

.mode-card-copy strong {
  font-family: "Syne", "Outfit", sans-serif;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  color: #f4f8ff;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.mode-beta-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 102, 0.45);
  background: rgba(255, 224, 102, 0.16);
  color: rgba(255, 235, 166, 0.95);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-card:has(input[type="radio"]:checked) {
  border-color: rgba(168, 252, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(210, 255, 255, 0.35),
    inset 0 0 0 1px rgba(124, 247, 255, 0.35),
    0 0 22px rgba(100, 230, 255, 0.28),
    0 0 40px rgba(60, 200, 255, 0.14);
}

.mode-card.is-locked {
  cursor: not-allowed;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(129, 153, 190, 0.24);
  background:
    radial-gradient(circle at 12% 12%, rgba(124, 247, 255, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(20, 28, 46, 0.86), rgba(8, 10, 20, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 -24px 70px rgba(0, 0, 0, 0.34),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.mode-card.is-locked .mode-card-media,
.mode-card.is-locked .mode-card-copy {
  filter: grayscale(0.72) saturate(0.62) brightness(0.72);
  opacity: 0.62;
  transform: scale(0.985);
}

.mode-card.is-locked::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0%, transparent 38%, rgba(124, 247, 255, 0.12) 44%, transparent 52%, transparent 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 76% 24%, rgba(255, 204, 76, 0.12), transparent 28%),
    rgba(4, 7, 16, 0.34);
  background-position: var(--locked-shine-x, -260px) 0, 0 0, 0 0, 0 0;
  mix-blend-mode: screen;
  opacity: 0.78;
  /* Avoid animating opacity during scroll (main-thread cost on phones). */
  transition: background-position 0.06s linear;
}

body.is-scrolling .mode-card.is-locked::before {
  opacity: 1;
}

/* Pulse only while Solo is the active selection (avoids a bright glow on an unselected card). */
#mode-card-solo:not(.is-locked):has(input[type="radio"]:checked) {
  animation: survival-mode-pulse 2.6s ease-in-out infinite;
}

@keyframes survival-mode-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(230, 255, 255, 0.45),
      inset 0 0 0 1px rgba(140, 240, 255, 0.38),
      0 0 17px rgba(90, 235, 255, 0.3),
      0 0 31px rgba(60, 200, 255, 0.12);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(245, 255, 255, 0.65),
      inset 0 0 0 1px rgba(180, 252, 255, 0.55),
      0 0 23px rgba(120, 245, 255, 0.42),
      0 0 48px rgba(80, 220, 255, 0.18);
  }
}

/* Must beat later `.btn` rule (same element uses class="btn mode-cta"). */
.btn.mode-cta {
  position: relative;
  overflow: hidden;
  margin-top: 2px;
  border: 1px solid rgba(255, 214, 92, 0.92);
  border-radius: 12px;
  color: #0a0a0a;
  background: linear-gradient(
    165deg,
    #fff3b0 0%,
    #ffd84a 42%,
    #e8a820 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 252, 220, 0.85),
    inset 0 -1px 0 rgba(180, 110, 0, 0.28),
    0 0 22px rgba(255, 200, 60, 0.38),
    0 6px 18px rgba(0, 0, 0, 0.22);
  text-shadow: none;
  animation: mode-cta-glow-breathe 2.8s ease-in-out infinite;
  transition:
    border-color 0.2s ease,
    transform 0.12s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.btn.mode-cta:hover,
.btn.mode-cta:focus-visible {
  border-color: rgba(255, 239, 188, 0.95);
  color: #0a0a0a;
  background: linear-gradient(165deg, #fff6c8 0%, #ffe066 100%);
  animation: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.82),
    inset 0 -1px 0 rgba(168, 106, 0, 0.2),
    0 0 26px rgba(255, 218, 110, 0.42),
    0 6px 18px rgba(0, 0, 0, 0.24);
}

.btn.mode-cta:active {
  transform: scale(0.985);
  animation: none;
}

@keyframes mode-cta-glow-breathe {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 252, 220, 0.85),
      inset 0 -1px 0 rgba(180, 110, 0, 0.28),
      0 0 18px rgba(255, 200, 60, 0.3),
      0 6px 18px rgba(0, 0, 0, 0.22);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 252, 220, 0.9),
      inset 0 -1px 0 rgba(180, 110, 0, 0.28),
      0 0 26px rgba(255, 210, 90, 0.45),
      0 6px 18px rgba(0, 0, 0, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn.mode-cta,
  #mode-card-solo:not(.is-locked):has(input[type="radio"]:checked) {
    animation: none;
  }
}

@media (max-width: 540px) {
  .telegram-get-id-btn {
    min-width: 72px;
    min-height: 32px;
    padding: 7px 10px;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }

  .mp-gate-actions .mp-gate-connect-btn {
    min-width: calc(72px * var(--mp-connect-scale, 0.84));
    min-height: calc(32px * var(--mp-connect-scale, 0.84));
    padding: calc(7px * var(--mp-connect-scale, 0.84)) calc(10px * var(--mp-connect-scale, 0.84));
    font-size: calc(0.68rem * var(--mp-connect-scale, 0.84));
    letter-spacing: calc(0.04em * var(--mp-connect-scale, 0.84));
  }

  #screen-start .telegram-id-control input[type="text"] {
    padding-right: 96px;
    font-size: 0.94rem;
  }

  #input-telegram-id::placeholder {
    font-size: 0.72rem;
    letter-spacing: 0;
  }

  .mode-card,
  .mode-card--reverse {
    flex-direction: column;
  }

  .mode-card-media {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
  }
}

/* Start screen: ~1.5× scale on desktop (vs default mobile layout). */
@media (min-width: 900px) {
  #screen-start .brand {
    max-width: min(960px, 94vw);
  }

  #screen-start .brand-mark:not(.brand-mark--landing-hero) {
    width: clamp(4.5rem, 5.5vw, 6rem);
  }

  .brand-mark--landing-hero {
    width: clamp(305px, 40vw, 655px);
    max-height: min(113vh, 728px);
  }

  #screen-start .card {
    width: min(960px, 100%);
    padding: 42px 42px 36px;
  }

  #screen-start .card.start-menu-panel-host {
    width: 100%;
    max-width: none;
    padding: 26px 32px;
  }

  #screen-start .brand h1 {
    font-size: clamp(2.48rem, 4.2vw, 3.52rem);
  }

  #screen-start .tagline {
    font-size: 1.68rem;
  }

  #screen-start .fineprint {
    max-width: 840px;
    font-size: 1.26rem;
  }

  #screen-start .field {
    font-size: 1.05rem;
    margin-bottom: 22px;
  }

  #screen-start .field span:first-child {
    font-size: 0.82rem;
  }

  .field-heading label {
    font-size: 0.82rem;
  }

  .telegram-get-id-btn {
    min-width: 104px;
    min-height: 48px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
  }

  .mp-gate-actions .mp-gate-connect-btn {
    min-width: calc(104px * var(--mp-connect-scale, 0.84));
    min-height: calc(48px * var(--mp-connect-scale, 0.84));
    padding: calc(10px * var(--mp-connect-scale, 0.84)) calc(18px * var(--mp-connect-scale, 0.84));
    border-radius: calc(12px * var(--mp-connect-scale, 0.84));
    font-size: calc(0.9rem * var(--mp-connect-scale, 0.84));
  }

  #screen-start .telegram-id-control input[type="text"] {
    padding-right: 136px;
  }

  #screen-start .muted.small {
    font-size: 1.02rem;
  }

  .mode-picker {
    gap: 18px;
  }

  .mode-picker > legend {
    font-size: 1.65rem;
    margin-bottom: 18px;
  }

  .mode-card {
    padding: 18px 21px;
    gap: 21px;
    border-radius: 16px;
  }

  .mode-card-media {
    width: 220px;
    min-width: 220px;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 14px;
  }

  .mode-card-copy {
    font-size: 1.32rem;
    line-height: 1.38;
    gap: 8px;
  }

  .mode-card-copy strong {
    font-size: 1.58rem;
  }

  .mode-beta-tag {
    padding: 2px 11px;
    font-size: 0.72rem;
  }

  .btn.mode-cta {
    font-size: 1.05rem;
    padding: 14px 18px;
  }

  #screen-start .field input[type="text"],
  #screen-start .field input[type="password"],
  #screen-start .field input[type="number"] {
    padding: 24px 24px;
    font-size: 1.68rem;
    border-radius: 14px;
  }

  #input-telegram-id::placeholder {
    font-size: 1.02rem;
  }

  #screen-start .btn.primary {
    padding: 24px 36px;
    font-size: 1.62rem;
    border-radius: 14px;
  }

  .asset-preload-track {
    height: 14px;
  }

  .asset-preload-text {
    font-size: 1.05rem;
  }

  #screen-start .text-link {
    font-size: 1.05rem;
  }

  /* Pilot Access (login): centered column, wider readable band on desktop */
  #menu-panel-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: min(920px, 96vw);
    margin-inline: auto;
    box-sizing: border-box;
  }

  #menu-panel-login > h2 {
    width: 100%;
    max-width: 22ch;
    margin-inline: auto;
  }

  #menu-panel-login .menu-panel-subtitle {
    width: 100%;
    max-width: min(52rem, 100%);
    margin-inline: auto;
    text-align: center;
  }

  #menu-panel-login #telegram-id-field {
    width: 100%;
    max-width: min(720px, 100%);
    margin-inline: auto;
  }

  #menu-panel-login .field-heading {
    justify-content: center;
  }

  #menu-panel-login .telegram-login-footer {
    max-width: min(720px, 100%);
    margin-inline: auto;
    gap: 1rem;
    margin-top: 0.75rem;
  }

  #menu-panel-login .telegram-auth-status {
    width: 100%;
    max-width: min(44rem, 100%);
    margin-inline: auto;
    text-align: center;
  }

  #menu-panel-login .login-bridge-icons {
    /* Desktop arrow spacing controls (edit these values). */
    --login-gap-logo-arrow: -30px; /* Shiba -> first arrow */
    --login-gap-arrow1-tg: 1px; /* First arrow -> TG */
    --login-gap-tg-arrow2: -5px; /* TG -> second arrow */
    --login-gap-arrow2-eth: -3px; /* Second arrow -> ETH */
    --login-bridge-shift-x: -24px;
    gap: clamp(14px, 2.2vw, 28px);
  }

  #menu-panel-login .login-bridge-icons__img {
    height: clamp(96px, 10vw, 136px);
    max-width: min(256px, 32vw);
  }

  #menu-panel-login .login-bridge-icons__img--logo {
    height: clamp(106px, 11.04vw, 150px);
    max-width: min(282px, 35.33vw);
  }

  #menu-panel-login .login-bridge-icons__img--tg {
    border-radius: 0;
    height: clamp(76px, 8vw, 104px);
    max-width: min(160px, 22vw);
  }

  #menu-panel-login .login-bridge-icons__img--eth {
    height: clamp(80px, 8.4vw, 108px);
    max-width: min(168px, 22vw);
  }

  #menu-panel-login .login-bridge-icons__arrow svg {
    width: clamp(48px, 5vw, 72px);
  }
}

/* Full-screen main menu: landing shows only nav; detail shows one panel + Back (no page scroll). */
#screen-start.screen-start-menu {
  /* Landing hero logo: tweak horizontal position (positive = farther right). */
  --start-menu-logo-nudge-x: 78px;
  justify-content: flex-start;
  align-items: stretch;
  padding: 0;
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: manipulation;
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

.menu-space-bg-root {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.start-menu-phase-landing .menu-space-bg-root {
  opacity: 1;
}

.start-menu-phase-detail .menu-space-bg-root {
  opacity: 0;
  visibility: hidden;
}

.menu-space-bg-root canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.start-menu-phase-detail .start-menu-nav {
  display: none !important;
}

.menu-entry-preview-root {
  display: none;
  position: absolute;
  inset: 0;
  left: 0;
  width: 100%;
  max-width: none;
  pointer-events: none;
  /* Behind nav/chrome so transparent rail can show GL across the whole viewport */
  z-index: 2;
}

.start-menu-phase-landing .menu-entry-preview-root {
  display: block;
}

.menu-entry-preview-root canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Landing: GL fills the viewport; rail stays readable via shadows (desktop + narrow). */
#screen-start.screen-start-menu.start-menu-phase-landing {
  background: transparent;
}

.start-menu-phase-landing .start-menu-nav {
  background: transparent;
  box-shadow: none;
}

.start-menu-phase-landing .start-menu-brand h1,
.start-menu-phase-landing .start-menu-brand .tagline {
  text-shadow:
    0 0 20px rgba(4, 8, 18, 0.95),
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 0 1px rgba(0, 0, 0, 1);
}

.start-menu-phase-landing .main-menu-btn {
  text-shadow:
    0 0 14px rgba(4, 8, 18, 0.92),
    0 1px 2px rgba(0, 0, 0, 0.88);
}

.start-menu-phase-landing .main-menu-btn.is-active {
  text-shadow:
    0 0 18px rgba(4, 10, 22, 0.95),
    0 0 10px rgba(124, 247, 255, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.9);
}

.start-menu-phase-landing .start-menu-nav__logo-hero .brand-mark--landing-hero {
  filter: drop-shadow(0 4px 22px rgba(0, 0, 0, 0.72)) drop-shadow(0 0 28px rgba(124, 247, 255, 0.12));
}

.start-menu-nav {
  position: relative;
  z-index: 4;
  flex: 1 1 auto;
  width: 100%;
  min-height: min(100dvh, 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  padding: calc(16px + var(--safe-top)) max(16px, env(safe-area-inset-right)) calc(20px + var(--safe-bottom))
    max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  background:
    radial-gradient(ellipse 90% 55% at 12% 12%, rgba(124, 247, 255, 0.12), transparent 50%),
    radial-gradient(ellipse 70% 45% at 95% 88%, rgba(255, 122, 24, 0.05), transparent 48%),
    linear-gradient(178deg, rgba(6, 10, 22, 0.98), rgba(3, 5, 12, 1));
  box-shadow: none;
}

.start-menu-nav__rail {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.start-menu-nav__logo-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  pointer-events: none;
}

/* Selected Astroverse profile (Asteroid) — above ASTROVERSE / tagline. */
.start-menu-brand > .start-menu-active-profile {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 6px;
  pointer-events: auto;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.start-menu-active-profile__ring {
  display: block;
  width: clamp(40px, 7.5vw, 52px);
  height: clamp(40px, 7.5vw, 52px);
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(124, 247, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 8px 22px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(124, 247, 255, 0.22);
  background: rgba(8, 14, 28, 0.9);
}

.start-menu-active-profile__avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picker-profile--add {
  gap: 0;
}

.brand-mark--landing-hero {
  display: block;
  width: clamp(232px, 47.32vw, 546px);
  height: auto;
  max-height: min(102vh, 619px);
  margin: 0;
  object-fit: contain;
}

.start-menu-phase-landing .start-menu-nav {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(12px, 3.5vw, 44px);
}

.start-menu-phase-landing .start-menu-nav__rail {
  flex: 1 1 auto;
  max-width: min(520px, 56%);
}

.start-menu-phase-landing .start-menu-nav__logo-hero {
  margin-left: 328px;
  align-self: center;
}

@media (max-width: 768px) {
  /*
   * Landing: nav + logo must stack above `.menu-entry-preview-root` (z-index 2) or the GL canvas hides them.
   * `start-menu-mobile-logo-bleed` on html/body is toggled from main.js while the landing menu is visible.
   *
   * Mobile hero logo horizontal tweak (desktop ignores this — it lives only inside this max-width block):
   *   On `#screen-start.screen-start-menu.start-menu-phase-landing`, change
   *   `--start-menu-logo-nudge-x-mobile` (e.g. 8px, 16px, 24px). Positive = farther right.
   */
  #screen-start.screen-start-menu.start-menu-phase-landing {
    --start-menu-logo-nudge-x-mobile: 0px;
  }

  html.start-menu-mobile-logo-bleed,
  body.start-menu-mobile-logo-bleed {
    overflow: visible !important;
    overscroll-behavior-x: none;
  }

  html.start-menu-mobile-logo-bleed #app {
    overflow: visible;
  }

  html.start-menu-mobile-logo-bleed #screen-start.screen.screen-start-menu.start-menu-phase-landing {
    overflow: visible !important;
    transform: none !important;
    touch-action: manipulation;
  }

  .start-menu-phase-landing .start-menu-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 18px;
    min-height: 100dvh;
    padding-bottom: min(44vh, 300px);
    overflow: visible;
    position: relative;
    z-index: 6;
  }

  .start-menu-phase-landing .start-menu-nav__rail {
    max-width: 100%;
    width: min(520px, 100%);
    flex: 0 0 auto;
  }

  /* Astroverse X hero logo — bottom-right empty area (above menu GL preview). */
  .start-menu-phase-landing .start-menu-nav__logo-hero {
    position: absolute;
    right: max(2px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: auto;
    top: auto;
    width: auto;
    max-width: min(58vw, 300px);
    margin: 0;
    padding: 0;
    justify-content: flex-end;
    align-items: flex-end;
    overflow: visible;
    z-index: 7;
    pointer-events: none;
  }

  .start-menu-phase-landing .start-menu-nav__logo-hero .brand-mark--landing-hero {
    width: clamp(152px, 50vw, 280px);
    max-height: min(40vh, 300px);
    opacity: 1;
    transform: none;
    will-change: auto;
  }
}

.start-menu-nav .start-menu-brand,
.start-menu-nav .main-menu-list {
  width: min(520px, 100%);
  max-width: 100%;
  align-self: flex-start;
}

.start-menu-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.65em;
  row-gap: 0.35em;
  text-align: left;
  padding: 6px 0 18px 2px;
}

.start-menu-brand .brand-mark {
  margin: 0 0 8px;
  align-self: flex-start;
}

.start-menu-brand h1 {
  font-size: clamp(1.12rem, 2.3vw, 1.6rem);
  margin-bottom: 6px;
}

.start-menu-brand .tagline {
  font-size: 0.86rem;
  line-height: 1.35;
}

.main-menu-list {
  display: grid;
  gap: 4px;
  width: 100%;
}

.main-menu-btn {
  position: relative;
  overflow: visible;
  isolation: isolate;
  width: 100%;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  border: none;
  outline: none;
  border-radius: 0;
  background: transparent;
  color: rgba(188, 210, 238, 0.82);
  font-family: "Syne", "Outfit", system-ui, sans-serif;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 12px 10px 12px 6px;
  text-align: left;
  cursor: pointer;
  transition: color 0.22s ease;
}

/* Left wash: solid cyan edge, sharp corners, fades right. */
.main-menu-btn::before {
  content: "";
  position: absolute;
  left: 0;
  right: -4px;
  top: 1px;
  bottom: 1px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  border: none;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    rgba(124, 247, 255, 0.52) 0%,
    rgba(124, 247, 255, 0.52) 3px,
    rgba(108, 220, 255, 0.38) 14%,
    rgba(124, 247, 255, 0.22) 30%,
    rgba(124, 247, 255, 0.12) 46%,
    rgba(124, 247, 255, 0.06) 60%,
    rgba(124, 247, 255, 0.028) 74%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 56%, transparent 90%);
  mask-image: linear-gradient(90deg, #000 0%, #000 56%, transparent 90%);
  box-shadow: inset 3px 0 0 transparent;
  transition:
    opacity 0.22s ease,
    box-shadow 0.22s ease;
}

.main-menu-btn > * {
  position: relative;
  z-index: 1;
}

.main-menu-btn:hover,
.main-menu-btn:focus-visible {
  color: rgba(236, 248, 255, 0.98);
  border: none;
  outline: none;
  box-shadow: none;
}

.main-menu-btn:hover::before,
.main-menu-btn:focus-visible::before {
  opacity: 1;
  box-shadow:
    inset 3px 0 0 rgba(168, 252, 255, 0.88),
    inset 0 0 0 1px rgba(124, 247, 255, 0.08);
}

.main-menu-btn.is-active {
  color: #f8feff;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
}

.main-menu-btn.is-active::before {
  opacity: 1;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    rgba(140, 252, 255, 0.62) 0%,
    rgba(140, 252, 255, 0.62) 4px,
    rgba(124, 247, 255, 0.46) 16%,
    rgba(124, 247, 255, 0.3) 32%,
    rgba(124, 247, 255, 0.18) 48%,
    rgba(124, 247, 255, 0.1) 62%,
    rgba(124, 247, 255, 0.045) 76%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 60%, transparent 92%);
  mask-image: linear-gradient(90deg, #000 0%, #000 60%, transparent 92%);
  box-shadow:
    inset 3px 0 0 rgba(210, 255, 255, 1),
    inset 0 0 0 1px rgba(124, 247, 255, 0.12),
    0 0 14px rgba(124, 247, 255, 0.14);
}

.main-menu-btn.is-active:hover,
.main-menu-btn.is-active:focus-visible {
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
}

.main-menu-btn.is-locked {
  position: relative;
  padding-right: 34px;
}

.main-menu-btn.is-locked::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  z-index: 2;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e1eeff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
  pointer-events: none;
}

.main-menu-btn.is-locked:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  filter: saturate(0.7);
}

.start-menu-phase-landing .start-menu-panel-host {
  display: none !important;
}

.start-menu-panel-host {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  max-width: none;
  border: none;
  border-radius: 0;
  background: rgba(4, 7, 14, 0.94);
  box-shadow: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: calc(10px + var(--safe-top)) max(14px, env(safe-area-inset-right))
    calc(14px + var(--safe-bottom)) max(14px, env(safe-area-inset-left));
  min-height: 0;
}

.start-menu-phase-detail .start-menu-panel-host:not(.hidden) {
  display: flex !important;
}

.menu-back-btn {
  position: relative;
  z-index: 8;
  flex: 0 0 auto;
  align-self: flex-start;
  width: auto;
  margin: 0 0 10px -2px;
  padding: 12px 10px 12px 6px;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(188, 210, 238, 0.82);
  font-family: "Syne", "Outfit", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition:
    color 0.14s ease,
    background 0.14s ease,
    outline 0.14s ease;
}

.menu-back-btn:hover,
.menu-back-btn:focus-visible {
  color: rgba(236, 248, 255, 0.94);
  background: rgba(124, 247, 255, 0.05);
  outline: none;
}

.menu-panel {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
}

#menu-panel-gamemodes {
  max-width: min(980px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#menu-panel-gamemodes .gamemodes-header {
  text-align: center;
  margin: 0 0 clamp(12px, 2.5vw, 18px);
}

#menu-panel-gamemodes .gamemodes-header h2 {
  margin: 0;
}

#menu-panel-gamemodes .gamemodes-subtitle {
  margin: 6px 0 0;
  font-size: clamp(0.78rem, 1.8vw, 0.92rem);
  line-height: 1.35;
  color: rgba(188, 212, 238, 0.82);
}

#menu-panel-gamemodes .mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 16px);
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

#menu-panel-gamemodes .mode-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(124, 247, 255, 0.22);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 38%, rgba(8, 12, 24, 0.72) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 8px 24px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

#menu-panel-gamemodes .mode-card:not(.is-locked):hover {
  transform: translateY(-2px);
  border-color: rgba(124, 247, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 28px rgba(0, 0, 0, 0.34),
    0 0 18px rgba(80, 210, 255, 0.12);
}

#menu-panel-gamemodes .mode-card::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(236, 248, 255, 0.55);
  background: rgba(4, 8, 18, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

#menu-panel-gamemodes .mode-card:has(input[type="radio"]:checked)::after {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: rgba(210, 255, 255, 0.95);
  background: linear-gradient(145deg, #9efcff, #4ed8ff);
  color: #041018;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 14px rgba(100, 230, 255, 0.55);
}

#menu-panel-gamemodes .mode-card-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(6, 10, 22, 0.85);
}

#menu-panel-gamemodes .mode-card-media-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(4, 8, 18, 0.72) 100%);
  pointer-events: none;
}

#menu-panel-gamemodes .mode-card-media {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  object-position: center 28%;
  border: none;
  border-radius: 0;
  background: rgba(8, 12, 24, 0.45);
  transition: transform 0.35s ease;
}

#menu-panel-gamemodes .mode-card:not(.is-locked):hover .mode-card-media {
  transform: scale(1.04);
}

#menu-panel-gamemodes .mode-card-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: clamp(10px, 2vw, 14px) clamp(11px, 2.2vw, 15px) clamp(12px, 2.2vw, 16px);
  font-size: clamp(0.74rem, 1.6vw, 0.84rem);
  line-height: 1.42;
  color: rgba(220, 232, 248, 0.86);
}

#menu-panel-gamemodes .mode-card-copy strong {
  font-size: clamp(0.88rem, 2vw, 1rem);
}

#menu-panel-gamemodes .mode-card-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  #menu-panel-gamemodes .mode-card,
  #menu-panel-gamemodes .mode-card-media {
    transition: none;
  }

  #menu-panel-gamemodes .mode-card:not(.is-locked):hover {
    transform: none;
  }

  #menu-panel-gamemodes .mode-card:not(.is-locked):hover .mode-card-media {
    transform: none;
  }
}

#menu-panel-gamemodes .gamemodes-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 920px;
  margin: clamp(12px, 2.5vw, 18px) auto 0;
  gap: 10px;
  box-sizing: border-box;
}

.mp-gate-panel {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 920px;
  margin: 14px auto 0;
  padding: 14px 16px;
  border: 1px solid rgba(124, 247, 255, 0.22);
  background:
    radial-gradient(circle at 12% 0%, rgba(124, 247, 255, 0.08), transparent 60%),
    linear-gradient(145deg, rgba(18, 22, 38, 0.78), rgba(8, 10, 20, 0.86));
  border-radius: 14px;
  color: #f1f3fb;
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.mp-gate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mp-gate-title {
  font-family: "Syne", "Outfit", sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

.mp-gate-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(124, 247, 255, 0.14);
  color: #7cf7ff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mp-gate-status-pill.is-ok {
  background: rgba(86, 220, 124, 0.18);
  color: #4ee08a;
}

.mp-gate-status-pill.is-blocked {
  background: rgba(255, 110, 110, 0.18);
  color: #ff8a8a;
}

.mp-gate-status-pill.is-loading {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(200, 214, 240, 0.85);
}

.mp-gate-requirement {
  margin: 0;
  color: rgba(200, 214, 240, 0.86);
  font-size: 0.84rem;
  line-height: 1.4;
}

.mp-gate-auth-row {
  display: grid;
  gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(124, 247, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.mp-gate-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mp-gate-auth-actions .mp-gate-connect-btn {
  --mp-connect-scale: 0.84;
  position: static;
  inset: auto;
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  transform: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: calc(82px * var(--mp-connect-scale));
  min-height: calc(34px * var(--mp-connect-scale));
  padding: calc(8px * var(--mp-connect-scale)) calc(13px * var(--mp-connect-scale));
  border-radius: calc(10px * var(--mp-connect-scale));
  font-size: calc(0.76rem * var(--mp-connect-scale));
  letter-spacing: calc(0.07em * var(--mp-connect-scale));
}

.mp-gate-auth-actions .mp-gate-connect-btn:active {
  transform: scale(0.97);
}

.mp-gate-auth-actions .mp-gate-connect-btn:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.mp-gate-code-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.mp-gate-input {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(124, 247, 255, 0.18);
  background: rgba(7, 11, 22, 0.88);
  color: #f1f3fb;
  padding: 0 14px;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  box-sizing: border-box;
}

.mp-gate-input::placeholder {
  color: rgba(200, 214, 240, 0.48);
}

.mp-gate-input:focus-visible {
  outline: none;
  border-color: rgba(124, 247, 255, 0.52);
  box-shadow: 0 0 0 3px rgba(124, 247, 255, 0.16);
}

.mp-gate-wallet-row,
.mp-gate-balance-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: rgba(200, 214, 240, 0.86);
  flex-wrap: wrap;
}

.mp-gate-wallet-address {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #7cf7ff;
  background: rgba(124, 247, 255, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.mp-gate-balance-required {
  color: rgba(200, 214, 240, 0.62);
  font-size: 0.72rem;
}

.mp-gate-balance-label,
.mp-gate-wallet-label {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.mp-gate-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mp-gate-tab {
  appearance: none;
  border: 1px solid rgba(124, 247, 255, 0.22);
  background: rgba(124, 247, 255, 0.06);
  color: rgba(200, 214, 240, 0.78);
  border-radius: 999px;
  padding: 7px 13px;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.mp-gate-tab.is-active {
  background: rgba(124, 247, 255, 0.16);
  border-color: rgba(124, 247, 255, 0.42);
  color: #7cf7ff;
}

.mp-gate-tab:disabled {
  opacity: 0.45;
  cursor: default;
}

.mp-gate-pane {
  display: grid;
  gap: 10px;
}

.mp-gate-history-list {
  display: grid;
  gap: 8px;
}

.mp-gate-history-card {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(124, 247, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.mp-gate-history-top,
.mp-gate-history-meta,
.mp-gate-history-winners {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.mp-gate-history-id {
  font-weight: 700;
  color: #f1f3fb;
}

.mp-gate-history-status {
  color: #7cf7ff;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mp-gate-history-meta,
.mp-gate-history-winners,
.mp-gate-muted {
  margin: 0;
  color: rgba(200, 214, 240, 0.7);
  font-size: 0.76rem;
  line-height: 1.45;
}

.mp-gate-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2px;
}

/* Same look as login “Get Code”, scaled down from Get Code (not absolutely positioned here). */
.mp-gate-actions .mp-gate-connect-btn {
  --mp-connect-scale: 0.84;
  position: static;
  transform: none;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  min-width: calc(82px * var(--mp-connect-scale));
  min-height: calc(34px * var(--mp-connect-scale));
  padding: calc(8px * var(--mp-connect-scale)) calc(13px * var(--mp-connect-scale));
  border-radius: calc(10px * var(--mp-connect-scale));
  font-size: calc(0.76rem * var(--mp-connect-scale));
  letter-spacing: calc(0.07em * var(--mp-connect-scale));
}

.mp-gate-actions .mp-gate-connect-btn:active {
  transform: scale(0.97);
}

.mp-gate-actions .mp-gate-connect-btn:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.mp-gate-link-btn {
  appearance: none;
  border: 1px solid rgba(124, 247, 255, 0.42);
  background: linear-gradient(135deg, #7cf7ff, #5b6dff);
  color: #050715;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.mp-gate-link-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 247, 255, 0.28);
}

.mp-gate-link-btn:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

.mp-gate-link-btn--ghost {
  background: transparent;
  color: #7cf7ff;
  border-color: rgba(124, 247, 255, 0.42);
}

.mp-gate-link-btn--ghost:hover {
  background: rgba(124, 247, 255, 0.08);
  box-shadow: none;
}

.mp-gate-error {
  margin: 0;
  color: #ff8a8a;
  font-size: 0.78rem;
}

#menu-panel-gamemodes #btn-enter-astroverse {
  width: 100%;
  max-width: 100%;
  padding: 10px 16px;
  font-size: 0.82rem;
  letter-spacing: 0.13em;
  display: inline-flex;
  justify-content: center;
}

#menu-panel-gamemodes .mode-card:has(input[type="radio"]:checked) {
  border-color: rgba(200, 255, 255, 0.88);
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(140, 250, 255, 0.22), transparent 58%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.1) 0%, rgba(12, 22, 38, 0.78) 100%);
  box-shadow:
    inset 0 1px 0 rgba(230, 255, 255, 0.45),
    inset 0 0 0 1px rgba(140, 240, 255, 0.38),
    0 0 0 1px rgba(100, 220, 255, 0.28),
    0 0 16px rgba(90, 235, 255, 0.28);
}

#menu-panel-gamemodes .mode-card.is-locked .mode-card-media-wrap::after {
  background: linear-gradient(180deg, rgba(4, 8, 18, 0.15) 0%, rgba(4, 8, 18, 0.82) 100%);
}

#menu-panel-onchainads {
  max-width: min(980px, 100%);
  margin: 0 auto;
}

.menu-panel-onchainads .onchain-ads-cta-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 clamp(18px, 3.5vw, 24px);
  padding-inline: clamp(8px, 2.5vw, 16px);
}

.menu-panel-onchainads .onchain-ads-cta-wrap .btn.mode-cta {
  width: min(620px, 100%);
}

.menu-panel-onchainads .astro-ads-catalog {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 22px);
  margin-bottom: 0;
}

.menu-panel-onchainads .astro-ads-tier {
  border-radius: 14px;
  padding: clamp(12px, 2.6vw, 16px);
  background: rgba(8, 12, 26, 0.55);
  border: 1px solid rgba(124, 247, 255, 0.2);
}

.menu-panel-onchainads .astro-ads-tier--zenith {
  border-color: rgba(124, 247, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(124, 247, 255, 0.06);
}

.menu-panel-onchainads .astro-ads-tier--core {
  border-color: rgba(255, 202, 77, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 202, 77, 0.07);
}

.menu-panel-onchainads .astro-ads-tier--nebule {
  border-color: rgba(179, 136, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(179, 136, 255, 0.07);
}

.menu-panel-onchainads .astro-ads-tier-title {
  margin: 0 0 4px;
  font-family: "Syne", "Outfit", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-panel-onchainads .astro-ads-tier-hint {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: rgba(198, 216, 238, 0.78);
  line-height: 1.35;
}

.menu-panel-onchainads .astro-ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}

.menu-panel-onchainads .astro-ads-empty {
  margin: 0;
  grid-column: 1 / -1;
  padding: 10px 4px;
  font-size: 0.82rem;
  color: rgba(198, 216, 238, 0.62);
  font-style: italic;
}

.menu-panel-onchainads .astro-ads-card {
  margin: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(4, 8, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-panel-onchainads .astro-ads-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.62;
  object-fit: cover;
  vertical-align: bottom;
}

.menu-panel-onchainads .astro-ads-thumb--broken {
  min-height: 72px;
  background: repeating-linear-gradient(
    -12deg,
    rgba(255, 202, 77, 0.12),
    rgba(255, 202, 77, 0.12) 8px,
    rgba(8, 12, 26, 0.5) 8px,
    rgba(8, 12, 26, 0.5) 16px
  );
}

.menu-panel-onchainads .astro-ads-card-title {
  padding: 6px 8px 8px;
  font-size: 0.68rem;
  line-height: 1.28;
  color: rgba(230, 236, 250, 0.88);
}

.menu-panel h2 {
  margin: 0 0 8px;
  font-family: "Syne", "Outfit", sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  letter-spacing: 0.04em;
}

.menu-panel-subtitle {
  margin: 0 0 14px;
  color: rgba(198, 216, 238, 0.86);
  font-size: 0.86rem;
}

.profile-shell {
  border: 1px solid rgba(124, 247, 255, 0.24);
  border-radius: 12px;
  padding: 14px;
  background: rgba(9, 15, 28, 0.7);
}

.profile-wallet-status {
  margin: 0 0 12px;
  color: #ff8a8a;
  font-size: 0.78rem;
  line-height: 1.35;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.profile-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(170, 194, 220, 0.82);
}

.profile-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-stat {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(124, 247, 255, 0.2);
  background: rgba(12, 20, 36, 0.75);
  display: grid;
  gap: 4px;
}

.profile-stat span {
  font-size: 0.72rem;
  color: rgba(180, 202, 228, 0.8);
}

.menu-dummy-list,
.menu-dummy-board {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: rgba(222, 237, 255, 0.9);
  font-size: 0.9rem;
}

.menu-dummy-board {
  padding-left: 0;
  list-style: none;
}

.menu-dummy-board li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(124, 247, 255, 0.18);
  border-radius: 10px;
  padding: 10px;
}

.menu-dummy-board em {
  font-style: normal;
  color: rgba(124, 247, 255, 0.9);
}

.menu-leaderboard-body {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.menu-leaderboard-section + .menu-leaderboard-section {
  margin-top: 10px;
}

.menu-leaderboard-heading {
  margin: 0 0 8px;
  color: rgba(232, 239, 255, 0.84);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu-leaderboard-placeholder {
  margin: 0;
  padding: 14px 12px;
  color: rgba(200, 214, 240, 0.72);
  font-size: 0.85rem;
  text-align: center;
  border: 1px dashed rgba(124, 247, 255, 0.18);
  border-radius: 10px;
}

.menu-leaderboard-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(124, 247, 255, 0.18);
  border-radius: 10px;
  background: rgba(12, 20, 36, 0.55);
}

.menu-leaderboard-row.is-top-1 {
  border-color: rgba(255, 215, 86, 0.45);
  background: linear-gradient(135deg, rgba(255, 215, 86, 0.16), rgba(12, 20, 36, 0.55));
}

.menu-leaderboard-row.is-top-2 {
  border-color: rgba(190, 220, 255, 0.38);
  background: linear-gradient(135deg, rgba(190, 220, 255, 0.14), rgba(12, 20, 36, 0.55));
}

.menu-leaderboard-row.is-top-3 {
  border-color: rgba(255, 164, 92, 0.38);
  background: linear-gradient(135deg, rgba(255, 164, 92, 0.13), rgba(12, 20, 36, 0.55));
}

.menu-leaderboard-row.is-you {
  outline: 1px solid rgba(124, 247, 255, 0.55);
}

.menu-leaderboard-rank {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: rgba(200, 214, 240, 0.72);
  font-weight: 700;
  font-size: 0.85rem;
}

.menu-leaderboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(222, 237, 255, 0.92);
  font-weight: 600;
  font-size: 0.86rem;
}

.menu-leaderboard-name small {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  font-size: 0.7rem;
  color: rgba(200, 214, 240, 0.62);
}

.menu-leaderboard-score {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  color: #7cf7ff;
}

.menu-leaderboard-cta {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(124, 247, 255, 0.4);
  color: #7cf7ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.menu-leaderboard-cta:hover {
  background: rgba(124, 247, 255, 0.08);
}

.menu-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  font-size: 0.84rem;
  color: rgba(224, 240, 255, 0.88);
}

.menu-toggle-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(124, 247, 255, 0.18);
  border-radius: 10px;
  padding: 10px;
  background: rgba(12, 20, 36, 0.68);
}

@media (max-width: 920px) {
  .start-menu-nav .main-menu-list {
    grid-template-columns: 1fr;
  }

  .main-menu-btn {
    font-size: 0.76rem;
    padding: 12px 10px 12px 6px;
    text-align: left;
  }

  .start-menu-panel-host {
    padding: calc(8px + var(--safe-top)) max(10px, env(safe-area-inset-right))
      calc(12px + var(--safe-bottom)) max(10px, env(safe-area-inset-left));
  }

  .menu-panel {
    width: 100%;
  }

  .start-menu-panel-host .mode-card,
  .start-menu-panel-host .mode-card--reverse {
    flex-direction: row;
    padding: 8px;
  }

}

@media (max-width: 680px) {
  #menu-panel-gamemodes .mode-picker {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

@media (max-width: 540px) {
  .mp-gate-header {
    gap: 6px;
  }

  .mp-gate-auth-row {
    padding: 12px;
  }

  .mp-gate-code-field {
    grid-template-columns: 1fr;
  }

  .mp-gate-title {
    font-size: 0.84rem;
  }

  .mp-gate-status-pill {
    padding: 2px 7px;
    font-size: 0.58rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
    transform: translateY(-2px);
  }

  #menu-panel-gamemodes .mode-card-media-wrap {
    aspect-ratio: 16 / 9;
  }

  #menu-panel-onchainads .onchain-ads-cta-wrap .btn.mode-cta {
    width: 100%;
    max-width: 100%;
  }
}

.admin-card h2,
.pause-card h2 {
  font-family: "Syne", sans-serif;
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.field span:first-child {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"] {
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 12px;
  font-size: 1rem;
  outline: none;
}

.field input[readonly] {
  color: rgba(244, 246, 255, 0.72);
  background: rgba(255, 255, 255, 0.025);
}

.field input:focus {
  border-color: rgba(124, 247, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(124, 247, 255, 0.2);
}

.field input[type="color"] {
  height: 44px;
  border: none;
  padding: 0;
  background: transparent;
}

.field.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.field.checkbox span {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
  color: var(--text);
}

.inline-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.grid-2 .span-2 {
  grid-column: span 2;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.btn {
  appearance: none;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
}

.btn.primary {
  background: linear-gradient(120deg, rgba(124, 247, 255, 0.25), rgba(255, 122, 24, 0.22));
  border-color: rgba(124, 247, 255, 0.35);
}

.btn.primary.glow {
  box-shadow: var(--glow);
}

.btn.ghost {
  background: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.text-link {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 0.88rem;
  padding: 8px;
}

.fineprint {
  max-width: 420px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.8rem;
  line-height: 1.4;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(10px + var(--safe-top)) 12px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  z-index: 4;
}

.hud-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: min(42vw, 198px);
  padding-right: 7px;
}

.hud .icon-btn {
  pointer-events: auto;
}

.hud-count-plain {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Same scale as coords; ~10% under prior coords clamp */
  font-size: clamp(0.56rem, 2.34vw, 0.68rem);
  font-weight: 500;
  color: rgba(200, 214, 240, 0.88);
  letter-spacing: 0.02em;
  padding-top: 2px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.hud-coords {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.56rem, 2.34vw, 0.68rem);
  font-weight: 500;
  color: rgba(200, 214, 240, 0.88);
  letter-spacing: 0.02em;
  line-height: 1.22;
  white-space: pre-line;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.hud-compass {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(10px + var(--safe-top));
  min-width: 40px;
  text-align: center;
  font-family: "Syne", "Outfit", sans-serif;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: clamp(0.95rem, 3.8vw, 1.15rem);
  color: #e8edf8;
  text-shadow: 0 0 14px rgba(124, 247, 255, 0.35);
  pointer-events: none;
}

/* Left-bottom toasts: same type as coords; sits above joystick padding. */
.alert-stack {
  position: absolute;
  left: max(10px, env(safe-area-inset-left));
  bottom: calc(18px + var(--safe-bottom) + 8dvh + 168px);
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  max-width: min(88vw, 300px);
  pointer-events: none;
}

.alert-stack.hidden {
  display: none;
}

.alert-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 6px;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.56rem, 2.34vw, 0.68rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.alert-line.alert-line--out {
  opacity: 0;
  transform: translateX(-8px);
}

@media (prefers-reduced-motion: reduce) {
  .alert-line {
    transition: opacity 0.25s ease;
  }

  .alert-line.alert-line--out {
    transform: none;
  }
}

.alert-name {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f4f7ff;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.alert-msg {
  color: rgba(200, 214, 240, 0.9);
  font: inherit;
  font-weight: 500;
}

.icon-btn {
  border-radius: 999px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--stroke);
  background: rgba(8, 10, 18, 0.55);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  isolation: isolate;
  pointer-events: none;
}

.controls > * {
  pointer-events: auto;
}

/* —— Desktop: centered joystick + action ring (keyboard + mouse) —— */
.controls.controls--desktop-center {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: auto;
  padding: 10px 24px calc(12px + var(--safe-bottom) + 10dvh);
  --stick-size: 120px;
  --stick-knob-size: 40px;
  --desktop-action-ring-radius: 118px;
  --desktop-action-btn-size: 46px;
}

.controls.controls--desktop-center .joystick-cluster {
  position: relative;
  left: auto;
  bottom: auto;
  width: var(--stick-size);
  height: var(--stick-size);
  flex: 0 0 auto;
  overflow: visible;
}

.controls.controls--desktop-center .joystick-cluster .action-pad-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}

.controls.controls--desktop-center .joystick-cluster .action-pad-ring .stick-action-btn {
  width: var(--desktop-action-btn-size);
  height: var(--desktop-action-btn-size);
  margin: calc(var(--desktop-action-btn-size) / -2) 0 0 calc(var(--desktop-action-btn-size) / -2);
  pointer-events: auto;
  transform: rotate(var(--btn-angle, 0deg)) translateX(var(--btn-radius, var(--desktop-action-ring-radius)))
    rotate(calc(-1 * var(--btn-angle, 0deg)));
}

.controls.controls--desktop-center .joystick-cluster .action-pad-ring .stick-action-btn:active {
  transform: rotate(var(--btn-angle, 0deg)) translateX(var(--btn-radius, var(--desktop-action-ring-radius)))
    rotate(calc(-1 * var(--btn-angle, 0deg))) scale(0.94);
}

/* Arc around stick: laser upper-left, nitro farther right, chat lower-right */
.controls.controls--desktop-center .joystick-cluster .action-pad-ring .stick-action-btn--laser {
  --btn-angle: -54deg;
  --btn-radius: 118px;
}

.controls.controls--desktop-center .joystick-cluster .action-pad-ring .stick-action-btn--nitro {
  --btn-angle: 0deg;
  --btn-radius: 136px;
  width: var(--desktop-action-btn-size);
  height: var(--desktop-action-btn-size);
  margin: calc(var(--desktop-action-btn-size) / -2) 0 0 calc(var(--desktop-action-btn-size) / -2);
}

.controls.controls--desktop-center .joystick-cluster .action-pad-ring .stick-action-btn--chat {
  --btn-angle: 54deg;
  --btn-radius: 118px;
}

.controls.controls--desktop-center .joystick-cluster .action-pad-ring .stick-action-btn--laser.is-firing,
.controls.controls--desktop-center .joystick-cluster .action-pad-ring .stick-action-btn--nitro.is-boosting {
  transform: rotate(var(--btn-angle, 0deg)) translateX(var(--btn-radius, var(--desktop-action-ring-radius)))
    rotate(calc(-1 * var(--btn-angle, 0deg))) scale(1.05);
}

/* —— Mobile: split thumb layout (tuned in /npc-settings) —— */
.controls.controls--touch-layout {
  height: 0;
  /* Defaults — overridden from /npc-settings via applyTouchControlsLayout */
  --stick-inset-left: 48px;
  --stick-inset-bottom: 10px;
  --controls-bottom-dvh: 8;
  --stick-size: 148px;
  --stick-knob-size: 52px;
  --action-btn-size: 56px;
}

.controls.controls--touch-layout .joystick-cluster {
  position: absolute;
  left: max(var(--stick-inset-left), env(safe-area-inset-left, 0px));
  bottom: calc(
    var(--stick-inset-bottom) + var(--safe-bottom) +
    var(--controls-bottom-lift, calc(var(--controls-bottom-dvh) * 1dvh))
  );
  width: var(--stick-size);
  height: var(--stick-size);
  overflow: visible;
}

.controls.controls--touch-layout .joystick-cluster .action-pad-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}

.controls.controls--touch-layout .stick-action-btn {
  width: var(--action-btn-size);
  height: var(--action-btn-size);
}

.controls.controls--touch-layout .joystick-cluster .action-pad-ring .stick-action-btn {
  position: absolute;
  left: 0;
  top: 0;
  margin: calc(var(--action-btn-size) / -2) 0 0 calc(var(--action-btn-size) / -2);
  pointer-events: auto;
  transform: rotate(var(--btn-angle, 0deg)) translateX(var(--btn-radius, 120px))
    rotate(calc(-1 * var(--btn-angle, 0deg)));
}

.controls.controls--touch-layout .joystick-cluster .action-pad-ring .stick-action-btn:active {
  transform: rotate(var(--btn-angle, 0deg)) translateX(var(--btn-radius, 120px))
    rotate(calc(-1 * var(--btn-angle, 0deg))) scale(0.92);
}

.controls.controls--touch-layout .joystick-cluster .action-pad-ring .stick-action-btn--nitro {
  width: calc(var(--action-btn-size) + 8px);
  height: calc(var(--action-btn-size) + 8px);
  margin: calc((var(--action-btn-size) + 8px) / -2) 0 0 calc((var(--action-btn-size) + 8px) / -2);
}

.stick-action-btn {
  position: relative;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  font-size: 0;
  color: rgba(124, 247, 255, 0.92);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  background: linear-gradient(168deg, rgba(21, 35, 68, 0.94) 0%, rgba(8, 14, 28, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(124, 247, 255, 0.24),
    inset 0 -2px 4px rgba(0, 0, 0, 0.4),
    0 6px 18px rgba(0, 0, 0, 0.45);
  transition:
    color 0.15s ease,
    filter 0.15s ease,
    transform 0.1s cubic-bezier(0.2, 0.9, 0.3, 1.1),
    box-shadow 0.15s ease;
}

.stick-action-btn:hover,
.stick-action-btn:focus-visible {
  color: #e8fbff;
  filter: drop-shadow(0 0 10px rgba(124, 247, 255, 0.35));
  outline: none;
}

.stick-action-btn:active {
  transform: scale(0.92);
}

.stick-action-btn--laser,
.stick-action-btn--chat {
  border: 1px solid rgba(124, 247, 255, 0.28);
}

.stick-action-btn--laser.is-firing {
  color: #e8fbff;
  border-color: rgba(124, 247, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(200, 244, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(124, 247, 255, 0.45),
    0 6px 18px rgba(0, 0, 0, 0.45);
}

.stick-action-btn--chat:disabled {
  color: rgba(110, 130, 145, 0.72);
  cursor: not-allowed;
  opacity: 0.72;
  filter: grayscale(0.45) brightness(0.88);
  border-color: rgba(90, 108, 120, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 3px 10px rgba(0, 0, 0, 0.38);
}

.stick-action-btn--chat:disabled:hover,
.stick-action-btn--chat:disabled:focus-visible {
  color: rgba(110, 130, 145, 0.72);
  filter: grayscale(0.45) brightness(0.88);
}

.stick-action-btn--chat:disabled:active {
  transform: none;
}

.stick-action-btn--nitro {
  color: rgba(255, 214, 120, 0.95);
  border: 1px solid rgba(255, 200, 90, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 190, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 0 16px rgba(255, 190, 70, 0.22),
    0 4px 14px rgba(0, 0, 0, 0.42);
}

.stick-action-btn--nitro:hover,
.stick-action-btn--nitro:focus-visible {
  color: #fff6d6;
  filter: drop-shadow(0 0 12px rgba(255, 200, 90, 0.35));
}

.stick-action-btn--nitro.is-boosting {
  color: #fff9e8;
  border-color: rgba(255, 220, 120, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 210, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(255, 180, 60, 0.45),
    0 6px 18px rgba(0, 0, 0, 0.45);
}

.controls.controls--touch-layout .joystick-cluster .action-pad-ring .stick-action-btn--laser.is-firing,
.controls.controls--touch-layout .joystick-cluster .action-pad-ring .stick-action-btn--nitro.is-boosting {
  transform: rotate(var(--btn-angle, 0deg)) translateX(var(--btn-radius, 120px))
    rotate(calc(-1 * var(--btn-angle, 0deg))) scale(1.05);
}

.stick-action-icon {
  display: block;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
}

.stick-zone {
  position: relative;
  z-index: 1;
  width: var(--stick-size);
  height: var(--stick-size);
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.stick-zone:active,
.stick-zone.is-active {
  cursor: grabbing;
}

/* Outer ambient glow */
.stick-base-outer {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 247, 255, 0.14) 0%, transparent 68%);
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.stick-zone.is-active .stick-base-outer {
  opacity: 1;
  transform: scale(1.04);
}

.stick-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(42, 58, 98, 0.55) 0%, transparent 52%),
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.45) 0%, transparent 55%),
    linear-gradient(165deg, rgba(14, 20, 38, 0.92) 0%, rgba(8, 12, 24, 0.96) 100%);
  border: 1.5px solid rgba(124, 247, 255, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 2px 12px rgba(124, 247, 255, 0.08),
    inset 0 -8px 28px rgba(0, 0, 0, 0.55),
    0 8px 32px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stick-zone.is-active .stick-base {
  border-color: rgba(124, 247, 255, 0.48);
  box-shadow:
    inset 0 2px 16px rgba(124, 247, 255, 0.14),
    inset 0 -8px 28px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(124, 247, 255, 0.12),
    0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Inner travel ring */
.stick-base-ring {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px dashed rgba(124, 247, 255, 0.14);
  pointer-events: none;
  opacity: 0.85;
}

.stick-knob {
  position: absolute;
  z-index: 3;
  width: var(--stick-knob-size);
  height: var(--stick-knob-size);
  left: 50%;
  top: 50%;
  margin-left: calc(var(--stick-knob-size) / -2);
  margin-top: calc(var(--stick-knob-size) / -2);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.08) 28%, transparent 42%),
    radial-gradient(circle at 50% 62%, rgba(124, 247, 255, 0.38) 0%, rgba(52, 118, 168, 0.55) 55%, rgba(18, 32, 58, 0.95) 100%);
  border: 1px solid rgba(200, 244, 255, 0.35);
  box-shadow:
    inset 0 -3px 8px rgba(0, 0, 0, 0.35),
    inset 0 2px 6px rgba(255, 255, 255, 0.22),
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 16px rgba(124, 247, 255, 0.15);
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.15s ease;
  will-change: transform;
}

.stick-knob.is-dragging {
  transition: none;
  box-shadow:
    inset 0 -3px 8px rgba(0, 0, 0, 0.35),
    inset 0 2px 6px rgba(255, 255, 255, 0.28),
    0 12px 32px rgba(0, 0, 0, 0.6),
    0 0 22px rgba(124, 247, 255, 0.28);
}

.stick-zone.is-active .stick-knob {
  border-color: rgba(220, 250, 255, 0.5);
}

.pause-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 420px) {
  .controls.controls--touch-layout .stick-action-icon {
    width: 26px;
    height: 26px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .stick-action-btn,
  .stick-knob,
  .stick-base,
  .stick-base-outer {
    transition: none;
  }
}

@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
  .hud-actions {
    bottom: calc(12px + var(--safe-bottom) + 10dvh + 86px);
  }

  .alert-stack {
    bottom: calc(18px + var(--safe-bottom) + 10dvh + 128px);
  }
}

/* —— Bottom-right HUD: bag / leaderboard / settings (sci-fi clipped chips) —— */
.hud-actions {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  bottom: calc(12px + var(--safe-bottom) + 8dvh + 228px);
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
}

.hud-actions .hud-action-btn {
  pointer-events: auto;
}

.hud-action-btn {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  margin: 0;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: rgba(124, 247, 255, 0.92);
  background: linear-gradient(168deg, rgba(21, 35, 68, 0.88) 0%, rgba(8, 14, 28, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(124, 247, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.42);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  transition:
    color 0.15s ease,
    filter 0.15s ease,
    transform 0.12s ease;
}

/* Outer chips only: slant the free edge; middle stays a square flush between them. */
.hud-action-btn:nth-child(1) {
  clip-path: polygon(0 11%, 100% 0, 100% 100%, 0 100%);
}

.hud-action-btn:nth-child(2) {
  clip-path: none;
}

.hud-action-btn:nth-child(3) {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 89%);
}

.hud-action-btn:hover,
.hud-action-btn:focus-visible {
  color: #e8fbff;
  filter: drop-shadow(0 0 10px rgba(124, 247, 255, 0.35));
  outline: none;
}

.hud-action-btn:active {
  transform: scale(0.96);
}

.hud-action-icon {
  display: block;
}

.hud-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  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));
  pointer-events: none;
}

.hud-modal-overlay:not(.hidden) {
  pointer-events: auto;
}

.hud-modal-scrim {
  position: absolute;
  inset: 0;
  background: transparent;
  cursor: pointer;
}

.hud-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  max-height: min(72vh, 520px);
  overflow: auto;
  padding: 18px 18px 16px;
  border: 1px solid rgba(124, 247, 255, 0.28);
  background: rgba(12, 14, 24, 0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 18px 48px rgba(0, 0, 0, 0.55);
  clip-path: polygon(0 10px, 10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px));
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .hud-modal-panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(12, 14, 24, 0.78);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hud-modal-overlay:not(.hidden) .hud-modal-panel {
    animation: hud-modal-in 0.2s ease-out;
  }
}

@keyframes hud-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hud-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(124, 247, 255, 0.28);
  border-radius: 6px;
  background: rgba(8, 10, 18, 0.55);
  color: rgba(124, 247, 255, 0.9);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.hud-modal-close:hover,
.hud-modal-close:focus-visible {
  background: rgba(124, 247, 255, 0.12);
  color: #f4fbff;
  outline: none;
}

.hud-modal-title {
  margin: 0 40px 12px 0;
  font-family: "Syne", "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232, 240, 255, 0.96);
  text-shadow: 0 0 18px rgba(124, 247, 255, 0.25);
}

.hud-modal-body {
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(200, 214, 240, 0.9);
}

.hud-modal-placeholder {
  margin: 0;
  color: var(--muted);
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.leaderboard-section + .leaderboard-section {
  margin-top: 18px;
}

.leaderboard-section-title {
  margin: 0 0 10px;
  color: rgba(232, 239, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.leaderboard-row:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 247, 255, 0.28);
  background: rgba(124, 247, 255, 0.07);
}

.leaderboard-row.is-top-1 {
  border-color: rgba(255, 215, 86, 0.5);
  background: linear-gradient(135deg, rgba(255, 215, 86, 0.2), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 18px rgba(255, 205, 70, 0.18);
}

.leaderboard-row.is-top-2 {
  border-color: rgba(190, 220, 255, 0.42);
  background: linear-gradient(135deg, rgba(190, 220, 255, 0.16), rgba(255, 255, 255, 0.04));
}

.leaderboard-row.is-top-3 {
  border-color: rgba(255, 164, 92, 0.42);
  background: linear-gradient(135deg, rgba(255, 164, 92, 0.15), rgba(255, 255, 255, 0.04));
}

.leaderboard-row.is-you {
  outline: 1px solid rgba(124, 247, 255, 0.55);
  box-shadow: 0 0 20px rgba(124, 247, 255, 0.18);
}

.leaderboard-rank,
.leaderboard-score {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.leaderboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-name small {
  display: block;
  margin-top: 2px;
  color: rgba(200, 214, 240, 0.72);
  font-size: 0.68rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-you {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(124, 247, 255, 0.16);
  color: rgba(124, 247, 255, 0.96);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* Multiverse Social — minimal sci-fi comms (top-right, glass, pilot colors in feed). */
.metaverse-chat {
  position: absolute;
  top: calc(8px + var(--safe-top));
  right: max(8px, env(safe-area-inset-right));
  z-index: 22;
  max-width: min(240px, 44vw);
  pointer-events: none;
}

.metaverse-chat__panel {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 7px 6px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(165deg, rgba(10, 18, 36, 0.19) 0%, rgba(4, 8, 18, 0.26) 100%);
  backdrop-filter: blur(8px) saturate(1.08);
  -webkit-backdrop-filter: blur(8px) saturate(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.metaverse-chat__feed {
  /* ~5 compact lines */
  max-height: calc(5 * 0.78rem + 6px);
  min-height: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 1px 2px;
  margin: 0 -1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 247, 255, 0.16) transparent;
}

.metaverse-chat__feed::-webkit-scrollbar {
  width: 4px;
}

.metaverse-chat__feed::-webkit-scrollbar-thumb {
  background: rgba(124, 247, 255, 0.12);
  border-radius: 99px;
}

.metaverse-chat__line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.45rem, 1.85vw, 0.52rem);
  line-height: 1.28;
  color: rgba(228, 236, 255, 0.82);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  word-break: break-word;
  padding: 2px 0;
  border-bottom: 1px solid rgba(124, 247, 255, 0.04);
}

.metaverse-chat__line:last-child {
  border-bottom: none;
}

.metaverse-chat__name {
  font-weight: 700;
}

.metaverse-chat__msg {
  font-weight: 400;
  color: rgba(232, 240, 255, 0.72);
}

.metaverse-chat__feed:empty::before {
  content: "Channel idle — tap chat on the stick";
  display: block;
  font-size: 0.48rem;
  font-style: italic;
  color: rgba(124, 247, 255, 0.22);
  padding: 4px 0 1px;
  letter-spacing: 0.02em;
}

.metaverse-chat__compose {
  margin-top: 2px;
}

.metaverse-chat__compose-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 7px;
  border: none;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: none;
}

.metaverse-chat__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: rgba(240, 246, 255, 0.88);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.58rem;
  outline: none;
  padding: 3px 2px;
}

.metaverse-chat__input::placeholder {
  color: rgba(124, 247, 255, 0.24);
}

.metaverse-chat__send-hint {
  flex-shrink: 0;
  font-size: 0.56rem;
  font-weight: 700;
  color: rgba(124, 247, 255, 0.3);
  user-select: none;
}

.metaverse-chat__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
