/* Uptown Run — style.css
   HUD, overlays, and zone-accented UI chrome. The game canvas lives in #app. */
:root {
  --font-display: 'Bungee', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Space Grotesk', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;

  --text: #f5f1e8;
  --muted: #a9a3b8;
  --line: rgba(255, 255, 255, 0.14);
  --panel: rgba(12, 14, 22, 0.62);

  /* Zone 0 — The Rooftop (golden hour) */
  --accent: #ff7a3c;
  --accent2: #ffd166;
}
body[data-zone="1"] { --accent: #ff3d5e; --accent2: #ffd166; }
body[data-zone="2"] { --accent: #5cffd8; --accent2: #ff5ad0; }
body[data-zone="3"] { --accent: #ffd166; --accent2: #8fa3ff; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }
body {
  background: #080a12;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app { position: fixed; inset: 0; }
#app canvas { display: block; }
#app::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 46%, transparent 52%, rgba(0, 0, 0, 0.52) 100%);
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

.hud-top {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 16px; right: 16px;
  display: flex; gap: 10px; justify-content: space-between;
}
.stat {
  flex: 1; max-width: 190px;
  padding: 9px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 2px;
}
.stat .label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.stat .value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 20px; line-height: 1.1; font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hearts {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  display: none; gap: 5px;
  font-size: 22px; line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}
body[data-chill="1"] .hearts { display: flex; }
.hearts span { color: rgba(255, 255, 255, 0.18); }
.hearts span.full { color: #ff3d5e; }

.boost {
  position: absolute;
  top: max(92px, calc(env(safe-area-inset-top) + 72px));
  left: 50%; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 999px;
  background: var(--accent); color: #0b0d16;
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0; transition: opacity 0.15s ease;
}
.boost.on { opacity: 1; animation: pulse 0.7s ease-in-out infinite alternate; }
@keyframes pulse {
  from { transform: translateX(-50%) scale(1); }
  to   { transform: translateX(-50%) scale(1.08); }
}

.zone-banner {
  position: absolute; top: 38%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 60px);
  letter-spacing: 0.04em;
  color: var(--text);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 32px var(--accent);
  opacity: 0; pointer-events: none;
  white-space: nowrap;
}
.zone-banner.show { animation: banner 2.2s ease forwards; }
@keyframes banner {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  12%  { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  22%  { transform: translate(-50%, -50%) scale(1); }
  78%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 50% 115%, rgba(255, 122, 60, 0.24), transparent 55%),
    radial-gradient(circle at 18% 0%, rgba(255, 61, 94, 0.16), transparent 46%),
    #0a0c15;
  transition: opacity 0.3s ease;
}
.overlay::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1.6px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000, transparent 76%);
  mask-image: radial-gradient(circle at 50% 42%, #000, transparent 76%);
}
.overlay.over { opacity: 0; pointer-events: none; }
.overlay.over.show { opacity: 1; pointer-events: auto; }

.panel {
  position: relative; z-index: 1;
  max-width: 700px; width: 100%;
  padding: 40px 28px;
  text-align: center;
}
.kicker {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.logo {
  font-family: var(--font-display);
  font-size: clamp(46px, 11vw, 104px);
  line-height: 0.92; letter-spacing: 0.03em;
  color: var(--text);
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.55), 0 0 42px var(--accent2);
  margin-bottom: 16px;
}
.logo span { color: var(--accent); }
.logo.sm { font-size: clamp(32px, 8vw, 60px); margin-bottom: 6px; }
.tagline {
  font-size: 17px; line-height: 1.5; color: var(--muted);
  max-width: 46ch; margin: 0 auto 26px;
}
.grace {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.06em; color: var(--muted);
  margin: 4px 0 20px;
}

.cta {
  display: inline-block; padding: 16px 36px; border: 0; border-radius: 12px;
  font-family: var(--font-body); font-size: 16px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: #0b0d16; background: var(--accent);
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.cta:hover { transform: translateY(-2px); }
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }

.chill {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 24px auto 16px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px; font-weight: 500;
}
.chill input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

.controls {
  display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center;
  margin-top: 22px;
}
.controls span { font-size: 12px; letter-spacing: 0.04em; color: var(--muted); }
.controls b { color: var(--text); font-family: var(--font-mono); font-weight: 700; }

.stats { display: flex; gap: 12px; justify-content: center; margin: 22px 0 28px; }
.stats div {
  min-width: 120px; padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stats dt { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stats dd {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 24px; font-weight: 700; color: var(--accent2);
  margin-top: 4px;
}
.hint { font-size: 12px; letter-spacing: 0.05em; color: var(--muted); margin-top: 14px; }

body.hurt #app { filter: brightness(1.35) saturate(1.4); }
