@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@600;700;800&family=Outfit:wght@500;600;700;800;900&display=swap");

:root {
  --bg: #05040c;
  --gold: #ffd56a;
  --gold-dim: rgba(255, 213, 106, 0.18);
  --pink: #ff2d95;
  --cyan: #00e5ff;
  --red: #e10600;
  --text: #f8fafc;
  --muted: #94a3b8;
  --panel: rgba(8, 6, 18, 0.78);
  --panel-solid: #0c0a16;
  --line: rgba(255, 255, 255, 0.12);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
}

#road {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

/* ——— Top chrome ——— */
.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(5, 4, 12, 0.94) 0%, rgba(5, 4, 12, 0.55) 55%, transparent 100%);
}

.brand {
  pointer-events: auto;
  text-align: center;
}

.brand-kicker {
  margin: 0 0 4px;
  font-family: "Orbitron", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.45);
}

.brand h1 {
  margin: 0;
  font-family: "Orbitron", monospace;
  font-size: clamp(0.72rem, 2.6vw, 1.05rem);
  line-height: 1.35;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255, 213, 106, 0.35), 2px 2px 0 #000;
  letter-spacing: 0.06em;
}

.brand p#tagline {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 440px;
  line-height: 1.35;
}

.links-pill {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.72rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  max-width: min(560px, 94vw);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.links-pill strong {
  color: var(--cyan);
  letter-spacing: 0.12em;
  font-size: 0.6rem;
  font-family: "Orbitron", monospace;
}

.links-pill #directLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
}

.links-pill a {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.15s;
}

.links-pill a:hover {
  color: var(--gold);
}

.stats-row {
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  max-width: min(560px, 96vw);
}

.stat {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-family: "Orbitron", monospace;
}

.stat em {
  font-style: normal;
  color: var(--gold);
  margin-right: 4px;
}

.stat.best em {
  color: var(--cyan);
}

/* Distance to next stop */
.next-meter {
  position: absolute;
  top: auto;
  left: 50%;
  bottom: calc(148px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 9;
  width: min(320px, 70vw);
  pointer-events: none;
}

.next-meter__label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 5px;
  text-shadow: 0 1px 4px #000;
}

.next-meter__track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  overflow: hidden;
}

.next-meter__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--gold), var(--pink));
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
  transition: width 0.12s linear;
}

/* ——— Bottom controls ——— */
.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 12px 14px calc(14px + var(--safe-b));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to top, rgba(5, 4, 12, 0.96) 0%, transparent 100%);
  pointer-events: none;
}

.target-banner {
  pointer-events: none;
  background: var(--panel);
  border: 2px solid rgba(255, 213, 106, 0.55);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--gold);
  box-shadow: 0 0 24px rgba(255, 213, 106, 0.12);
  min-height: 1.4em;
  text-align: center;
  backdrop-filter: blur(10px);
}

.target-banner.ready {
  border-color: var(--pink);
  color: #fff;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 32px rgba(255, 45, 149, 0.5);
  }
}

.controls {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.btn {
  appearance: none;
  border: 2px solid #000;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 72px;
  transition: transform 0.1s, filter 0.15s;
}

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

.btn-dir {
  background: linear-gradient(180deg, #2a3448, #141a28);
  color: #fff;
  border-color: #0a0e16;
  min-width: 64px;
  min-height: 52px;
  font-size: 1.2rem;
  box-shadow: 0 4px 0 #0a0e16, inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-boost {
  background: linear-gradient(180deg, #67e8f9, #0891b2);
  color: #042f2e;
  border-color: #0e7490;
  min-width: 72px;
  min-height: 52px;
  font-family: "Orbitron", monospace;
  font-size: 0.72rem;
  box-shadow: 0 4px 0 #0e7490, 0 0 16px rgba(0, 229, 255, 0.25);
}

.btn-boost.hot,
.btn-boost:active {
  background: linear-gradient(180deg, #a5f3fc, #22d3ee);
  box-shadow: 0 2px 0 #0e7490, 0 0 28px rgba(0, 229, 255, 0.55);
  filter: brightness(1.08);
}

.btn-boost:disabled {
  opacity: 0.35;
  filter: grayscale(0.5);
}

.btn-go {
  background: linear-gradient(180deg, #ffe566, #f59e0b);
  color: #1a0a00;
  box-shadow: 0 4px 0 #92400e, 0 0 20px rgba(245, 158, 11, 0.35);
  min-width: 140px;
  opacity: 0.4;
  pointer-events: none;
}

.btn-go.hot {
  opacity: 1;
  pointer-events: auto;
  animation: go-glow 1.2s ease infinite;
}

@keyframes go-glow {
  50% {
    box-shadow: 0 4px 0 #92400e, 0 0 36px rgba(255, 45, 149, 0.55);
  }
}

.hint {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.hint kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.65rem;
  font-family: inherit;
}

/* Toast popups (orb / nitro / perfect park) */
.toast {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 20;
  font-family: "Orbitron", monospace;
  font-weight: 800;
  font-size: clamp(0.85rem, 3vw, 1.15rem);
  letter-spacing: 0.08em;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255, 213, 106, 0.6), 0 2px 8px #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.35s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -70%);
}

.toast.orb {
  color: #fde68a;
}
.toast.nitro {
  color: #67e8f9;
}
.toast.park {
  color: #f9a8d4;
}

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .btn-dir {
    display: none;
  }
  .hint::after {
    content: " · Arrows / A D · Shift nitro · Enter";
  }
}

@media (hover: none), (pointer: coarse) {
  .btn-dir {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .hud-top {
    padding: calc(6px + var(--safe-t)) 10px 6px;
    gap: 4px;
  }
  .brand-kicker {
    display: none;
  }
  .brand h1 {
    font-size: clamp(0.5rem, 1.8vw, 0.75rem);
  }
  .brand p#tagline {
    display: none;
  }
  .stats-row {
    gap: 4px 6px;
  }
  .stat {
    font-size: 0.55rem;
    padding: 3px 7px;
  }
  .next-meter {
    bottom: calc(110px + var(--safe-b));
  }
  .hud-bottom {
    padding: 6px 12px calc(8px + var(--safe-b));
    gap: 6px;
  }
  .target-banner {
    padding: 5px 14px;
    font-size: 0.8rem;
  }
  .controls {
    gap: 10px;
  }
  .btn-dir,
  .btn-boost {
    min-width: 52px;
    min-height: 46px;
  }
  .btn-go {
    min-width: 120px;
    padding: 10px 12px;
    font-size: 0.78rem;
  }
}

@media (max-width: 520px) {
  .links-pill {
    display: none;
  }
  .brand p#tagline {
    font-size: 0.7rem;
    max-width: 220px;
  }
  .stat.best {
    display: none;
  }
}

/* Strip Club shame modal */
.shame-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.shame-modal.open {
  display: flex;
}

.shame-card {
  width: min(380px, 100%);
  text-align: center;
  background: linear-gradient(165deg, #1a1028 0%, #0a0614 100%);
  border: 2px solid #e11d48;
  border-radius: 18px;
  padding: 22px 18px 18px;
  box-shadow: 0 0 40px rgba(225, 29, 72, 0.35), 0 20px 50px rgba(0, 0, 0, 0.55);
  animation: shame-pop 0.4s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}

@keyframes shame-pop {
  from {
    transform: scale(0.75);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.shame-zinu-wrap {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 8px;
  overflow: visible;
}

.shame-zinu {
  height: 190px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.45));
  animation: shame-wiggle 0.7s ease-in-out infinite;
  transform-origin: 50% 90%;
}

@keyframes shame-wiggle {
  0%,
  100% {
    transform: rotate(-4deg) translateY(0);
  }
  50% {
    transform: rotate(5deg) translateY(4px);
  }
}

.shame-msg {
  margin: 8px 0 16px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  color: #fecdd3;
}

.shame-card .btn-go {
  opacity: 1;
  pointer-events: auto;
  width: 100%;
  max-width: 220px;
}
