/* ============================================================
   Pocket Unicorns 🦄 — style.css
   Whimsical purple-night, mobile-first.
   ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Brand vars below are MIRRORED FROM palette.js (BRAND) — it re-applies them
   to :root at boot, so palette.js is the source of truth once JS is up. This
   static copy exists for first paint before the module loads; keep in sync.
   palette.js also injects the semantic tokens (--ok, --bad, --magic,
   --night-top, --night-bot) which have no static copy. */
:root {
  --night:       #2a1b4e;
  --night-deep:  #1c1038;
  --purple:      #8a5cf5;
  --purple-soft: #b399f0;
  --lavender:    #efe6ff;
  --pink:        #ff8fd8;
  --gold:        #ffd166;
  --text:        #3c2a63;
  --card:        rgba(255, 250, 255, 0.97);
  /* ---- Kartans ljushierarki (se "MAP AFFORDANCE" längre ner) ----
     Tre steg, ljusast = mest värt att trycka på. Vi mörkar med
     saturation/brightness i stället för ren opacity: över det lila
     nattfiltret försvinner en genomskinlig markör helt, medan en
     mörkad markör fortfarande läses som "den finns, men inte nu". */
  --mk-dim:      saturate(0.32) brightness(0.52);  /* inget att göra här just nu */
  --mk-soft:     saturate(0.80) brightness(0.88);  /* går att trycka på, men ingen belöning väntar */
  --radius:      22px;
  --shadow:      0 10px 30px rgba(30, 10, 70, 0.4);
  --font: "Segoe UI Rounded", "Segoe UI", "Comic Sans MS", -apple-system, system-ui, sans-serif;
}

html, body {
  margin: 0; padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--night-deep);
  color: var(--text);
  touch-action: manipulation;
  overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
}

button {
  font-family: var(--font);
  border: none;
  cursor: pointer;
  background: none;
  color: inherit;
}

.hidden { display: none !important; }

/* ---------------- Map & magic night filter ---------------- */
#map {
  position: fixed; inset: 0;
  z-index: 1;
  background: var(--night-deep);
}
.leaflet-tile-pane {
  filter: invert(1) sepia(0.5) hue-rotate(205deg) saturate(2.1) brightness(var(--tod-bright, 0.82)) contrast(1.05);
  transition: filter 1.2s ease;
}
#weatherfx {
  position: fixed; inset: 0; z-index: 3;
  pointer-events: none;
}
.leaflet-control-attribution {
  background: rgba(28, 16, 56, 0.7) !important;
  color: #cbb8f0 !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a { color: #e3d3ff !important; }

#vignette {
  position: fixed; inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(120, 70, 220, 0) 50%, rgba(30, 8, 70, 0.5) 100%),
    linear-gradient(rgba(140, 80, 230, 0.08), rgba(140, 80, 230, 0.08));
}

/* ---------------- Markers ---------------- */
.leaflet-marker-icon.no-frame { background: none; border: none; }

.player-marker { position: relative; width: 60px; height: 60px; }
.player-marker .p-pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(255, 143, 216, 0.35);
  animation: pulse 2s ease-out infinite;
}
.player-marker .p-avatar {
  position: absolute; inset: 8px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffd6f2, #c9a6ff);
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
@keyframes pulse {
  0%   { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}
.player-marker .p-here {
  position: absolute; left: 50%; top: 60px;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(28, 16, 56, 0.9);
  color: #fceaff;
  font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Grundläget är MÖRKT: en markör som just lagts till hinner annars blinka
   till i "redo"-ljus innan updateProximity() hunnit sätta .reachable. */
.uni-marker {
  width: 96px; text-align: center;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)) var(--mk-dim);
  transition: filter 0.35s ease, opacity 0.35s ease;
}
.uni-marker .uni-bubble {
  width: 52px; height: 52px;
  margin: 0 auto;
  border-radius: 50% 50% 50% 12%;
  background: linear-gradient(160deg, #fff, var(--uc, #b399f0));
  border: 3px solid var(--uc, #b399f0);
  display: flex; align-items: center; justify-content: center;
  font-size: 27px;
  animation: bob 2.6s ease-in-out infinite;
  position: relative;
}
/* R16: bubbles hold real unicorn art now (uniArt small variant) */
.uni-marker .uni-bubble svg { width: 48px; height: 48px; display: block; overflow: visible; animation: none; }
.buddy-marker svg { width: 34px; height: 34px; display: block; overflow: visible; animation: none; }
.uni-marker.bonded .uni-bubble::after {
  content: "💖";
  position: absolute; top: -10px; right: -10px;
  font-size: 18px;
}
.uni-marker .uni-name {
  margin-top: 3px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(28, 16, 56, 0.85);
  color: #fceaff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.uni-marker .uni-name b { color: #ffd9a8; font-weight: 800; margin-right: 3px; }
.uni-marker .uni-dist {
  display: none;
  margin-top: 2px;
  font-size: 10px; font-weight: 700;
  color: #d9c6ff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
/* REDO (inom 500 m) → full färg, guldglöd som andas, tryckbar. */
.uni-marker.reachable {
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
  opacity: 1;
}
.uni-marker.reachable .uni-bubble {
  border-color: #ffe08a;
  /* Statisk glöd FÖRST, pulsen ovanpå: både body.reduced och
     prefers-reduced-motion stänger av animation, och då bar box-shadow:en
     inget alls om den bara låg i keyframen. Glöden är bärande signal. */
  box-shadow: 0 0 14px 4px rgba(255, 208, 120, 0.9);
  /* Två animationer på samma element: bob rör transform, mk-pulse rör
     box-shadow — de krockar inte. Pulsen är signalen "tryck här". */
  animation: bob 2.6s ease-in-out infinite, mk-pulse 1.9s ease-in-out infinite;
}
.uni-marker.reachable .uni-name { background: rgba(88, 60, 10, 0.9); }
/* R28: utom räckhåll = OSYNLIG. Drip-mekaniken placerar alla spawnar innanför
   räckvidd, så det här är säkerhetsnätet mot en wander som råkar bära dem
   för långt — och mot spawnar seedade före R28 med gamla banden. En stum
   grå enhörning på 800 m signalerar "här händer inget" bättre om den bara
   inte finns. */
.uni-marker.unreachable { display: none; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* ============================================================
   MAP AFFORDANCE — vad är värt att trycka på?
   Kartan har fyra klickbara markörtyper (enhörning, vänhem,
   vän-kluster, magisk plats) plus ren dekor (biomringar, tro-ljus).
   Målgruppen är 4–9 år: de ska kunna svepa blicken över kartan och
   se VAR det finns något att göra, utan att läsa en enda etikett.
   Därför en och samma ljusskala på alla fyra:

     LJUS + guldpuls  = belöning väntar nu (vänskap/EXP/gåvor)
     NORMAL           = går att trycka på, men inget väntar
     MÖRK             = finns, men går inte att göra något med just nu
     bakåtskjuten     = dekor, ska aldrig konkurrera om blicken

   Guldpulsen är avsiktligt samma i alla fyra fallen — "det som
   glimmar går att göra" ska vara EN regel att lära sig, inte fyra.
   body.reduced stänger av all animation globalt; då bär färg och
   ljusstyrka signalen ensamma, vilket de gör även utan pulsen.
   ============================================================ */
@keyframes mk-pulse {
  0%, 100% { box-shadow: 0 0 10px 2px rgba(255, 208, 120, 0.55); }
  50%      { box-shadow: 0 0 21px 7px rgba(255, 208, 120, 0.95); }
}

/* ---------------- HUD ---------------- */
#hud {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: 10px; right: 10px;
  z-index: 600;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }
#btn-menu { margin-left: auto; }
#hud-gps { font-size: 13px; letter-spacing: -0.2px; }
/* Narrow phones: compact pills so the HUD wraps less */
@media (max-width: 400px) {
  .pill { padding: 6px 10px; font-size: 13px; gap: 4px; }
  #hud { gap: 6px; }
  .xp-track { width: 26px; }
  #hud-gps { font-size: 11.5px; }
  #hud-env { font-size: 13px; }
}
.pill {
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 5px;
}
.round-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.round-btn:active { transform: scale(0.88); }

/* ---------------- Meet button ---------------- */
#btn-meet {
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: linear-gradient(135deg, #a56bff, var(--pink));
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  padding: 13px 26px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(160, 80, 255, 0.6);
  animation: meet-glow 1.6s ease-in-out infinite;
}
#btn-meet small { font-weight: 500; opacity: 0.85; font-size: 12px; }
@keyframes meet-glow {
  0%, 100% { box-shadow: 0 8px 24px rgba(160, 80, 255, 0.6); transform: translateX(-50%) scale(1); }
  50%      { box-shadow: 0 8px 34px rgba(255, 140, 220, 0.85); transform: translateX(-50%) scale(1.04); }
}

/* ---------------- Bottom nav ---------------- */
#navbar {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: flex; gap: 6px;
  background: var(--card);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow);
}
#navbar button {
  display: flex; flex-direction: column; align-items: center;
  gap: 1px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  transition: background 0.2s, transform 0.15s;
}
#navbar button:active { transform: scale(0.92); background: var(--lavender); }
#navbar .nav-ico { font-size: 21px; }

/* ---------------- Sheets (bottom panels) ---------------- */
#backdrop {
  position: fixed; inset: 0;
  z-index: 700;
  background: rgba(20, 8, 45, 0.5);
  opacity: 1;
  transition: opacity 0.3s;
}
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 800;
  max-height: 76vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 26px 26px 0 0;
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(20, 5, 60, 0.55);
  transform: translateY(105%);
  transition: transform 0.32s cubic-bezier(0.22, 1.1, 0.36, 1);
  -webkit-overflow-scrolling: touch;
}
.sheet.open { transform: translateY(0); }
.sheet-handle {
  /* Visible bar is small (44x5) but the hit area is a full-width strip so a
     child can grab and drag with a thumb without aiming. R28 swipe-to-close
     lives on pointer events targeting this element. */
  width: 100%; height: 24px;
  margin: 0 auto 6px;
  cursor: grab;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;         /* let us follow the finger — no browser scrolling */
  -webkit-user-select: none; user-select: none;
}
.sheet-handle::before {
  content: "";
  width: 44px; height: 5px;
  border-radius: 999px;
  background: #d4c3f2;
  transition: background 0.15s, width 0.15s;
}
.sheet-handle:active::before { background: #8a5cf5; width: 60px; }
.sheet h2 { margin: 4px 0 12px; font-size: 21px; }
.sheet h3 { margin: 16px 0 8px; font-size: 15px; color: #6b4fa8; }
/* R10 a11y: was #6b5691 (~4.0:1 on white) — below WCAG AA for small text. */
.hint { font-size: 12px; color: #6b5691; text-align: center; margin: 8px 0 0; }
.col-count { font-size: 14px; color: #6b5691; font-weight: 500; }

/* ---------------- Gift grid ---------------- */
.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gift-card {
  background: #fff;
  border: 2px solid #e8dcff;
  border-radius: 16px;
  padding: 10px 4px 8px;
  text-align: center;
  transition: transform 0.12s, border-color 0.2s;
  position: relative;
}
button.gift-card:active:not(:disabled) { transform: scale(0.92); }
.gift-card:disabled { opacity: 0.4; }
.gift-card.fav { border-color: var(--gold); background: #fffbe8; }
.gift-card .fav-star {
  position: absolute; top: -8px; right: -6px;
  font-size: 16px;
}
.gift-card .g-emoji { font-size: 28px; }
.gift-card .g-name { font-size: 11px; font-weight: 700; margin-top: 2px; }
.gift-card .g-count { font-size: 11px; color: #6b5691; }

/* ---------------- Big buttons ---------------- */
.big-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #8a5cf5, var(--pink));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(150, 80, 240, 0.45);
  transition: transform 0.15s, filter 0.2s;
}
.big-btn:active:not(:disabled) { transform: scale(0.96); }
.big-btn:disabled { filter: grayscale(0.7); opacity: 0.6; }

/* ---------------- Collection ---------------- */
.col-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff;
  border: 2px solid #eee3ff;
  border-radius: 18px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.col-row.bonded { border-color: var(--pink); background: #fff5fb; }
.col-emoji {
  width: 52px; height: 52px; flex: none;
  border-radius: 50%;
  background: linear-gradient(160deg, #fff, var(--uc, #b399f0));
  border: 3px solid var(--uc, #b399f0);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.col-info { flex: 1; min-width: 0; }
.col-info .c-name { font-weight: 800; font-size: 15px; }
.col-info .c-desc { font-size: 11px; color: #6b5691; margin: 1px 0 5px; }
.col-info .c-meta { font-size: 11px; color: #6b4fa8; margin-top: 4px; }

.fbar {
  height: 10px;
  border-radius: 999px;
  background: #eadfff;
  overflow: hidden;
}
.fbar > i {
  display: block; height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8a5cf5, var(--pink));
  transition: width 0.5s ease;
}

/* ---------------- Meet sheet ---------------- */
#meet-head { display: flex; align-items: center; gap: 14px; padding: 4px 0 2px; }
#meet-head .m-info { flex: 1; }
#meet-head .m-name { font-size: 20px; font-weight: 800; }
#meet-head .m-sub { font-size: 12px; color: #6b5691; margin: 2px 0 6px; }
#meet-head .m-f { font-size: 12px; font-weight: 700; color: #6b4fa8; margin-top: 3px; }

.game-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  background: #fff;
  border: 2px solid #e8dcff;
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 7px;
  text-align: left;
  transition: transform 0.12s;
}
.game-row:active { transform: scale(0.97); }
.game-row .gr-emoji { font-size: 26px; }
.game-row .gr-name { font-weight: 800; font-size: 14px; }
.game-row .gr-desc { font-size: 11px; color: #6b5691; }

/* ---------------- Dev panel ---------------- */
.dev-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed #e5d8ff;
  font-size: 14px;
}
.dev-row .d-name { flex: 1; font-weight: 700; }
.dev-btn {
  background: var(--lavender);
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.dev-btn:active { background: #dcc8ff; }
.dev-btn.danger { background: #ffd9e0; color: #a3123a; }
.dev-inputs { display: flex; gap: 6px; margin: 10px 0; }
.dev-inputs input {
  flex: 1; min-width: 0;
  border: 2px solid #e8dcff;
  border-radius: 12px;
  padding: 8px;
  font-size: 13px;
  font-family: var(--font);
}
.dev-check {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 0;
  font-size: 14px; font-weight: 600;
}
.dev-check input { width: 19px; height: 19px; accent-color: var(--purple); }

/* ---------------- Minigame overlay ---------------- */
#mg-overlay {
  position: fixed; inset: 0;
  z-index: 900;
  background: var(--night-deep);
}
#mg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#mg-hud {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 12px; right: 12px;
  display: flex; align-items: center; gap: 8px;
}
#mg-hud .pill { font-size: 14px; }
#mg-quit { margin-left: auto; width: 38px; height: 38px; font-size: 15px; }

.mg-card {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(88vw, 360px);
  /* R27: the result card grows with what the round earned — hero emoji,
     heading, stars, score, reward block, up to five bonus chips, the
     "nå 80"-line and the button. On a landscape phone (~360 px tall) it
     overflowed and took FORTSÄTT off-screen with it — and Escape is
     deliberately inert while the result card is up, so the only way out
     was to rotate back. Same guard .finale-card and #horn-picker .sp-card
     already carry; this card was the one that missed it. */
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;   /* don't hand the scroll to the page behind */
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: pop-in 0.3s cubic-bezier(0.22, 1.4, 0.36, 1);
}
.mg-card .mgc-emoji { font-size: 52px; }
.mg-card h2 { margin: 8px 0 4px; font-size: 22px; }
.mg-card p { margin: 4px 0; font-size: 14px; color: #6b4fa8; }
.mg-card .mgc-rewards { font-size: 17px; font-weight: 800; margin: 12px 0; line-height: 1.7; }
@keyframes pop-in {
  from { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ---------------- Bonding celebration ---------------- */
#bond-overlay {
  position: fixed; inset: 0;
  z-index: 1000;
  background: radial-gradient(circle at 50% 40%, rgba(120, 60, 220, 0.85), rgba(25, 8, 55, 0.96));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bond-card {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 20px;
  animation: pop-in 0.45s cubic-bezier(0.22, 1.4, 0.36, 1);
}
.bond-card .b-emoji {
  font-size: 90px;
  display: inline-block;
  animation: bond-bounce 1s ease-in-out infinite;
}
.bond-card h2 {
  font-size: 28px;
  margin: 10px 0 4px;
  background: linear-gradient(90deg, #ffd166, #ff8fd8, #a78bfa, #6fe3e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bond-card p { font-size: 16px; margin: 6px 0; color: #f4e8ff; }
.bond-card .big-btn { max-width: 240px; margin: 18px auto 0; }
@keyframes bond-bounce {
  0%, 100% { transform: scale(1) rotate(-4deg); }
  50%      { transform: scale(1.15) rotate(4deg); }
}
.bond-part {
  position: absolute;
  bottom: -60px;
  font-size: 26px;
  animation: rise linear forwards;
  pointer-events: none;
}
@keyframes rise {
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to   { transform: translateY(-115vh) rotate(360deg); opacity: 0; }
}

/* ---------------- Toast ---------------- */
#toast {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  max-width: 86vw;
  background: rgba(30, 14, 66, 0.94);
  color: #ffeefc;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease;
}
@keyframes toast-in {
  from { transform: translate(-50%, -12px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

/* ---------------- Locating overlay ---------------- */
#locating {
  position: fixed; inset: 0;
  z-index: 1200;
  background: linear-gradient(170deg, #34205e, #1c1038);
  display: flex; align-items: center; justify-content: center;
}
.loc-card { text-align: center; color: #f0e6ff; padding: 24px; }
.loc-card h1 { margin: 8px 0 4px; font-size: 30px; }
.loc-card p { color: #c3aaee; font-size: 15px; }
.loc-uni { font-size: 76px; animation: bob 2s ease-in-out infinite; }
.loc-spinner {
  width: 34px; height: 34px;
  margin: 18px auto 0;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.18);
  border-top-color: var(--pink);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Type badges & dex ---------------- */
.type-badges { display: inline-flex; flex-wrap: wrap; gap: 5px; vertical-align: middle; }
.tbadge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--tc, #8a5cf5);
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  white-space: nowrap;
}
.tbadge .tb-ico { font-size: 12px; }

.dex-num {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #b58bef;
  letter-spacing: 0.5px;
}
.col-row.locked { opacity: 0.9; }
.col-row.locked .col-emoji { filter: grayscale(1) brightness(0.6); }
.col-row.locked .c-desc { font-style: italic; color: #a996c9; }

/* ---------------- Minigame launcher ---------------- */
.lg-fam { margin: 14px 0 7px; font-size: 13px; font-weight: 800; color: #6b4fa8; }
.lg-fam:first-child { margin-top: 4px; }
.lg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lg-card {
  background: #fff;
  border: 2px solid #e8dcff;
  border-radius: 16px;
  padding: 10px 4px 8px;
  text-align: center;
  transition: transform 0.12s, border-color 0.2s;
  position: relative;
}
.lg-card:active { transform: scale(0.92); }
.lg-card.fav { border-color: var(--gold); background: #fffbe8; }
.lg-card .lg-star { position: absolute; top: -8px; right: -6px; font-size: 15px; }
.lg-card .lg-emoji { font-size: 27px; }
.lg-card .lg-name { font-size: 10.5px; font-weight: 700; margin-top: 3px; line-height: 1.15; }

.fav-game-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: #6b4fa8; font-weight: 700;
}

/* ---------------- Desktop tweaks ---------------- */
/* ---------------- Nursery / pots ---------------- */
.pot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pot {
  background: #fff;
  border: 2px solid #e8dcff;
  border-radius: 18px;
  padding: 12px 8px 10px;
  text-align: center;
  min-height: 132px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
}
.pot.empty { border-style: dashed; background: #faf6ff; }
.pot.ready { border-color: var(--gold); background: #fffbe8; animation: potglow 1.6s ease-in-out infinite; }
@keyframes potglow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); }
  50%      { box-shadow: 0 0 18px rgba(255, 209, 102, 0.75); }
}
.pot-emoji { font-size: 40px; line-height: 1.1; }
.pot.growing .pot-emoji { animation: bob 3s ease-in-out infinite; }
.pot.ready .pot-emoji { animation: bob 1.4s ease-in-out infinite; }
.pot-name { font-size: 11px; font-weight: 700; color: #6b4fa8; }
.pot-count { font-size: 15px; font-weight: 800; color: var(--purple); font-variant-numeric: tabular-nums; }
.pot-bar { width: 84%; height: 7px; border-radius: 999px; background: #eadfff; overflow: hidden; margin-top: 2px; }
.pot-bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7ed491, #8a5cf5); }
.pot-btn {
  background: var(--lavender); color: var(--text);
  border-radius: 12px; padding: 7px 12px; font-size: 12px; font-weight: 800;
}
.pot-btn:active { transform: scale(0.93); }
.pot-btn.harvest { background: linear-gradient(135deg, #ffd166, var(--pink)); color: #fff; }

/* ---------------- Seed picker ---------------- */
#seed-picker {
  position: fixed; inset: 0; z-index: 950;
  background: rgba(20, 8, 45, 0.55);
  display: flex; align-items: center; justify-content: center;
}
.sp-card {
  width: min(88vw, 360px);
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  animation: pop-in 0.25s cubic-bezier(0.22, 1.4, 0.36, 1);
}
.sp-card h3 { margin: 0 0 12px; text-align: center; font-size: 17px; }
.sp-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  background: #fff; border: 2px solid #e8dcff; border-radius: 14px;
  padding: 9px 12px; margin-bottom: 7px; text-align: left;
}
.sp-item:active { transform: scale(0.97); }
.sp-item .sp-emoji { font-size: 26px; }
.sp-item .sp-name { font-weight: 800; font-size: 14px; }
.sp-item .sp-desc { font-size: 11px; color: #6b5691; }
#sp-cancel { display: block; margin: 6px auto 0; }

/* ---------------- Dex badges & filter ---------------- */
/* R20: dex controls stack vertically (search on top, dropdowns, chips) */
.col-filter { display: flex; flex-direction: column; gap: 7px; margin: 2px 0 12px; }
.col-search {
  width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 12px;
  border: 1.5px solid #e5d8ff; background: #fff; color: var(--text);
  font-size: 14px; font-weight: 600;
}
.col-search::placeholder { color: #9a86c9; }
.col-selects { display: flex; gap: 7px; }
.col-select {
  flex: 1; min-width: 0; padding: 8px 8px; border-radius: 12px;
  border: 1.5px solid #e5d8ff; background: #fff; color: var(--text);
  font-size: 12.5px; font-weight: 700;
}
.col-chips { display: flex; gap: 6px; }
.col-chip {
  flex: 1; padding: 7px 4px; border-radius: 12px;
  background: var(--lavender); color: var(--text);
  font-size: 12px; font-weight: 800; text-align: center;
}
.col-chip.active { background: var(--purple); color: #fff; }
.dex-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; margin-left: 4px; vertical-align: middle;
}
.dex-badge.locked { background: #e5dcf3; color: #6b5691; }
.dex-badge.met { background: #cfe6ff; color: #2c6aa8; }
.dex-badge.friend { background: linear-gradient(135deg, #ffd166, var(--pink)); color: #fff; }

/* ---------------- Round 4: HUD level/xp/buddy ---------------- */
#hud { flex-wrap: wrap; }
.lvl-pill { gap: 4px; }
.lvl-pill b { color: var(--purple); }
.xp-track { display: inline-block; width: 34px; height: 6px; border-radius: 999px; background: #e6dcff; overflow: hidden; vertical-align: middle; }
.xp-track > i { display: block; height: 100%; background: linear-gradient(90deg, #8a5cf5, var(--pink)); border-radius: 999px; transition: width 0.4s; }
#hud-buddy { gap: 2px; font-size: 15px; }

/* rarity badge on markers */
.uni-marker .uni-rar {
  position: absolute; bottom: -6px; right: -8px; font-size: 13px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4));
}
.buddy-marker {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(160deg, #fff, var(--uc, #b399f0));
  border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  animation: bob 2.2s ease-in-out infinite;
}
.rar-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; color: #fff; background: var(--rc, #9aa0b5);
  vertical-align: middle;
}

/* ---------------- Mini buttons ---------------- */
.mini-btn {
  background: var(--lavender); color: var(--text);
  border-radius: 11px; padding: 6px 12px; font-size: 12px; font-weight: 800;
  margin-top: 6px;
}
.mini-btn:active { transform: scale(0.93); }
.mini-btn.active { background: linear-gradient(135deg, #ffd166, var(--pink)); color: #fff; }
.mini-btn:disabled { opacity: 0.45; }

/* ---------------- Menu ---------------- */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.menu-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: #fff; border: 2px solid #e8dcff; border-radius: 16px; padding: 14px 6px;
  font-size: 13px; font-weight: 800; color: var(--text);
}
.menu-item:active { transform: scale(0.95); }
.menu-ico { font-size: 28px; }
.menu-lock { font-size: 9px; color: #b09; font-weight: 600; }

/* ---------------- Shop ---------------- */
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shop-card {
  position: relative; background: #fff; border: 2px solid #e8dcff; border-radius: 16px;
  padding: 10px 4px 8px; text-align: center;
}
.shop-card.fav { border-color: var(--gold); background: #fffbe8; }
.shop-card.deal { border-color: #ff6fb5; background: #fff4fa; }
.shop-card .s-emoji { font-size: 26px; }
.shop-card .s-name { font-size: 11px; font-weight: 700; margin: 2px 0; }
.shop-card .s-price { font-size: 11px; color: #6b4fa8; font-weight: 700; }
.shop-card .s-deal { position: absolute; top: -8px; left: -4px; background: #ff6fb5; color: #fff; font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 999px; }

/* ---------------- Quests ---------------- */
.quest-row, .ach-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 2px solid #e8dcff; border-radius: 16px; padding: 10px 12px; margin-bottom: 8px;
}
.quest-row.done, .ach-row.unlocked { border-color: #7ed491; background: #f2fdf5; }
.q-info { flex: 1; min-width: 0; }
.q-name { font-weight: 800; font-size: 14px; }
.qbar { height: 8px; border-radius: 999px; background: #eadfff; overflow: hidden; margin: 5px 0; }
.qbar > i { display: block; height: 100%; background: linear-gradient(90deg, #8a5cf5, var(--pink)); border-radius: 999px; }
.q-meta { font-size: 11px; color: #6b5691; }
.q-claimed { font-size: 20px; }

/* ---------------- Achievements ---------------- */
.ach-emoji { font-size: 30px; width: 40px; text-align: center; }
.ach-info { flex: 1; }
.ach-name { font-weight: 800; font-size: 14px; }
.ach-desc { font-size: 11px; color: #6b5691; }
.ach-rew { font-size: 11px; color: #6b4fa8; margin-top: 2px; }
.ach-row:not(.unlocked) { opacity: 0.75; }

/* ---------------- Eggs / incubator ---------------- */
.incubator {
  background: #fff; border: 2px dashed #e8dcff; border-radius: 18px;
  padding: 16px; text-align: center; margin-bottom: 8px;
}
.incubator.ready { border-style: solid; border-color: var(--gold); background: #fffbe8; animation: potglow 1.6s ease-in-out infinite; }
.inc-emoji { font-size: 46px; animation: bob 2.4s ease-in-out infinite; }
.inc-name { font-weight: 800; font-size: 13px; margin: 4px 0; }
.egg-inv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.egg-item { background: #fff; border: 2px solid var(--rc, #e8dcff); border-radius: 16px; padding: 10px 4px; text-align: center; }
.egg-item .s-emoji { font-size: 26px; }
.egg-item .s-name { font-size: 11px; font-weight: 700; margin: 2px 0; }

/* ---------------- Buddy ---------------- */
.buddy-cur {
  display: flex; align-items: center; gap: 12px;
  background: #fff5fb; border: 2px solid var(--pink); border-radius: 18px; padding: 12px; margin-bottom: 8px;
}

/* ---------------- Settings ---------------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; font-size: 14px; font-weight: 600; }
.set-row input[type="range"] { flex: 1; max-width: 160px; accent-color: var(--purple); }

/* ---------------- Onboarding ---------------- */
#onboard {
  position: fixed; inset: 0; z-index: 1150;
  background: linear-gradient(170deg, rgba(52,32,94,0.97), rgba(28,16,56,0.98));
  display: flex; align-items: center; justify-content: center;
}
.ob-card {
  width: min(88vw, 360px); background: var(--card); border-radius: var(--radius);
  padding: 26px 22px; text-align: center; box-shadow: var(--shadow);
  animation: pop-in 0.3s cubic-bezier(0.22, 1.4, 0.36, 1);
}
.ob-emoji { font-size: 60px; }
.ob-card h2 { margin: 8px 0 6px; font-size: 21px; }
.ob-card p { font-size: 14px; color: #6b4fa8; line-height: 1.5; }
.ob-dots { display: flex; justify-content: center; gap: 6px; margin: 16px 0; }
.ob-dot { width: 8px; height: 8px; border-radius: 50%; background: #d9c9f5; }
.ob-dot.on { background: var(--purple); width: 20px; border-radius: 999px; }
.ob-btns { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------------- Round 5: env, habitats, POI, evolve ---------------- */
#hud-env { font-size: 15px; letter-spacing: -1px; }

.habitat-label {
  font-size: 10px; font-weight: 800; color: #fff; white-space: nowrap; text-align: center;
  /* Ren dekor — biomerna går inte att trycka på. Skjuts bakåt så att de
     inte konkurrerar med de guldpulsande markörerna om blicken. */
  background: var(--hc, #8a5cf5); opacity: 0.52;
  padding: 1px 8px; border-radius: 999px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.poi-marker {
  width: 52px; height: 52px; margin: 6px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, #b48cff);
  border: 3px solid #d9c2ff; box-shadow: 0 3px 10px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  /* Grundläget = laddar om → MÖRK. */
  position: relative; filter: var(--mk-dim);
  transition: filter 0.35s ease, opacity 0.35s ease;
}
/* REDO: laddad OCH inom räckhåll → full färg + samma guldpuls som allt annat
   man kan göra just nu. */
.poi-marker.ready {
  filter: none; border-color: #ffd166;
  box-shadow: 0 0 14px 3px rgba(255, 208, 120, 0.8);  /* statisk grund, se .uni-marker.reachable */
  animation: mk-pulse 1.7s ease-in-out infinite;
}
/* UTOM RÄCKHÅLL: går aldrig att snurra den här sessionen (spelaren rör sig
   inte) → mörkast av allt, så barnet inte går på den om och om igen. */
.poi-marker.far { filter: var(--mk-dim) grayscale(0.85); opacity: 0.62; }
.poi-cd {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  background: rgba(28,16,56,0.9); color: #fceaff; font-size: 9px; font-weight: 800;
  padding: 1px 6px; border-radius: 999px; white-space: nowrap;
}
.poi-cd.far { background: rgba(28,16,56,0.75); color: #b9a8d8; }
.uni-marker.evolved .uni-bubble { box-shadow: 0 0 14px 3px rgba(255,220,120,0.85); border-color: #ffe08a; }
.uni-marker.evolved .uni-name b { color: #fff; }
.col-emoji.evolved { box-shadow: 0 0 12px 2px rgba(255,220,120,0.8); border-color: #ffe08a; }
.col-row.evo { border-color: #ffe08a; background: linear-gradient(120deg, #fffaf0, #fff5fb); }

/* ---------------- Crafting ---------------- */
.craft-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 2px solid #e8dcff; border-radius: 16px; padding: 10px 12px; margin-bottom: 8px;
}
.craft-out { font-size: 30px; width: 42px; text-align: center; }
.craft-info { flex: 1; min-width: 0; }
.craft-name { font-weight: 800; font-size: 14px; }

/* ---------------- Story ---------------- */
.story-row {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 2px solid #e8dcff; border-radius: 16px; padding: 11px 12px; margin-bottom: 8px;
}
.story-row.done { border-color: #7ed491; background: #f2fdf5; }
.story-row.current { border-color: var(--purple); background: #f7f2ff; box-shadow: var(--shadow); }
.story-row.locked { opacity: 0.6; }
.story-ico { font-size: 22px; }
.story-title { font-weight: 800; font-size: 14px; }

/* ---------------- Stats ---------------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-cell {
  background: #fff; border: 2px solid #eee3ff; border-radius: 14px; padding: 10px 4px; text-align: center;
}
.stat-ico { font-size: 20px; }
.stat-v { font-weight: 800; font-size: 15px; color: var(--purple); margin: 2px 0; }
.stat-k { font-size: 10px; color: #6b5691; }
.milestone-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.ms-chip {
  font-size: 11px; font-weight: 800; padding: 5px 10px; border-radius: 999px;
  background: #eee3ff; color: #6b5691;
}
.ms-chip.done { background: linear-gradient(135deg, #ffd166, var(--pink)); color: #fff; }

/* ---------------- Settings help note ---------------- */
.help-note {
  background: #f3ecff; border-radius: 14px; padding: 11px 13px; margin: 12px 0 4px;
  font-size: 12px; color: #5a4a86; line-height: 1.5;
}
.help-note code { background: #e2d4ff; padding: 1px 5px; border-radius: 5px; font-size: 11px; }

/* ---------------- Accessibility: tap targets + reduced motion ---------------- */
.mini-btn, .dev-btn, .col-chip { min-height: 34px; }
#navbar button { min-height: 44px; }
.round-btn { min-width: 42px; min-height: 42px; }
body.reduced * { animation: none !important; }
body.reduced #weatherfx { display: none; }
@media (prefers-reduced-motion: reduce) {
  .leaflet-tile-pane { transition: none; }
  .uni-marker .uni-bubble, .loc-uni, .inc-emoji, .pot.growing .pot-emoji { animation: none; }
}

/* ============================================================
   ROUND 6 — The Unicorn Parade
   ============================================================ */

/* R28: awareness bar moved off the map into the menu ("🌍 Världen tror").
   The DOM node is kept (parade.js still writes to it and openBelief() may
   reveal a compact version later); the map view no longer shows it. */
#hud-aware { display: none !important; }
/* Old on-map layout kept below, commented out — restoring is one line.
#hud-aware {
  position: fixed;
  top: calc(58px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  z-index: 590;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(120deg, rgba(60,30,120,0.92), rgba(150,70,220,0.92));
  color: #fff; border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px; padding: 5px 14px 5px 10px;
  box-shadow: var(--shadow); font-family: var(--font);
  max-width: 88vw;
} */
#hud-aware .aw-ico { font-size: 18px; }
#hud-aware .aw-mid { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
#hud-aware .aw-count { font-size: 14px; font-weight: 800; }
#hud-aware .aw-label { font-size: 9.5px; opacity: 0.9; }
.aw-bar { display: block; width: 130px; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.25); overflow: hidden; margin-top: 3px; }
.aw-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #ffd166, #ff8fd8); border-radius: 999px; transition: width 0.5s; }
.aw-bar.big { width: 100%; height: 9px; margin-top: 6px; background: #eadfff; }
.aw-bar.big > i { background: linear-gradient(90deg, #8a5cf5, var(--pink)); }

.menu-item.highlight { border-color: var(--pink); background: linear-gradient(135deg, #fff, #fff2fb); }

/* Awareness panel (in parade sheet) */
.aware-panel { background: linear-gradient(135deg, #f3ecff, #ffeef8); border: 2px solid #e6d6ff; border-radius: 18px; padding: 12px; margin-bottom: 6px; }
.ap-top { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.ap-rank { font-size: 12px; font-weight: 800; color: #8a5cf5; }
.ap-count { font-size: 13px; margin-top: 4px; color: #4a2f80; }
.ap-next { color: #6b5691; font-size: 11px; }
.ap-prestige { margin-top: 6px; font-size: 11px; font-weight: 800; color: #b8860b; }

/* Parade preview */
.parade-preview { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; justify-content: center; background: linear-gradient(180deg, #2a1b4e, #3b2270); border-radius: 16px; padding: 16px 10px; min-height: 74px; }
.parade-preview.empty { color: #cbb8f0; font-size: 13px; align-items: center; }
.pp-uni { font-size: 30px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); transition: transform 0.2s; }
.pp-uni.up { transform: translateY(-12px); }
.pp-uni.down { transform: translateY(8px); }
.pp-uni.arc0 { transform: translateY(6px); } .pp-uni.arc1 { transform: translateY(-6px); }
.pp-uni.arc2 { transform: translateY(-12px); } .pp-uni.arc3 { transform: translateY(-6px); } .pp-uni.arc4 { transform: translateY(6px); }

.form-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.fr-label { font-size: 12px; font-weight: 800; color: #6b4fa8; width: 100%; }
.chip-btn { background: var(--lavender); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; }
.chip-btn.active { background: var(--purple); color: #fff; }
.perf-meta { font-size: 11px; color: #6b5691; text-align: center; margin: 8px 0 4px; }

.parade-friend { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid #e8dcff; border-radius: 16px; padding: 9px 11px; margin-bottom: 7px; }
.parade-friend.in { border-color: var(--pink); background: #fff5fb; }
.pf-info { flex: 1; min-width: 0; }
.pf-name { font-weight: 800; font-size: 13px; }
.pf-btns { display: flex; gap: 4px; }
.pf-btns .mini-btn { padding: 6px 9px; margin-top: 0; }

/* Performance overlay */
#parade-overlay { position: fixed; inset: 0; z-index: 900; background: #2a1b4e; touch-action: none; }
/* R23: during a map performance the overlay is a transparent tap-catcher
   (the neighbourhood below IS the stage); the result card gets a soft dim. */
#parade-overlay.on-map { background: transparent; }
#parade-overlay.on-map.dimres { background: rgba(20, 10, 40, 0.55); }
#parade-phud { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; }
#parade-phud .pill { font-size: 14px; }
#parade-phud .combo { color: #ff7043; font-weight: 800; }
#perf-quit { margin-left: auto; width: 38px; height: 38px; font-size: 15px; }
#parade-result { z-index: 2; }

/* Today / home summary */
.today-hero { background: linear-gradient(135deg, #6a4bd0, #b466e0); color: #fff; border-radius: 18px; padding: 14px; margin-bottom: 10px; text-align: center; }
.th-aware { font-size: 17px; font-weight: 800; }
.th-sub { font-size: 12px; opacity: 0.92; margin-top: 4px; }
.today-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid #e8dcff; border-radius: 14px; padding: 10px 12px; margin-bottom: 7px; }
.td-ico { font-size: 22px; }
.td-txt { flex: 1; font-size: 13px; font-weight: 600; }

/* Finale */
#parade-finale { position: fixed; inset: 0; z-index: 1000; overflow: hidden; background: radial-gradient(circle at 50% 35%, rgba(150,80,230,0.9), rgba(25,8,55,0.97)); display: flex; align-items: center; justify-content: center; }
.finale-card { position: relative; z-index: 2; width: min(92vw, 400px); max-height: 90vh; overflow-y: auto; text-align: center; color: #fff; padding: 24px 20px; animation: pop-in 0.5s cubic-bezier(0.22,1.4,0.36,1); }
.fin-emoji { font-size: 60px; animation: bond-bounce 1.1s ease-in-out infinite; }
.finale-card h1 { font-size: 26px; margin: 8px 0; background: linear-gradient(90deg,#ffd166,#ff8fd8,#a78bfa,#6fe3e1); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.fin-parade { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin: 10px 0; }
.fin-uni { width: 60px; height: 60px; }
.fin-uni svg { width: 60px; height: 60px; display: block; }
.finale-card p { font-size: 14px; margin: 6px 0; color: #f4e8ff; }
.fin-big { font-size: 17px !important; font-weight: 800; color: #fff !important; }
.finale-card .big-btn { max-width: 280px; margin: 16px auto 8px; }
.finale-card .mini-btn { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  .fin-emoji, .pp-uni { animation: none; }
  #hud-aware .aw-bar > i, .aw-bar.big > i { transition: none; }
}

/* ---------------- R7: Unicorn character art (SVG) ---------------- */
#meet-head { align-items: center; }
.m-hero { flex: none; width: 124px; align-self: center; }
.m-hero .uni-svg, .uni-svg { width: 124px; height: 124px; display: block; overflow: visible; }
.uni-svg text { font-family: "Segoe UI Emoji", "Apple Color Emoji", serif; }
.uni-svg.glowy { filter: drop-shadow(0 0 5px var(--gl, transparent)); }
.uni-svg.evolved { animation: uniShimmer 2.6s ease-in-out infinite; }
@keyframes uniShimmer {
  0%, 100% { filter: drop-shadow(0 0 4px var(--gl, #ffe08a)) brightness(1); }
  50%      { filter: drop-shadow(0 0 13px var(--gl, #ffe08a)) brightness(1.09); }
}
.bond-svg { display: inline-block; }
.bond-svg svg { width: 118px; height: 118px; }
body.reduced .uni-svg.evolved { animation: none; }
@media (prefers-reduced-motion: reduce) { .uni-svg.evolved { animation: none; } }

/* meet-card hero gentle idle bob */
.m-hero .uni-svg { animation: heroBob 3.4s ease-in-out infinite; }
.m-hero .uni-svg.evolved { animation: heroBob 3.4s ease-in-out infinite, uniShimmer 2.6s ease-in-out infinite; }
@keyframes heroBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
body.reduced .m-hero .uni-svg, body.reduced .m-hero .uni-svg.evolved { animation: none; }
@media (prefers-reduced-motion: reduce) { .m-hero .uni-svg, .m-hero .uni-svg.evolved { animation: none; } }

/* ---------------- R8: art in dex cards ---------------- */
.col-emoji { overflow: hidden; }
.col-art { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.col-art svg { width: 112%; height: 112%; display: block; overflow: visible; }
.parade-friend .col-emoji { overflow: hidden; }

/* ---------------- R8: juice / polish ---------------- */
.mini-btn, .chip-btn, .game-row, .gift-card, .lg-card, .shop-card, .pot-btn, .today-row .mini-btn, .col-chip, .menu-item, .dev-btn, .sp-item {
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.big-btn:active:not(:disabled), .mini-btn:active:not(:disabled), .chip-btn:active, .game-row:active, .menu-item:active, .dev-btn:active, .sp-item:active { transform: scale(0.95); }
.sheet { will-change: transform; }
/* awareness HUD: tidy spacing */
#hud-aware .aw-mid { gap: 1px; }
#hud-aware .aw-count { line-height: 1.1; }
body.reduced .big-btn:active, body.reduced .mini-btn:active { transform: none; }

/* ============================================================
   ROUND 10 — goal clarity, events, world parade, help/about
   ============================================================ */

/* "Next milestone" goal line on the Idag hero */
.th-goal {
  margin-top: 8px; padding: 7px 10px;
  background: rgba(255,255,255,0.16);
  border-radius: 12px; font-size: 12px; font-weight: 700;
}
.th-goalbar { display: block; height: 6px; border-radius: 999px; background: rgba(0,0,0,0.25); overflow: hidden; margin-top: 5px; }
.th-goalbar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold, #ffd166), #fff); transition: width 0.5s; }

/* Seasonal event banner (Idag) */
.event-banner {
  background: linear-gradient(120deg, #ff8fd8, #8a5cf5 55%, #6fe3e1);
  color: #fff; border-radius: 16px; padding: 11px 13px; margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(150, 80, 240, 0.4);
}
.eb-top { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.eb-ico { font-size: 20px; }
.eb-left { margin-left: auto; font-size: 11px; font-weight: 800; background: rgba(0,0,0,0.25); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.eb-blurb { font-size: 12px; opacity: 0.95; margin-top: 3px; }
.eb-note { font-size: 11px; font-weight: 800; margin-top: 4px; background: rgba(255,255,255,0.2); display: inline-block; padding: 2px 8px; border-radius: 999px; }
.hud-ev { margin-left: 1px; }

/* World parade button */
.world-btn {
  background: linear-gradient(135deg, #ffd166, #ff8fd8 50%, #6fe3e1);
  color: #2a1b4e; text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  animation: worldpulse 1.8s ease-in-out infinite;
}
.world-btn small { display: block; font-size: 11px; font-weight: 700; opacity: 0.8; }
@keyframes worldpulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(255, 209, 102, 0.5); }
  50%      { box-shadow: 0 6px 30px rgba(255, 143, 216, 0.9); }
}
body.reduced .world-btn { animation: none; }

/* Minigame result: make rarity/skill bonuses visible */
.rw-chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 2px 0 8px; }
.rw-chip {
  font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px;
  background: var(--rc, #eee3ff); color: #4a2f80; border: 1px solid rgba(0,0,0,0.06);
}
.rw-chip.good { background: #d9f8e2; color: #1d6b3a; }
.rw-chip.slow { background: #efe6ff; color: #5a4a86; }
.mgc-next { font-size: 11.5px !important; color: #6b5691 !important; margin-top: -2px !important; }

/* R11: element themes — launcher sections, match highlight, intro + result */
.lg-fam .lg-match {
  font-size: 10px; font-weight: 800; background: #fff; border: 1px solid currentColor;
  border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px;
}
.lg-card.match { box-shadow: inset 0 0 0 2px var(--elc, var(--purple-soft)); }
.mg-card .mgc-elem { font-weight: 800; font-size: 13px !important; }
.mg-card .mgc-fam { color: #9a86c9; font-weight: 600; }
.mg-card .mgc-match {
  background: #eafff0; border: 1.5px solid #7ed491; border-radius: 12px;
  padding: 6px 10px !important; font-weight: 800; font-size: 12.5px !important; color: #1d6b3a !important;
}
.rw-chip.elem { background: #fff; border: 1.5px solid var(--ec, var(--purple-soft)); }
#mg-elem { font-weight: 800; }

/* R13: Labbet — demo playtesting */
.demo-badge {
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em; vertical-align: 2px;
  background: #ffe9a8; color: #7a5a00; border: 1px solid #e8c76a;
  border-radius: 999px; padding: 1px 6px;
}
.lab-card {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid #e5d8ff; border-radius: 16px;
  padding: 8px 10px; margin-bottom: 8px;
}
.lab-play {
  flex: 1; display: flex; align-items: center; gap: 10px; text-align: left;
  background: none; border: none; padding: 4px; cursor: pointer; color: inherit;
}
.lab-play:active { transform: scale(0.97); }
.lab-emoji { font-size: 30px; }
.lab-info { display: flex; flex-direction: column; gap: 2px; }
.lab-name { font-weight: 800; font-size: 14px; }
.lab-desc { font-size: 11.5px; color: #6b5691; }
.lab-meta { font-size: 10.5px; color: #6b5691; font-weight: 700; } /* R19: was #9a86c9 (3.07:1, failed AA) → 6.05:1 */
.lab-votes { display: flex; gap: 6px; }
.mg-card .lab-votes { justify-content: center; margin: 6px 0 12px; }
.vote-btn {
  font-size: 18px; width: 42px; height: 42px; border-radius: 50%;
  background: #f4edff; border: 1.5px solid #e5d8ff; cursor: pointer;
}
.vote-btn:active { transform: scale(0.9); }
.vote-btn.sel { background: #ffe9a8; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.35); }

/* 🔮 Framtiden (beta) — Chapter-2 prototypes */
.fut-beta {
  font-size: 11.5px; color: #5a4a86; line-height: 1.5;
  background: #f6efff; border: 1.5px dashed #c9a6ff; border-radius: 12px;
  padding: 8px 10px; margin: 2px 0 10px;
}
.fut-samklang {
  text-align: center; font-size: 15px; font-weight: 800; color: var(--text);
  background: linear-gradient(135deg, #fff, #fff2fb); border: 1.5px solid #ffd9f0;
  border-radius: 14px; padding: 8px; margin-bottom: 10px;
}
.fut-samklang b { color: #c74fa0; }
.fut-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.fut-tab {
  flex: 1; padding: 9px 4px; font-size: 12.5px; font-weight: 700;
  background: #f4edff; border: 1.5px solid #e5d8ff; border-radius: 12px; cursor: pointer; color: #5a4a86;
}
.fut-tab.sel { background: var(--purple); border-color: var(--purple); color: #fff; }
.fut-townbar, .fut-collect { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fut-townbar { margin-bottom: 8px; }
.fut-town { font-size: 16px; font-weight: 800; color: var(--text); }
.fut-rate { font-size: 12px; color: #6b5691; font-weight: 700; }
.fut-station, .fut-mission {
  background: #fff; border: 1.5px solid #e5d8ff; border-radius: 16px; padding: 9px 10px; margin-bottom: 9px;
}
.fut-station.match { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.28); }
.fut-st-head, .fut-msn-head { display: flex; align-items: center; gap: 9px; }
.fut-st-emoji { font-size: 26px; flex: none; }
.fut-st-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fut-st-name { font-weight: 800; font-size: 13.5px; }
.fut-st-type { font-weight: 600; font-size: 10.5px; color: #6b5691; }
.fut-st-help { font-size: 11px; color: #6b5691; }
.fut-st-rate { font-size: 11.5px; font-weight: 800; color: #4a8f5e; flex: none; text-align: right; }
.fut-chiprow { display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px 2px; -webkit-overflow-scrolling: touch; }
.fut-chip {
  flex: none; width: 62px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: #f8f4ff; border: 1.5px solid #e5d8ff; border-radius: 12px; padding: 5px 3px; cursor: pointer; color: inherit;
}
.fut-chip.sel { background: #ffe9a8; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.35); }
.fut-chip:disabled { opacity: 0.4; cursor: default; }
.fut-chip-art { width: 38px; height: 38px; }
.fut-chip-art svg { width: 38px; height: 38px; display: block; }
.fut-chip-name { font-size: 9.5px; font-weight: 700; color: #5a4a86; }
.fut-chip-types { font-size: 10px; }
.fut-prov {
  font-size: 8px; font-weight: 800; letter-spacing: 0.04em; margin-left: 2px;
  background: #e5d8ff; color: #6b4fb0; border-radius: 999px; padding: 0 4px; vertical-align: 1px;
}
.fut-prov.match { background: #ffe9a8; color: #7a5a00; }
.fut-collect { margin: 6px 0 4px; }
.fut-collect .big-btn { width: auto; margin: 0; padding: 10px 16px; }
.fut-pending { font-size: 13px; font-weight: 700; color: var(--text); }
.fut-pending b, .fut-townbar b { color: #4a8f5e; }
.fut-msn-run { display: flex; align-items: center; gap: 9px; padding: 8px 2px 2px; font-size: 12.5px; color: #5a4a86; }
.fut-msn-art { width: 40px; height: 40px; flex: none; }
.fut-msn-art svg { width: 40px; height: 40px; display: block; }
.fut-msn-timer { color: var(--purple); font-size: 15px; }
.fut-msn-home { margin-left: auto; }
.fut-h3 { font-size: 14px; margin: 14px 0 8px; }
.fut-voterow {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #fff; border: 1.5px solid #e5d8ff; border-radius: 14px; padding: 8px 12px; margin-bottom: 8px;
}
.fut-vlabel { font-weight: 700; font-size: 13px; }
.fut-abrow { display: flex; gap: 8px; }
.fut-ab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center;
  background: #fff; border: 2px solid #e5d8ff; border-radius: 16px; padding: 12px 8px; cursor: pointer; color: inherit;
}
.fut-ab.sel { border-color: var(--pink); background: linear-gradient(135deg, #fff, #fff2fb); box-shadow: 0 0 0 2px rgba(255, 143, 216, 0.3); }
.fut-ab-emoji { font-size: 30px; }
.fut-ab-name { font-weight: 800; font-size: 14px; }
.fut-ab-desc { font-size: 10.5px; color: #6b5691; line-height: 1.4; }

/* "Idag" unseen dot in the menu */
.menu-item.newdot { position: relative; }
.menu-item.newdot::after {
  content: ""; position: absolute; top: 8px; right: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--pink); box-shadow: 0 0 0 2px #fff;
}

/* Help sheet */
.help-row { display: flex; gap: 11px; align-items: flex-start; background: #fff; border: 2px solid #e8dcff; border-radius: 16px; padding: 11px 12px; margin-bottom: 8px; }
.help-ico { font-size: 24px; flex: none; width: 30px; text-align: center; }
.help-txt { flex: 1; min-width: 0; }
.help-title { font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.help-txt .help-body { font-size: 12px; color: #5a4a86; line-height: 1.5; }

/* About sheet */
.about-hero { text-align: center; padding: 4px 0 8px; }
.about-uni { width: 108px; margin: 0 auto; }
.about-uni svg { width: 108px; height: 108px; display: block; }
.about-hero h3 { margin: 4px 0 2px; font-size: 19px; }
.about-p { font-size: 12.5px; color: #5a4a86; line-height: 1.55; margin: 4px 0 2px; }
.about-p code { background: #efe6ff; padding: 1px 5px; border-radius: 5px; font-size: 11px; }

/* ---------------- Desktop tweaks ---------------- */
@media (min-width: 700px) {
  .sheet {
    left: 50%; right: auto;
    width: 440px;
    transform: translate(-50%, 105%);
  }
  .sheet.open { transform: translate(-50%, 0); }
}

/* ============================================================
   R21 — Friends live on the map (vänhem)
   ============================================================ */
/* R28: two levels, not three.
     · Grundläget = "redan hälsat på idag" är NEUTRALT — inget puls, ingen guld,
       full färg utan att skrika. Vännen bor bara här. Går fortfarande att
       trycka (öppnar möteskortet).
     · .visitable = dagens besök väntar → guldpuls, se längre ner.
   Föregående R27-läge dämpade grundläget med --mk-soft; det läste ändå som
   "något händer" när vi la den bredvid en pulsande visitable. */
.home-marker {
  width: 86px; text-align: center;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.45));
  cursor: pointer;
  transition: filter 0.35s ease;
}
.home-den { width: 58px; height: 46px; margin: 0 auto; }
.home-den svg { width: 100%; height: 100%; display: block; }
.home-uni { width: 38px; height: 38px; margin: -36px auto 0; position: relative; }
.home-uni svg { width: 38px; height: 38px; display: block; overflow: visible; animation: none; }
.home-marker.asleep .home-uni { opacity: 0.5; filter: saturate(0.55) brightness(0.8); transform: translateY(5px) scale(0.85); }
.home-name {
  font-size: 10px; font-weight: 700; color: #fff;
  background: rgba(40,22,78,0.78); border: 1px solid var(--uc, #b399f0);
  border-radius: 8px; padding: 1px 6px; display: inline-block;
  max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 2px;
}
/* REDO: dagens "hälsa på" väntar → full färg + samma guldpuls som en
   enhörning inom räckhåll. Detta är dagens säkraste vänskap+EXP. */
.home-marker.visitable { filter: drop-shadow(0 3px 6px rgba(0,0,0,0.45)); }
.home-marker.visitable .home-den { filter: drop-shadow(0 0 9px var(--gold)); animation: mk-pulse 1.9s ease-in-out infinite; border-radius: 50%; }
.home-marker.visitable .home-name { border-color: var(--gold); background: rgba(88,60,10,0.85); }
.home-count {
  font-size: 15px; font-weight: 800; color: #fff; position: relative;
  margin-top: -32px; text-shadow: 0 1px 3px rgba(0,0,0,0.65);
}
.home-marker.cluster .home-name { max-width: 104px; }

/* ============================================================
   R21 — "Någon kommer!" arrival moments
   ============================================================ */
#arrival-banner {
  position: fixed; top: 92px; left: 50%;
  transform: translate(-50%, -180%);
  z-index: 650; /* over map + HUD, under sheets (700+) and every overlay */
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(42,27,78,0.96), rgba(96,54,158,0.96));
  border: 2px solid var(--gold); border-radius: 16px;
  padding: 8px 14px; color: #fff; max-width: 90vw;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  cursor: pointer;
}
#arrival-banner.show { transform: translate(-50%, 0); }
body.reduced #arrival-banner { transition: none; }
.arr-art { width: 46px; height: 46px; flex: 0 0 auto; }
.arr-art svg { width: 46px; height: 46px; display: block; overflow: visible; animation: none; }
.arr-txt { font-size: 14px; line-height: 1.3; font-weight: 600; }
.arr-txt b { color: #ffe9a8; }
.arr-sub { display: block; font-size: 11px; font-weight: 500; opacity: 0.85; }
.arrival-shimmer {
  position: fixed; inset: 0; z-index: 640; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(255,225,150,0.35), rgba(201,166,255,0.12) 45%, transparent 75%);
  animation: arrShimmer 1.3s ease-out forwards;
}
@keyframes arrShimmer { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.arrival-trail {
  stroke-dasharray: 3 9; stroke-linecap: round;
  animation: trailDash 1.2s linear infinite;
  filter: drop-shadow(0 0 5px var(--gold));
  transition: opacity 0.6s;
}
@keyframes trailDash { to { stroke-dashoffset: -24; } }

/* ============================================================
   R22 — Äventyret (goal spine) + Silverhorn picker
   ============================================================ */
.story-row.compact { padding: 6px 10px; opacity: 0.75; }
.story-row.compact .story-title { font-size: 12.5px; }
#horn-picker { position: fixed; inset: 0; z-index: 950; background: rgba(20,10,40,0.55); display: flex; align-items: center; justify-content: center; }
#horn-picker.hidden { display: none; }
#horn-picker .sp-card { max-height: 78vh; overflow-y: auto; }
.horn-art { display: inline-flex; width: 40px; height: 40px; }
.horn-art svg { width: 40px; height: 40px; overflow: visible; }
.horn-card .s-price { font-size: 11px; }

/* ============================================================
   R23 — The parade marches through the neighbourhood
   ============================================================ */
.parade-route {
  stroke-dasharray: 4 12; stroke-linecap: round;
  animation: trailDash 1.4s linear infinite;
  filter: drop-shadow(0 0 6px var(--gold));
}
body.reduced .parade-route { animation: none; }

/* marchers */
.pm-wrap { position: relative; width: 52px; height: 56px; text-align: center; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5)); }
.pm-wrap .pm-art { width: 48px; height: 48px; margin: 4px auto 0; animation: pmBob 0.9s ease-in-out infinite; }
.pm-wrap .pm-art svg { width: 48px; height: 48px; display: block; overflow: visible; }
@keyframes pmBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.pm-wrap.evolved .pm-art { filter: drop-shadow(0 0 9px rgba(255,224,138,0.9)); }
.pm-ring {
  position: absolute; left: 50%; top: 55%; width: 54px; height: 54px;
  margin: -27px 0 0 -27px; border: 4px solid var(--gold); border-radius: 50%;
  opacity: 0; transform: scale(1.25); pointer-events: none;
}
.pm-wrap.cued .pm-ring { opacity: 1; animation: pmRing 0.75s ease-in-out infinite alternate; }
.pm-wrap.cued.sweet .pm-ring { border-color: var(--ok); box-shadow: 0 0 12px var(--ok); }
@keyframes pmRing { from { transform: scale(1.3); } to { transform: scale(0.92); } }
.pm-tap { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 17px; opacity: 0; pointer-events: none; }
.pm-wrap.cued .pm-tap { opacity: 1; animation: pmBob 0.5s ease-in-out infinite; }
.pm-wrap.hit .pm-art { animation: pmHit 0.45s ease-out; }
@keyframes pmHit { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-14px) scale(1.15); } 100% { transform: translateY(0) scale(1); } }
body.reduced .pm-wrap .pm-art, body.reduced .pm-wrap.cued .pm-ring, body.reduced .pm-tap { animation: none; }

/* spectators */
.spectator { width: 26px; height: 38px; opacity: 0.95; animation: specPop 0.4s ease-out; }
.spectator svg { width: 100%; height: 100%; display: block; overflow: visible; }
@keyframes specPop { from { transform: translateY(8px) scale(0.4); opacity: 0; } to { transform: none; opacity: 0.95; } }
.spectator .spec-flag, .spectator .spec-arm { transform-origin: 16px 16px; }
.spectator.cheer { animation: specCheer 0.55s ease-in-out infinite alternate; }
@keyframes specCheer { from { transform: translateY(0); } to { transform: translateY(-5px); } }
body.reduced .spectator { animation: none; }

/* score floats + confetti (DOM, few per hit, self-removing) */
.perf-float {
  position: absolute; transform: translate(-50%, 0); z-index: 30;
  font-weight: 800; font-size: 18px; color: #fff; pointer-events: none;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  animation: floatUp 1s ease-out forwards;
}
@keyframes floatUp { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -46px; } }
.perf-conf {
  position: absolute; width: 7px; height: 7px; border-radius: 2px; z-index: 29; pointer-events: none;
  animation: confFly 0.85s ease-out forwards;
}
@keyframes confFly { from { opacity: 1; transform: translate(0, 0) rotate(0); } to { opacity: 0; transform: translate(var(--dx, 30px), var(--dy, -60px)) rotate(200deg); } }

/* world-parade belief meter in the HUD */
#perf-belief {
  position: relative; flex: 1 1 100%; height: 20px; margin-top: 6px;
  background: rgba(0,0,0,0.4); border: 2px solid var(--gold); border-radius: 999px; overflow: hidden;
}
#perf-belief.hidden { display: none; }
#perf-belief i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--pink)); transition: width 0.25s; }
#perf-belief span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
#parade-phud { flex-wrap: wrap; }

/* a friend's home cheering the parade on */
.home-marker.cheer { animation: homeCheer 0.5s ease-in-out infinite alternate; }
.home-marker.cheer .home-den { filter: drop-shadow(0 0 12px var(--gold)) brightness(1.15); }
@keyframes homeCheer { from { transform: translateY(0); } to { transform: translateY(-6px); } }

/* ============================================================
   R23 — Belief lights ("Världen tror", visible)
   ============================================================ */
/* Dekor (ej klickbar) — se MAP AFFORDANCE. Tonad så att tro-ljusen läses
   som stämning i bakgrunden, inte som något att trycka på. */
.belief-light { width: 18px; height: 18px; opacity: 0.62; animation: beliefTwinkle 3.4s ease-in-out infinite; }
.belief-light svg { width: 100%; height: 100%; display: block; overflow: visible; }
/* Keyframen äger opacity medan den kör, så nedtoningen ovan måste göras
   HÄR också — annars gäller den bara i body.reduced. */
@keyframes beliefTwinkle { 0%, 100% { opacity: 0.40; } 50% { opacity: 0.72; } }
.belief-light.pop { animation: beliefPop 0.7s ease-out backwards, beliefTwinkle 3.4s ease-in-out 0.7s infinite; }
@keyframes beliefPop { from { transform: scale(0); opacity: 0; } 70% { transform: scale(1.4); } to { transform: scale(1); opacity: 0.62; } }
body.reduced .belief-light { animation: none; opacity: 0.6; }

/* milestone vignette inside the celebration card */
.celeb-vig { width: 100%; max-width: 300px; border-radius: 12px; margin: 6px auto; display: block; border: 2px solid rgba(255,209,102,0.5); }

/* ============================================================
   R30 — Access gate (family beta)
   Same night gradient as #locating so unlocking feels like the
   game just started fading in behind. Kept intentionally simple:
   one card, four digits, no chrome. Shown BEFORE #locating so no
   GPS/asset/audio work has started when the child sees it.
   ============================================================ */
#gate {
  position: fixed; inset: 0;
  z-index: 1300;                       /* above #locating (1200) and every sheet */
  background: linear-gradient(170deg, #34205e, #1c1038);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
#gate.hidden { display: none; }
.gate-card { text-align: center; color: #f0e6ff; max-width: 380px; }
.gate-emoji { font-size: 72px; animation: bob 2.4s ease-in-out infinite; }
.gate-card h1 { margin: 8px 0 4px; font-size: 30px; }
.gate-sub { color: #c3aaee; font-size: 14px; margin: 0 0 22px; }
.gate-hint { color: #f0e6ff; font-size: 15px; margin: 4px 0 10px; font-weight: 600; }
.gate-inputs {
  display: flex; gap: 10px; justify-content: center; margin: 4px 0 8px;
}
.gate-digit {
  width: 54px; height: 64px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff; font-size: 30px; font-weight: 800;
  text-align: center;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.gate-digit:focus { border-color: var(--pink); background: rgba(255,255,255,0.15); }
.gate-inputs.shake { animation: gateShake 0.4s ease-in-out; }
@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.gate-error {
  color: #ff9ec6; font-size: 13px; font-weight: 700; margin: 8px 0 0;
  min-height: 18px;
}
.gate-signup {
  color: #a996d0; font-size: 12px; margin-top: 22px; line-height: 1.5;
}
body.reduced .gate-emoji, body.reduced .gate-inputs.shake { animation: none; }
