/* Neon Drive — synthwave music + 3D drive experience */
:root {
  --nd-pink: #ff36b3;
  --nd-magenta: #ff00aa;
  --nd-purple: #9d4dff;
  --nd-cyan: #00d6ff;
  --nd-gold: #ffd400;
  --nd-deep: #0a001a;
}

.nd-page {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0a001a;
  color: #fff;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
}

.nd-fatal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: rgba(10, 0, 26, 0.95);
  color: #ff36b3;
  font-size: 1.1rem;
}

body.nd-active {
  overflow: hidden;
  background: #0a001a;
}

body.nd-active .header-top-news,
body.nd-active .rainbow-header,
body.nd-active .header-default,
body.nd-active .my_switcher,
body.nd-active .rainbow-footer,
body.nd-active .copyright-area,
body.nd-active .rbt-progress-parent,
body.nd-active .popup-mobile-menu {
  display: none !important;
}

body.nd-active .page-wrapper {
  padding: 0;
  margin: 0;
  background: #0a001a;
  overflow: hidden;
  min-height: 100vh;
}

body.nd-active main.page-wrapper {
  position: relative;
}

.nd-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

#nd-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

/* Vignette */
.nd-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}

/* Scanlines for retro CRT */
.nd-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* Top bar */
.nd-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 20px 26px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 0, 26, 0.55), transparent);
}

.nd-topbar > * { pointer-events: auto; }

.nd-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 0, 40, 0.7);
  border: 1px solid rgba(255, 54, 179, 0.35);
  color: var(--nd-pink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  box-shadow: 0 0 16px rgba(255, 54, 179, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nd-back:hover {
  background: rgba(40, 0, 80, 0.8);
  border-color: var(--nd-pink);
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 54, 179, 0.5);
}

.nd-brand {
  text-align: center;
  letter-spacing: 0.5em;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.nd-brand strong {
  display: block;
  font-size: 24px;
  letter-spacing: 0.18em;
  font-weight: 900;
  background: linear-gradient(180deg, #fff7c4 0%, #ffd400 30%, #ff36b3 70%, #9d4dff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 18px rgba(255, 54, 179, 0.7));
  font-family: 'Inter', system-ui, sans-serif;
}

.nd-bpm {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(20, 0, 40, 0.7);
  border: 1px solid rgba(0, 214, 255, 0.35);
  color: var(--nd-cyan);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 120px;
  text-align: center;
  font-weight: 700;
  text-shadow: 0 0 8px var(--nd-cyan);
}

.nd-bpm .beat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nd-cyan);
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 10px var(--nd-cyan);
  transition: transform 0.1s ease, background 0.1s ease;
}

.nd-bpm.is-pulse .beat-dot {
  transform: scale(1.7);
  background: var(--nd-pink);
  box-shadow: 0 0 18px var(--nd-pink);
}

/* Bottom toolbar */
.nd-toolbar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(15, 0, 30, 0.7);
  border: 1px solid rgba(255, 54, 179, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 0 32px rgba(255, 54, 179, 0.18);
}

.nd-tool {
  appearance: none;
  background: transparent;
  border: 1.5px solid transparent;
  color: rgba(255, 255, 255, 0.75);
  padding: 10px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  min-width: 80px;
  justify-content: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'Inter', system-ui, sans-serif;
}

.nd-tool .ico {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.nd-tool:hover {
  background: rgba(255, 54, 179, 0.12);
  color: #fff;
}

.nd-tool.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--nd-pink), var(--nd-purple));
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(255, 54, 179, 0.55);
}

.nd-tool[data-action="play"].is-on {
  background: linear-gradient(135deg, #00d6ff, #9d4dff);
  box-shadow: 0 0 22px rgba(0, 214, 255, 0.6);
  color: #fff;
}

.nd-toolbar .divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 3px;
}

/* Track selector */
.nd-tracks {
  position: fixed;
  right: 24px;
  bottom: 110px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(15, 0, 30, 0.78);
  border: 1px solid rgba(255, 54, 179, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: 'Courier New', monospace;
  box-shadow: 0 0 24px rgba(255, 54, 179, 0.15);
}

.nd-tracks-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 6px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--nd-pink);
  border-bottom: 1px solid rgba(255, 54, 179, 0.18);
  margin-bottom: 4px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
}

.nd-tracks-title i {
  color: var(--nd-cyan);
  filter: drop-shadow(0 0 6px var(--nd-cyan));
}

.nd-track-btn {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 150px;
}

.nd-track-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }

.nd-track-btn.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(255, 54, 179, 0.2), rgba(157, 77, 255, 0.2));
  border-color: rgba(255, 54, 179, 0.4);
}

.nd-track-btn .bpm-label {
  color: var(--nd-cyan);
  font-size: 10px;
}

/* Side help */
.nd-help {
  position: fixed;
  left: 24px;
  bottom: 26px;
  z-index: 25;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.08em;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: opacity 0.4s ease;
}

.nd-help.is-dim { opacity: 0.5; }

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

.nd-help kbd {
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
}

/* Intro / start prompt */
.nd-intro {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(40, 0, 80, 0.65) 0%, rgba(10, 0, 26, 0.95) 70%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.7s ease, visibility 0.7s ease;
  text-align: center;
  padding: 0 32px;
}

.nd-intro.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.nd-intro h1 {
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  background: linear-gradient(180deg, #fff7c4 0%, #ffd400 25%, #ff36b3 65%, #9d4dff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 30px rgba(255, 54, 179, 0.5));
  line-height: 0.95;
}

.nd-intro h1 .sub {
  display: block;
  font-size: 0.45em;
  letter-spacing: 0.5em;
  font-weight: 700;
  background: linear-gradient(90deg, var(--nd-cyan), var(--nd-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 8px;
  filter: drop-shadow(0 0 10px var(--nd-cyan));
}

.nd-intro p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.7);
  max-width: 580px;
  line-height: 1.55;
  margin: 0 0 28px;
}

.nd-intro-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--nd-pink), var(--nd-purple));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 0;
  cursor: pointer;
  box-shadow: 0 0 32px rgba(255, 54, 179, 0.65), 0 8px 28px rgba(157, 77, 255, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: 'Inter', system-ui, sans-serif;
  animation: nd-intro-pulse 2.5s ease-in-out infinite;
}

.nd-intro-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 50px rgba(255, 54, 179, 0.85), 0 12px 36px rgba(157, 77, 255, 0.5);
}

.nd-intro-btn i { font-size: 18px; }

@keyframes nd-intro-pulse {
  0%, 100% { box-shadow: 0 0 32px rgba(255, 54, 179, 0.55), 0 8px 28px rgba(157, 77, 255, 0.4); }
  50% { box-shadow: 0 0 56px rgba(255, 54, 179, 0.85), 0 8px 32px rgba(157, 77, 255, 0.55); }
}

.nd-intro-tip {
  margin-top: 22px;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
}

/* HUD speedometer */
.nd-hud {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  font-family: 'Courier New', monospace;
  text-align: right;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.nd-hud .stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.nd-hud .stat .label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.nd-hud .stat .value {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px var(--nd-cyan);
  color: var(--nd-cyan);
  font-variant-numeric: tabular-nums;
}

.nd-hud .stat[data-stat="speed"] .value { color: var(--nd-pink); text-shadow: 0 0 12px var(--nd-pink); }

/* ============================================================
   Run score badge (HTML element, not drawn on canvas)
   ============================================================ */

.nd-score {
  position: fixed;
  left: 24px;
  top: 78px;
  z-index: 25;
  padding: 10px 14px 8px;
  border-radius: 12px;
  background: rgba(10, 0, 22, 0.55);
  border: 1px solid rgba(255, 54, 179, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Inter', system-ui, sans-serif;
  pointer-events: none;
  box-shadow: 0 0 22px rgba(255, 54, 179, 0.12);
  min-width: 168px;
}

.nd-score .row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
}

.nd-score .row.main {
  margin-bottom: 4px;
}

.nd-score .lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 240, 200, 0.7);
}

.nd-score .val {
  font: 800 22px/1 'JetBrains Mono', 'Inter', system-ui, sans-serif;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(255, 54, 179, 0.55);
}

.nd-score .row.sub {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 214, 255, 0.72);
}

.nd-score .row.sub .dot { opacity: 0.4; }
.nd-score [data-best-val],
.nd-score [data-crash-val] { color: #fff; }

/* ============================================================
   On-screen driving controls — game-pad layout, edge-anchored.
   Left thumb: [lane-left | brake]   Right thumb: [boost | accel | lane-right]
   ============================================================ */

.nd-touch {
  position: fixed;
  bottom: 22px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.nd-touch-left  { left: 22px; }
.nd-touch-right { right: 22px; }

.nd-touch-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(15, 0, 30, 0.32);
  border: 1.5px solid rgba(255, 54, 179, 0.45);
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 0 14px rgba(255, 54, 179, 0.18),
    inset 0 0 10px rgba(255, 54, 179, 0.04);
  transition:
    transform 0.08s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  opacity: 0.78;
}

.nd-touch-btn:hover { opacity: 1; color: #fff; }

.nd-touch-btn:active,
.nd-touch-btn.is-pressed {
  opacity: 1;
  transform: scale(0.9);
  background: rgba(255, 54, 179, 0.42);
  border-color: var(--nd-pink);
  box-shadow:
    0 0 28px rgba(255, 54, 179, 0.7),
    inset 0 0 14px rgba(255, 54, 179, 0.25);
}

/* Lane buttons — larger, pink, edge-anchored, primary controls */
.nd-touch-lane {
  width: 72px;
  height: 72px;
  font-size: 26px;
  border-color: rgba(255, 54, 179, 0.55);
}
.nd-touch-lane:active,
.nd-touch-lane.is-pressed {
  background: rgba(255, 54, 179, 0.5);
  box-shadow:
    0 0 36px rgba(255, 54, 179, 0.8),
    inset 0 0 16px rgba(255, 54, 179, 0.3);
}

/* Brake — cyan */
.nd-touch-brake {
  border-color: rgba(0, 214, 255, 0.5);
  box-shadow: 0 0 14px rgba(0, 214, 255, 0.18);
}
.nd-touch-brake:active,
.nd-touch-brake.is-pressed {
  background: rgba(0, 214, 255, 0.42);
  border-color: var(--nd-cyan);
  box-shadow:
    0 0 28px rgba(0, 214, 255, 0.7),
    inset 0 0 14px rgba(0, 214, 255, 0.25);
}

/* Accel — gold */
.nd-touch-accel {
  border-color: rgba(255, 212, 0, 0.55);
  box-shadow: 0 0 14px rgba(255, 212, 0, 0.18);
}
.nd-touch-accel:active,
.nd-touch-accel.is-pressed {
  background: rgba(255, 212, 0, 0.38);
  border-color: var(--nd-gold);
  box-shadow:
    0 0 28px rgba(255, 212, 0, 0.7),
    inset 0 0 14px rgba(255, 212, 0, 0.25);
}

/* Boost — violet/pink */
.nd-touch-boost {
  border-color: rgba(157, 77, 255, 0.6);
  background: linear-gradient(135deg, rgba(157, 77, 255, 0.14), rgba(255, 54, 179, 0.14));
  box-shadow: 0 0 18px rgba(157, 77, 255, 0.28);
}
.nd-touch-boost:active,
.nd-touch-boost.is-pressed {
  background: linear-gradient(135deg, rgba(157, 77, 255, 0.65), rgba(255, 54, 179, 0.65));
  border-color: var(--nd-purple);
  box-shadow:
    0 0 34px rgba(157, 77, 255, 0.85),
    inset 0 0 16px rgba(157, 77, 255, 0.25);
}

/* Below 1024px (iPad and friends): tighten everything around the gameplay. */
@media (max-width: 1024px) {
  .nd-help { display: none; }
  .nd-tracks { bottom: 110px; padding: 6px; }
  .nd-track-btn { min-width: 130px; padding: 5px 10px; font-size: 10px; }
  .nd-hud { right: 16px; top: 80px; transform: none; gap: 6px; }
  .nd-hud .stat .value { font-size: 18px; }
  .nd-score { top: 70px; min-width: 0; padding: 8px 12px 6px; }
  .nd-score .val { font-size: 18px; }
}

@media (max-width: 767px) {
  .nd-topbar { padding: 12px 14px; }
  .nd-brand strong { font-size: 18px; }
  .nd-bpm { font-size: 10px; min-width: auto; padding: 6px 10px; }
  .nd-toolbar { bottom: 100px; flex-wrap: wrap; padding: 6px; gap: 3px; max-width: calc(100vw - 28px); justify-content: center; }
  .nd-tool { font-size: 10px; padding: 7px 10px; min-width: auto; letter-spacing: 0.05em; }
  .nd-tracks { display: none; }
  .nd-help { display: none; }
  .nd-hud { display: none; }
  .nd-intro h1 { letter-spacing: 0; }
  .nd-score {
    top: auto;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 6px 12px 5px;
    min-width: 0;
  }
  .nd-score .val { font-size: 14px; }
  .nd-score .row.sub { font-size: 9px; }
  .nd-touch { bottom: 14px; gap: 8px; }
  .nd-touch-left  { left: 14px; }
  .nd-touch-right { right: 14px; }
  .nd-touch-btn { width: 50px; height: 50px; font-size: 16px; }
  .nd-touch-lane { width: 58px; height: 58px; font-size: 20px; }
}
