/* Direction: Metro City neon-noir — asphalt night, amber street glow, condensed game HUD type */
/* Completed by the platform from the short form: both modes, every
   palette token, each text-on-ground pair at its floor. To restyle, write the
   short form again (the decisions in one :root) and it is completed again. */

:root {
  color-scheme: dark;
  --canvas: #0a0d12;
  --surface: #121823;
  --surface-2: #1a2230;
  --border: #283241;
  --border-strong: #545659;
  --ink: #eaf0f8;
  --muted: #9cabbd;
  --accent: #ffb524;
  --accent-hover: #ffc045;
  --accent-ink: #1a1203;
  --accent-text: #ffc654;
  --accent-strong: #ffcf7a;
  --accent-soft: #3a2a0c;
  --accent-border: #78591a;
  --success: #3fd68c;
  --success-ink: #ffffff;
  --success-soft: #16392d;
  --success-strong: #3fd68c;
  --warning: #ffc653;
  --warning-ink: #ffffff;
  --warning-soft: #403620;
  --warning-strong: #ffc653;
  --danger: #ff4d5e;
  --danger-ink: #ffffff;
  --danger-soft: #401b23;
  --danger-strong: #ff4d5e;
  --chart-1: #ffb524;
  --chart-2: #87d668;
  --chart-3: #2dc2c6;
  --chart-4: #95c0fe;
  --chart-5: #d284eb;
  --chart-6: #fca1a4;

  --font-display: "Teko", Impact, sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --display-weight: 600;
  --display-tracking: 0.01em;
  --radius-card: 12px;
  --radius-btn: 8px;
  --x-hud: rgba(10, 13, 18, 0.62);
  --x-hud-line: rgba(255, 181, 36, 0.35);
  --x-on-photo: #ffffff;
  --gradient-sky: linear-gradient(180deg, #16243a 0%, #0a0d12 70%);
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "Barlow", system-ui, sans-serif;
  --eyebrow-tracking: 0.08em;
}

html[data-theme="light"] {
  color-scheme: light;
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --border: #ddddde;
  --border-strong: #b6b6b8;
  --ink: #0a0d12;
  --muted: #6c6e71;
  --accent: #ffb524;
  --accent-hover: #d99a1f;
  --accent-ink: #0a0d12;
  --accent-text: #8f6614;
  --accent-strong: #8f6614;
  --accent-soft: #fff5e0;
  --accent-border: #ffde9c;
  --success: #3fd68c;
  --success-ink: #0a0d12;
  --success-soft: #e8faf1;
  --success-strong: #23794e;
  --warning: #ffc653;
  --warning-ink: #0a0d12;
  --warning-soft: #fff8ea;
  --warning-strong: #84662a;
  --danger: #ff4d5e;
  --danger-ink: #0a0d12;
  --danger-soft: #ffeaec;
  --danger-strong: #b73743;
  --chart-1: #be8722;
  --chart-2: #649e4c;
  --chart-3: #1b8c8e;
  --chart-4: #5c93e0;
  --chart-5: #965daa;
  --chart-6: #dd747b;
}

/* METRO CITY: STREET LEGENDS — game shell, HUD and touch controls */

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

#game-root {
  position: fixed;
  inset: 0;
  background: var(--gradient-sky);
}

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

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: var(--font-body);
}

.hud .clickable {
  pointer-events: auto;
}

.hud-panel {
  background: var(--x-hud);
  border: 1px solid var(--x-hud-line);
  border-radius: var(--radius-card);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.hud-label {
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1;
}

.hud-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
}

.bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition: width 0.28s ease-out;
}

.bar-xp > span {
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
}

.bar-health > span {
  background: linear-gradient(90deg, var(--danger), var(--warning));
}

.portrait {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--x-hud-line);
  background: radial-gradient(circle at 50% 30%, var(--accent-soft), var(--surface));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent-text);
}

#minimap {
  width: 148px;
  height: 148px;
  border-radius: 12px;
  border: 1px solid var(--x-hud-line);
  background: rgba(8, 11, 15, 0.8);
}

/* interaction prompt */
#prompt {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 1.5rem;
  line-height: 1.1;
  animation: prompt-pulse 1.5s ease-in-out infinite;
}

@keyframes prompt-pulse {
  0%,
  100% {
    transform: translate(-50%, 0) scale(1);
    border-color: var(--x-hud-line);
  }
  50% {
    transform: translate(-50%, -3px) scale(1.035);
    border-color: var(--accent);
  }
}

html.reduced-motion #prompt {
  animation: none;
}

/* mission objective panel */
#task-panel {
  max-height: 46vh;
  overflow: hidden;
}

#task-list li {
  line-height: 1.25;
}

#dialogue-card {
  border-left: 4px solid var(--accent);
}

#gps-arrow {
  display: inline-block;
  transition: transform 0.12s linear;
}

@media (max-width: 520px) {
  #task-panel {
    top: 5.75rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
  }
  #gps-panel {
    top: auto;
    bottom: 7.5rem;
  }
}

.keycap {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--x-hud-line);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-display);
}

/* ---------- touch controls ---------- */
#touch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#joy-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46%;
  height: 48%;
  pointer-events: auto;
}

#joy-base {
  position: absolute;
  width: 128px;
  height: 128px;
  margin: -64px 0 0 -64px;
  border-radius: 50%;
  border: 2px solid var(--x-hud-line);
  background: rgba(10, 13, 18, 0.45);
  opacity: 0;
  transition: opacity 0.15s linear;
}

#joy-base.on {
  opacity: 1;
}

#joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
}

.touch-btn {
  pointer-events: auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--x-hud-line);
  background: var(--x-hud);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.06em;
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
}

.touch-btn:active,
.touch-btn.held {
  background: var(--accent);
  color: var(--accent-ink);
}

.touch-btn.wide {
  width: 92px;
  height: 62px;
  border-radius: 16px;
}

/* ---------- overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: radial-gradient(circle at 50% 40%, rgba(10, 13, 18, 0.72), rgba(5, 7, 10, 0.95));
  backdrop-filter: blur(3px);
}

.overlay.hidden,
.hidden {
  display: none !important;
}

.menu-title {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  line-height: 0.88;
}

#cinematic {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  align-content: space-between;
}

#cinematic .bar-top,
#cinematic .bar-bottom {
  height: 12vh;
  background: #05070a;
}

#levelup-card {
  animation: lvl-pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes lvl-pop {
  from {
    transform: scale(0.72) translateY(18px);
  }
  to {
    transform: scale(1) translateY(0);
  }
}

#flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: var(--accent);
  mix-blend-mode: screen;
}

#flash.go {
  animation: flash-go 0.5s ease-out both;
}

@keyframes flash-go {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
  }
}

.toast-mission {
  animation: toast-in 0.4s ease-out both;
}

@keyframes toast-in {
  from {
    transform: translateY(-14px);
    opacity: 0.2;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

html.reduced-motion #levelup-card,
html.reduced-motion .toast-mission,
html.reduced-motion #flash.go {
  animation: none;
}

#loading-bar > span {
  background: var(--accent);
}
