/* ============================================================
   CSS VARIABLES — 8-bit pixel-art design system
   Edit these to retheme the whole app.
============================================================ */
:root {
  /* --- Core palette — SUN-FADED ANALOG NOSTALGIA (espresso + terracotta,
         cream game-map paper, DMG olive-green LCD) --------------------- */
  --c-ink:        #201320;   /* espresso-plum, terracotta-tinged (app bg) */
  --c-ink-2:      #2c1a29;   /* warmer raised bg (gradient top)          */
  --c-espresso:   #150b11;   /* deepest brown-plum vignette              */
  --c-panel:      #2f1d2c;   /* warm plum-brown HUD panel surface        */
  --c-panel-2:    #452a3d;   /* raised warm plum-clay / hover            */
  --c-cream:      #f7ecd4;   /* warm parchment text on dark              */
  --c-white:      #fff4e4;   /* warm pixel highlight                     */
  --c-rose:       #ff5277;   /* signature accent (Rose)                  */
  --c-gold:       #ffcf4d;   /* score / sparkle                          */
  --c-amber:      #ffb457;   /* paper-lantern warm amber glow            */
  --c-cyan:       #33e1d2;   /* arcade-cabinet cyan/teal (avatar accent) */
  --c-black:      #120a0d;   /* outlines & hard shadow (warm espresso)   */

  /* --- Analog era accents ------------------------------------------- */
  --c-terracotta:  #c4623a;  /* sun-baked clay / CRT-lit terracotta      */
  --c-terracotta-2:#e07d4c;  /* terracotta highlight                     */
  --c-parchment:   #f0dfb0;  /* SMB3 game-map paper surface (warm tan)   */
  --c-parchment-2: #e3cc92;  /* parchment shade / tile lines             */
  --c-parch-ink:   #4a2f1e;  /* dark espresso-brown ink on parchment     */
  --c-parch-ink-2: #7a5433;  /* softer brown ink on parchment            */
  --c-lcd:         #a7b45f;  /* Game Boy DMG olive LCD (screen light)    */
  --c-lcd-2:       #c2cd86;  /* LCD lit highlight                        */
  --c-lcd-dark:    #3c4a24;  /* LCD dark text / pixels                   */
  --c-lcd-deep:    #263019;  /* LCD deepest shade                        */
  --c-led:         #6cff7a;  /* power/battery LED (ON)                   */

  /* --- Ambient glow presets (bloom around light sources) --- */
  --glow-rose:  0 0 10px rgba(255, 82, 119, 0.55);
  --glow-amber: 0 0 12px rgba(255, 180, 87, 0.45);
  --glow-gold:  0 0 12px rgba(255, 207, 77, 0.5);
  --glow-cyan:  0 0 10px rgba(51, 225, 210, 0.5);
  --glow-lcd:   0 0 12px rgba(167, 180, 95, 0.45);

  /* --- Category colours (kept distinguishable) --- */
  --c-cafe:       #ff9b42;   /* orange     */
  --c-restaurant: #ff5277;   /* rose-red   */
  --c-bar:        #3fa9f5;   /* blue       */
  --c-hotel:      #ffcf4d;   /* gold       */
  --c-activity:   #4fd06a;   /* green      */
  /* --- Extended category colours (added for the 4 unstyled cats) --- */
  --c-event:      #b76bff;   /* violet     */
  --c-travel:     #29e0d0;   /* teal/cyan  */
  --c-shopping:   #ff8fc7;   /* bubblegum pink */
  --c-clinic:     #9fe85a;   /* lime       */
  --c-theatre:    #ff7a3c;   /* burnt amber */

  /* --- Legacy aliases (used by inline legend/chip refs) --- */
  --color-cafe:       var(--c-cafe);
  --color-restaurant: var(--c-restaurant);
  --color-bar:        var(--c-bar);
  --color-hotel:      var(--c-hotel);
  --color-activity:   var(--c-activity);

  /* --- Layout --- */
  --drawer-width:   400px;
  --sheet-height:   74vh;
  --header-height:  56px;

  /* --- Type --- */
  --font-hud:  "Press Start 2P", monospace;      /* headings / HUD labels — small sizes only */
  --font-body: "VT323", "Courier New", monospace; /* body text                              */

  --transition-drawer: 0.28s steps(6, end);
  --hard-shadow: 6px 6px 0 rgba(10, 8, 18, 0.45);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Global focus-visible — retro gold/rose outline for all interactive
   elements. Specific rules (fchip, filter-city) override below.
   Consistent with the pixel-art aesthetic: flat 2px solid outline,
   small offset so it clears the pixel borders. ────────────────────── */
button:focus-visible,
[role="button"]:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}
/* Leaflet marker containers — keyboard-focusable divs */
.leaflet-marker-icon:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  /* Warm "terracotta room lit by a CRT" wash — a sun-faded clay pool up top,
     espresso-plum falling to the corners. Sun-faded analog nostalgia. */
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(196, 98, 58, 0.16) 0%, transparent 44%),
    radial-gradient(120% 80% at 50% 8%, rgba(255, 180, 87, 0.06) 0%, transparent 40%),
    radial-gradient(92% 82% at 50% 36%, var(--c-ink-2) 0%, var(--c-ink) 46%, var(--c-espresso) 100%);
  background-color: var(--c-ink);
  color: var(--c-cream);
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
  text-rendering: geometricPrecision;
}

body {
  display: flex;
  flex-direction: column;
}

/* Warm film grain — fine noise so the darks feel lived-in, not flat 8-bit.
   Sits under vignette + scanlines; pointer-events none so nothing is blocked. */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1998;
  opacity: 0.05;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Warm CRT vignette — corners fall into espresso, faint amber bloom at centre,
   plus a very slight screen-curve feel. Cozy depth without hurting legibility. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1999;
  background:
    radial-gradient(70% 55% at 50% 40%, rgba(196, 98, 58, 0.06) 0%, transparent 55%),
    radial-gradient(135% 115% at 50% 46%, transparent 50%, rgba(24, 12, 18, 0.44) 82%, rgba(15, 8, 12, 0.72) 100%);
}

/* Global scanline overlay — fine CRT lines, warmed, never over hit-targets */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  background: repeating-linear-gradient(
    to bottom,
    rgba(14, 9, 19, 0.06) 0px,
    rgba(14, 9, 19, 0.06) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

/* ============================================================
   HEADER — game title bar
============================================================ */
header {
  height: var(--header-height);
  /* warm plum cabinet face with a soft amber inner top-light */
  background:
    linear-gradient(180deg, rgba(255, 180, 87, 0.07) 0%, transparent 30%),
    var(--c-panel);
  border-bottom: 4px solid var(--c-black);
  box-shadow: inset 0 3px 0 rgba(255, 240, 210, 0.07),
              inset 0 -3px 0 rgba(0, 0, 0, 0.4),
              inset 0 -5px 0 rgba(255, 82, 119, 0.18),  /* neon rose underline */
              0 4px 22px rgba(12, 7, 18, 0.55);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  z-index: 1000;
  flex-shrink: 0;
}

.header-mark {
  width: 30px;
  height: 30px;
  background: var(--c-rose);
  color: var(--c-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hud);
  font-size: 12px;
  flex-shrink: 0;
  /* pixel-notched border via layered box-shadow + warm rose bloom */
  box-shadow:
    0 -4px 0 0 var(--c-black), 0 4px 0 0 var(--c-black),
    -4px 0 0 0 var(--c-black), 4px 0 0 0 var(--c-black),
    4px 4px 0 0 rgba(10, 8, 18, 0.5),
    0 0 14px rgba(255, 82, 119, 0.55);
  animation: sign-flicker 7s steps(1, end) infinite;
}
/* occasional neon-sign flicker — mostly steady, tiny dips */
@keyframes sign-flicker {
  0%, 88%, 92%, 97%, 100% { filter: brightness(1); }
  90%, 96%                { filter: brightness(0.72); }
  91%                     { filter: brightness(1.18); }
}

.header-title {
  font-family: var(--font-hud);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--c-white);
  text-shadow: 2px 2px 0 var(--c-black), 0 0 12px rgba(255, 207, 77, 0.3);
  white-space: nowrap;
}

/* blinking cursor after the title */
.header-cursor {
  display: inline-block;
  width: 9px;
  height: 15px;
  background: var(--c-rose);
  box-shadow: var(--glow-rose);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s steps(1, end) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* score counter */
.header-pill {
  font-family: var(--font-hud);
  font-size: 10px;
  color: var(--c-gold);
  background: var(--c-ink);
  padding: 7px 10px;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--c-black), 0 0 10px rgba(255, 207, 77, 0.4);
  box-shadow:
    0 -3px 0 0 var(--c-black), 0 3px 0 0 var(--c-black),
    -3px 0 0 0 var(--c-black), 3px 0 0 0 var(--c-black),
    inset 0 0 10px rgba(255, 207, 77, 0.12);
  white-space: nowrap;
}

.header-spacer { flex: 1; }

.header-location {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--c-cream);
  letter-spacing: 1px;
  opacity: 0.8;
  white-space: nowrap;
}

/* ============================================================
   MAP WRAP
============================================================ */
#map-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--c-ink);
}

#map {
  width: 100%;
  height: 100%;
  transition: margin-right var(--transition-drawer);
  background: var(--c-ink);
}

#map.drawer-open {
  margin-right: var(--drawer-width);
}

/* Sun-faded cast on the real tiles — sepia-warmed like an old game-map,
   legibility preserved. */
.leaflet-tile {
  filter: saturate(1.08) contrast(1.04) brightness(0.94) sepia(0.34) hue-rotate(-12deg);
}

/* Subtle CRT-TV bezel — the map sits inside a faintly curved glass tube.
   Kept low-contrast so the map stays immersive and fully legible; darkens
   the extreme corners and adds a hairline inner rim + top glass sheen. */
#map-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 640;              /* under filter HUD (905) & drawer (800) */
  pointer-events: none;
  box-shadow:
    inset 0 0 0 2px rgba(18, 10, 13, 0.55),
    inset 0 0 3px 3px rgba(18, 10, 13, 0.35),
    inset 0 26px 60px -30px rgba(255, 236, 196, 0.10),   /* top glass sheen */
    inset 0 0 120px 40px rgba(21, 11, 17, 0.30);         /* corner tube fall-off */
}

/* ── VHS camcorder OSD — a "● REC / 3:00 AM" timestamp, bottom-right.
   Glowing bitmap-style overlay; a rare era detail, kept to one corner. */
.vhs-stamp {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 760;                    /* under the drawer (800) when it opens */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  pointer-events: none;
  font-family: var(--font-body);
  text-transform: uppercase;
  color: #fff6e6;
  text-shadow: 0 0 7px rgba(255, 244, 228, 0.55), 1px 1px 0 rgba(0, 0, 0, 0.65);
  letter-spacing: 1px;
  opacity: 0.9;
  animation: vhs-jitter 7s steps(1, end) infinite;
}
.vhs-rec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  line-height: 1;
}
.vhs-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff3b3b;
  box-shadow: 0 0 8px 2px rgba(255, 59, 59, 0.85);
  animation: blink 1.1s steps(1, end) infinite;
}
.vhs-time { font-size: 25px; line-height: 1; }
.vhs-tape {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.62;
  line-height: 1;
}
@keyframes vhs-jitter {
  0%, 96%, 100% { transform: translateX(0); }
  97%           { transform: translate(-1px, 0.5px); }
  98%           { transform: translate(1px, -0.5px); }
  99%           { transform: translate(-0.5px, 0); }
}

/* Leaflet chrome restyled as pixel HUD bits */
.leaflet-control-attribution {
  font-family: var(--font-body) !important;
  font-size: 12px !important;
  background: rgba(26, 17, 40, 0.85) !important;
  color: var(--c-cream) !important;
  border: 2px solid var(--c-black) !important;
  padding: 1px 6px !important;
}
.leaflet-control-attribution a { color: var(--c-rose) !important; }

.leaflet-bar {
  border: none !important;
  box-shadow: none !important;
}
/* zoom +/- as a stacked d-pad key: top-lit bevel, hard shadow, real press */
.leaflet-bar a {
  background:
    linear-gradient(180deg, rgba(255, 244, 228, 0.16) 0%, transparent 38%),
    var(--c-panel-2) !important;
  color: var(--c-cream) !important;
  font-family: var(--font-hud) !important;
  font-size: 12px !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  border: 3px solid var(--c-black) !important;
  border-bottom-width: 3px !important;
  margin-bottom: 5px;
  box-shadow:
    inset 0 2px 0 rgba(255, 244, 228, 0.18),
    inset 0 -3px 0 rgba(18, 10, 13, 0.5),
    0 3px 0 var(--c-black),
    0 4px 0 rgba(18, 10, 13, 0.4) !important;
  transition: transform 0.05s steps(1, end);
}
.leaflet-bar a:hover { filter: brightness(1.12); }
.leaflet-bar a:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 0 rgba(255, 244, 228, 0.1),
    inset 0 -2px 0 rgba(18, 10, 13, 0.5) !important;
}

/* ============================================================
   PIN ICONS — gamified per-category item-slot badges
   A round CREAM badge, ringed in the category colour, hard black
   outline + offset shadow, a pointer tail, and a hand-drawn pixel
   icon inside. Reads like a collectible sprite / Google-saved pin.
============================================================ */
.pin {
  position: relative;
  width: 32px;
  height: 40px;
  cursor: pointer;
  display: block;
  /* category colour drives the badge ring + tail via currentColor */
  transition: transform 0.12s steps(3, end);
  transform-origin: 50% 95%;   /* grow from the tail tip (venue point) */
}
.pin .pin-art {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  image-rendering: pixelated;
}
/* the round badge parts stay smooth; the pixel icons stay crisp */
.pin .pin-art > circle,
.pin .pin-art > polygon { shape-rendering: geometricPrecision; }
.pin .pin-art svg       { shape-rendering: crispEdges; }

.pin[data-cat="cafe"]       { color: var(--c-cafe); }
.pin[data-cat="restaurant"] { color: var(--c-restaurant); }
.pin[data-cat="bar"]        { color: var(--c-bar); }
.pin[data-cat="hotel"]      { color: var(--c-hotel); }
.pin[data-cat="activity"]   { color: var(--c-activity); }
.pin[data-cat="event"]      { color: var(--c-event); }
.pin[data-cat="travel"]     { color: var(--c-travel); }
.pin[data-cat="shopping"]   { color: var(--c-shopping); }
.pin[data-cat="clinic"]     { color: var(--c-clinic); }
.pin[data-cat="theatre"]    { color: var(--c-theatre); }

/* idle bob on hover — like a collectible game item */
.pin:hover {
  animation: pin-bob 0.5s steps(4, end) infinite;
  z-index: 650;
}
@keyframes pin-bob {
  0%, 100% { transform: translateY(0) scale(1.12); }
  50%      { transform: translateY(-5px) scale(1.12); }
}

/* selected state — bigger, gold pulse ring around the badge */
.pin.is-active {
  transform: translateY(-3px) scale(1.3);
  animation: pin-selected 0.7s steps(2, end) infinite;
  z-index: 660;
}
@keyframes pin-selected {
  0%, 100% { transform: translateY(-3px) scale(1.3); }
  50%      { transform: translateY(-6px) scale(1.3); }
}
.pin.is-active::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--c-gold);
  box-shadow: 0 0 0 2px var(--c-black), 0 0 14px 2px rgba(255, 207, 77, 0.6);
  animation: ring-flash 0.7s steps(2, end) infinite;
  pointer-events: none;
}
@keyframes ring-flash { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.25; } }

/* ── Category item-slot swatch — shared by the legend + filter chips ──
   A small round cream badge ringed in the category colour, matching the
   map pins so the whole HUD reads as one collectible system. */
.cat-swatch {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--c-cream);
  border: 2px solid currentColor;   /* category colour ring */
  box-shadow: 0 0 0 2px var(--c-black);
}
.cat-swatch .cat-ico-svg {
  width: 15px;
  height: 15px;
  display: block;
  shape-rendering: crispEdges;
  image-rendering: pixelated;
}

/* ============================================================
   LEGEND — game HUD panel
============================================================ */
.legend {
  position: absolute;
  top: 12px;
  right: 12px;
  /* below the drawer (800) so it tucks behind it when a venue is open,
     and never intercepts the drawer's controls */
  z-index: 780;
  background:
    linear-gradient(180deg, rgba(255, 180, 87, 0.06) 0%, transparent 34%),
    var(--c-panel);
  color: var(--c-cream);
  padding: 12px 14px 13px;
  border: 4px solid var(--c-black);
  box-shadow: var(--hard-shadow),
              inset 0 3px 0 rgba(255, 240, 210, 0.07),
              inset 0 0 22px rgba(255, 180, 87, 0.08),
              0 0 20px rgba(12, 7, 18, 0.5);
}

.legend-heading {
  font-family: var(--font-hud);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--c-gold);
  text-shadow: 1px 1px 0 var(--c-black), 0 0 10px rgba(255, 207, 77, 0.4);
  margin-bottom: 11px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1;
  color: var(--c-cream);
  margin-bottom: 6px;
}
.legend-row:last-child { margin-bottom: 0; }

/* square pixel chip instead of a round dot */
.legend-dot {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--c-black),
              inset -3px -3px 0 rgba(0, 0, 0, 0.28),
              inset 3px 3px 0 rgba(255, 255, 255, 0.28);
}

/* ============================================================
   DRAWER — retro dialog box
============================================================ */
.drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--drawer-width);
  height: 100%;
  background:
    radial-gradient(120% 40% at 50% 0%, rgba(255, 180, 87, 0.07) 0%, transparent 46%),
    var(--c-panel);
  border-left: 5px solid var(--c-black);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 800;
  box-shadow: inset 5px 0 0 rgba(255, 82, 119, 0.22),  /* neon rose inner edge */
              -14px 0 30px rgba(12, 7, 18, 0.5);
  transform: translateX(100%);
  transition: transform var(--transition-drawer);
}
.drawer.is-open { transform: translateX(0); }

/* mobile grab handle */
.drawer-handle-bar {
  display: none;
  width: 54px;
  height: 8px;
  background: var(--c-gold);
  box-shadow: 0 0 0 3px var(--c-black);
  margin: 12px auto 4px;
  flex-shrink: 0;
}

/* ── Handheld-console top bezel — Game Boy DMG olive LCD status strip ──
   Gives the drawer a "device" identity: power LED, model label, speaker
   grille. The venue content below reads as the screen output. */
.drawer-device {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 7px;
  background:
    repeating-linear-gradient(to bottom,
      rgba(38, 49, 25, 0.14) 0 2px, transparent 2px 4px),          /* LCD scanlines */
    linear-gradient(180deg, var(--c-lcd-2) 0%, var(--c-lcd) 62%, #98a552 100%);
  border-bottom: 4px solid var(--c-black);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.24),
              inset 0 -3px 0 rgba(38, 49, 25, 0.4);
  font-family: var(--font-hud);
  font-size: 7px;
  letter-spacing: 0.5px;
  line-height: 1;
}
.device-power {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-lcd-dark);
}
.device-led {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  background: var(--c-led);
  box-shadow: 0 0 0 1px rgba(38, 49, 25, 0.7),
              inset -1px -1px 0 rgba(38, 49, 25, 0.35),
              0 0 7px 1px rgba(108, 255, 122, 0.85);
  animation: led-pulse 2.6s ease-in-out infinite;
}
@keyframes led-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.68; } }
.device-model {
  margin: 0 auto;
  color: var(--c-lcd-dark);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}
.device-tm { font-size: 5px; vertical-align: super; opacity: 0.8; }
.device-grille { display: inline-flex; gap: 3px; flex-shrink: 0; }
.device-grille i {
  width: 3px;
  height: 11px;
  background: rgba(38, 49, 25, 0.5);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.22);
}

/* Drawer header */
.drawer-head {
  padding: 18px 18px 16px;
  background:
    linear-gradient(180deg, rgba(196, 98, 58, 0.10) 0%, transparent 40%),
    var(--c-ink);
  border-bottom: 4px solid var(--c-black);
  flex-shrink: 0;
  position: relative;
}

.drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  background: var(--c-rose);
  color: var(--c-white);
  cursor: pointer;
  font-family: var(--font-hud);
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 -4px 0 0 var(--c-black), 0 4px 0 0 var(--c-black),
    -4px 0 0 0 var(--c-black), 4px 0 0 0 var(--c-black),
    4px 4px 0 0 rgba(10, 8, 18, 0.5),
    0 0 14px rgba(255, 82, 119, 0.5);
  transition: transform 0.06s steps(1, end);
}
.drawer-close:hover { background: #ff6f8d; }
.drawer-close:active { transform: translate(2px, 2px); }
.drawer-close:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}

#dv-name {
  font-family: var(--font-body);
  font-size: 30px;
  line-height: 1.05;
  color: var(--c-white);
  text-shadow: 2px 2px 0 var(--c-black), 0 0 14px rgba(255, 207, 77, 0.25);
  padding-right: 44px;
  word-break: break-word;
}

.drawer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

#dv-suburb {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--c-cream);
  opacity: 0.85;
  letter-spacing: 0.5px;
}

/* category pixel badge */
.chip {
  font-family: var(--font-hud);
  font-size: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--c-black);
  padding: 6px 8px;
  line-height: 1;
  box-shadow:
    0 -3px 0 0 var(--c-black), 0 3px 0 0 var(--c-black),
    -3px 0 0 0 var(--c-black), 3px 0 0 0 var(--c-black);
}
.chip[data-cat="cafe"]       { background: var(--c-cafe); }
.chip[data-cat="restaurant"] { background: var(--c-restaurant); }
.chip[data-cat="bar"]        { background: var(--c-bar); }
.chip[data-cat="hotel"]      { background: var(--c-hotel); }
.chip[data-cat="activity"]   { background: var(--c-activity); }
.chip[data-cat="event"]      { background: var(--c-event); }
.chip[data-cat="travel"]     { background: var(--c-travel); }
.chip[data-cat="shopping"]   { background: var(--c-shopping); }
.chip[data-cat="clinic"]     { background: var(--c-clinic); }
.chip[data-cat="theatre"]    { background: var(--c-theatre); }

#dv-date {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--c-gold);
  letter-spacing: 0.5px;
}

/* Drawer scrollable body */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.drawer-body::-webkit-scrollbar { width: 12px; }
.drawer-body::-webkit-scrollbar-track { background: var(--c-ink); }
.drawer-body::-webkit-scrollbar-thumb {
  background: var(--c-rose);
  border: 2px solid var(--c-black);
}

.posts-label {
  font-family: var(--font-hud);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--c-gold);
  text-shadow: 1px 1px 0 var(--c-black), 0 0 10px rgba(255, 207, 77, 0.35);
}

/* ============================================================
   POST CARDS — framed so IG embeds read as intentional
============================================================ */
.post-card {
  overflow: hidden;
  background: var(--c-cream);
  border: 4px solid var(--c-black);
  box-shadow: var(--hard-shadow);
}

.post-card .instagram-media {
  margin: 0 !important;
  min-width: unset !important;
  width: 100% !important;
  max-width: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Fallback card — shown when embed hasn't / won't hydrate */
.post-fallback {
  padding: 14px 16px 16px;
  background: var(--c-cream);
  color: var(--c-ink);
}

.type-badge {
  display: inline-block;
  font-family: var(--font-hud);
  font-size: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--c-ink);
  color: var(--c-gold);
  padding: 5px 8px;
  margin-bottom: 12px;
  box-shadow: 3px 3px 0 rgba(10, 8, 18, 0.35);
}

.post-caption {
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.25;
  color: var(--c-ink);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ig-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-hud);
  font-size: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--c-white);
  background: var(--c-rose);
  text-decoration: none;
  padding: 8px 10px;
  box-shadow: 3px 3px 0 rgba(10, 8, 18, 0.4);
  transition: transform 0.06s steps(1, end);
}
.ig-link:hover { background: #ff6f8d; }
.ig-link:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(10,8,18,0.4); }

/* ============================================================
   INLINE VIDEO PLAYER — self-hosted, plays in the drawer
============================================================ */
.post-card--video {
  background: var(--c-ink);
  padding: 0;
}
.video-frame {
  position: relative;
  background: var(--c-black);
  /* thick pixel frame + hard shadow to match the retro dialog style */
  border: 5px solid var(--c-black);
  box-shadow: inset 0 0 0 2px var(--c-panel-2);
  line-height: 0;
}
.post-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  background: var(--c-black);
  image-rendering: auto;   /* real footage — no pixelation */
}
.video-badge {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 3;
  margin: 0;
  pointer-events: none;
}

/* big pixel PLAY affordance over the poster */
.video-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(10, 8, 18, 0.28);
  cursor: pointer;
  transition: opacity 0.15s linear;
}
.video-frame.is-playing .video-play { opacity: 0; pointer-events: none; }
.video-play-btn {
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-rose);
  box-shadow:
    0 -5px 0 0 var(--c-black), 0 5px 0 0 var(--c-black),
    -5px 0 0 0 var(--c-black), 5px 0 0 0 var(--c-black),
    6px 6px 0 0 rgba(10, 8, 18, 0.5);
  transition: transform 0.08s steps(1, end), background 0.1s linear;
}
.video-play:hover .video-play-btn { background: #ff6f8d; }
.video-play:active .video-play-btn { transform: translate(2px, 2px); }
.video-play-btn svg { display: block; image-rendering: pixelated; }

.video-caption {
  padding: 12px 14px 0;
  color: var(--c-cream) !important;
  background: transparent;
}
.video-ig-link { margin: 12px 14px 14px; }

/* ============================================================
   EMPTY STATE — "content coming soon" cartridge
============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 34px 18px;
  margin: auto 0;
}
.empty-cart {
  width: 88px;
  height: 88px;
  image-rendering: pixelated;
  animation: cart-bob 1s steps(3, end) infinite;
}
@keyframes cart-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.empty-title {
  font-family: var(--font-hud);
  font-size: 12px;
  line-height: 1.6;
  color: var(--c-gold);
  text-shadow: 2px 2px 0 var(--c-black), 0 0 12px rgba(255, 207, 77, 0.3);
}
.empty-sub {
  font-family: var(--font-body);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--c-cream);
  opacity: 0.85;
}
.empty-sub .press {
  color: var(--c-rose);
  animation: blink 1s steps(1, end) infinite;
}

/* ============================================================
   OVERLAY (mobile tap-to-dismiss)
============================================================ */
.overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 18, 0.55);
  z-index: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-drawer);
}
.overlay.is-visible { opacity: 1; pointer-events: auto; }

/* ============================================================
   FETCH ERROR STATE — retro dialog
============================================================ */
.fetch-error-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 950;
  background: var(--c-panel);
  color: var(--c-cream);
  border: 5px solid var(--c-black);
  padding: 26px 26px 28px;
  box-shadow: var(--hard-shadow), inset 0 3px 0 rgba(255,255,255,0.06);
  max-width: 340px;
  width: calc(100% - 40px);
  text-align: center;
}
.fetch-error-card h3 {
  font-family: var(--font-hud);
  font-size: 12px;
  line-height: 1.5;
  color: var(--c-rose);
  text-shadow: 2px 2px 0 var(--c-black);
  margin-bottom: 14px;
}
.fetch-error-card p {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.3;
  color: var(--c-cream);
  margin-bottom: 12px;
}
.fetch-error-card code {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 17px;
  background: var(--c-ink);
  padding: 4px 8px;
  color: var(--c-gold);
  border: 2px solid var(--c-black);
  user-select: all;
}

/* ============================================================
   FILTER BAR — pixel HUD (city dropdown + category chips)
============================================================ */
.filter-bar {
  position: absolute;
  top: 12px;
  /* LEFT rail — offset past the Leaflet zoom control, clear of the right drawer */
  left: 56px;
  z-index: 905;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(430px, calc(100% - 72px));
  padding: 9px 11px;
  background:
    linear-gradient(180deg, rgba(255, 180, 87, 0.06) 0%, transparent 40%),
    rgba(34, 22, 50, 0.95);
  border: 4px solid var(--c-black);
  box-shadow: var(--hard-shadow),
              inset 0 3px 0 rgba(255, 240, 210, 0.07),
              inset 0 0 20px rgba(255, 180, 87, 0.07),
              0 0 20px rgba(12, 7, 18, 0.5);
}

/* ── City selector as a cartridge slot ──────────────────────────────
   The label reads as an engraved slot header; the <select> reads as a
   cartridge seated in the slot (top-ridged bevel, dark seating shadow). */
.filter-city-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 4px 3px 6px;
  background: var(--c-espresso);
  border: 3px solid var(--c-black);
  box-shadow: inset 0 3px 5px rgba(18, 10, 13, 0.75);   /* dark slot recess */
}
.filter-city-label {
  font-family: var(--font-hud);
  font-size: 8px;
  letter-spacing: 0.5px;
  color: var(--c-gold);
  text-shadow: 1px 1px 0 var(--c-black);
  flex-shrink: 0;
}
.filter-city {
  font-family: var(--font-hud);
  font-size: 9px;
  color: var(--c-cream);
  /* cartridge body: top ridge lines + top-light bevel */
  background:
    repeating-linear-gradient(90deg,
      rgba(255, 244, 228, 0.10) 0 2px, transparent 2px 5px) top / 100% 4px no-repeat,
    linear-gradient(180deg, rgba(255, 244, 228, 0.16) 0%, transparent 40%),
    var(--c-panel-2);
  border: 3px solid var(--c-black);
  padding: 7px 24px 7px 9px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow:
    inset 0 2px 0 rgba(255, 244, 228, 0.16),
    inset 0 -3px 0 rgba(18, 10, 13, 0.5),
    0 2px 0 var(--c-black);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--c-gold) 50%),
    linear-gradient(135deg, var(--c-gold) 50%, transparent 50%);
  background-position:
    calc(100% - 13px) calc(50% - 1px),
    calc(100% - 8px) calc(50% - 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.filter-city:hover { transform: translateY(-1px); }
.filter-city:focus-visible {
  outline: 2px solid var(--c-rose);
  outline-offset: 2px;
  border-color: var(--c-rose);
  box-shadow: inset 0 2px 0 rgba(255,244,228,0.16), inset 0 -3px 0 rgba(18,10,13,0.5), 0 2px 0 var(--c-black);
}

.filter-divider {
  width: 3px;
  align-self: stretch;
  background: var(--c-black);
  margin: 0 2px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Console-button toggle chip ───────────────────────────────────────
   Styled like a tactile hardware button: top-lit bevel, hard drop shadow
   that collapses when the button travels down. ON = raised & lit,
   OFF = pressed-in & dimmed (the button stays depressed). */
.fchip {
  font-family: var(--font-hud);
  font-size: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--c-cream);
  background:
    linear-gradient(180deg, rgba(255, 244, 228, 0.14) 0%, transparent 34%),
    var(--c-panel-2);
  border: 3px solid var(--c-black);
  padding: 7px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  user-select: none;
  /* raised hardware key: bright top edge, dark bottom edge, hard shadow */
  box-shadow:
    inset 0 2px 0 rgba(255, 244, 228, 0.18),
    inset 0 -3px 0 rgba(18, 10, 13, 0.5),
    0 3px 0 var(--c-black),
    0 4px 0 rgba(18, 10, 13, 0.4);
  transition: transform 0.05s steps(1, end), box-shadow 0.05s steps(1, end),
              opacity 0.1s linear, filter 0.1s linear;
}
.fchip:hover { background:
    linear-gradient(180deg, rgba(255, 244, 228, 0.2) 0%, transparent 34%),
    var(--c-panel-2); }
.fchip:active {                                   /* physical key press */
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 0 rgba(255, 244, 228, 0.12),
    inset 0 -2px 0 rgba(18, 10, 13, 0.5),
    0 0 0 var(--c-black);
}
.fchip:focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 2px;
}
.fchip .fchip-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--c-black),
              inset -2px -2px 0 rgba(0,0,0,0.28),
              inset 2px 2px 0 rgba(255,255,255,0.28);
}
/* OFF — button depressed into the housing, colour drained */
.fchip[aria-pressed="false"] {
  color: rgba(247, 236, 212, 0.55);
  opacity: 0.6;
  filter: grayscale(0.72);
  transform: translateY(3px);
  background: var(--c-panel);
  box-shadow:
    inset 0 3px 5px rgba(18, 10, 13, 0.7),
    inset 0 -1px 0 rgba(255, 244, 228, 0.05);
}
/* ON — button lit, LCD-tinted inner glow, colour full */
.fchip[aria-pressed="true"] {
  color: var(--c-white);
  box-shadow:
    inset 0 2px 0 rgba(255, 244, 228, 0.2),
    inset 0 -3px 0 rgba(18, 10, 13, 0.5),
    inset 0 0 10px rgba(255, 180, 87, 0.12),
    0 3px 0 var(--c-black),
    0 4px 0 rgba(18, 10, 13, 0.4);
}
.fchip[aria-pressed="true"] .fchip-dot {
  box-shadow: 0 0 0 2px var(--c-black),
              inset -2px -2px 0 rgba(0,0,0,0.28),
              inset 2px 2px 0 rgba(255,255,255,0.4),
              0 0 7px 1px currentColor;
}

/* ============================================================
   CITY COLLECTION STRIP — pixel cards
============================================================ */
/* ── COLLECTION DOCK — bottom-LEFT, collapsible (clear of drawer) ── */
.collection-dock {
  position: absolute;
  bottom: 24px;
  left: 16px;
  z-index: 900;
  max-width: min(56vw, 620px);
}

/* Cream "game-map" surface — like the parchment world map in Super Mario 3.
   Dark espresso ink on tan paper, a faint tile grid, pixel-beveled edges. */
.collection-panel {
  background:
    repeating-linear-gradient(0deg,  rgba(122, 84, 51, 0.06) 0 15px, transparent 15px 16px),
    repeating-linear-gradient(90deg, rgba(122, 84, 51, 0.06) 0 15px, transparent 15px 16px),
    linear-gradient(180deg, #f6e6bc 0%, var(--c-parchment) 55%, var(--c-parchment-2) 100%);
  border: 4px solid var(--c-black);
  box-shadow: var(--hard-shadow),
              inset 0 3px 0 rgba(255, 250, 232, 0.55),
              inset 0 -4px 0 rgba(122, 84, 51, 0.28),
              inset 0 0 0 2px rgba(240, 223, 176, 0.4);
  padding: 8px 10px 6px;
}
.collection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 1px 2px 5px;
  border-bottom: 2px dashed rgba(122, 84, 51, 0.4);   /* torn map-fold line */
}
.collection-title {
  font-family: var(--font-hud);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--c-parch-ink);
  text-shadow: 1px 1px 0 rgba(255, 250, 232, 0.6);
}
.collection-collapse {
  width: 24px; height: 20px;
  flex-shrink: 0;
  border: 3px solid var(--c-black);
  background:
    linear-gradient(180deg, var(--c-terracotta-2) 0%, var(--c-terracotta) 100%);
  color: var(--c-white);
  font-family: var(--font-hud);
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 0 rgba(255, 244, 228, 0.35),
              inset 0 -2px 0 rgba(74, 47, 30, 0.5), 0 2px 0 var(--c-black);
  transition: transform 0.05s steps(1, end);
}
.collection-collapse:hover { filter: brightness(1.1); }
.collection-collapse:active { transform: translateY(2px); box-shadow: none; }
.collection-collapse:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}

/* collapsed → just a reopen tab */
.collection-tab {
  font-family: var(--font-hud);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--c-parch-ink);
  background:
    linear-gradient(180deg, #f6e6bc 0%, var(--c-parchment) 100%);
  border: 4px solid var(--c-black);
  box-shadow: var(--hard-shadow),
              inset 0 3px 0 rgba(255, 250, 232, 0.55),
              inset 0 -4px 0 rgba(122, 84, 51, 0.28);
  padding: 10px 13px;
  cursor: pointer;
  text-shadow: 1px 1px 0 rgba(255, 250, 232, 0.5);
  transition: transform 0.06s steps(1, end);
}
.collection-tab:hover { filter: brightness(1.04); color: var(--c-terracotta); }
.collection-tab:active { transform: translate(2px, 2px); }
.collection-tab:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}

.city-strip {
  display: flex;
  gap: 12px;
  max-width: min(52vw, 580px);
  overflow-x: auto;
  padding: 8px 2px 8px;
  scrollbar-width: thin;
  /* SMB3 world-path: a dotted trail runs behind the level tiles, visible in
     the gaps between them so the cities read as connected map nodes. */
  background:
    radial-gradient(circle, rgba(122, 84, 51, 0.55) 0 2px, transparent 2.5px)
      0 46% / 13px 5px repeat-x;
}
.city-strip::-webkit-scrollbar { height: 8px; }
.city-strip::-webkit-scrollbar-track { background: rgba(122, 84, 51, 0.18); }
.city-strip::-webkit-scrollbar-thumb { background: var(--c-terracotta); border: 1px solid var(--c-black); }

/* City card = a level tile on the paper map (no side-stripe accent) */
.city-card {
  flex: 0 0 auto;
  width: 136px;
  background:
    linear-gradient(180deg, #fff4d9 0%, var(--c-parchment) 100%);
  border: 3px solid var(--c-black);
  box-shadow:
    inset 0 2px 0 rgba(255, 252, 236, 0.7),
    inset 0 -3px 0 rgba(122, 84, 51, 0.3),
    3px 3px 0 rgba(74, 47, 30, 0.4);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s cubic-bezier(0.16,1,0.3,1), box-shadow 0.12s ease-out;
  padding: 0;
  text-align: left;
}
.city-card:hover {
  transform: translateY(-4px);
  box-shadow:
    inset 0 2px 0 rgba(255, 252, 236, 0.7),
    inset 0 -3px 0 rgba(122, 84, 51, 0.3),
    3px 6px 0 rgba(74, 47, 30, 0.45),
    0 0 14px rgba(196, 98, 58, 0.4);
}
.city-card:active { transform: translateY(2px); }
.city-card:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}
.city-card.is-active {
  outline: 3px solid var(--accent, var(--c-terracotta));
  outline-offset: -1px;
}
.city-thumb-wrap {
  position: relative;
  width: 100%;
  height: 66px;
  border-bottom: 3px solid var(--c-black);
  overflow: hidden;
}
.city-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: auto;
  background: var(--c-panel-2);
}
.city-thumb-ph {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg, var(--c-parchment-2) 0 6px, #f6e6bc 6px 12px);
}
.city-thumb-wrap.no-thumb .city-thumb-ph { display: flex; }
.city-thumb-ph span {
  font-family: var(--font-hud);
  font-size: 18px;
  color: var(--accent, var(--c-gold));
  text-shadow: 2px 2px 0 var(--c-black);
}
/* accent glow strip under the thumbnail */
.city-thumb-wrap::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--accent, var(--c-gold));
  opacity: 0.9;
}
.city-card-body { padding: 8px 10px 10px; }
.city-card-name {
  font-family: var(--font-hud);
  font-size: 8px;
  line-height: 1.4;
  color: var(--c-parch-ink);
  text-shadow: 1px 1px 0 rgba(255, 250, 232, 0.55);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.city-card-count {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--c-terracotta);
  letter-spacing: 0.5px;
}

/* ============================================================
   HEADER BURGER / NAV
============================================================ */
.header-burger {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  background: var(--c-panel-2);
  color: var(--c-gold);
  cursor: pointer;
  font-family: var(--font-hud);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 -3px 0 0 var(--c-black), 0 3px 0 0 var(--c-black),
    -3px 0 0 0 var(--c-black), 3px 0 0 0 var(--c-black);
}
.header-burger:hover { background: var(--c-rose); color: var(--c-white); }
.header-burger:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}

.nav-menu {
  position: absolute;
  top: calc(var(--header-height) + 6px);
  right: 12px;
  z-index: 1500;
  background: var(--c-panel);
  border: 4px solid var(--c-black);
  box-shadow: var(--hard-shadow);
  display: none;
  flex-direction: column;
  min-width: 150px;
}
.nav-menu.is-open { display: flex; }
.nav-menu button {
  font-family: var(--font-hud);
  font-size: 10px;
  color: var(--c-cream);
  background: transparent;
  border: none;
  border-bottom: 3px solid var(--c-black);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.nav-menu button:last-child { border-bottom: none; }
.nav-menu button:hover { background: var(--c-panel-2); color: var(--c-gold); }
.nav-menu button:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: -3px;
}

/* ============================================================
   VIEWS — SPA view toggling
============================================================ */
.view { display: none; }
.view.is-active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#view-map.is-active { display: flex; }

/* ============================================================
   LANDING (#/) — pixel treasure-hunt splash
============================================================ */
#view-landing {
  position: relative;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Purple-dusk bedroom lit by a warm CRT: a sun-faded terracotta glow pools
     around the treasure chest, the dusk-plum room falling to espresso corners. */
  background:
    radial-gradient(54% 44% at 50% 56%, rgba(224, 125, 76, 0.30) 0%, rgba(196, 98, 58, 0.12) 40%, transparent 70%),
    radial-gradient(120% 92% at 50% 26%, #3d2546 0%, #2a1834 46%, var(--c-ink) 78%, var(--c-espresso) 100%);
  /* Custom pixel-rose cursor — landing ONLY (map keeps native cursors). */
  cursor:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 12 12' shape-rendering='crispEdges'><rect x='5' y='6' width='1' height='4' fill='%233fa34a'/><rect x='6' y='8' width='2' height='1' fill='%234fd06a'/><rect x='4' y='2' width='4' height='1' fill='%23ff5277'/><rect x='3' y='3' width='6' height='3' fill='%23ff5277'/><rect x='4' y='6' width='4' height='1' fill='%23ff5277'/><rect x='5' y='3' width='2' height='2' fill='%23d83b5e'/><rect x='4' y='3' width='1' height='1' fill='%23ff90a8'/></svg>") 6 4,
    auto;
}
/* Keep the rose cursor over interactive landing elements too (whimsy > affordance here). */
#view-landing .chest,
#view-landing .landing-cta { cursor: inherit; }

/* pixel splash-grid wipe reveal */
.splash-grid {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  pointer-events: none;
}
.splash-grid > i {
  background: var(--c-ink);
  animation: splash-cell 0.5s steps(1, end) forwards;
}
@keyframes splash-cell {
  to { opacity: 0; }
}
.splash-grid.done { display: none; }

/* cursor spotlight glow */
.landing-spotlight {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 42%),
    rgba(255, 207, 77, 0.14),
    transparent 70%
  );
  transition: background 0.1s linear;
}

.landing-inner {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  /* Top breathing room keeps the title clear of the header on all viewport heights */
  padding: clamp(32px, 5vh, 72px) 16px clamp(16px, 3vh, 40px);
}

.landing-title {
  font-family: var(--font-hud);
  font-size: clamp(20px, 6vw, 44px);
  line-height: 1.25;
  color: var(--c-gold);
  text-shadow:
    3px 3px 0 var(--c-black),
    6px 6px 0 rgba(255, 82, 119, 0.35),
    0 0 26px rgba(255, 207, 77, 0.35);
  letter-spacing: 2px;
}
.landing-title .rose-word {
  color: var(--c-rose);
  text-shadow: 3px 3px 0 var(--c-black), 0 0 24px rgba(255, 82, 119, 0.55);
}

.landing-sub {
  font-family: var(--font-body);
  font-size: clamp(16px, 2.6vw, 22px);
  letter-spacing: 1px;
  color: var(--c-cream);
  opacity: 0.85;
  max-width: 440px;
}
.landing-sub .press { color: var(--c-rose); animation: blink 1s steps(1, end) infinite; }

/* ── GIANT CHEST STAGE — hero element ────────────────────────── */
.landing-stage {
  position: relative;
  width:  min(52vh, 66vw);
  height: min(52vh, 66vw);
  max-width: 480px;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* pulsing gold aura behind the chest */
.chest-aura {
  position: absolute;
  left: 50%; top: 52%;
  width: 78%; height: 78%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255, 200, 112, 0.5) 0%, rgba(255, 138, 92, 0.2) 38%, transparent 68%);
  animation: aura-pulse 2.6s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes aura-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.9);  opacity: 0.65; }
  50%      { transform: translate(-50%, -50%) scale(1.08); opacity: 1;    }
}

/* treasure chest sprite — now the dominant hero */
.chest {
  position: relative;
  z-index: 3;
  width:  82%;
  height: 82%;
  cursor: pointer;
  image-rendering: pixelated;
  animation: chest-bob 2.4s ease-in-out infinite;
  filter: drop-shadow(6px 10px 0 rgba(10, 8, 18, 0.5))
          drop-shadow(0 0 20px rgba(255, 196, 110, 0.4));
  will-change: transform;
}
@keyframes chest-bob {
  0%, 100% { transform: translateY(0)     scale(1);    }
  50%      { transform: translateY(-2.2%) scale(1.012); }
}
.chest svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
  shape-rendering: crispEdges;
  image-rendering: pixelated;
}
.chest .chest-open-sprite { display: none; }
.chest.is-open { animation: chest-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.chest.is-open .chest-closed-sprite { display: none; }
.chest.is-open .chest-open-sprite   { display: block; animation: lid-flip 0.45s cubic-bezier(0.16,1,0.3,1); }
@keyframes chest-pop {
  0%   { transform: translateY(0) scale(1); }
  35%  { transform: translateY(-8%) scale(1.16); }
  100% { transform: translateY(0) scale(1.05); }
}
/* lid appears to fling open */
@keyframes lid-flip {
  0%   { transform: scaleY(0.6) translateY(6%); opacity: 0.4; }
  100% { transform: scaleY(1)   translateY(0);  opacity: 1;   }
}

/* ── ROSE AVATAR — pixel influencer beside the chest ─────────── */
.rose-avatar {
  position: absolute;
  right: -6%;
  bottom: 2%;
  height: 64%;
  z-index: 4;
  pointer-events: none;
  image-rendering: pixelated;
  filter: drop-shadow(4px 6px 0 rgba(10,8,18,0.45));
  animation: av-bob 2.9s ease-in-out infinite;
  transform-origin: 50% 100%;
  will-change: transform;
}
.rose-avatar-svg { height: 100%; width: auto; display: block; shape-rendering: crispEdges; }
@keyframes av-bob {
  0%, 100% { transform: translateY(0)    rotate(0deg);   }
  50%      { transform: translateY(-3%)  rotate(-1.2deg); }
}
/* hair sway (subtle, independent of the body bob) */
.av-hair { transform-origin: 50% 20%; animation: hair-sway 3.4s ease-in-out infinite; }
@keyframes hair-sway {
  0%, 100% { transform: translateX(0)     skewX(0deg);   }
  50%      { transform: translateX(0.3px) skewX(-3deg);  }
}

.chest-hint {
  font-family: var(--font-hud);
  font-size: 9px;
  color: var(--c-gold);
  opacity: 0.85;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 var(--c-black), 0 0 10px rgba(255, 207, 77, 0.4);
  animation: hint-flicker 1.6s steps(1, end) infinite;
}
@keyframes hint-flicker { 0%, 70% { opacity: 0.9; } 70.01%, 100% { opacity: 0.45; } }

/* ── COIN / SPARKLE LAYER ────────────────────────────────────── */
.coin-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}
/* ambient floating coins */
.floater {
  position: absolute;
  bottom: 24%;
  width: 9px; height: 9px;
  background: var(--c-gold);
  box-shadow: inset -2px -2px 0 rgba(0,0,0,0.3), 0 0 0 2px var(--c-black);
  opacity: 0;
  animation: floater-rise linear infinite;
  will-change: transform, opacity;
}
.floater--rose { background: var(--c-rose); }
@keyframes floater-rise {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.7); }
  15%  { opacity: 1; }
  85%  { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--drift), -190px) scale(1); }
}

/* burst sparkles + coins on open (appended to <body>, fixed to viewport) */
.sparkle {
  position: fixed;
  width: 9px;
  height: 9px;
  background: var(--c-gold);
  box-shadow: 0 0 0 2px var(--c-black);
  z-index: 2500;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}
.sparkle--coin {
  width: 12px; height: 12px;
  background: var(--c-gold);
  box-shadow: inset -3px -3px 0 rgba(0,0,0,0.32), 0 0 0 2px var(--c-black);
}
.sparkle.go { animation: sparkle-fly 0.9s cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes sparkle-fly {
  0%   { opacity: 1; transform: translate(0,0) scale(1); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(0.3); }
}

/* full-screen gold flash on unlock */
.unlock-flash {
  position: fixed;
  inset: 0;
  z-index: 2400;
  pointer-events: none;
  background: radial-gradient(circle at 50% 46%, rgba(255,236,170,0.9), rgba(255,207,77,0.5) 45%, transparent 72%);
  opacity: 0;
}
.unlock-flash.go { animation: unlock-flash 0.6s ease-out forwards; }
@keyframes unlock-flash {
  0%   { opacity: 0; }
  18%  { opacity: 1; }
  100% { opacity: 0; }
}

/* screen-kick on the whole landing scene */
.landing-inner.shake { animation: scene-shake 0.5s steps(2, end); }
@keyframes scene-shake {
  0%, 100% { transform: translate(0, 0); }
  20%  { transform: translate(-5px, 3px); }
  40%  { transform: translate(5px, -3px); }
  60%  { transform: translate(-4px, -2px); }
  80%  { transform: translate(4px, 2px); }
}

/* pixel CTA button */
.landing-cta {
  font-family: var(--font-hud);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--c-white);
  background: var(--c-rose);
  border: none;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow:
    0 -4px 0 0 var(--c-black), 0 4px 0 0 var(--c-black),
    -4px 0 0 0 var(--c-black), 4px 0 0 0 var(--c-black),
    6px 6px 0 0 rgba(10, 8, 18, 0.5),
    0 0 18px rgba(255, 82, 119, 0.5);
  transition: transform 0.06s steps(1, end), box-shadow 0.2s ease-out;
  animation: cta-glow 2.4s ease-in-out infinite;
}
.landing-cta:hover {
  background: #ff6f8d;
  box-shadow:
    0 -4px 0 0 var(--c-black), 0 4px 0 0 var(--c-black),
    -4px 0 0 0 var(--c-black), 4px 0 0 0 var(--c-black),
    6px 6px 0 0 rgba(10, 8, 18, 0.5),
    0 0 26px rgba(255, 82, 119, 0.7);
}
.landing-cta:active { transform: translate(2px, 2px); }
.landing-cta:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 4px;
}
/* gentle neon breathe on the primary CTA */
@keyframes cta-glow {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.08); }
}

/* landing → map lift-off */
#view-landing.lifting {
  animation: view-lift 0.5s steps(6, end) forwards;
}
@keyframes view-lift {
  to { transform: translateY(-100%); opacity: 0; }
}

/* About modal */
.about-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 18, 0.7);
  padding: 20px;
}
.about-modal.is-open { display: flex; }
.about-box {
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 180, 87, 0.08) 0%, transparent 46%),
    var(--c-panel);
  border: 5px solid var(--c-black);
  box-shadow: var(--hard-shadow),
              inset 0 0 26px rgba(255, 180, 87, 0.07),
              0 0 40px rgba(255, 82, 119, 0.18);
  max-width: 360px;
  width: 100%;
  padding: 24px 22px 26px;
  text-align: center;
}
.about-box h3 {
  font-family: var(--font-hud);
  font-size: 12px;
  color: var(--c-gold);
  text-shadow: 2px 2px 0 var(--c-black), 0 0 14px rgba(255, 207, 77, 0.35);
  margin-bottom: 14px;
  line-height: 1.5;
}
.about-box p {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.35;
  color: var(--c-cream);
  margin-bottom: 16px;
}
.about-box .landing-cta { font-size: 10px; padding: 10px 16px; }

/* ============================================================
   MOBILE OVERRIDES
============================================================ */
@media (max-width: 767px) {
  #map.drawer-open { margin-right: 0; }

  .drawer {
    top: auto;
    bottom: 0;
    right: 0;
    width: 100%;
    height: var(--sheet-height);
    border-left: none;
    border-top: 5px solid var(--c-black);
    transform: translateY(100%);
  }
  .drawer.is-open { transform: translateY(0); }

  .drawer-handle-bar { display: block; }
  .overlay { display: block; }

  .header-location { display: none; }
  .header-title { font-size: 11px; }

  .filter-bar {
    top: 8px;
    left: 8px;
    right: 8px;
    max-width: none;
    padding: 8px;
  }
  .collection-dock {
    left: 8px;
    right: 8px;
    bottom: 10px;
    max-width: none;
    /* safe-area: keep content above the home indicator / gesture bar */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .city-strip { max-width: calc(100vw - 40px); }
  .legend { display: none; }
  .vhs-stamp { display: none; }

  /* ── Mobile tap targets — bump sub-44px controls to WCAG 2.5.8 minimum ── */
  .drawer-close {
    width: 44px;
    height: 44px;
  }
  .header-burger {
    width: 44px;
    height: 44px;
  }
  .collection-collapse {
    width: 44px;
    height: 44px;
  }
  /* Filter bar: single-row layout on mobile — chips scroll horizontally
     instead of wrapping into multiple rows that eat map space.         */
  .filter-bar { flex-wrap: nowrap; align-items: center; }
  .filter-divider { align-self: stretch; flex-shrink: 0; }
  .filter-chips {
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .filter-chips::-webkit-scrollbar { display: none; }

  /* Filter chips: maintain 44px touch height + don't shrink when scrolled */
  .fchip {
    flex-shrink: 0;
    min-height: 44px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  /* Scale the landing scene down gracefully on phones */
  .landing-stage {
    width:  min(64vw, 320px);
    height: min(64vw, 320px);
  }
  .rose-avatar { right: -4%; height: 58%; }
  .landing-inner { gap: 14px; padding-top: clamp(20px, 3vh, 40px); }
}

/* ============================================================
   REDUCED MOTION
============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
