@font-face {
  font-family: "Press Start 2P";
  src: url("../assets/fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --pine: #143026;
  --pine-deep: #0c1c16;
  --gold: #f0c14a;
  --blue: #1d4e89;
  --cream: #fff6e4;
  --ink: #24160c;
  --wood: #d39a52;
  --wood-dark: #6a3a14;
  --wood-edge: #3d220c;
  --ember: #e25822;
  --good: #2f7d4a;
  --font: "Trebuchet MS", Verdana, "Segoe UI", sans-serif;
  --pixel: "Press Start 2P", "Trebuchet MS", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--pine-deep);
  color: var(--cream);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body { overflow: hidden; }

button, a { font-family: inherit; }

button {
  cursor: pointer;
}

img { max-width: 100%; }

#app { height: 100dvh; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: var(--pine);
}

.boot a { color: var(--gold); }

.screen {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--pine-deep);
}

.screen.overlay {
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.hud {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  background: linear-gradient(#3d2814, #24160c);
  border-bottom: 4px solid var(--gold);
  color: var(--cream);
}

.screen.overlay .hud {
  position: sticky;
  top: 0;
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compass-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px;
  background: transparent;
  color: var(--cream);
  border: 0;
}

button, .btn { touch-action: manipulation; }

.hud-label {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.pips { display: flex; gap: 6px; }

.pips i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: transparent;
  display: block;
}

.pips i.on {
  background: var(--gold);
  box-shadow: 0 0 0 2px #24160c;
}

.pips i.pop { animation: pip 0.85s ease; }

@keyframes pip {
  50% { transform: scale(1.45); }
}

.sound-btn, .skip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sound-btn {
  border: 3px solid var(--gold);
  background: #1a3f28;
  color: var(--cream);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 8px 10px;
}

.skip {
  align-self: flex-start;
  color: var(--gold);
  font-weight: 800;
  font-size: 15px;
  text-underline-offset: 3px;
}

.scene {
  position: relative;
  flex: 1 1 auto;
  min-height: 28vh;
  background: #1b4a30;
  overflow: hidden;
}

.screen.overlay .scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  min-height: 100dvh;
}

.scene img.art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.screen.overlay .scene img.art {
  object-fit: contain;
  object-position: center center;
  background: #0c1c16;
}
.scene[data-pos="arch"] img.art { object-position: center 48%; }

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(8, 18, 14, 0.45), transparent 22%, transparent 68%, rgba(8, 18, 14, 0.5));
}

.scene.dim img.art { filter: brightness(0.52) saturate(0.9); }

.scene.glow-fire::before,
.scene.glow-tent::before,
.scene.glow-cook::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.scene.glow-fire::before {
  background: radial-gradient(circle at 50% 78%, rgba(255, 120, 30, 0.55), transparent 46%);
}

.scene.glow-tent::before {
  background: radial-gradient(circle at 18% 62%, rgba(255, 220, 120, 0.4), transparent 40%);
}

.scene.glow-cook::before {
  background: radial-gradient(circle at 78% 42%, rgba(230, 240, 255, 0.35), transparent 28%);
}

.bubble {
  position: absolute;
  z-index: 8;
  top: 54px;
  left: 10px;
  right: 10px;
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--wood-edge);
  padding: 10px 12px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.35;
}

.spark {
  position: absolute;
  z-index: 3;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle, rgba(255, 236, 170, 0.0) 0 30%, rgba(255, 210, 80, 0.45) 46%, transparent 62%);
  box-shadow: none;
}

.spark:hover,
.spark:focus-visible {
  background: radial-gradient(circle, rgba(255, 244, 200, 0.85) 0 28%, rgba(240, 193, 74, 0.35) 46%, transparent 68%);
}

.spark:active { transform: scale(0.94); }

.sign-grid {
  position: absolute;
  z-index: 3;
  left: 8px;
  right: 8px;
  bottom: calc(64px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.trail {
  min-height: 64px;
  padding: 8px 8px 10px;
  text-align: left;
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0 2px, transparent 2px 8px),
    linear-gradient(#e0ac62, #c4843c);
  border: 4px solid var(--wood-edge);
  box-shadow: 0 4px 0 var(--wood-edge);
}

.trail .kicker {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #5c3212;
}

.trail .name {
  display: block;
  margin-top: 2px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.3;
}

.trail.found {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 8px),
    linear-gradient(#ffe08a, #f0c14a);
}

.trail:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--wood-edge); }

.hint {
  position: absolute;
  z-index: 3;
  left: 10px;
  top: auto;
  bottom: calc(152px + env(safe-area-inset-bottom));
  margin: 0;
  padding: 6px 8px;
  background: rgba(20, 24, 16, 0.72);
  color: var(--cream);
  font-weight: 800;
  font-size: 15px;
}

.screen.activity .scene {
  flex: 0 0 auto;
  height: 34vh;
  min-height: 168px;
  max-height: 320px;
}

.drawer {
  position: relative;
  z-index: 5;
  flex: 1 1 auto;
  max-height: none;
  overflow: auto;
  padding: 12px 12px calc(72px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255, 236, 196, 0.35), transparent 14px),
    repeating-linear-gradient(90deg, #d7a15a 0 10px, #c68b42 10px 20px);
  color: var(--ink);
  border-top: 6px solid var(--wood-edge);
}

.lead, .found, .tagline, .skills, .motto, .units, .mallow-line {
  margin: 0 0 10px;
}

.lead, .mallow-line {
  font-weight: 800;
  font-size: 17px;
}

.found {
  font-family: var(--pixel);
  font-size: 13px;
  line-height: 1.55;
  color: #6a2a08;
}

.card {
  background: var(--cream);
  color: var(--ink);
  border: 4px solid var(--wood-edge);
  padding: 12px 12px 4px;
  margin-bottom: 10px;
}

.card h2, .title-card h1, .eyebrow {
  font-family: var(--pixel);
  line-height: 1.45;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.tagline { font-weight: 800; }

.title-card {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100% - 20px));
  margin: 12px auto calc(8px + env(safe-area-inset-bottom));
  margin-top: auto;
  padding: 16px 14px calc(72px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 9px),
    linear-gradient(#e2b36a, #c4843c);
  border: 4px solid var(--gold);
  box-shadow: 0 0 0 4px var(--wood-edge), 0 14px 0 rgba(0, 0, 0, 0.25);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.title-card h1 {
  margin: 0 0 10px;
  font-size: clamp(16px, 4.8vw, 28px);
}

.title-card p { margin: 0 0 10px; font-weight: 800; }

.title-card .credits {
  margin: 12px 0 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: rgba(62, 38, 16, 0.62);
}

.title-card .credits a {
  color: inherit;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.units {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  padding: 0;
  list-style: none;
  font-weight: 800;
}

.motto {
  font-family: var(--pixel);
  font-size: 11px;
  line-height: 1.6;
}

.logo {
  width: 128px;
  height: auto;
  margin: 0 auto 8px;
  display: block;
  background: var(--cream);
  border-radius: 50%;
}

.skills {
  font-size: 15px;
  font-weight: 700;
}

.btn, .car-btn, .step, .zone {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-height: 52px;
  margin: 0 0 8px;
  padding: 12px 10px;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  color: var(--cream);
  background: var(--blue);
  border: 4px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}

.btn.pixel, .car-btn .px-name {
  font-family: var(--pixel);
  font-size: 12px;
  line-height: 1.5;
}

.btn.gold, .step.done {
  background: var(--gold);
  color: var(--ink);
}

.btn.ghost {
  background: #fff6e4;
  color: var(--ink);
  box-shadow: none;
  border: 4px solid var(--ink);
}

.btn.xl {
  min-height: 64px;
  font-size: 18px;
  background: var(--gold);
  color: var(--ink);
}

.btn:active, .car-btn:active, .step:active, .zone:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.cars, .steps, .zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.car-btn, .step, .zone { margin: 0; }

.car-btn {
  background: var(--cream);
  color: var(--ink);
  min-height: 72px;
}

.car-btn.picked { outline: 4px solid var(--blue); }

.pxcar {
  display: inline-flex;
  width: 54px;
  height: 22px;
  border-radius: 4px 8px 4px 4px;
  position: relative;
  vertical-align: middle;
}

.pxcar::before, .pxcar::after {
  content: "";
  position: absolute;
  bottom: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #24160c;
}

.pxcar::before { left: 4px; }
.pxcar::after { right: 4px; }
.pxcar.red { background: #d23b3b; }
.pxcar.blue { background: #2f6fce; }
.pxcar.green { background: #2f8a45; }
.pxcar.gold { background: #e2b423; }

.pxcar.has-art {
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
}

.pxcar.has-art::before,
.pxcar.has-art::after { display: none; }

.pxcar.has-art img {
  display: block;
  height: 36px;
  width: auto;
  image-rendering: pixelated;
}

.track { margin: 4px 0 10px; }

.lane {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.lane-name { font-size: 13px; font-weight: 800; }

.rail {
  position: relative;
  height: 28px;
  background: #f3e2c4;
  border: 3px solid var(--ink);
  overflow: hidden;
}

.rail::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: repeating-linear-gradient(#24160c 0 6px, #fff 6px 12px);
}

.mover {
  position: absolute;
  left: 0;
  top: 4px;
  width: calc(100% - 100px);
}

.count {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(32px, 9vw, 68px);
  color: var(--cream);
  text-shadow: 4px 4px 0 #24160c;
  pointer-events: none;
}

.target-wrap { display: grid; justify-items: center; }

.target {
  position: relative;
  width: min(210px, 64vw);
  height: min(210px, 64vw);
  margin: 4px auto 10px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: radial-gradient(circle at 50% 50%,
    #f0c14a 0 11%,
    #e25822 11% 23%,
    #1d4e89 23% 38%,
    #f4f4f4 38% 54%,
    #1d4e89 54% 72%,
    #c0392b 72% 100%);
  touch-action: manipulation;
}

.aim {
  position: absolute;
  top: 50%;
  left: calc(8% + (var(--p, 0) * 84%));
  width: 8px;
  height: 34px;
  background: #24160c;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.aim::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -9px;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 10px solid #c0392b;
}

.aim.vert {
  left: 50%;
  top: calc(8% + (var(--p, 0) * 84%));
}

.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.rose-img {
  width: 108px;
  height: 108px;
  object-fit: contain;
  image-rendering: pixelated;
}

.map {
  width: 132px;
  height: 132px;
  border: 0;
  background: transparent;
  position: relative;
  transition: transform 0.7s ease;
}

button.map {
  display: block;
  padding: 0;
  cursor: pointer;
}

button.map:disabled {
  cursor: default;
}

.map img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

.rose-img {
  width: 118px;
  height: 118px;
}

.facing {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: 17px;
}

.rose .n, .map .mn {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  font-family: var(--pixel);
  font-size: 12px;
}

.mini-needle {
  position: absolute;
  left: 50%;
  top: 22px;
  width: 6px;
  height: 36px;
  background: #c0392b;
  transform: translateX(-50%);
  transform-origin: bottom center;
}

.map .path {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 16px;
  height: 8px;
  background: #c4a574;
}

.map.lit .path {
  background: #f0c14a;
  box-shadow: 0 0 12px #f0c14a;
}

.map .church {
  position: absolute;
  right: 8px;
  bottom: 28px;
  font-size: 12px;
  font-weight: 800;
}

.sign-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.sign-row span {
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 4px;
  background: #5c3a1e;
  color: var(--cream);
  border: 3px solid var(--ink);
}

.sign-row span.east {
  background: var(--gold);
  color: var(--ink);
}

.token {
  width: 54px;
  height: 54px;
  margin: 0 auto 8px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background:
    radial-gradient(circle at 50% 50%, #1d4e89 0 5px, transparent 6px),
    radial-gradient(circle at 50% 50%, transparent 8px, var(--gold) 9px 12px, transparent 13px),
    var(--cream);
}

.mallow {
  width: 86px;
  height: 28px;
  margin: 0 auto 8px;
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 28px 8px 0 -6px #8a5a2b;
}

.dial {
  width: min(200px, 62vw);
  height: min(200px, 62vw);
  margin: 4px auto 12px;
  position: relative;
  border-radius: 50%;
  background: #1a3358;
  border: 8px solid var(--wood-dark);
  box-shadow: 0 0 0 4px var(--gold);
}

.quad {
  position: absolute;
  width: 34%;
  height: 34%;
  background: #6d8299;
}

.quad.on { background: var(--gold); }
.q1 { left: 14%; top: 14%; }
.q2 { right: 14%; top: 14%; }
.q3 { left: 14%; bottom: 14%; }
.q4 { right: 14%; bottom: 14%; }

.dir {
  position: absolute;
  font-family: var(--pixel);
  font-size: 11px;
  color: var(--cream);
}

.dir.n { left: 50%; top: 10px; transform: translateX(-50%); }
.dir.e { right: 10px; top: 50%; transform: translateY(-50%); }
.dir.s { left: 50%; bottom: 10px; transform: translateX(-50%); }
.dir.w { left: 10px; top: 50%; transform: translateY(-50%); }

.needle {
  position: absolute;
  left: 50%;
  top: 18%;
  width: 8px;
  height: 34%;
  background: #c0392b;
  transform: translateX(-50%);
  transform-origin: bottom center;
  z-index: 2;
}

.needle.spin { animation: sweep 3.4s linear forwards; }
.needle.found { transform: translateX(-50%) rotate(337.5deg); }

@keyframes sweep {
  0% { transform: translateX(-50%) rotate(0deg); }
  10% { transform: translateX(-50%) rotate(45deg); }
  14% { transform: translateX(-50%) rotate(45deg); }
  24% { transform: translateX(-50%) rotate(90deg); }
  28% { transform: translateX(-50%) rotate(90deg); }
  38% { transform: translateX(-50%) rotate(135deg); }
  42% { transform: translateX(-50%) rotate(135deg); }
  52% { transform: translateX(-50%) rotate(180deg); }
  56% { transform: translateX(-50%) rotate(180deg); }
  66% { transform: translateX(-50%) rotate(225deg); }
  70% { transform: translateX(-50%) rotate(225deg); }
  80% { transform: translateX(-50%) rotate(270deg); }
  84% { transform: translateX(-50%) rotate(270deg); }
  94% { transform: translateX(-50%) rotate(315deg); }
  100% { transform: translateX(-50%) rotate(337.5deg); }
}

.cap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--ink);
  z-index: 3;
}

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 16, 12, 0.78);
  display: grid;
  place-items: end center;
  padding: 12px;
}

.modal {
  width: min(520px, 100%);
  max-height: 92dvh;
  overflow: auto;
  background: var(--cream);
  color: var(--ink);
  border: 4px solid var(--wood-edge);
  padding: 10px;
}

.modal img { display: block; width: 100%; height: auto; }
.modal p { font-weight: 800; }

.runaway {
  position: fixed;
  z-index: 45;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: -70px;
  animation: roll 2.2s linear forwards;
  pointer-events: none;
}

@keyframes roll { to { left: 110%; } }

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 48;
  overflow: hidden;
}

.confetti i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  animation: fall 2.2s linear forwards;
}

@keyframes fall {
  to { transform: translateY(105dvh) rotate(200deg); }
}

@media (orientation: landscape) and (max-height: 520px) {
  .screen.activity.poster {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
    grid-template-rows: 1fr;
  }
  .screen.activity.poster .drawer { max-height: 100dvh; }
  .sign-grid { grid-template-columns: repeat(4, 1fr); }
  .trail { min-height: 52px; }
  .trail .name { font-size: 15px; }
  .hint { bottom: 72px; }
  .cars, .steps { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .hint { top: 12px; bottom: auto; }
  .drawer { max-height: none; }
  .title-card { margin-top: auto; }
}

.screen.activity.poster {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0c1c16;
}

.screen.title .stage-wrap,
.screen.hub .stage-wrap,
.screen.activity.poster .stage-wrap {
  container-type: size;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen.title .stage,
.screen.hub .stage,
.screen.activity.poster .stage {
  width: min(100cqi, calc(100cqb * 9 / 16));
  height: auto;
  aspect-ratio: 9 / 16;
  max-height: 100%;
  max-width: 100%;
}

.screen.activity.poster.church-visit .stage {
  width: min(100cqi, calc(100cqb * var(--church-w, 1000) / var(--church-h, 1096)));
  aspect-ratio: var(--church-w, 1000) / var(--church-h, 1096);
  overflow: hidden;
}

.screen.church-visit .dock-bar .btn {
  margin-bottom: 8px;
}

.screen.church-visit .dock-bar .btn:last-child {
  margin-bottom: 0;
}

.fisher {
  position: absolute;
  z-index: 4;
  left: 56%;
  top: 36%;
  width: 15%;
  margin: 0;
  padding: 0;
  border: 3px solid rgba(255, 226, 140, 0.95);
  border-radius: 8px;
  background: rgba(255, 214, 90, 0.2);
  box-shadow: 0 0 0 2px rgba(40, 18, 6, 0.4), 0 0 16px rgba(255, 214, 90, 0.75);
  line-height: 0;
  cursor: pointer;
  touch-action: manipulation;
  animation: hintglow 1.6s ease-in-out infinite;
}

.fisher img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  pointer-events: none;
}

.screen.fishing-pier .stage { overflow: hidden; }

.fish-detail {
  margin: 0 0 8px;
  font-size: 15px;
}

.fish-splash,
.fish-prize,
.fish-fly,
.fish-visit {
  position: absolute;
  z-index: 2;
  height: auto;
  image-rendering: pixelated;
  pointer-events: none;
}

.fish-splash {
  left: 58%;
  top: 75%;
  width: 28%;
}

.fish-prize {
  left: 40%;
  top: 22%;
  width: 21%;
  z-index: 8;
}

.fish-prize.tiny {
  width: 18%;
  left: 74%;
  top: 34%;
  z-index: 9;
  image-rendering: auto;
}

.fish-prize.caught-boot { width: 14%; left: 48%; top: 22%; z-index: 9; }

.fish-prize.caught-boot { width: 14%; left: 48%; top: 22%; z-index: 9; }

.fish-prize.caught-gator { width: 34%; left: 46%; top: 58%; z-index: 8; }

.fish-stamp {
  position: absolute;
  z-index: 5;
  left: 10%;
  right: 10%;
  top: 6%;
  margin: 0;
  padding: 8px 10px;
  text-align: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  background: rgba(255, 246, 228, 0.96);
  border: 3px solid #24160c;
  border-radius: 8px;
  pointer-events: none;
}

.fish-fly {
  top: 18%;
  width: 14%;
  animation: flyby 7s linear infinite;
}

.fish-visit {
  left: 62%;
  top: 48%;
  width: 26%;
  animation: glide 0.7s ease;
}

.art.catch-pop { animation: pip 0.6s ease; }

@keyframes flyby {
  from { left: -20%; }
  to { left: 110%; }
}

.lightning {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.lightning.on { opacity: 1; }

.storm-art {
  z-index: 4;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.storm-art.on { opacity: 1; }
.storm-art.leaving { opacity: 0; }

.storm-card {
  position: absolute;
  z-index: 6;
  left: 8%;
  right: 8%;
  bottom: 16%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 246, 228, 0.96);
  color: var(--ink);
  text-align: center;
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}

.storm-card p { margin: 0; }

.storm-card.on { opacity: 1; }
.storm-card.leaving { opacity: 0; }

.gator {
  position: absolute;
  z-index: 2;
  width: 28%;
  height: auto;
  pointer-events: none;
  image-rendering: pixelated;
  animation: glide 0.7s ease;
}

.gator.upper { left: 66%; top: 47%; width: 18%; }
.gator.lower { left: 18%; top: 89%; width: 30%; }

@keyframes glide {
  from { transform: translateX(16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.screen.hub.map23 .stage {
  width: min(100cqi, calc(100cqb * 2 / 3));
  aspect-ratio: 2 / 3;
}

.screen.hub.map34 .stage {
  width: min(100cqi, calc(100cqb * 3 / 4));
  aspect-ratio: 3 / 4;
}

.screen.activity.poster .drawer {
  flex: 0 0 auto;
  max-height: 48vh;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.screen.activity.poster.dock {
  position: relative;
}

.screen.activity.poster.dock .drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  flex: none;
  max-height: none;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}

.screen.activity.poster.dock .skip {
  color: #fff6e4;
  background: transparent;
  text-shadow: 0 1px 2px #000;
  margin: 0 0 6px;
}

.screen.activity.poster.dock .step {
  min-height: 44px;
  padding: 8px 6px;
  font-size: 14px;
  background: rgba(16, 36, 64, 0.42);
  border-width: 2px;
  box-shadow: none;
  backdrop-filter: blur(2px);
}

.screen.activity.poster.dock .step.done {
  background: rgba(240, 193, 74, 0.88);
}

.screen.activity.poster.dock .card {
  background: rgba(255, 246, 228, 0.94);
}

.target.painted {
  position: absolute;
  z-index: 4;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.sound-btn.sky {
  position: absolute;
  z-index: 6;
  top: 8px;
  right: 8px;
  min-height: 36px;
  padding: 6px 8px;
  font-size: 12px;
}

.screen.hub .sound-btn.sky {
  right: auto;
  left: 8px;
}

.sky-ui {
  position: absolute;
  z-index: 6;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.sky-ui > * { pointer-events: auto; }

.sky-ui .sound-btn,
.sky-ui .compass-hud {
  min-height: 36px;
  padding: 4px 8px;
  background: rgba(12, 28, 22, 0.55);
  border-radius: 8px;
}

.skip.chip {
  position: absolute;
  z-index: 6;
  left: 8px;
  bottom: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(12, 28, 22, 0.82);
  color: var(--cream);
  font-size: 13px;
  text-decoration: none;
}

.skip.dark {
  color: var(--ink);
  font-size: 14px;
  margin: 0 0 8px;
}

.hot {
  position: absolute;
  z-index: 3;
  margin: 0;
  padding: 0;
  background: rgba(255, 244, 210, 0.04);
  border: 2px solid rgba(255, 228, 150, 0.72);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(40, 18, 6, 0.35);
  color: transparent;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
}

.hot.plain {
  background: rgba(255, 244, 210, 0.04);
  border-color: transparent;
  box-shadow: none;
}

.hot.plain::before { inset: 0; }

.hot.plain:hover,
.hot.plain:focus-visible,
.hot.plain:active,
.hot.plain.hint {
  background: rgba(255, 214, 90, 0.28);
  border-color: rgba(255, 226, 140, 0.95);
  box-shadow: 0 0 0 2px rgba(40, 18, 6, 0.35), 0 0 16px rgba(255, 214, 90, 0.7);
}

.hot.plain.hint { animation: hintglow 1.6s ease-in-out infinite; }

@keyframes hintglow {
  50% {
    background: rgba(255, 236, 160, 0.46);
    box-shadow: 0 0 0 3px rgba(255, 226, 140, 0.85), 0 0 22px rgba(255, 214, 90, 0.9);
  }
}

.hub-chrome {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 10px 6px;
}

.hub-foot {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--cream);
}

.stage-wrap {
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.stage {
  position: relative;
  aspect-ratio: 4 / 3;
  width: min(100%, calc((100dvh - 112px) * 4 / 3));
  max-height: calc(100dvh - 112px);
}

.stage img.art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}

.stage img.art.storm-art {
  z-index: 4;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.stage img.art.storm-art.on { opacity: 1; }
.stage img.art.storm-art.leaving { opacity: 0; }

.stage img.art.church-fade {
  opacity: 0;
  transition: opacity 1s ease;
}

.stage img.art.church-fade.on { opacity: 1; }

.hot {
  position: absolute;
  z-index: 3;
  margin: 0;
  padding: 0;
  background: rgba(255, 244, 210, 0.06);
  border: 2px solid rgba(255, 228, 150, 0.72);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(40, 18, 6, 0.35);
  color: transparent;
}

.hot::before {
  content: "";
  position: absolute;
  inset: -14px -6px;
}

.hot:hover,
.hot:focus-visible {
  background: rgba(255, 214, 90, 0.2);
  border-color: rgba(255, 226, 140, 0.95);
}

.hot:active { background: rgba(255, 214, 90, 0.34); }

.hot.found {
  border-color: rgba(240, 193, 74, 0.95);
  background: rgba(240, 193, 74, 0.16);
}

.screen.hub .bubble {
  top: auto;
  bottom: 8px;
}

.art-pip {
  position: absolute;
  z-index: 4;
  width: 2.3%;
  height: 3.15%;
  border-radius: 50%;
  pointer-events: none;
  background: transparent;
}

.art-pip.on {
  background: radial-gradient(circle at 38% 32%, #fff1b8, #f0c14a 58%, #b47a12);
  box-shadow: 0 0 8px rgba(240, 193, 74, 0.85);
}

.art-pip.pop { animation: pip 0.85s ease; }

@media (orientation: landscape) and (max-height: 520px) {
  .hub-foot { font-size: 14px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .hub-chrome { padding-top: calc(4px + env(safe-area-inset-top)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.dock-bar {
  position: absolute;
  z-index: 7;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  max-height: 42vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 246, 228, 0.94);
  color: var(--ink);
}

.dock-bar .btn {
  width: 100%;
  max-width: 100%;
}

.toast-note {
  margin: 0 0 8px;
  font-weight: 800;
  font-size: 16px;
}

.play-chip {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-height: 44px;
  padding: 8px 16px;
  background: rgba(16, 36, 64, 0.72);
  color: #fff6e4;
  border: 2px solid rgba(255, 228, 170, 0.8);
  border-radius: 8px;
  font-weight: 800;
}

.sheet-back {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: flex-end;
  background: rgba(8, 16, 12, 0.45);
}

.sheet-back[hidden] { display: none !important; }

.sheet {
  width: 100%;
  max-height: 62vh;
  overflow: auto;
  padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
  background: rgba(255, 246, 228, 0.96);
  color: var(--ink);
}

.sheet .lead { color: var(--ink); }

.screen.race {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
  background: #143026;
  color: var(--cream);
}

.screen.race .race-top {
  display: flex;
  justify-content: flex-end;
}

.screen.race .sound-btn {
  min-height: 36px;
  padding: 4px 8px;
}

.screen.race h1 {
  margin: 0;
  text-align: center;
  font-family: var(--pixel);
  font-size: 16px;
  line-height: 1.5;
}

.screen.race .raceway {
  margin: 0;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.screen.overlay { position: relative; }

.screen.overlay .hud,
.overlay-sky {
  background: transparent;
  border: 0;
}

.overlay-sky .skip.chip {
  position: static;
  min-height: 36px;
}

.dial.map-dial {
  position: relative;
  z-index: 4;
  left: auto;
  top: auto;
  align-self: center;
  margin: auto 0 10px;
  width: min(46vw, 200px);
  height: min(46vw, 200px);
  max-width: none;
  max-height: none;
  flex: 0 0 auto;
}

.screen.bearing {
  justify-content: flex-end;
}

.screen.bearing #reveal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
  max-height: none;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 6;
}

.screen.bearing #reveal h1,
.screen.bearing #reveal p,
.screen.bearing #reveal a {
  margin: 0;
  position: static;
}

.screen.bearing #reveal .credits {
  margin: 0;
  padding-top: 2px;
  font-size: 10px;
  line-height: 1.35;
}

#reveal[hidden] { display: none !important; }

.screen.race .count {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  text-align: center;
  font-size: 40px;
  line-height: 1;
  margin: 0;
}
.screen.race .found { color: var(--gold); }
.screen.race .lane-name { color: var(--cream); }
.screen.race .rail { height: 48px; }
.screen.race .card { color: var(--ink); }
.screen.race .card .found { color: #6a2a08; }
