/* ==========================================================================
   Ice Castles — guest app
   --------------------------------------------------------------------------
   Storybook winter: the landing's bright ice sky, pale cards, aurora mint
   for the next step. Lantern gold is earned light only.
   ========================================================================== */

:root {
  --ink-900: #3d8ec4;
  --ink-800: #4a9ad0;
  --ink-700: #62b0dc;
  --ink-600: #7ec4e6;
  --hairline: #b7ddf2;
  --frost-rim: rgba(255, 255, 255, 0.7);
  --ice-pale: #f3faff;
  --ice-card: #c5e8f6;
  --ice-mid: #3d8ec4;
  --ink-text: #1a4060;
  --snow: #ffffff;
  --glass-fill: linear-gradient(165deg, #eef8fd 0%, #d2eef8 100%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --candy-lip: #1a8a94;

  /* type */
  --frost-100: #ffffff;
  --frost-300: #e4f4fb;
  --frost-500: #4a7fa3;

  /* accents */
  --aurora: #7ef3ff;
  --aurora-dim: #2ad4ea;
  --lantern: #f5b942;
  --lantern-dim: #e8a020;
  --violet: #9b6bc3;
  --blush: #ff8fb8;
  --play: #4caf50;
  --play-deep: #2e7d32;
  --water: #3b82c4;
  --earth: #4e7c3a;
  --fire: #cc5500;
  --air: #8fa8bc;
  --spirit: #9b6bc3;
  --realm: var(--aurora);

  /* category keys, reused by map markers and the legend */
  --cat-landmark: #bfeaff;
  --cat-sculpture: var(--violet);
  --cat-lantern: var(--lantern);
  --cat-photo-op: var(--blush);
  --cat-ride: var(--aurora);
  --cat-amenity: #7fa8c9;

  --display: 'Fredoka', 'Nunito', ui-rounded, ui-sans-serif, system-ui, sans-serif;
  --body: 'Nunito', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 26px;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 74px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(120% 70% at 50% -8%, rgba(255, 255, 255, 0.62), transparent 50%),
    radial-gradient(80% 50% at 100% 0%, rgba(196, 160, 255, 0.2), transparent 48%),
    linear-gradient(180deg, #62b4e0 0%, #8ecce8 42%, #c8e8f6 100%);
  color: var(--frost-100);
  font-family: var(--body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
body.quest { overflow: auto; }
body.quest.guide-open,
body.quest.panel-open { overflow: hidden; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}
input { font: inherit; }

:focus-visible {
  outline: 2px solid var(--aurora);
  outline-offset: 3px;
  border-radius: 4px;
}

svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------- aurora -------------------------------- */

.aurora {
  position: fixed;
  inset: 0 0 auto 0;
  height: 62vh;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

.aurora__band {
  position: absolute;
  left: -30%;
  width: 160%;
  height: 190px;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.34;
  will-change: transform;
}

.aurora__band--1 { top: -90px;  background: radial-gradient(ellipse at 50% 50%, var(--aurora), transparent 70%); animation: drift 26s ease-in-out infinite !important; animation-play-state: running !important; opacity: 0.28; }
.aurora__band--2 { top: -30px;  background: radial-gradient(ellipse at 40% 50%, var(--spirit), transparent 70%); animation: drift 34s ease-in-out -8s infinite reverse !important; animation-play-state: running !important; opacity: 0.18; }
.aurora__band--3 { top: 40px;   background: radial-gradient(ellipse at 60% 50%, #4a7bb5, transparent 72%); animation: drift 44s ease-in-out -18s infinite !important; animation-play-state: running !important; opacity: 0.2; }

/* While the guest is panning/zooming, freeze decorative loops so they
   don't compete with map paints on a mid-range phone. */
body.map-moving .pin__halo,
body.map-moving .pin.is-target::before,
body.map-moving .pin.is-glow::before,
body.map-moving .aurora__band { animation-play-state: paused; }

@keyframes drift {
  0%, 100% { transform: translate3d(-6%, 0, 0) skewY(-2deg) scaleY(1); }
  50%      { transform: translate3d(6%, 18px, 0) skewY(2.5deg) scaleY(1.25); }
}

/* ---------------------------------- topbar -------------------------------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: calc(var(--safe-t) + 14px) 16px 22px;
  background: linear-gradient(to bottom, rgba(98, 180, 224, 0.72) 12%, rgba(98, 180, 224, 0));
  pointer-events: none;
}

.topbar__id { pointer-events: auto; min-width: 0; }

.topbar__eyebrow {
  display: block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ice-card);
  margin-bottom: 3px;
}

.topbar__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1;
  color: var(--snow);
  text-shadow: 0 0 8px rgba(120, 180, 255, 0.4);
}

.progressRing {
  position: relative;
  flex: none;
  width: 46px; height: 46px;
  pointer-events: auto;
  display: grid;
  place-items: center;
}

.progressRing svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progressRing__track { stroke: rgba(126, 243, 255, 0.18); stroke-width: 3.5; }
.progressRing__fill {
  stroke: var(--aurora);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 113;
  stroke-dashoffset: 113;
  transition: stroke-dashoffset 900ms var(--ease-out);
  filter: drop-shadow(0 0 6px rgba(126, 243, 255, 0.7));
}

.progressRing__gem {
  position: absolute;
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.9;
  pointer-events: none;
}
.progressRing__label {
  position: absolute;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--frost-100);
  text-shadow: 0 0 8px #04101f, 0 1px 2px #04101f;
}

/* ----------------------------------- map ---------------------------------- */

#map {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: var(--ink-900);
}

.leaflet-container { background: var(--ink-900); font-family: var(--body); outline: none; }
.leaflet-control-attribution { display: none; }
.leaflet-marker-icon { background: none; border: 0; }

/* faceted crystal markers ------------------------------------------------- */

.pin {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  transition: transform 220ms var(--ease-spring);
}

.pin__gem {
  position: relative;
  width: 17px; height: 17px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: var(--ink-700); /* fallback for engines without color-mix */
  background: color-mix(in srgb, var(--pin-color) 26%, var(--ink-800));
  border: 1.6px solid var(--pin-color);
  box-shadow: 0 0 12px -1px var(--pin-color);
}
.pin__art {
  position: relative;
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}
.pin.is-realm { width: 44px; height: 44px; }
.pin.is-realm .pin__art { width: 40px; height: 40px; }

/* Inner sliver reads as a light catch on a carved facet. */
.pin__gem::after {
  content: '';
  position: absolute;
  inset: 2px 8px 8px 2px;
  border-radius: 2px;
  background: var(--pin-color);
  opacity: 0.45;
}

.pin__halo {
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--pin-color);
  opacity: 0;
  animation: haloPulse 2.8s ease-out infinite;
}

@keyframes haloPulse {
  0%   { transform: scale(0.45); opacity: 0.55; }
  70%  { transform: scale(1.1); opacity: 0; }
  100% { transform: scale(1.1); opacity: 0; }
}

.pin__tick {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-900);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 260ms, transform 320ms var(--ease-spring);
}
.pin__tick svg { width: 11px; height: 11px; stroke-width: 3.4; }
.pin__tick img { width: 18px; height: 18px; object-fit: contain; }

/* visited: solid fill, tick shown, halo retired */
.pin.is-visited .pin__gem { background: var(--pin-color); }
.pin.is-visited .pin__gem::after { opacity: 0; }
.pin.is-visited .pin__halo { animation: none; opacity: 0; }
.pin.is-visited .pin__tick { opacity: 1; transform: scale(1); }
.pin.is-visited .pin__art { filter: drop-shadow(0 0 6px var(--pin-color)); }

/* a hunt target wears a warm ring until it's found */
.pin.is-target::before {
  content: '';
  position: absolute;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px dashed var(--lantern);
  animation: spin 12s linear infinite;
}
.pin.is-target.is-visited::before { border-style: solid; animation: none; opacity: 0.5; }

.pin.is-glow::before {
  width: 44px;
  height: 44px;
  border: 2px solid var(--lantern);
  box-shadow: 0 0 18px rgba(255, 180, 85, 0.72);
  animation: glowPulse 1.8s ease-in-out infinite;
}
.pin.is-glow .pin__halo {
  opacity: 0.95;
  transform: scale(1.35);
}
.pin.is-dimmed { opacity: 0.42; }
.pin.is-dimmed::before {
  animation: none;
  opacity: 0.35;
  border-style: solid;
}
.pin.is-dimmed .pin__halo { animation: none; opacity: 0.2; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glowPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.18); opacity: 1; }
}

.pin.is-selected { transform: scale(1.5); z-index: 500; }

.pin__label {
  position: absolute;
  top: 30px;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--frost-300);
  background: rgba(4, 16, 31, 0.78);
  padding: 2px 6px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 200ms;
  pointer-events: none;
}
.zoomed-in .pin__label { opacity: 1; }

/* -------------------------------- map tools ------------------------------- */

.mapTools {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 22px);
  z-index: 30;
  display: grid;
  gap: 9px;
  transition: opacity 240ms, transform 240ms;
}

.mapTool {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--snow);
  padding: 0;
}
.mapTool svg { width: 19px; height: 19px; }
.mapTool img { width: 36px; height: 36px; object-fit: contain; display: block; }
.mapTool.is-on { color: var(--aurora); border-color: rgba(93, 240, 207, 0.45); }

.challenge {
  margin-top: 18px;
  padding: 16px 16px 18px;
  border-radius: 18px;
  background: var(--ice-pale);
  border: 2.5px solid var(--ice-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: var(--ink-text);
  display: grid;
  gap: 12px;
}
.challenge__prompt {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-text);
}
.challenge__row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.challenge__input {
  width: 100%;
  min-height: 52px;
  border: 2px solid var(--ice-card);
  background: var(--snow);
  color: var(--ink-text);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
}
.challenge__choices {
  display: grid;
  gap: 8px;
}
.challenge__choice {
  text-align: left;
  min-height: 52px;
  border: 2px solid var(--ice-card);
  background: var(--snow);
  color: var(--ink-text);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}
.challenge__choice:active { transform: scale(0.98); }

.threshold {
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.threshold.is-open { opacity: 1; pointer-events: auto; }

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-t) + 18px) max(16px, env(safe-area-inset-right, 0px)) calc(18px + var(--safe-b)) max(16px, env(safe-area-inset-left, 0px));
  background: #071526;
  color: #eef8ff;
  overflow: hidden;
}
body.landing-open .topbar,
body.landing-open .station { visibility: hidden; }
.landing__place {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(198, 230, 255, 0.72);
}
.landing__brand {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: center;
  margin-top: 18px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}
.landing__crest {
  width: 42px;
  height: 42px;
  margin-bottom: 4px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(126, 243, 255, 0.55));
}
.landing__title {
  margin: 0;
  max-width: 100%;
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(30px, 10vw, 50px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #f4fbff;
  text-shadow:
    0 0 18px rgba(180, 236, 255, 0.55),
    0 2px 0 rgba(20, 60, 90, 0.35);
}
.landing__kicker {
  margin: 10px 0 0;
  max-width: 100%;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(210, 236, 255, 0.78);
}
.landing__crew {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 16px;
}
.landing__talk {
  position: relative;
  width: min(340px, 100%);
  margin: 10px auto 0;
  z-index: 4;
  pointer-events: none;
}
.landing__talk[hidden] { display: none; }
.landing__bubble {
  position: relative;
  margin: 0;
  padding: 10px 14px 12px;
  border-radius: 16px;
  border: 2px solid rgba(126, 243, 255, 0.55);
  background: rgba(10, 28, 48, 0.92);
  color: #f4fbff;
  text-align: left;
  box-shadow: 0 12px 28px rgba(4, 16, 31, 0.55);
  backdrop-filter: blur(10px);
  animation: bubblePop 420ms var(--ease-spring);
}
.landing__bubble.is-fresh { animation: bubblePop 420ms var(--ease-spring); }
.landing__bubble::after {
  content: "";
  position: absolute;
  left: var(--tail, 50%);
  top: -6px;
  bottom: auto;
  width: 12px;
  height: 12px;
  background: rgba(10, 28, 48, 0.92);
  border-right: 2px solid rgba(126, 243, 255, 0.55);
  border-bottom: 2px solid rgba(126, 243, 255, 0.55);
  transform: translateX(-50%) rotate(-135deg);
}
.landing__bubbleWho {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aurora);
}
.landing__bubble[data-realm="water"] .landing__bubbleWho { color: #7ecbff; }
.landing__bubble[data-realm="earth"] .landing__bubbleWho { color: #8fd07a; }
.landing__bubble[data-realm="fire"] .landing__bubbleWho { color: #ffb068; }
.landing__bubble[data-realm="air"] .landing__bubbleWho { color: #c9dce8; }
.landing__bubble[data-realm="spirit"] .landing__bubbleWho { color: #d7b4ff; }
.landing__bubbleText {
  display: block;
  font-family: var(--body);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}
.landing__realms {
  position: relative;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  padding: 0;
}
.landing__realms li {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}
.landing__realm {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(220, 240, 255, 0.8);
}
.landing__realm img {
  width: clamp(52px, 16vw, 80px);
  height: clamp(52px, 16vw, 80px);
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 4px 10px rgba(4, 16, 31, 0.4));
  animation: pfpBob 2.6s ease-in-out infinite;
}
.landing__realm--earth img { animation-name: pfpSway; animation-duration: 2.9s; animation-delay: 0.15s; }
.landing__realm--fire img { animation-delay: 0.35s; }
.landing__realm--air img { animation-name: pfpSway; animation-duration: 2.4s; animation-delay: 0.5s; }
.landing__realm--spirit img { animation-delay: 0.7s; }
.landing__realm.is-talking img {
  animation: pfpTalk 560ms var(--ease-spring);
  filter: drop-shadow(0 0 14px currentColor);
}
.landing__realm--water { color: #7ecbff; }
.landing__realm--earth { color: #8fd07a; }
.landing__realm--fire { color: #ffb068; }
.landing__realm--air { color: #c9dce8; }
.landing__realm--spirit { color: #d7b4ff; }
.landing__progress {
  margin: 12px 0 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(198, 230, 255, 0.7);
}
.landing__gate {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  pointer-events: none;
}
.landing__gate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
}
.landing__gate::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 21, 38, 0.78) 0%, rgba(7, 21, 38, 0.28) 36%, rgba(7, 21, 38, 0.18) 55%, rgba(7, 21, 38, 0.82) 100%);
}
.landing__lead {
  position: relative;
  z-index: 1;
  margin: auto 0 0;
  max-width: 280px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(220, 240, 255, 0.92);
  text-shadow: 0 1px 8px rgba(7, 21, 38, 0.7);
}
.landing__begin {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  min-height: 118px;
  margin-top: 8px;
  padding: 36px 48px 16px;
  border-radius: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 1px 2px rgba(8, 32, 56, 0.75),
    0 0 10px rgba(8, 32, 56, 0.45);
  background: url("/assets/art/btn-begin-quest.png") center / 100% 100% no-repeat;
  box-shadow: none;
}
.landing__begin span { position: relative; z-index: 1; }
.landing__begin::after {
  content: "";
  position: absolute;
  inset: 24% 12% 34%;
  border-radius: 40px;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.45) 50%, transparent 65%);
  transform: translateX(-130%);
  pointer-events: none;
  animation: btnShimmer 3.2s var(--ease-out) 0.9s infinite;
}
.landing__foot {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  width: min(380px, 100%);
  margin-top: 12px;
}
.landing__link {
  position: relative;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 68px;
  padding: 0 28px;
  border-radius: 999px;
  border: 0;
  background: url("/assets/art/btn-pill-a.png") center / 100% 100% no-repeat;
  box-shadow: none;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 1px 2px rgba(8, 32, 56, 0.7),
    0 0 8px rgba(8, 32, 56, 0.4);
}
.landing__link img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: none;
}
.landing__link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  flex: none;
}
.landing__link + .landing__link { background-image: url("/assets/art/btn-pill-b.png"); }
.landing__link::after {
  content: "";
  position: absolute;
  inset: 18% 10% 22%;
  border-radius: 999px;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.4) 50%, transparent 65%);
  transform: translateX(-130%);
  pointer-events: none;
}
.landingHowto {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 18, 32, 0.72);
}
.landingHowto[hidden] { display: none; }
.landingHowto__card {
  width: min(380px, 100%);
  padding: 22px 18px 16px;
  border-radius: 18px;
  border: 3px solid var(--ice-card);
  background: var(--ice-pale);
  color: var(--ink-text);
}
.landingHowto__kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ice-mid);
}
.landingHowto__title {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  color: var(--ink-text);
}
.landingHowto__body {
  margin: 12px 0 18px;
  line-height: 1.5;
  font-size: 15px;
}
.threshold__primary,
.threshold__ghost {
  min-height: 56px;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.threshold__primary {
  background: linear-gradient(#b8fbff, var(--aurora) 55%, var(--aurora-dim));
  color: var(--ink-text);
  border-bottom: 4px solid var(--candy-lip);
}
.threshold__primary--earned {
  background: linear-gradient(#ffe28a, var(--lantern) 50%, var(--lantern-dim));
  color: #3a2200;
  border-bottom-color: #b07810;
}
.threshold__ghost {
  border: 2px solid var(--ice-mid);
  color: var(--ink-text);
  background: var(--snow);
}

.mapModal {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  background: rgba(7, 22, 38, 0.42);
  opacity: 0;
  pointer-events: none;
}
.mapModal.is-open { opacity: 1; pointer-events: auto; }
.mapModal--hint {
  align-items: end;
  background: linear-gradient(180deg, rgba(7, 22, 38, 0) 0%, rgba(7, 22, 38, 0) 42%, rgba(7, 22, 38, 0.28) 100%);
  pointer-events: none;
}
.mapModal--hint .mapModal__card {
  margin-bottom: calc(8px + env(safe-area-inset-bottom));
  pointer-events: auto;
}
/* Begin Quest frames only the Guardian row. The rest of the park sits
   outside this pane until the guest asks for the whole map. */
body.begin-frame .guide #map {
  top: calc(var(--safe-t) + 12px);
  bottom: auto;
  height: 188px;
  overflow: hidden;
}
body.begin-frame.map-modal-open .mapModal--hint {
  top: calc(var(--safe-t) + 208px);
  bottom: auto;
  height: auto;
  padding-top: 8px;
  align-items: start;
  background: transparent;
}
body.begin-frame.map-modal-open .mapModal--hint .mapModal__card {
  margin-bottom: 0;
}
body.begin-frame .guide .mapTools {
  top: auto;
  bottom: calc(16px + var(--safe-b));
}
body.begin-frame.map-modal-open .mapTools,
body.begin-frame.map-modal-open .scanFab--guide,
body.begin-frame.map-modal-open .guideFab {
  visibility: hidden;
}
.mapModal__card {
  width: min(380px, 100%);
  margin-bottom: 8vh;
  padding: 20px 18px 16px;
  border-radius: 18px;
  border: 3px solid var(--ice-card);
  background: var(--ice-pale);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  color: var(--ink-text);
  transform: translateY(16px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.mapModal.is-open .mapModal__card { transform: translateY(0); }
.mapModal__eyebrow {
  margin: 0 0 6px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ice-mid);
}
.mapModal__title {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.1;
  color: var(--ink-text);
}
.mapModal__body {
  margin: 10px 0 0;
  color: var(--ink-text);
  line-height: 1.45;
  font-size: 15px;
}
.mapModal__actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.badgeCard {
  margin: 18px 0 12px;
  padding: 22px 18px;
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 180, 85, 0.28), transparent 55%),
    linear-gradient(160deg, #143454, #071b31);
  border: 1px solid rgba(255, 180, 85, 0.35);
}
.badgeCard__seal {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lantern);
}
.badgeCard__title {
  margin: 10px 0 0;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: -0.02em;
}
.badgeCard__meta,
.badgeCard__date,
.badgeCard__body {
  margin: 8px 0 0;
  color: var(--frost-300);
  font-size: 13px;
  line-height: 1.45;
}
.badgeCard__body { margin-top: 14px; }
.journeyAudio { width: 100%; margin-top: 16px; }

body.sheet-open .mapTools,
body.sheet-open .legend,
body.panel-open .mapTools { opacity: 0; transform: translateY(10px); pointer-events: none; }

/* --------------------------------- legend --------------------------------- */

.legend {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 76px);
  z-index: 31;
  width: 186px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--ice-pale);
  color: var(--ink-text);
  border: 2px solid var(--ice-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: popIn 260ms var(--ease-spring);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.legend__title {
  margin: 0 0 9px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--frost-500);
}

.legend__rows { display: grid; gap: 2px; }

.legend__row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 5px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-text);
  text-align: left;
  width: 100%;
}
.legend__row[aria-pressed="true"] { color: var(--ink-text); background: rgba(93, 240, 207, 0.16); }
.legend__row[aria-pressed="false"] { opacity: 0.44; }

.legend__gem {
  width: 11px; height: 11px;
  flex: none;
  transform: rotate(45deg);
  border-radius: 2px;
  border: 1.5px solid var(--pin-color);
  background: rgba(255, 255, 255, 0.18); /* fallback */
  background: color-mix(in srgb, var(--pin-color) 40%, transparent);
}

.legend__count { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--frost-500); }

/* ---------------------------------- sheet --------------------------------- */

.sheet {
  position: fixed;
  left: 0; right: 0;
  top: 0;
  bottom: auto;
  z-index: 45;
  max-height: 84vh;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: linear-gradient(to bottom, #f3faff, #d8eef8);
  color: var(--ink-text);
  border-bottom: 3px solid var(--ice-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-104%);
  transition: transform 420ms var(--ease-out);
  padding-top: calc(var(--safe-t) + 4px);
}

body.sheet-open .sheet { transform: none; }

.sheet__grip {
  flex: none;
  height: 26px;
  display: grid;
  place-items: center;
}
.sheet__grip::before {
  content: '';
  width: 42px; height: 4px;
  border-radius: 99px;
  background: var(--frost-500);
  opacity: 0.5;
}

.sheet__scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 20px 18px;
}

/* POI content ------------------------------------------------------------- */

.poi__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ice-mid);
  margin-bottom: 7px;
}
.poi__eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pin-color); flex: none; }

.poi__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.poi__name { color: var(--ink-text); }
.poi__blurb {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ice-mid);
}

.poi__img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  margin-bottom: 14px;
  background: var(--ink-700);
}

.poi__body { margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: var(--ink-text); }

.poi__fact {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 2px solid var(--lantern);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: rgba(255, 180, 85, 0.07);
  font-size: 13.5px;
  line-height: 1.5;
  color: #ffd6a3;
}
.poi__fact strong {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lantern);
  margin-bottom: 5px;
}

.chipRow { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 99px;
  border: 1px solid var(--hairline);
  font-size: 11.5px;
  color: var(--ink-text);
  background: rgba(255, 255, 255, 0.7);
}
.chip--found { border-color: var(--lantern-dim); color: #ffe28a; background: rgba(244, 193, 74, 0.12); }
.chip--target {
  border-color: color-mix(in srgb, var(--realm) 55%, transparent);
  color: var(--realm);
  background: color-mix(in srgb, var(--realm) 14%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--realm) 22%, transparent);
}

/* ---------------------------------- panels -------------------------------- */

.panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #eef8fd 0%, #d4eef8 100%);
  color: var(--ink-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(100%);
  transition: transform 440ms var(--ease-out);
}
.panel.is-open { transform: none; }

.panel__head {
  flex: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 20px) 20px 18px;
  background: linear-gradient(#7ec8ea, #4aa6d4);
  color: var(--snow);
  border-bottom: 0;
  border-radius: 0 0 28px 28px;
}

.panel__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0;
}

.panel__close { font-size: 14px; color: var(--snow); font-weight: 700; padding: 4px 2px; }

.panel__scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px calc(var(--nav-h) + var(--safe-b) + 28px);
}

/* hunt cards -------------------------------------------------------------- */

.hunt {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 16px;
  background: var(--glass-fill);
  box-shadow: var(--glass-edge);
  position: relative;
  overflow: hidden;
}
.hunt { color: var(--ink-text); }
.hunt.is-complete {
  background: linear-gradient(160deg, #fff6e4, #fff);
  border-color: var(--lantern-dim);
}

.hunt__tagline {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.hunt__title {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--violet);
  margin: 0 0 10px;
}
.hunt.is-complete .hunt__title { color: var(--lantern); }
.hunt__desc { margin: 0 0 15px; font-size: 13.5px; line-height: 1.55; color: var(--ink-text); }

.tally {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.tally__bar {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(166, 203, 226, 0.16);
  overflow: hidden;
}
.tally__fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--lantern-dim), var(--lantern));
  box-shadow: 0 0 10px rgba(255, 180, 85, 0.6);
  transition: width 700ms var(--ease-out);
}
.tally__count { font-family: var(--mono); font-size: 11px; color: var(--frost-500); flex: none; }

.stopList { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }

.stop {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  background: #fff;
  border: 2px solid var(--ice-card);
  width: 100%;
  text-align: left;
}
.stop.is-found { border-color: rgba(245, 185, 66, 0.55); background: #fff8e8; }

.stop__token { flex: none; margin-top: 1px; }
.stop__token img { width: 28px; height: 28px; object-fit: contain; display: block; }
.remainList {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 0;
}
.remainList li {
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.remainList img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

.stop__name { font-size: 14px; margin: 0 0 2px; color: var(--ink-text); }
.stop.is-found .stop__name { color: #ffd6a3; }
.stop__hint { font-size: 12px; line-height: 1.45; margin: 0; color: var(--frost-500); }
.stop__zone {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--frost-500);
  margin: 3px 0 0;
}

/* Unfound stops keep their name hidden — the hint is the puzzle. */
.stop.is-secret .stop__name { color: var(--frost-500); font-style: italic; }

.reward {
  margin-top: 15px;
  padding: 15px;
  border-radius: var(--r-md);
  border: 1px dashed var(--lantern-dim);
  background: rgba(255, 180, 85, 0.08);
}
.reward--locked { border-color: var(--hairline); background: rgba(255, 255, 255, 0.02); }
.reward__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--lantern);
}
.reward--locked .reward__title { color: var(--frost-500); }
.reward__body { margin: 0; font-size: 13px; line-height: 1.5; color: var(--frost-300); }
.reward__code {
  display: inline-block;
  margin-top: 11px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  background: var(--lantern);
  color: #2a1600;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.18em;
}

/* --------------------------------- passport -------------------------------- */

.tokenGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.token {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.025);
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 9px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.token.is-earned {
  border-color: var(--lantern-dim);
  background: radial-gradient(circle at 50% 40%, rgba(255, 180, 85, 0.24), rgba(255, 180, 85, 0.05));
  box-shadow: inset 0 0 22px rgba(255, 180, 85, 0.14);
}
.token__glyph { font-size: 25px; line-height: 1; filter: grayscale(1) opacity(0.28); }
.token.is-earned .token__glyph { filter: none; animation: bob 4s ease-in-out infinite; }
.token__name {
  font-size: 9.5px;
  line-height: 1.25;
  color: var(--frost-500);
  letter-spacing: 0.02em;
}
.token.is-earned .token__name { color: #ffd6a3; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

.sectionLabel {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--frost-500);
  margin: 0 0 12px;
}

.statRow { display: flex; gap: 10px; margin-bottom: 24px; }
.stat {
  flex: 1;
  padding: 14px;
  border-radius: var(--r-md);
  border: 2px solid var(--ice-card);
  background: #fff;
}
.stat__n {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.03em;
  display: block;
}
.stat__l {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--frost-500);
  margin-top: 6px;
  display: block;
}

.empty {
  text-align: center;
  padding: 40px 20px;
}
.empty__mark { font-size: 34px; opacity: 0.4; margin-bottom: 12px; }
.empty__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 7px;
}
.empty__body { margin: 0 auto; max-width: 30ch; font-size: 13.5px; line-height: 1.55; color: var(--frost-500); }

.textButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  min-height: 54px;
  padding: 12px 24px;
  border-radius: 14px;
  border: 0;
  border-bottom: 4px solid var(--candy-lip);
  color: var(--ink-text);
  background: linear-gradient(#b8fbff, var(--aurora) 55%, var(--aurora-dim));
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.textButton--play {
  color: #073014;
  background: linear-gradient(#81c784, var(--play) 50%, var(--play-deep));
  border-bottom-color: #1b5e20;
}

.fineprint { font-size: 11.5px; line-height: 1.5; color: var(--frost-500); }
.challenge .fineprint, .shrinePanel .fineprint { color: var(--ink-text); }

/* --------------------------------- scanner -------------------------------- */

.scanner {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 22px calc(var(--safe-b) + 30px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms, visibility 260ms;
}
.scanner.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

#scannerVideo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.scanner__veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, transparent 26%, rgba(0, 0, 0, 0.82) 68%);
}

.scanner__frame {
  position: absolute;
  top: 50%; left: 50%;
  width: 62vw; height: 62vw;
  max-width: 300px; max-height: 300px;
  transform: translate(-50%, -60%);
  overflow: hidden;
}
.scanner__frame span {
  position: absolute;
  width: 34px; height: 34px;
  border: 2.5px solid var(--aurora);
  filter: drop-shadow(0 0 8px var(--aurora));
}
.scanner__frame span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.scanner__frame span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.scanner__frame span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.scanner__frame span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }

.scanner__sweep {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--aurora), transparent);
  box-shadow: 0 0 14px var(--aurora);
  animation: sweep 2.4s ease-in-out infinite;
}
@keyframes sweep {
  0%, 100% { top: 4%; opacity: 0.2; }
  50%      { top: 94%; opacity: 1; }
}

.scanner__hint {
  position: relative;
  text-align: center;
  font-size: 14px;
  color: var(--frost-300);
  margin: 0 0 20px;
  max-width: 28ch;
}

.scanner__manual { position: relative; width: 100%; max-width: 340px; }
.scanner__label {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--frost-500);
  margin-bottom: 8px;
  text-align: center;
}
.scanner__row { display: flex; gap: 8px; }
.scanner__row input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: rgba(13, 39, 67, 0.9);
  color: var(--frost-100);
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}
.scanner__row input::placeholder { color: var(--frost-500); letter-spacing: 0.16em; }
.scanner__row button {
  flex: none;
  padding: 0 22px;
  border-radius: var(--r-md);
  background: var(--aurora);
  color: #032a24;
  font-weight: 600;
  font-size: 15px;
}

.scanner__close {
  position: absolute;
  top: calc(var(--safe-t) + 14px);
  right: 16px;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--hairline);
  color: var(--frost-100);
}
.scanner__close svg { width: 19px; height: 19px; stroke-width: 2.2; }

/* ------------------------------- award moment ----------------------------- */

.award {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 28px;
  background: radial-gradient(circle at 50% 42%, #2a1a05 0%, #0b1424 45%, #04101f 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 320ms, visibility 320ms;
}
.award.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

/* Frost cracking outward from the medallion as it ignites. */
.award__shatter {
  position: absolute;
  inset: 0;
  background:
    conic-gradient(from 0deg at 50% 42%,
      transparent 0deg, rgba(255, 180, 85, 0.14) 8deg, transparent 16deg,
      transparent 40deg, rgba(255, 180, 85, 0.1) 48deg, transparent 56deg,
      transparent 90deg, rgba(255, 180, 85, 0.16) 98deg, transparent 106deg,
      transparent 150deg, rgba(255, 180, 85, 0.1) 158deg, transparent 166deg,
      transparent 210deg, rgba(255, 180, 85, 0.14) 218deg, transparent 226deg,
      transparent 280deg, rgba(255, 180, 85, 0.12) 288deg, transparent 296deg,
      transparent 330deg, rgba(255, 180, 85, 0.1) 338deg, transparent 346deg);
  opacity: 0;
  transform: scale(0.3);
}
.award.is-open .award__shatter { animation: shatter 1500ms var(--ease-out) forwards !important; animation-play-state: running !important; }
@keyframes shatter {
  0%   { opacity: 0; transform: scale(0.25) rotate(-14deg); }
  35%  { opacity: 1; }
  100% { opacity: 0.55; transform: scale(1.5) rotate(10deg); }
}

.award__stage { position: relative; text-align: center; max-width: 340px; }

.award__medallion {
  position: relative;
  width: 130px; height: 130px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
}
.award__medallion svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.award__facet {
  fill: rgba(255, 180, 85, 0.14);
  stroke: var(--lantern);
  stroke-width: 2.5;
}
.award__facetInner { fill: none; stroke: rgba(255, 214, 163, 0.6); stroke-width: 1.4; }
.award__glyph { position: relative; font-size: 46px; line-height: 1; }
.award__glyph img { width: 72px; height: 72px; object-fit: contain; display: block; }

.award.is-open .award__medallion { animation: ignite 1100ms var(--ease-spring) forwards !important; animation-play-state: running !important; }
@keyframes ignite {
  0%   { transform: scale(0.2) rotate(-90deg); opacity: 0; filter: grayscale(1) brightness(0.4); }
  55%  { transform: scale(1.18) rotate(6deg); opacity: 1; filter: none; }
  100% { transform: scale(1) rotate(0deg); opacity: 1;
         filter: drop-shadow(0 0 34px rgba(255, 180, 85, 0.75)); }
}

.award__kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lantern);
  margin: 0 0 10px;
}
.award__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.award__meta { margin: 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--frost-300); }

.award__pips { display: flex; justify-content: center; gap: 7px; margin-bottom: 26px; }
.award__pip {
  width: 11px; height: 11px;
  transform: rotate(45deg);
  border-radius: 2px;
  border: 1.5px solid var(--lantern-dim);
}
.award__pip.is-on { background: var(--lantern); box-shadow: 0 0 10px var(--lantern); }

.award__done {
  padding: 15px 34px;
  border-radius: 14px;
  background: linear-gradient(#ffe28a, var(--lantern) 50%, var(--lantern-dim));
  color: #3a2200;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 4px solid #b07810;
}

.award.is-final .award__title { color: var(--lantern); }

/* stagger the copy in behind the medallion */
.award.is-open .award__kicker,
.award.is-open .award__title,
.award.is-open .award__meta,
.award.is-open .award__pips,
.award.is-open .award__done { animation: riseIn 620ms var(--ease-out) backwards; }
.award.is-open .award__kicker { animation-delay: 420ms; }
.award.is-open .award__title  { animation-delay: 500ms; }
.award.is-open .award__meta   { animation-delay: 580ms; }
.award.is-open .award__pips   { animation-delay: 650ms; }
.award.is-open .award__done   { animation-delay: 730ms; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ----------------------------------- nav ---------------------------------- */

.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 55;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: 1fr 1fr 78px 1fr 1fr;
  align-items: center;
  background: rgba(4, 16, 31, 0.98);
  border-top: 1px solid var(--hairline);
}

.nav__item {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 0;
  color: var(--frost-500);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  transition: color 180ms;
}
.nav__item svg { width: 21px; height: 21px; }
.nav__item.is-active { color: var(--aurora); }
.nav__item.is-active svg { filter: drop-shadow(0 0 8px rgba(93, 240, 207, 0.55)); }

/* The shutter button: the scan is the app's primary verb, so it breaks the bar. */
.scanFab {
  position: relative;
  justify-self: center;
  width: 64px; height: 64px;
  margin-top: -26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: #032a24;
  box-shadow: none;
}
.scanFab svg { width: 27px; height: 27px; stroke-width: 2; position: relative; }
.scanFab img { width: 60px; height: 60px; object-fit: contain; position: relative; }
.scanFab img { transition: transform 220ms var(--ease-spring); }

.scanFab__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--aurora);
  animation: fabPulse 2.6s ease-out infinite !important;
  animation-play-state: running !important;
}
@keyframes fabPulse {
  0%   { transform: scale(1); opacity: 0.7; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* ---------------------------------- toast --------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 20px);
  z-index: 65;
  transform: translate(-50%, 20px);
  max-width: min(88vw, 400px);
  padding: 12px 18px;
  border-radius: 99px;
  background: var(--ice-pale);
  color: var(--ink-text);
  border: 2px solid var(--ice-card);
  box-shadow: var(--glass-edge);
  font-size: 13.5px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms, transform 300ms var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-warm { border-color: var(--lantern-dim); color: #ffd6a3; }

/* ---------------------------------- splash -------------------------------- */

.bootSplash {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background: linear-gradient(180deg, #62b4e0 0%, #8ecce8 100%);
  transition: opacity 500ms, visibility 500ms;
}
.bootSplash.is-gone { opacity: 0; visibility: hidden; }

.bootSplash__mark { display: flex; gap: 7px; align-items: flex-end; height: 54px; }
.bootSplash__mark span {
  width: 9px;
  border-radius: 3px;
  background: linear-gradient(to top, var(--aurora-dim), var(--aurora));
  animation: grow 1.4s var(--ease-out) infinite !important;
  animation-play-state: running !important;
}
.bootSplash__mark span:nth-child(1) { animation-delay: 0s; }
.bootSplash__mark span:nth-child(2) { animation-delay: 0.18s; }
.bootSplash__mark span:nth-child(3) { animation-delay: 0.36s; }
@keyframes grow {
  0%, 100% { height: 14px; opacity: 0.35; }
  50%      { height: 52px; opacity: 1; }
}

.bootSplash__text {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--frost-500);
}

/* Motion stays on. Windows “Animation effects” and similar OS flags
   set prefers-reduced-motion, which used to zero every keyframe. */

/* Wider screens: keep the app phone-shaped and centre it, rather than
   stretching a thumb-reach layout across a desktop monitor. */
@media (min-width: 760px) {
  body {
    background:
      radial-gradient(70% 55% at 50% -8%, rgba(255, 255, 255, 0.45), transparent 48%),
      linear-gradient(180deg, #62b4e0 0%, #8ecce8 50%, #c8e8f6 100%);
  }
  .topbar, .nav, .sheet, .panel, .scanner, .award, .toast, .aurora,
  .bootSplash {
    max-width: 460px;
    margin-inline: auto;
  }
  .aurora, .panel, .scanner, .award, .bootSplash { left: 50%; right: auto; transform: translateX(-50%); width: 460px; }
  .panel { transform: translate(-50%, 100%); }
  .panel.is-open { transform: translateX(-50%); }
  .toast { left: 50%; }
}


/* ==========================================================================
   Storybook retheme
   Painted ice-crystal art wants a round, playful display face — Fredoka
   for names and buttons, Nunito for anything you read at speed.
   ========================================================================== */

.topbar__name, .poi__name, .panel__title, .hunt__tagline,
.reward__title, .stat__n, .empty__title, .award__title {
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Hand-inked hairline: warmer than the old cyan, closer to the map's
   cream trails so chrome and artwork read as one illustration. */
:root {
  --hairline: #9ec4e0;
  --vellum: #e9d6a8;
}

.legend__title, .poi__eyebrow, .eyebrow {
  font-variant: small-caps;
  letter-spacing: 0.16em;
}

/* ---------------------------------- quest --------------------------------- */

body.quest { --nav-h: 0px; }

body.quest .topbar {
  position: sticky;
  align-items: flex-start;
  padding: calc(var(--safe-t) + 10px) 16px 12px;
  background: linear-gradient(to bottom, rgba(98, 180, 224, 0.88) 0%, rgba(142, 204, 232, 0.55) 68%, rgba(200, 232, 246, 0));
  pointer-events: auto;
}

.questProgress {
  margin: 8px 0 0;
  padding: 0;
  font-family: var(--body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ice-card);
}
.realmPips {
  display: flex;
  gap: 10px;
  padding: 8px 0 0;
}
.realmPip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.42;
  filter: grayscale(0.25);
}
.realmPip.is-on { opacity: 1; filter: none; }

.station {
  position: relative;
  z-index: 5;
  padding: 8px 16px calc(28px + var(--safe-b));
}
.shrine { max-width: 460px; margin: 0 auto; --realm: var(--aurora); }
.shrine[data-realm="water"] { --realm: var(--water); }
.shrine[data-realm="earth"] { --realm: var(--earth); }
.shrine[data-realm="fire"] { --realm: var(--fire); }
.shrine[data-realm="air"] { --realm: var(--air); }
.shrine[data-realm="spirit"] { --realm: var(--spirit); }
.shrine__kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--realm);
  text-shadow: 0 0 12px color-mix(in srgb, var(--realm) 45%, transparent);
}
.shrine__title {
  margin: 6px 0 10px;
  font-family: var(--display);
  font-style: normal;
  font-size: 34px;
  line-height: 1.05;
  color: var(--snow);
  text-shadow: 0 0 8px rgba(120, 180, 255, 0.4);
}
.shrine__placeholder {
  height: 140px;
  margin: 16px 0;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 48px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--realm) 18%, transparent), rgba(197, 139, 255, 0.1));
  border: 1px solid var(--hairline);
}
.shrine__art {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 0;
  margin: 8px 0 0;
  display: block;
  background: none;
  filter: drop-shadow(0 10px 18px rgba(20, 70, 110, 0.22));
}
.shrine__art--small { max-height: 120px; object-fit: contain; margin: 10px 0 0; }
.shrine__portrait {
  display: block;
  width: min(240px, 72%);
  margin: 0 auto 14px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(20, 70, 110, 0.22));
}
.shrine__block { margin-top: 22px; }
.shrine__block h3,
.shrinePanel h3 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e8f6ff;
  text-shadow: 0 1px 8px rgba(20, 70, 110, 0.3);
}
.shrine__block p { margin: 0; color: #f4fbff; line-height: 1.5; font-size: 16px; text-shadow: 0 1px 8px rgba(20, 70, 110, 0.35); }
.shrinePanel p { margin: 0; color: var(--ink-text); line-height: 1.5; font-size: 16px; }
.shrinePanel h3 { color: var(--ice-mid); }

.shrineGate {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  min-height: 168px;
  margin: 22px 0 8px;
}
.shrineIcon {
  position: relative;
  width: 88px;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--frost-100);
  transition: transform 520ms var(--ease-spring), opacity 320ms;
}
.shrineIcon__gem {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.shrineIcon__gem img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}
.shrineIcon__gem svg {
  width: 40px;
  height: 40px;
  stroke: var(--realm);
  fill: none;
  stroke-width: 1.8;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--realm) 55%, transparent));
}
.shrineIcon__gem--play svg { color: var(--play); fill: none; stroke: var(--play); }
.shrineIcon__gem--play path:last-child { fill: var(--play); stroke: none; }
.shrineIcon__orbit {
  position: absolute;
  top: -8px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1.5px dashed rgba(93, 240, 207, 0.0);
  pointer-events: none;
}
.shrineIcon__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--frost-300);
}
.shrineGate.is-focus .shrineIcon:not(.is-on) {
  transform: scale(0.72);
  opacity: 0.55;
}
.shrineGate.is-focus .shrineIcon.is-on {
  transform: scale(1.18);
  z-index: 2;
}
.shrineGate.is-focus .shrineIcon.is-on .shrineIcon__gem {
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--realm) 55%, transparent));
}
.shrineGate.is-focus .shrineIcon.is-on .shrineIcon__label { color: var(--realm); }
.shrineGate.is-spinning .shrineIcon.is-on .shrineIcon__orbit {
  border-color: color-mix(in srgb, var(--realm) 70%, transparent);
  animation: shrineSwirl 780ms var(--ease-out) both !important;
  animation-play-state: running !important;
}
.shrineGate.is-spinning .shrineIcon.is-on .shrineIcon__gem {
  animation: shrineZoom 780ms var(--ease-spring) both !important;
  animation-play-state: running !important;
}
@keyframes shrineSwirl {
  0%   { transform: rotate(-40deg) scale(0.45); opacity: 0; }
  35%  { opacity: 1; }
  100% { transform: rotate(380deg) scale(1); opacity: 0.85; }
}
@keyframes shrineZoom {
  0%   { transform: scale(0.7); }
  55%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.shrinePanel {
  display: none;
  margin-top: 8px;
  padding: 18px 16px 20px;
  border-radius: 18px;
  background: var(--ice-pale);
  border: 2.5px solid var(--ice-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transform-origin: top center;
}
.shrinePanel.is-open {
  display: block;
  animation: shrineReveal 480ms var(--ease-out) both !important;
  animation-play-state: running !important;
}
@keyframes shrineReveal {
  from { opacity: 0; transform: scale(0.88) translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.topbar__actions {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: none;
}
.mapChip {
  min-height: 36px;
  width: 108px;
  padding: 0;
  border-radius: 0;
  border: 0;
  color: var(--ink-text);
  background: transparent;
}
.mapChip img { width: 100%; height: 36px; object-fit: contain; display: block; }
.mapChip img { transition: transform 220ms var(--ease-spring); }
.guideFab {
  display: none;
  position: absolute;
  right: 14px;
  bottom: calc(16px + var(--safe-b));
  z-index: 55;
  min-width: 112px;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: #e8f6ff;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  gap: 0;
}
.guideFab img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.guideFab span { position: relative; }
body.guide-open .guideFab { display: inline-flex; align-items: center; justify-content: center; }
body.panel-open .guideFab,
body.award-open .guideFab { display: none; }

.guide {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--ink-900);
}
.guide[hidden] { display: none; }
.guide #map {
  position: absolute;
  inset: 0;
  width: auto;
  max-width: none;
  transform: none;
  left: 0;
  right: 0;
  margin: 0;
}
.guide .mapTools,
.guide .legend,
.guide .sheet {
  position: absolute;
  left: auto;
  right: 12px;
  margin: 0;
}
.guide .mapTools {
  top: calc(var(--safe-t) + 12px);
  bottom: auto;
}
.guide .legend {
  left: 12px;
  right: 12px;
  top: calc(var(--safe-t) + 148px);
}
.guide .sheet {
  left: 0;
  right: 0;
  top: 0;
  bottom: auto;
}
.scanFab--guide {
  position: absolute;
  left: 14px;
  bottom: calc(16px + var(--safe-b));
  width: 56px;
  height: 56px;
  margin: 0;
  transform: none;
  z-index: 40;
}
.pickGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 380px) {
  .pickGrid { grid-template-columns: 1fr 1fr 1fr; }
}
.pickTile, .seqBtn {
  min-height: 72px;
  border-radius: 18px;
  transition: transform 200ms var(--ease-spring), box-shadow 200ms, filter 200ms;
  border: 1px solid color-mix(in srgb, var(--tile, var(--aurora)) 40%, transparent);
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.16), transparent 46%),
    color-mix(in srgb, var(--tile, var(--aurora)) 26%, #061428);
  color: var(--frost-100);
  font-weight: 800;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 6px 16px rgba(0,0,0,0.22);
}
.pickTile--art, .seqBtn--art {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 6px 10px;
  background: rgba(6, 20, 40, 0.35);
  border-color: rgba(186, 230, 255, 0.2);
}
.pickTile--art img, .seqBtn--art img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.seqBtn--art img { width: 56px; height: 56px; }
.pickTile--art span, .seqBtn--art span { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.pickTile.is-on, .seqBtn:active {
  outline: 2px solid var(--play);
  color: #f4fbff;
  box-shadow: 0 0 18px color-mix(in srgb, var(--play) 40%, transparent);
}
.seqRow { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 10px; }
.seqReadout { margin: 0; color: var(--ink-text); font-weight: 700; min-height: 1.4em; }

.quizQ {
  border: 2px solid var(--ice-card);
  border-radius: 14px;
  padding: 12px;
  margin: 0 0 10px;
  background: var(--snow);
  color: var(--ink-text);
}
.quizQ legend { padding: 0 4px; font-weight: 700; }
.quizChoice { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; font-size: 16px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-text); }

.finale {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 24px 16px calc(24px + var(--safe-b));
  background-color: rgba(30, 58, 95, 0.92);
  background-image: radial-gradient(120% 80% at 50% 10%, rgba(245, 185, 66, 0.22), transparent 52%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.finale.is-open { opacity: 1; pointer-events: auto; }
.finale__card { width: min(400px, 100%); }

.finaleStage {
  display: grid;
  gap: 16px;
  justify-items: stretch;
  text-align: center;
  padding: 28px 20px 20px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 12%, rgba(245, 185, 66, 0.28), transparent 48%),
    var(--ice-pale);
  border: 3px solid var(--lantern);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  animation: sealIn 900ms var(--ease-spring) both !important;
  animation-play-state: running !important;
}
.finaleStage__lead {
  margin: 0;
  color: var(--ink-text);
  font-size: 15px;
  line-height: 1.5;
}
.finaleStage__btn { width: 100%; margin: 0; }
.finaleStage .seal,
.finaleStage .staffCard {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  animation: none;
}
.finaleStage .staffCard h3,
.finaleStage .seal__names { color: var(--ink-text); }
.finaleStage .seal__meta,
.finaleStage .staffCard .fineprint { color: #3d5a7a; }

.seal {
  text-align: center;
  padding: 20px 16px 24px;
  border-radius: 28px;
  border: 1px solid rgba(126, 210, 255, 0.35);
  background:
    radial-gradient(circle at 50% 18%, rgba(126, 226, 255, 0.22), transparent 52%),
    var(--ice-pale);
  box-shadow: var(--glass-edge);
}
.seal__art {
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
  filter: drop-shadow(0 0 18px rgba(126, 226, 255, 0.45));
}
.seal__wordmark {
  width: min(280px, 92%);
  margin: 0 auto 10px;
  display: block;
}
.seal__ring {
  width: 88px; height: 88px; margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--lantern);
  box-shadow: 0 0 24px var(--lantern);
  animation: sealSpin 8s linear infinite !important;
  animation-play-state: running !important;
}
.seal__kicker { letter-spacing: 0.22em; text-transform: uppercase; font-size: 11px; color: var(--lantern); }
.seal__names { font-family: var(--display); font-style: normal; font-size: 32px; margin: 8px 0; }
.seal__meta { color: var(--frost-300); }
@keyframes sealIn { from { transform: scale(0.84); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sealSpin { to { transform: rotate(360deg); } }

.staffCard {
  text-align: center;
  padding: 28px 18px;
  border-radius: 24px;
  background: var(--glass-fill);
  border: 1px solid var(--lantern);
  box-shadow: var(--glass-edge);
}
.staffCard__kicker { letter-spacing: 0.18em; text-transform: uppercase; font-size: 11px; color: var(--lantern); }
.staffCard h3 { font-family: var(--display); font-style: normal; font-size: 30px; margin: 8px 0; }
.staffCard__names { font-size: 18px; font-weight: 700; }
.staffCard__count { font-size: 22px; color: var(--aurora); font-weight: 800; margin: 10px 0; }

body.quest .toast { bottom: calc(20px + var(--safe-b)); }
body.quest.guide-open .toast {
  top: calc(16px + var(--safe-t));
  bottom: auto;
}

.keepers label { display: grid; gap: 6px; margin-top: 12px; font-size: 14px; color: var(--ink-text); }
.challenge .threshold__primary { width: 100%; margin-top: 8px; }

@media (min-width: 760px) {
  .station, .guide, body.quest .topbar {
    max-width: 460px;
    margin-inline: auto;
  }
  .guide {
    left: 50%;
    right: auto;
    width: 460px;
    transform: translateX(-50%);
    border-inline: 1px solid var(--hairline);
  }
  .threshold,
  .mapModal,
  .finale,
  .award,
  .scanner {
    left: 50%;
    right: auto;
    width: 460px;
    transform: translateX(-50%);
  }
}

/* -------------------------------- fun buttons ----------------------------- */

button.is-fun { position: relative; overflow: visible; }

button:not(.shrineIcon):not(.sheet__grip):not(.landing__realm) {
  transition: transform 200ms var(--ease-spring), filter 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  button:not(.shrineIcon):not(.sheet__grip):not(.landing__realm):hover {
    transform: translateY(-3px) scale(1.045);
    filter: brightness(1.08);
  }
  .landing__realm:hover img { animation: pfpTalk 480ms var(--ease-spring); }
  .landing__begin:hover {
    filter: brightness(1.1) drop-shadow(0 10px 18px rgba(126, 243, 255, 0.35));
  }
  .landing__link:hover::after { animation: btnShimmer 700ms var(--ease-out); }
  .mapTool:hover img,
  .scanFab:hover img,
  .progressRing:hover .progressRing__gem,
  .mapChip:hover img,
  .guideFab:hover img {
    animation: btnWiggle 420ms var(--ease-spring);
  }
}

button:not(.shrineIcon):not(.sheet__grip):not(.landing__realm):active,
button:not(.shrineIcon):not(.sheet__grip):not(.landing__realm).is-pressed {
  transform: scale(0.985);
  filter: brightness(0.94);
  transition-duration: 70ms;
}

button:not(.shrineIcon):not(.sheet__grip):not(.landing__realm).is-pop {
  animation: btnPop 480ms var(--ease-spring);
}

.landing__begin { animation: btnFloat 2.6s ease-in-out infinite; }
.landing__begin:hover,
.landing__begin:active,
.landing__begin.is-pressed { animation: none; }
.landing__begin.is-pop { animation: btnPop 480ms var(--ease-spring); }

.textButton.is-pressed,
.textButton:active,
.threshold__primary.is-pressed,
.threshold__primary:active,
.award__done.is-pressed,
.award__done:active {
  transform: translateY(2px) scale(0.99);
  border-bottom-width: 2px;
}

.shrineIcon__gem { transition: transform 200ms var(--ease-spring), filter 200ms; }
.shrineIcon.is-pressed .shrineIcon__gem { transform: scale(0.86); }
.shrineIcon.is-pop .shrineIcon__gem { animation: btnPop 460ms var(--ease-spring); }

.sheet__grip::before {
  transition: transform 200ms var(--ease-spring), opacity 200ms, background 200ms;
}
.sheet__grip:hover::before { opacity: 0.9; background: var(--aurora); transform: scaleX(1.12); }
.sheet__grip.is-pressed::before { transform: scaleX(0.72); background: var(--aurora); opacity: 1; }

.pickTile.is-on { animation: btnSelect 400ms var(--ease-spring); }

.btnBurst {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 4;
}
.btnBurst i {
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 7px;
  margin: -3.5px;
  border-radius: 1px;
  background: #fff;
  box-shadow: 0 0 10px #7ef3ff;
  animation: btnSpark 540ms var(--ease-out) forwards;
  transform: rotate(45deg);
}
.btnBurst i:nth-child(1) { --dx: -26px; --dy: -18px; background: #7ef3ff; }
.btnBurst i:nth-child(2) { --dx: 8px; --dy: -28px; background: #ffe28a; }
.btnBurst i:nth-child(3) { --dx: 24px; --dy: -10px; }
.btnBurst i:nth-child(4) { --dx: 18px; --dy: 16px; background: #d7b4ff; }
.btnBurst i:nth-child(5) { --dx: -14px; --dy: 20px; background: #7ef3ff; }
.btnBurst i:nth-child(6) { --dx: -22px; --dy: 4px; background: #ffe28a; }

@keyframes btnFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes btnPop {
  0% { transform: translateY(3px) scale(0.92); }
  40% { transform: translateY(-6px) scale(1.08) rotate(-2deg); }
  68% { transform: translateY(1px) scale(0.97) rotate(1.5deg); }
  100% { transform: none; }
}
@keyframes btnShimmer {
  0% { transform: translateX(-130%); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(130%); opacity: 0; }
}
@keyframes btnWiggle {
  0%, 100% { transform: rotate(0) scale(1); }
  30% { transform: rotate(-14deg) scale(1.1); }
  60% { transform: rotate(10deg) scale(1.08); }
}
@keyframes btnSpark {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(45deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.15) rotate(45deg); }
}
@keyframes btnSelect {
  0% { transform: scale(0.9); }
  55% { transform: scale(1.07); }
  100% { transform: none; }
}
@keyframes pfpBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}
@keyframes pfpSway {
  0%, 100% { transform: translateY(0) rotate(2.5deg); }
  50% { transform: translateY(-6px) rotate(-2.5deg); }
}
@keyframes pfpTalk {
  0% { transform: scale(1) translateY(0); }
  32% { transform: scale(1.16) translateY(-10px) rotate(-8deg); }
  58% { transform: scale(1.08) translateY(-3px) rotate(5deg); }
  100% { transform: scale(1.04) translateY(-2px); }
}
@keyframes bubblePop {
  0% { opacity: 0; transform: translateY(10px) scale(0.86); }
  70% { opacity: 1; transform: translateY(-3px) scale(1.03); }
  100% { opacity: 1; transform: none; }
}
