:root {
  --bg: #0b0d12;
  --panel: rgba(16, 19, 27, 0.92);
  --panel-line: rgba(255, 255, 255, 0.08);
  --ink: #e9edf5;
  --ink-dim: #9aa3b2;
  --accent: #ffb84d;
  --accent-2: #6fd3ff;
  --good: #7ee787;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#world {
  position: fixed;
  inset: 0;
  z-index: 0;
}
#world canvas { display: block; touch-action: none; }

.hidden { display: none !important; }
.muted { color: var(--ink-dim); font-weight: 400; }

/* ===== Screens ===== */
.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(111, 211, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 80% 110%, rgba(255, 184, 77, 0.08), transparent 60%),
    var(--bg);
}

.intro-card, .win-card {
  width: min(560px, 100%);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  padding: 30px 30px 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.logo {
  font-size: 40px;
  letter-spacing: 0.22em;
  margin: 0 0 6px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { margin: 0 0 24px; color: var(--ink-dim); font-size: 15px; }

.field-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin: 18px 0 8px;
}

.input-row { display: flex; gap: 10px; }
#place-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  color: var(--ink);
  padding: 13px 14px;
  font-size: 14px;
  outline: none;
}
#place-input:focus { border-color: var(--accent-2); }

button { cursor: pointer; font-family: var(--font); }

.primary {
  background: linear-gradient(180deg, var(--accent), #f59e2b);
  color: #1a1206;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.primary:hover { filter: brightness(1.06); }
.primary:active { transform: translateY(1px); }

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  padding: 13px 20px;
  font-weight: 600;
}
.ghost:hover { border-color: var(--ink-dim); }

.presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.presets-label { color: var(--ink-dim); font-size: 13px; }
.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-line);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chip:hover { background: rgba(111, 211, 255, 0.12); border-color: var(--accent-2); }

.photo-field { margin-top: 4px; }
#photo-input { color: var(--ink-dim); font-size: 13px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--panel-line);
}

.fineprint { color: var(--ink-dim); font-size: 12px; margin: 22px 0 0; line-height: 1.5; }
.fineprint a { color: var(--accent-2); text-decoration: none; }
.fineprint a:hover { text-decoration: underline; }

/* ===== Home page — "drop a place, it comes alive" (mastermind redesign) ===== */
.intro-screen { padding: 0; overflow: hidden; }
.intro-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }

.intro-stack {
  position: relative; z-index: 1;
  width: min(640px, 90vw);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: transform 0.24s cubic-bezier(.4, 0, .2, 1), opacity 0.24s ease;
}
.intro-stack.handoff-lift { transform: translateY(-8px); opacity: 0; pointer-events: none; }

.wordmark {
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.42em; text-indent: 0.42em;
  color: var(--ink-dim); margin-bottom: 22px;
}
.intro-tagline {
  margin: 0 0 34px; font-weight: 600;
  font-size: clamp(24px, 4.4vw, 40px); line-height: 1.12; letter-spacing: -0.01em;
  color: var(--ink);
}

/* the hero field */
.field-wrap {
  position: relative; width: 100%;
  display: flex; align-items: center; gap: 12px; padding: 12px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  transition: border-color 0.3s ease, opacity 0.2s ease;
}
.field-wrap.is-valid { border-color: rgba(255, 184, 77, 0.25); }
.field-wrap.busy { opacity: 0.6; }

.headphones-hint {
  margin: 16px 0 0; font-size: 12.5px; color: var(--ink-dim);
  letter-spacing: 0.01em; opacity: 0.78;
}
.field-pin { color: var(--ink-dim); display: flex; flex: none; transition: color 0.3s ease; }
.field-wrap.is-valid .field-pin { color: var(--accent); }

#place-input.place-field {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none; box-shadow: none;
  color: var(--ink); caret-color: var(--accent); padding: 2px 0;
  font: 400 clamp(18px, 2.6vw, 24px)/1.3 var(--font);
}
#place-input.place-field::placeholder { color: transparent; }

.field-ghost {
  position: absolute; left: 38px; right: 56px;
  font: 400 clamp(18px, 2.6vw, 24px)/1.3 var(--font);
  color: var(--ink-dim); opacity: 0.6;
  text-align: left; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.2s ease;
}
.tw-caret {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -0.16em;
  background: var(--accent); animation: tw-blink 1.05s steps(1) infinite;
}
@keyframes tw-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.field-go {
  flex: none; width: 38px; height: 38px; border-radius: 999px;
  background: none; border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink-dim); font-size: 18px; line-height: 1;
  display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.08s;
}
.field-go:hover { color: var(--ink); border-color: var(--ink-dim); }
.field-go:active { transform: scale(0.94); }
.field-wrap.is-valid .field-go {
  color: #1a1206; background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 22px rgba(255, 184, 77, 0.35);
}

.field-seam {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: scaleX(0); transform-origin: left center; opacity: 0;
  transition: transform 0.5s cubic-bezier(.2, .7, .2, 1), opacity 0.3s ease;
}
.field-wrap.is-valid .field-seam { transform: scaleX(0.6); opacity: 0.5; }
.field-wrap.seam-go .field-seam { transform: scaleX(1); opacity: 1; transition: transform 0.22s ease-out; }

/* second tier — revealed once the field is engaged */
.intro-second {
  width: 100%; margin-top: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
/* Reveal on focus, and STAY revealed once engaged — a file dialog steals focus,
   which would otherwise drop :focus-within and hide (and un-click) the tier. */
#intro-stack:focus-within .intro-second,
#intro-stack.is-engaged .intro-second { opacity: 1; transform: none; pointer-events: auto; }

.preset-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 13.5px; }
.preset-lead { color: var(--ink-dim); }
.preset-line .chip {
  background: none; border: none; border-radius: 0; padding: 2px 0;
  color: var(--ink); font-size: 13.5px; border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.preset-line .chip:hover { color: var(--accent); border-bottom-color: var(--accent); background: none; }

.photo-add { font-size: 12.5px; color: var(--ink-dim); cursor: pointer; position: relative; }
.photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-add:hover { color: var(--ink); }
.intro-screen .fineprint { font-size: 11.5px; opacity: 0.75; margin: 4px 0 0; }

.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;
}

@media (prefers-reduced-motion: reduce) {
  .intro-second { opacity: 1; transform: none; pointer-events: auto; }
  .intro-stack, .field-seam, .field-ghost { transition: none; }
  .tw-caret { animation: none; }
}
@media (max-width: 560px) {
  .intro-stack { width: 92vw; }
  .field-ghost { left: 36px; right: 50px; }
}

/* ===== Loading — "The Survey" ===== */
/* Full-bleed amber survey canvas + a centred DOM overlay. The home flow-field
   continues with no cut; the donut survey-ring is drawn on the canvas. */
.loading-screen {
  padding: 0;
  background: #0b0d12; /* flat near-black — the canvas paints the world */
  transition: opacity 0.46s ease;
}
.loading-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto 1fr; /* mid row centres on the canvas ring */
  align-items: center;
  justify-items: center;
  text-align: center;
  padding: 24px;
  pointer-events: none;
}
.lo-mid { height: 46vmin; } /* clears the ring (radius 20vmin) above and below */
.lo-top { align-self: end; padding-bottom: 10px; }
.lo-bot {
  align-self: start;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto; /* the error "Back" button must be clickable */
}
.loading-title {
  font-size: clamp(20px, 3.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.01em;
}
#loading-place { color: var(--accent); }
.loading-step {
  font-size: clamp(15px, 2.2vw, 19px);
  font-weight: 600;
  color: var(--ink);
  min-height: 24px;
  font-variant-ligatures: none; /* steady width while the label decodes */
}
.loading-sub {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}
.loading-count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.loading-sub:empty, .loading-count:empty { display: none; }
.loading-error {
  margin-top: 14px;
  color: #ffb4b4;
  font-size: 13px;
  line-height: 1.5;
  max-width: 30ch;
}
.loading-error button { margin-top: 10px; }
/* crossfade out into the 3D scene (#world is always behind) */
#loading.leaving { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .loading-screen { transition: none; }
}

/* ===== HUD ===== */
.hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.7), transparent);
}
.hud-place {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  max-width: 40vw;
}
.hud-objectives { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; flex: 1; }
.obj-pill {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 6px 12px 6px 9px;
  font-size: 12.5px;
  color: var(--ink-dim);
  transition: all 0.25s ease;
}
.obj-pill .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink-dim);
  box-shadow: 0 0 0 transparent;
}
.obj-pill.found { color: var(--ink); border-color: rgba(126, 231, 135, 0.4); }
.obj-pill.found .dot { background: var(--good); box-shadow: 0 0 10px var(--good); }

.hud-buttons { display: flex; gap: 8px; pointer-events: auto; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}
.icon-btn:hover { border-color: var(--accent-2); color: var(--accent-2); }
.icon-btn.off { color: var(--ink-dim); opacity: 0.6; }

.street-sign {
  position: absolute;
  top: 62px;
  left: 18px;
  --sign-ink: #174a8b;
  --sign-line: rgba(23, 74, 139, 0.72);
  --sign-paper: rgba(252, 254, 255, 0.9);
  --sign-wash: rgba(23, 74, 139, 0.06);
  max-width: min(320px, 42vw);
  color: var(--sign-ink);
  transform: translateY(0);
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}
.street-sign.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
.street-sign[data-style="fr"] {
  --sign-ink: #173d7a;
  --sign-line: rgba(23, 61, 122, 0.72);
  --sign-wash: rgba(190, 31, 46, 0.07);
}
.street-sign[data-style="it"] {
  --sign-ink: #14633b;
  --sign-line: rgba(20, 99, 59, 0.72);
  --sign-wash: rgba(196, 43, 45, 0.07);
}
.street-sign[data-style="us"] {
  --sign-ink: #f3f7ef;
  --sign-line: rgba(243, 247, 239, 0.5);
  --sign-paper: rgba(21, 86, 62, 0.78);
  --sign-wash: rgba(255, 255, 255, 0.08);
}
.street-sign[data-style="global"] {
  --sign-ink: #d8e4ee;
  --sign-line: rgba(216, 228, 238, 0.38);
  --sign-paper: rgba(14, 20, 28, 0.58);
  --sign-wash: rgba(255, 255, 255, 0.05);
}
.street-sign-toggle {
  max-width: min(240px, 34vw);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(8, 10, 14, 0.34);
  color: rgba(232, 238, 246, 0.78);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  font-size: 11px;
  letter-spacing: 0.08em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
.street-sign-toggle:hover,
.street-sign-toggle:focus-visible {
  border-color: var(--sign-line);
  color: var(--ink);
}
.street-sign-panel {
  position: relative;
  margin-top: 8px;
  padding: 11px 35px 13px 16px;
  background:
    linear-gradient(135deg, var(--sign-paper), color-mix(in srgb, var(--sign-paper), var(--sign-wash) 55%));
  border: 2px solid var(--sign-line);
  border-radius: 9px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(7px);
}
.street-sign-collapsed .street-sign-panel {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}
.street-sign-close {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--sign-ink), transparent 25%);
  font-size: 18px;
  line-height: 1;
}
.street-sign-close:hover,
.street-sign-close:focus-visible {
  background: var(--sign-wash);
  color: var(--sign-ink);
}
.street-sign-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font: 700 9px Georgia, "Times New Roman", serif;
  color: color-mix(in srgb, var(--sign-ink), transparent 28%);
  margin-bottom: 3px;
}
.street-sign-name {
  font: 800 17px Georgia, "Times New Roman", serif;
  line-height: 1.12;
}
.street-sign-say {
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.35;
  color: color-mix(in srgb, var(--sign-ink), transparent 18%);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 19%;
  transform: translate(-50%, 16px);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 14px 18px;
  max-width: min(420px, 86vw);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .toast-item { font-weight: 700; color: var(--accent); margin-bottom: 3px; font-size: 14px; }
.toast .toast-lore { font-size: 13.5px; color: var(--ink); line-height: 1.5; }

.controls-hint {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  color: var(--ink-dim);
  font-size: 12px;
  background: rgba(8, 10, 14, 0.55);
  padding: 7px 14px;
  border-radius: 999px;
  transition: opacity 0.5s ease;
}

/* Places-discovered counter */
.places-count {
  display: flex; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--panel); border: 1px solid var(--panel-line);
  padding: 0 12px; height: 34px; border-radius: 999px;
  pointer-events: auto; white-space: nowrap;
  cursor: pointer; font-family: var(--font);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.places-count:hover { border-color: var(--accent-2); color: var(--accent-2); }

/* Viewfinder reticle for the "frame" mechanic */
.reticle {
  position: absolute; left: 50%; top: 50%;
  width: 132px; height: 132px; transform: translate(-50%, -54%);
  pointer-events: none;
}
.reticle-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25) inset;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.reticle::before, .reticle::after {
  content: ""; position: absolute; left: 50%; top: 50%; background: rgba(255, 255, 255, 0.5);
}
.reticle::before { width: 2px; height: 14px; transform: translate(-50%, -50%); }
.reticle::after { width: 14px; height: 2px; transform: translate(-50%, -50%); }
.reticle.locked .reticle-ring {
  border-color: var(--accent); transform: scale(0.82);
  box-shadow: 0 0 20px rgba(255, 184, 77, 0.5);
}

/* Current-step guidance banner with a directional cue */
.guide {
  position: absolute;
  top: 70px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  max-width: min(560px, 92vw);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 14px;
  transition: opacity 0.4s ease;
}
.guide .guide-arrow {
  font-size: 18px; line-height: 1;
  color: var(--accent);
  transition: transform 0.2s ease, color 0.3s ease;
}
.guide .guide-text { font-weight: 600; }
.guide .guide-warm { color: var(--accent); }
.guide .guide-cold { color: var(--ink-dim); }

/* A real place you walked past */
.place-card {
  position: absolute;
  left: 50%; bottom: 32%;
  transform: translate(-50%, 14px);
  display: flex; align-items: baseline; gap: 9px;
  background: rgba(12, 15, 21, 0.94);
  border: 1px solid var(--panel-line);
  border-left: 3px solid var(--accent-2);
  border-radius: 12px;
  padding: 11px 16px;
  max-width: min(420px, 86vw);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.place-card.show { opacity: 1; transform: translate(-50%, 0); }
.place-card .pc-name { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.place-card .pc-kind { font-size: 12.5px; color: var(--accent-2); white-space: nowrap; }
.place-card .pc-link { display: flex; align-items: baseline; gap: 9px; text-decoration: none; pointer-events: auto; }
.place-card .pc-go { font-size: 11.5px; color: var(--accent); margin-left: auto; padding-left: 6px; white-space: nowrap; }
.place-card .pc-link:hover .pc-name { color: var(--accent-2); }

/* Places journal — the real places you found, with links */
.places-panel {
  position: fixed; top: 0; right: 0; z-index: 30;
  width: min(380px, 90vw); height: 100%;
  background: var(--panel); border-left: 1px solid var(--panel-line);
  box-shadow: var(--shadow); backdrop-filter: blur(12px);
  padding: 26px 24px; overflow-y: auto;
  transform: translateX(0); transition: transform 0.3s ease;
}
.places-panel.hidden { transform: translateX(102%); display: block !important; }
.places-sub { color: var(--ink-dim); font-size: 13px; line-height: 1.5; margin: 0 0 18px; }
.places-list { list-style: none; padding: 0; margin: 0; }
.found-item {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--panel-line);
}
.found-item .fi-text { min-width: 0; }
.found-item .fi-name { font-weight: 600; font-size: 14px; color: var(--ink); display: block; }
.found-item .fi-kind, .found-item .fi-status { font-size: 12px; color: var(--ink-dim); display: block; }
.found-item .fi-status { color: var(--accent); margin-top: 2px; }
.found-item .fi-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex: none; }
.found-item .fi-links, .found-item .fi-votes { display: flex; gap: 10px; flex: none; }
.found-item .fi-links a {
  font-size: 12.5px; color: var(--accent-2); text-decoration: none; white-space: nowrap;
  border-bottom: 1px solid transparent; transition: border-color 0.15s ease;
}
.found-item .fi-links a:hover { border-bottom-color: var(--accent-2); }
.found-item .fi-votes button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  color: var(--ink-dim);
  font: 600 11.5px/1 var(--font);
  padding: 5px 8px;
}
.found-item .fi-votes button:hover,
.found-item .fi-votes button.active {
  border-color: var(--accent);
  color: var(--accent);
}
.found-empty { color: var(--ink-dim); font-size: 13.5px; padding: 8px 0; list-style: none; }

/* First-run tip card */
.intro-tip {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, 90vw);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  padding: 22px 24px 20px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  transition: opacity 0.45s ease;
}
.intro-tip .tip-title { font-size: 18px; font-weight: 800; margin-bottom: 12px; color: var(--ink); }
.intro-tip .tip-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.intro-tip .tip-list li { font-size: 13.5px; line-height: 1.5; color: var(--ink-dim); }
.intro-tip .tip-list b { color: var(--accent); font-weight: 700; }
.intro-tip .tip-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: var(--ink-dim);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.intro-tip .tip-close:hover { color: var(--ink); }
.kbd {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
}

/* OpenStreetMap attribution (ODbL) */
.osm-credit {
  position: absolute;
  bottom: 8px; right: 12px;
  font-size: 11px;
  color: var(--ink-dim);
  background: rgba(8, 10, 14, 0.55);
  padding: 4px 9px;
  border-radius: 6px;
  pointer-events: auto;
}
.osm-credit a { color: var(--ink-dim); text-decoration: underline; }
.osm-credit a:hover { color: var(--ink); }

/* touch joystick */
.joystick {
  position: absolute;
  left: 26px; bottom: 26px;
  width: 116px; height: 116px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-line);
  pointer-events: auto;
  touch-action: none;
}
.joystick-knob {
  position: absolute;
  left: 50%; top: 50%;
  width: 50px; height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: rgba(255, 184, 77, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

/* ===== Story panel ===== */
.story-panel {
  position: fixed;
  top: 0; right: 0;
  z-index: 30;
  width: min(380px, 90vw);
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--panel-line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 26px 24px;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.3s ease;
}
.story-panel.hidden { transform: translateX(102%); display: block !important; }
.story-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: var(--ink-dim);
  font-size: 26px;
  line-height: 1;
}
.story-close:hover { color: var(--ink); }
.story-title { font-size: 22px; margin: 4px 0 12px; line-height: 1.2; }
.story-intro { color: var(--ink); font-size: 14.5px; line-height: 1.6; margin: 0 0 22px; }
.story-beats { list-style: none; padding: 0; margin: 0; counter-reset: beat; }
.story-beats li {
  position: relative;
  padding: 0 0 20px 34px;
  counter-increment: beat;
}
.story-beats li::before {
  content: counter(beat);
  position: absolute;
  left: 0; top: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  display: grid; place-items: center;
  font-size: 12px;
  color: var(--ink-dim);
}
.story-beats li.found::before {
  content: "✓";
  border-color: var(--good);
  color: var(--good);
}
.story-beats .beat-item { font-weight: 700; font-size: 14px; }
.story-beats li.locked .beat-item { color: var(--ink-dim); }
.story-beats .beat-lore { font-size: 13px; color: var(--ink-dim); line-height: 1.5; margin-top: 4px; }
.story-beats li.locked .beat-lore { filter: blur(3px); user-select: none; }

/* ===== Win ===== */
.win-card { text-align: center; }
.win-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 12px;
}
.win-title { font-size: 28px; margin: 0 0 16px; line-height: 1.2; }
.win-resolution { color: var(--ink); font-size: 15px; line-height: 1.65; margin: 0 0 26px; }
.win-buttons { display: flex; gap: 12px; justify-content: center; }

@media (max-width: 560px) {
  .hud-objectives { display: none; }
  .street-sign {
    top: 124px;
    left: 50%;
    max-width: min(300px, 78vw);
    transform: translateX(-50%);
  }
  .street-sign-toggle { max-width: min(240px, 68vw); }
  .street-sign.hidden { transform: translate(-50%, -8px); }
  .guide {
    top: auto;
    right: 18px;
    bottom: calc(54px + env(safe-area-inset-bottom));
    left: 154px;
    transform: none;
    justify-content: flex-start;
    max-width: none;
    border-radius: 18px;
    padding: 10px 13px;
    font-size: 13px;
    line-height: 1.25;
  }
  .guide .guide-arrow {
    flex: 0 0 auto;
  }
  .guide .guide-text {
    min-width: 0;
  }
  .controls-hint { display: none; }
  .logo { font-size: 32px; }
}
