/* =========================================================
   Interactive barn features
   ========================================================= */

body { padding-bottom: 84px; }

section[data-section] { overflow: clip; }

/* ---------- Wagon loading screen ---------- */
.loader { display: none; }

.js .loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #7ec3ec 0%, #bfe1f2 45%, #f3d9a2 70%, #c99a4e 100%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.done { opacity: 0; visibility: hidden; }

.loader-hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 46%;
}

.loader-track {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 21%;
  height: 90px;
}

.wagon {
  position: absolute;
  bottom: 0;
  left: calc(var(--p, 0) * (100% - 150px));
  width: 150px;
  transition: left 0.35s ease-out;
  animation: bump 0.35s ease-in-out infinite alternate;
}

.wagon .wheel { transform-box: fill-box; transform-origin: center; animation: wheel 0.6s linear infinite; }

.loader-copy {
  position: relative;
  margin-bottom: 18vh;
  text-align: center;
  font-family: "Rye", serif;
  color: var(--ink);
  font-size: clamp(1.2rem, 4vw, 2rem);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.5);
}

.loader-copy b { display: block; font-family: "Luckiest Guy", cursive; font-weight: 400; color: var(--red); font-size: 1.4em; }

/* ---------- HUD: wanted level, reputation, toggles ---------- */
.hud {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.45rem 0.4rem 0.75rem;
  border-radius: 12px;
  background: rgba(28, 18, 10, 0.9);
  border: 2px solid rgba(232, 181, 77, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}

.wanted { display: grid; gap: 1px; }

.hud-label {
  font-family: "Rye", serif;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1;
}

.stars { display: flex; gap: 1px; }

.stars svg { width: 15px; height: 15px; fill: rgba(255, 255, 255, 0.15); transition: fill 0.3s, transform 0.3s; }
.stars svg.on { fill: var(--hay); }
[data-wanted="4"] .stars svg.on,
[data-wanted="5"] .stars svg.on { fill: #ff4b3e; animation: starPulse 0.8s ease-in-out infinite alternate; }

.rep {
  display: grid;
  gap: 1px;
  padding-left: 0.55rem;
  border-left: 1px solid rgba(232, 181, 77, 0.3);
  min-width: 82px;
}

.rep b { font-family: "Luckiest Guy", cursive; font-weight: 400; font-size: 1rem; color: var(--hay-light); line-height: 1; }
.rep b.bump { animation: bumpText 0.5s ease; }

.hud-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 244, 224, 0.08);
  color: var(--cream);
  font-size: 1.05rem;
  cursor: pointer;
}

.hud-btn:hover { background: rgba(255, 244, 224, 0.18); }
.hud-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Siren glow at high wanted levels */
.siren {
  position: fixed;
  inset: 0;
  z-index: 26;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s;
}

[data-wanted="4"] .siren,
[data-wanted="5"] .siren { opacity: 1; animation: siren 1.6s linear infinite; }
[data-wanted="4"] .siren { animation-duration: 2.6s; }

/* ---------- Toasts and sheriff notices ---------- */
.toasts {
  position: fixed;
  top: 16px;
  left: 50%;
  translate: -50% 0;
  z-index: 70;
  display: grid;
  gap: 0.5rem;
  width: min(380px, calc(100% - 2rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  color: var(--ink);
  background: var(--speckle), var(--paper);
  border-left: 6px solid var(--toast, var(--red));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  font-weight: 800;
  line-height: 1.3;
  animation: toastIn 0.4s cubic-bezier(.2, 1.4, .4, 1) both;
}

.toast.out { animation: toastOut 0.35s ease-in both; }
.toast .ico { font-size: 1.5rem; }
.toast b { display: block; font-family: "Rye", serif; font-weight: 400; color: var(--red-deep); }

.notice-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(10, 6, 2, 0.65);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.3s ease both;
}

.notice-backdrop[hidden] { display: none; }

.notice {
  position: relative;
  width: min(440px, 100%);
  padding: 2.2rem 1.8rem 1.6rem;
  color: var(--ink);
  text-align: center;
  background:
    radial-gradient(circle at 80% 15%, rgba(120, 72, 24, 0.25), transparent 22%),
    var(--speckle),
    var(--paper);
  box-shadow: inset 0 0 40px rgba(110, 66, 20, 0.45), 0 30px 60px rgba(0, 0, 0, 0.6);
  transform: rotate(-1.5deg);
  animation: slam 0.45s cubic-bezier(.2, 1.4, .4, 1) both;
}

.notice .nail:nth-of-type(1) { top: 10px; left: 50%; margin-left: -6px; }
.notice h2 { font-family: "Rye", serif; font-weight: 400; font-size: 2.6rem; line-height: 1; }
.notice .by { font-family: "Rye", serif; font-size: 0.85rem; color: var(--red-deep); margin: 0.4rem 0 1rem; letter-spacing: 0.06em; }
.notice h3 { font-family: "Permanent Marker", cursive; font-weight: 400; font-size: 1.5rem; margin-bottom: 0.5rem; }
.notice p { font-weight: 700; line-height: 1.55; }
.notice .btn { margin-top: 1.3rem; }

/* ---------- Searchlight ---------- */
.searchlight {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.6s;
}

.searchlight.on { opacity: 1; }

.searchlight i {
  position: absolute;
  left: 0;
  top: 0;
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, rgba(255, 248, 215, 0.3), rgba(255, 248, 215, 0.1) 55%, rgba(6, 4, 10, 0.5) 100%);
  box-shadow: 0 0 0 250vmax rgba(6, 4, 10, 0.5);
}

.searchlight.on i { animation: sweep 5.5s ease-in-out both; }

/* ---------- Weather, mood and night overlays ---------- */
.weather {
  position: fixed;
  inset: 0;
  z-index: 28;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.weather-tint {
  position: fixed;
  inset: 0;
  z-index: 27;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s, background 1.5s;
}

[data-weather="dust"] .weather-tint { opacity: 1; background: radial-gradient(circle at 50% 40%, rgba(196, 140, 70, 0.18), rgba(150, 100, 45, 0.42)); }
[data-weather="sunset"] .weather-tint { opacity: 1; background: linear-gradient(180deg, rgba(255, 120, 60, 0.2), rgba(255, 70, 90, 0.12) 50%, rgba(80, 30, 90, 0.18)); mix-blend-mode: soft-light; }
[data-weather="rain"] .weather-tint,
[data-weather="storm"] .weather-tint { opacity: 1; background: rgba(20, 30, 50, 0.22); }

.flash {
  position: fixed;
  inset: 0;
  z-index: 29;
  pointer-events: none;
  background: #eef4ff;
  opacity: 0;
}

.flash.go { animation: lightning 0.9s ease-out; }

.mood {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background: transparent;
  transition: background 0.8s;
}

[data-station="lofi"] .mood { background: linear-gradient(180deg, rgba(120, 80, 220, 0.55), rgba(240, 120, 170, 0.4)); }
[data-station="arcade"] .mood { background: linear-gradient(135deg, rgba(255, 40, 200, 0.45), rgba(40, 220, 255, 0.4)); }
[data-station="outlaw"] .mood { background: rgba(170, 95, 30, 0.6); }
[data-station="arcade"] .section-head h2 { box-shadow: 0 0 0 2px #ff5fd8, 0 0 22px #ff3fd0, 0 0 44px #3fe0ff; }
[data-station="arcade"] .hero h1 { text-shadow: 4px 4px 0 #ff3fd0, 8px 8px 0 #3fe0ff; }
[data-station="outlaw"] main img { filter: sepia(0.65) contrast(1.05); }

/* Night: dim the barn, light the lanterns */
.night { --shade: rgba(8, 12, 34, 0.5); --bg: #110b08; }
.night .scene > img { filter: brightness(0.42) saturate(0.7) hue-rotate(-10deg); }
.night .sunbeam { opacity: 0 !important; animation: none; }
.night-sky,
.lantern-glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s; }
.night .night-sky,
.night .lantern-glow { opacity: 1; }

.night-sky i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px #fff;
  animation: twinkle var(--d, 3s) ease-in-out var(--delay, 0s) infinite alternate;
}

.lantern-glow {
  background:
    radial-gradient(circle at 18% 32%, rgba(255, 170, 60, 0.45), transparent 26%),
    radial-gradient(circle at 84% 40%, rgba(255, 170, 60, 0.3), transparent 22%);
  mix-blend-mode: screen;
  animation: lanternFlicker 3s ease-in-out infinite;
}

.night .scene-fade { background: linear-gradient(180deg, rgba(10, 8, 20, 0.5) 0%, transparent 25%, transparent 52%, var(--bg) 100%); }
.night .dust .mote { background: rgba(255, 190, 110, 0.9); }
.night .poster,
.night .sheriff-note,
.night .map,
.night .mission,
.night .photo { filter: brightness(0.82) sepia(0.15); }

/* ---------- Inventory bar ---------- */
.inventory {
  position: fixed;
  left: 50%;
  bottom: 10px;
  translate: -50% 0;
  z-index: 60;
  display: flex;
  gap: 0.35rem;
  padding: 0.4rem;
  border-radius: 14px;
  background:
    var(--grain-h),
    linear-gradient(180deg, #6d4a2a, #4a3019);
  border: 2px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), inset 0 2px 0 rgba(255, 235, 200, 0.15);
}

.slot {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 58px;
  padding: 0.35rem 0 0.3rem;
  border-radius: 9px;
  background: rgba(20, 12, 6, 0.55);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  color: rgba(255, 244, 224, 0.45);
  font-family: "Rye", serif;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  transition: color 0.3s, background 0.3s, transform 0.15s;
}

.slot svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.slot:hover { transform: translateY(-3px); color: var(--cream); }
.slot.lit { color: var(--hay-light); background: rgba(232, 181, 77, 0.16); }
.slot.lit::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6dff8f;
  box-shadow: 0 0 6px #6dff8f;
}

/* ---------- Character buddy (reactions + propeller) ---------- */
.buddy {
  position: fixed;
  left: 14px;
  bottom: 18px;
  z-index: 61;
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  pointer-events: none;
}

.buddy-face {
  position: relative;
  width: 66px;
  height: 66px;
  flex: none;
  pointer-events: auto;
  cursor: pointer;
}

.buddy-face img {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 3px solid var(--hay);
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s;
}

.buddy-face img.swap { animation: faceSwap 0.4s ease; }
.buddy .prop { top: -12px; }

.buddy-say {
  position: relative;
  max-width: 220px;
  margin-bottom: 1.6rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  color: var(--ink);
  background: #fffaf0;
  font-family: "Permanent Marker", cursive;
  font-size: 0.95rem;
  line-height: 1.25;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  opacity: 0;
  translate: -6px 0;
  transition: opacity 0.3s, translate 0.3s;
}

.buddy-say::before {
  content: "";
  position: absolute;
  left: -8px;
  bottom: 12px;
  border: 8px solid transparent;
  border-right-color: #fffaf0;
  border-left: 0;
}

.buddy-say.show { opacity: 1; translate: 0 0; }

/* ---------- Barn doors that open each section ---------- */
.doors {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  pointer-events: none;
}

.door {
  flex: 1;
  border: 10px solid #efe2c6;
  background:
    linear-gradient(to top right, transparent calc(50% - 7px), #efe2c6 calc(50% - 7px) calc(50% + 7px), transparent calc(50% + 7px)),
    linear-gradient(to top left, transparent calc(50% - 7px), #efe2c6 calc(50% - 7px) calc(50% + 7px), transparent calc(50% + 7px)),
    var(--grain-v),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0 2px, transparent 2px 46px),
    linear-gradient(180deg, #b8332a, #8f231c);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
  transition: transform 1.05s cubic-bezier(.65, .05, .3, 1);
}

.doors.open .door-l { transform: translateX(-102%); }
.doors.open .door-r { transform: translateX(102%); }

/* ---------- Section stamps ---------- */
.section-head { position: relative; }

.stamp-mark {
  position: absolute;
  top: -0.4rem;
  right: max(0px, calc(50% - 15rem));
  padding: 0.25rem 0.7rem 0.1rem;
  border: 3px solid currentColor;
  border-radius: 6px;
  font-family: "Rye", serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: #e2463b;
  background: rgba(255, 244, 224, 0.06);
  rotate: -14deg;
  mix-blend-mode: screen;
  animation: stampSlam 0.5s cubic-bezier(.2, 1.6, .4, 1) both;
  z-index: 2;
}

.stamp-mark.cleared { color: #6dd38f; }
.stamp-mark.completed { color: var(--hay-light); }

/* ---------- Horizon strip: train and wagon outside ---------- */
.horizon {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: linear-gradient(180deg, #8fd0f2 0%, #cfeaf5 55%, #f4dca8 100%);
  border-top: 10px solid #4e331c;
  border-bottom: 10px solid #4e331c;
  transition: background 1.2s;
}

.night .horizon { background: linear-gradient(180deg, #0b1030 0%, #1d2350 60%, #3b2d4a 100%); }

.horizon svg.land { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; }

.sky-orb {
  position: absolute;
  top: 18px;
  right: 12%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #ffe48a;
  box-shadow: 0 0 40px rgba(255, 220, 120, 0.9);
  transition: background 1.2s, box-shadow 1.2s;
}

.night .sky-orb { background: #f2efe0; box-shadow: 0 0 30px rgba(220, 230, 255, 0.6), inset -10px -4px 0 #cfcab5; }

.horizon .night-sky { z-index: 0; }

.train {
  position: absolute;
  left: 0;
  bottom: 58px;
  width: 340px;
  animation: trainRun 38s linear infinite;
}

.train .puff { animation: puff 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.train .puff:nth-of-type(2) { animation-delay: 0.5s; }
.train .puff:nth-of-type(3) { animation-delay: 1s; }
.train .win { fill: #2b1a0e; transition: fill 1s; }
.night .train .win { fill: #ffd37a; }

.wagon-far {
  position: absolute;
  left: 0;
  bottom: 16px;
  width: 120px;
  animation: wagonRun 64s linear infinite;
}

/* ---------- Haystack easter eggs ---------- */
.haystack {
  position: absolute;
  z-index: 5;
  width: 92px;
  height: 56px;
  border: 0;
  cursor: pointer;
  background: none;
  transition: transform 0.15s;
}

.haystack::before {
  content: "";
  position: absolute;
  inset: 8px 0 0;
  border-radius: 50% 50% 10px 10px / 80% 80% 10px 10px;
  background:
    repeating-linear-gradient(80deg, transparent 0 5px, rgba(120, 75, 20, 0.35) 5px 6px, transparent 6px 11px),
    repeating-linear-gradient(-70deg, transparent 0 7px, rgba(255, 236, 170, 0.45) 7px 8px, transparent 8px 15px),
    radial-gradient(ellipse at 50% 20%, #f3d27e, #d4a24a 60%, #a8782f);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.45);
}

.haystack::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  width: 50px;
  height: 18px;
  background:
    linear-gradient(70deg, transparent 45%, #e8b54d 45% 52%, transparent 52%),
    linear-gradient(110deg, transparent 40%, #f3d27e 40% 46%, transparent 46%),
    linear-gradient(95deg, transparent 60%, #c99437 60% 66%, transparent 66%);
}

.haystack:hover { transform: scale(1.08) rotate(-3deg); }
.haystack:focus-visible { outline: 3px solid var(--sky); outline-offset: 4px; border-radius: 10px; }
.haystack.found { animation: poof 0.5s ease forwards; pointer-events: none; }

.egg-card {
  position: fixed;
  z-index: 110;
  width: min(300px, calc(100% - 2rem));
  padding: 1.6rem 1.2rem 1.1rem;
  color: var(--ink);
  text-align: center;
  background: var(--speckle), #fff7e4;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.6);
  transform: rotate(-2deg);
  animation: slam 0.4s cubic-bezier(.2, 1.4, .4, 1) both;
}

.egg-card h3 { font-family: "Permanent Marker", cursive; font-weight: 400; font-size: 1.35rem; margin-bottom: 0.4rem; }
.egg-card p { font-weight: 700; line-height: 1.5; }
.egg-card img { width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; margin: 0.4rem 0 0.6rem; border: 4px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }
.egg-card .btn { margin-top: 0.8rem; }
.egg-card .close { position: absolute; top: 6px; right: 10px; border: 0; background: none; font-size: 1.4rem; cursor: pointer; color: var(--ink); }

.straw-burst {
  position: fixed;
  z-index: 80;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f6d887, #c99437);
  pointer-events: none;
  animation: burst 0.9s cubic-bezier(.2, .8, .4, 1) forwards;
}

.shake { animation: shake 0.5s ease; }

/* ---------- Hayloft hangout: radio, safe, bell ---------- */
.hangout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 2rem;
  align-items: end;
}

.prop-label {
  display: block;
  width: max-content;
  margin: 1.1rem auto 0;
  padding: 0.45rem 1.1rem 0.3rem;
  border-radius: 6px;
  font-family: "Rye", serif;
  font-size: 0.95rem;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.prop-hint { margin-top: 0.6rem; text-align: center; font-family: "Permanent Marker", cursive; color: var(--hay-light); font-size: 0.95rem; }

/* Radio */
.radio {
  position: relative;
  padding: 1.1rem;
  border-radius: 26px 26px 14px 14px;
  background:
    var(--grain-h),
    linear-gradient(180deg, #9c6a3a, #6b4422);
  box-shadow: inset 0 3px 0 rgba(255, 235, 200, 0.2), inset 0 -6px 10px rgba(0, 0, 0, 0.35), 0 18px 34px rgba(0, 0, 0, 0.5);
}

.radio::before {
  content: "";
  position: absolute;
  right: 40px;
  top: -64px;
  width: 4px;
  height: 70px;
  background: linear-gradient(180deg, #ddd, #777);
  rotate: 18deg;
  transform-origin: bottom;
  border-radius: 2px;
}

.radio-face {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.25fr);
  gap: 1rem;
  padding: 0.9rem;
  border-radius: 16px 16px 8px 8px;
  background: #e9d8b2;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.35);
}

.grille {
  position: relative;
  border-radius: 10px;
  min-height: 130px;
  background:
    repeating-linear-gradient(90deg, #5a3b22 0 3px, #2c1a0c 3px 8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  overflow: hidden;
}

.eq i {
  display: block;
  width: 7px;
  height: 8px;
  border-radius: 2px;
  background: var(--hay);
  opacity: 0.25;
}

.eq { display: flex; align-items: flex-end; gap: 4px; height: 100%; }
.radio.on .eq i { opacity: 0.95; animation: eq 0.5s ease-in-out infinite alternate; }
.radio.on .eq i:nth-child(2n) { animation-duration: 0.36s; }
.radio.on .eq i:nth-child(3n) { animation-duration: 0.62s; }

.dial {
  position: relative;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff6dc, #f1dfae);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.dial-scale {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0.6rem 0;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink);
  background: repeating-linear-gradient(90deg, rgba(58, 36, 18, 0.5) 0 1px, transparent 1px 8px) bottom / 100% 12px no-repeat;
  height: 100%;
}

.needle {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: var(--needle, 12%);
  width: 3px;
  background: var(--red);
  border-radius: 2px;
  transition: left 0.6s cubic-bezier(.3, 1.4, .5, 1);
}

.now {
  margin: 0.55rem 0;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: #1d2a1f;
  color: #7dffa8;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.now span { display: inline-block; padding-left: 100%; animation: marquee 11s linear infinite; }

.stations { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }

.station {
  padding: 0.4rem 0.3rem 0.3rem;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-family: "Rye", serif;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--cream);
  background: linear-gradient(180deg, #6b4a2e, #4a3019);
  box-shadow: 0 3px 0 #2c1a0c;
}

.station small { display: block; font-family: ui-monospace, monospace; font-size: 0.68rem; color: var(--hay-light); }
.station.active { background: linear-gradient(180deg, var(--red), var(--red-deep)); box-shadow: 0 1px 0 #2c1a0c; transform: translateY(2px); }

.radio-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 0.8rem; }

.power {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem 0.3rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Luckiest Guy", cursive;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  background: var(--hay);
  box-shadow: 0 3px 0 #a87b26;
}

.power::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #5a2b1c; }
.radio.on .power::before { background: #6dff8f; box-shadow: 0 0 6px #6dff8f; }

.radio-knob { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e9d8b2, #8a6440); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5); }

/* Safe */
.safe {
  position: relative;
  aspect-ratio: 0.86;
  max-width: 330px;
  margin: 0 auto;
  perspective: 900px;
}

.safe-inside {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.6rem;
  padding: 1.4rem;
  border-radius: 14px;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 220, 120, 0.9), rgba(232, 181, 77, 0.6) 40%, #6b4a2e 100%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.safe-inside h3 { font-family: "Permanent Marker", cursive; font-weight: 400; font-size: 1.35rem; }
.safe-inside p { font-weight: 800; line-height: 1.4; font-size: 0.95rem; }
.safe-inside .ca-mini { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.safe-door {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.8rem;
  padding: 1.1rem 1.4rem 1.2rem 1.1rem;
  border-radius: 14px;
  background:
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.2), transparent 40%),
    linear-gradient(160deg, #5f6670, #353a41 60%, #23272c);
  box-shadow: inset 0 0 0 6px #2a2e33, inset 0 0 0 9px #6f7781, 0 18px 34px rgba(0, 0, 0, 0.55);
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(.5, 0, .2, 1);
  backface-visibility: hidden;
}

.safe.open .safe-door { transform: rotateY(-108deg); }
.safe.wrong .safe-door { animation: shake 0.45s ease; }

.safe-display {
  padding: 0.45rem;
  border-radius: 6px;
  background: #0f1a12;
  color: #7dffa8;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-align: center;
  text-shadow: 0 0 8px rgba(125, 255, 168, 0.8);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.safe.wrong .safe-display { color: #ff6b5e; text-shadow: 0 0 8px rgba(255, 90, 80, 0.8); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem; }

.key {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Luckiest Guy", cursive;
  font-size: 1.15rem;
  padding-top: 0.2rem;
  color: #e8ecf0;
  background: linear-gradient(180deg, #7b838d, #4c535b);
  box-shadow: 0 3px 0 #1d2024;
}

.key:active { transform: translateY(2px); box-shadow: 0 1px 0 #1d2024; }
.key.go { background: linear-gradient(180deg, #4fbf7a, #2f8a4a); }
.key.clr { background: linear-gradient(180deg, #d9534a, #9e2a22); }

.safe-handle {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 64px;
  margin-top: -32px;
  border-radius: 5px;
  background: linear-gradient(90deg, #c9ced4, #7c838b);
}

/* Bell */
.bell-wrap { text-align: center; }

.bell-yoke {
  width: 170px;
  height: 18px;
  margin: 0 auto;
  border-radius: 4px;
  background: var(--grain-h), linear-gradient(180deg, #7d5732, #4e331c);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.bell {
  position: relative;
  display: block;
  width: 130px;
  margin: -2px auto 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: 50% 0;
}

.bell svg { display: block; width: 100%; overflow: visible; }
.bell.ring { animation: bellSwing 1.1s ease-in-out; }
.bell:focus-visible { outline: 3px solid var(--sky); outline-offset: 4px; border-radius: 12px; }

.bell-waves { position: relative; height: 0; }

.bell-waves i {
  position: absolute;
  left: 50%;
  top: -70px;
  width: 120px;
  height: 120px;
  margin-left: -60px;
  border: 3px solid var(--hay-light);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.bell-waves.go i { animation: wave 1.1s ease-out forwards; }
.bell-waves.go i:nth-child(2) { animation-delay: 0.2s; }
.bell-waves.go i:nth-child(3) { animation-delay: 0.4s; }

.ding {
  position: absolute;
  left: 50%;
  top: -40px;
  translate: -50% 0;
  font-family: "Luckiest Guy", cursive;
  font-size: 2rem;
  color: var(--hay-light);
  -webkit-text-stroke: 1px var(--brown);
  text-shadow: 3px 3px 0 var(--red);
  pointer-events: none;
  white-space: nowrap;
  animation: ding 1.1s ease-out forwards;
}

/* ---------- Photo booth ---------- */
.booth {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: center;
  margin-top: 4.5rem;
  padding: 2rem;
  border-radius: 14px;
  background: rgba(20, 12, 6, 0.45);
  border: 2px dashed rgba(232, 181, 77, 0.35);
}

.booth-cam { text-align: center; }

.camera {
  width: 190px;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.15s;
}

.camera:hover { transform: rotate(-3deg) scale(1.04); }
.camera:active { transform: scale(0.96); }
.camera svg { display: block; width: 100%; }

.booth h3 { font-family: "Rye", serif; font-weight: 400; font-size: 1.6rem; color: var(--cream); }
.booth p { color: var(--muted); font-weight: 700; margin: 0.3rem 0 1rem; }

.prints { display: flex; flex-wrap: wrap; gap: 1rem; min-height: 200px; align-items: flex-start; }

.print {
  width: 180px;
  padding: 8px 8px 0;
  background: #fbf6ea;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  rotate: var(--r, -2deg);
  animation: printOut 0.7s cubic-bezier(.2, 1.2, .4, 1) both;
}

.print img { width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; animation: develop 2.2s ease-out both; }
.print figcaption { font-family: "Permanent Marker", cursive; color: var(--ink); font-size: 0.85rem; text-align: center; padding: 0.4rem 0 0.55rem; line-height: 1.2; }

.camera-flash {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  background: #fff;
  animation: camFlash 0.5s ease-out forwards;
}

/* ---------- Secret tunnels ---------- */
.tunnel-hole {
  position: absolute;
  z-index: 5;
  width: 74px;
  height: 58px;
  border: 0;
  cursor: pointer;
  border-radius: 40px 40px 4px 4px;
  background: radial-gradient(ellipse at 50% 85%, #000 0 45%, #1a0f07 75%);
  box-shadow: inset 0 6px 10px rgba(0, 0, 0, 0.9), 0 0 0 5px rgba(90, 60, 30, 0.9), 0 0 0 7px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s;
}

.tunnel-hole span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  translate: -50% 0;
  white-space: nowrap;
  padding: 0.25rem 0.6rem 0.1rem;
  border-radius: 4px;
  font-family: "Rye", serif;
  font-size: 0.72rem;
  color: var(--cream);
  background: linear-gradient(180deg, #8a6440, #5a3b22);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.tunnel-hole:hover { transform: scale(1.08); }

.tunnel {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  display: none;
  background: #050302;
  overflow: hidden;
}

.tunnel.run { display: block; animation: tunnelIris 1.8s ease-in-out both; }

.tunnel::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: repeating-radial-gradient(circle, #050302 0 26px, #2c1a0c 26px 34px, #4a2e17 34px 38px, #050302 38px 64px);
  animation: tunnelZoom 0.9s linear infinite;
}

.tunnel::after {
  content: "crawling through the tunnel...";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18%;
  text-align: center;
  font-family: "Permanent Marker", cursive;
  font-size: 1.3rem;
  color: var(--hay-light);
}

/* ---------- Shooting range mini-game ---------- */
.range {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 16px;
  border-radius: 12px;
}

.range-hud {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0.5rem 0.8rem;
  font-family: "Rye", serif;
  color: var(--cream);
}

.range-hud b { font-family: "Luckiest Guy", cursive; font-weight: 400; color: var(--hay-light); font-size: 1.3rem; margin-left: 0.3rem; }

.field {
  position: relative;
  height: 400px;
  border-radius: 6px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  background:
    linear-gradient(180deg, transparent 63%, #b88a3e 63%, #8a6228),
    linear-gradient(180deg, #8fd0f2, #f4dca8 63%);
}

.night .field { background: linear-gradient(180deg, transparent 63%, #5c4320 63%, #3e2c14), linear-gradient(180deg, #0b1030, #3b2d4a 63%); }

.rail {
  position: absolute;
  left: 0;
  right: 0;
  height: 16px;
  background: var(--grain-h), linear-gradient(180deg, #8a6440, #5a3b22);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.lane {
  position: absolute;
  left: 0;
  right: 0;
  height: 110px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}

.lane:nth-of-type(1) { top: 10px; }
.lane:nth-of-type(2) { top: 140px; }
.lane:nth-of-type(3) { top: 270px; }

.lane-slot { position: relative; }

/* Fence post behind each target spot */
.lane-slot::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 14px;
  height: 46px;
  margin-left: -7px;
  border-radius: 3px 3px 0 0;
  background: var(--grain-v), linear-gradient(90deg, #7d5732, #5a3b22);
}

.target svg.hen { overflow: visible; }

.target {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 64px;
  height: 84px;
  margin-left: -32px;
  border: 0;
  padding: 0;
  background: none;
  cursor: crosshair;
  translate: 0 100%;
  transition: translate 0.18s ease-out;
  font-size: 3.4rem;
  line-height: 84px;
}

.target.up { translate: 0 0; }
.target.hit { animation: knock 0.35s ease-in forwards; }
.target svg { width: 100%; height: 100%; }

.hit-text {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  font-family: "Luckiest Guy", cursive;
  font-size: 1.5rem;
  color: var(--hay-light);
  -webkit-text-stroke: 1px var(--brown);
  text-shadow: 2px 2px 0 var(--red);
  translate: -50% -50%;
  animation: hitText 0.7s ease-out forwards;
}

.hit-text.bad { color: #fff; text-shadow: 2px 2px 0 #000; }

.field-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-content: center;
  gap: 0.8rem;
  text-align: center;
  background: rgba(20, 12, 6, 0.72);
  color: var(--cream);
  padding: 1rem;
}

.field-overlay[hidden] { display: none; }
.field-overlay h3 { font-family: "Rye", serif; font-weight: 400; font-size: clamp(1.6rem, 5vw, 2.4rem); }
.field-overlay p { font-weight: 700; color: var(--muted); max-width: 30rem; }
.field-overlay .btn { justify-self: center; }

/* ---------- Bounty board ---------- */
.bounties {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.2rem;
}

.bounty {
  position: relative;
  padding: 1.3rem 0.8rem 0.9rem;
  color: var(--ink);
  text-align: center;
  background:
    radial-gradient(circle at 80% 15%, rgba(120, 72, 24, 0.25), transparent 22%),
    var(--speckle),
    var(--paper);
  box-shadow: inset 0 0 26px rgba(110, 66, 20, 0.45), 0 12px 22px rgba(0, 0, 0, 0.45);
  rotate: var(--r, -1.5deg);
  transition: rotate 0.2s, scale 0.2s;
}

.bounty:hover { rotate: 0deg; scale: 1.04; }
.bounty .nail:nth-of-type(1) { top: 6px; left: 50%; margin-left: -6px; }

.bounty .rank {
  position: absolute;
  top: -10px;
  left: -8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding-top: 3px;
  border-radius: 50%;
  font-family: "Luckiest Guy", cursive;
  color: #fff;
  background: var(--red);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.bounty .w { font-family: "Rye", serif; font-size: 1.15rem; }
.bounty img { width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; border: 3px solid var(--ink); margin: 0.4rem 0; filter: sepia(0.4); }
.bounty h3 { font-family: "Rye", serif; font-weight: 400; font-size: 0.95rem; line-height: 1.2; min-height: 2.4em; }
.bounty .amt { font-family: "Permanent Marker", cursive; color: var(--red-deep); font-size: 1rem; }
.bounty .ttl { font-size: 0.75rem; font-weight: 800; opacity: 0.75; }
.bounty.you { background: radial-gradient(circle at 80% 15%, rgba(120, 72, 24, 0.25), transparent 22%), var(--speckle), #f8e08e; outline: 3px dashed var(--red); outline-offset: 4px; }
.bounty.you img { filter: none; }
.bounty-note { text-align: center; margin-top: 1.8rem; font-weight: 700; color: var(--muted); font-size: 0.9rem; }

/* ---------- Trapdoor and secret cellar ---------- */
.trapdoor {
  position: absolute;
  z-index: 2;
  right: 7%;
  bottom: 32px;
  width: 130px;
  height: 78px;
  border: 0;
  cursor: pointer;
  background: none;
  perspective: 400px;
}

.trapdoor .hatch {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.4) 0 3px, transparent 3px 32px),
    var(--grain-v),
    linear-gradient(180deg, #7d5732, #5a3b22);
  box-shadow: 0 4px 0 #2c1a0c, 0 8px 14px rgba(0, 0, 0, 0.45);
  transform-origin: top;
  transition: transform 0.8s cubic-bezier(.5, 0, .2, 1);
}

.trapdoor .hatch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 4px solid #9aa0a6;
  border-radius: 50%;
}

.trapdoor .hole { position: absolute; inset: 0; border-radius: 4px; background: radial-gradient(ellipse, #000 20%, #1a0f07 80%); }
.trapdoor.open .hatch { transform: rotateX(110deg); }
.trapdoor:hover .hatch { transform: rotateX(18deg); }
.trapdoor.open:hover .hatch { transform: rotateX(110deg); }

.cellar {
  padding-top: 5rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 170, 60, 0.28), transparent 30%),
    radial-gradient(circle at 85% 70%, rgba(255, 170, 60, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0 3px, transparent 3px) 0 0 / 100% 46px,
    linear-gradient(90deg, rgba(0, 0, 0, 0.3) 0 3px, transparent 3px) 0 0 / 110px 92px,
    linear-gradient(90deg, rgba(0, 0, 0, 0.3) 0 3px, transparent 3px) 55px 46px / 110px 92px,
    var(--speckle),
    linear-gradient(180deg, #4a443c, #2c2823);
  border-top: 14px solid #2c1a0c;
}

.cellar[hidden] { display: none; }
.cellar.reveal-in { animation: cellarIn 0.9s ease-out both; }

.cellar-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem; align-items: start; }

.lore {
  padding: 1.8rem 1.6rem;
  color: var(--ink);
  background: var(--speckle), #e8d7b0;
  box-shadow: inset 0 0 40px rgba(110, 66, 20, 0.5), 0 18px 34px rgba(0, 0, 0, 0.55);
  transform: rotate(-1deg);
}

.lore h3 { font-family: "Rye", serif; font-weight: 400; font-size: 1.6rem; margin-bottom: 0.6rem; }
.lore p { font-weight: 700; line-height: 1.65; }
.lore p + p { margin-top: 0.8rem; }

.rare-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.rare-grid .photo { animation: none; }
.rare-grid .photo::before { display: none; }

.rare-tag {
  position: absolute;
  top: 14px;
  right: -6px;
  z-index: 1;
  padding: 0.2rem 0.6rem 0.05rem;
  font-family: "Rye", serif;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(90deg, #8a3fd1, #c25ee8);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* ---------- Moon Ranch ---------- */
.ranch {
  padding: 5rem 0;
  background:
    radial-gradient(circle at 80% 15%, rgba(140, 90, 255, 0.35), transparent 40%),
    radial-gradient(circle at 15% 80%, rgba(60, 200, 255, 0.18), transparent 40%),
    linear-gradient(180deg, #120c2e, #2a1a4a 60%, #3c2a5a);
}

.ranch .night-sky { opacity: 1; }

.gate {
  position: relative;
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 2rem 1.6rem;
  border-radius: 10px;
  text-align: center;
  background:
    repeating-linear-gradient(90deg, transparent 0 18%, rgba(0, 0, 0, 0.35) 18% calc(18% + 4px)),
    var(--grain-h),
    linear-gradient(180deg, #8a6440, #5a3b22);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.gate::before,
.gate::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: 50%;
  height: 14px;
  background: repeating-linear-gradient(90deg, #a9aeb4 0 18px, #6f757c 18px 22px);
  border-radius: 7px;
  rotate: 8deg;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}

.gate::after { rotate: -8deg; }

.gate-inner {
  position: relative;
  z-index: 1;
  padding: 1.4rem 1.2rem;
  border-radius: 8px;
  color: var(--ink);
  background: var(--speckle), var(--paper);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.lock { font-size: 2.6rem; line-height: 1; }
.gate-inner h3 { font-family: "Rye", serif; font-weight: 400; font-size: 1.6rem; margin: 0.4rem 0; }
.gate-inner p { font-weight: 700; }

.checklist { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1rem; }

.checklist li {
  padding: 0.3rem 0.7rem 0.15rem;
  border: 2px solid rgba(58, 36, 18, 0.45);
  border-radius: 999px;
  font-family: "Rye", serif;
  font-size: 0.85rem;
  color: rgba(58, 36, 18, 0.6);
}

.checklist li.done { border-color: var(--green); background: var(--green); color: #fff; }
.checklist li.done::before { content: "\2713  "; }

.ranch-open { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.ranch-open[hidden] { display: none; }
.ranch-open.reveal-in { animation: cellarIn 1s ease-out both; }

.ranch-photo {
  border: 6px solid #f3d27e;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 0 4px #2a1a4a, 0 0 50px rgba(160, 110, 255, 0.6);
}

.ranch-photo img { width: 100%; height: auto; }

.ranch-copy h3 {
  font-family: "Luckiest Guy", cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1;
  color: var(--hay-light);
  -webkit-text-stroke: 1.5px #2a1a4a;
  text-shadow: 4px 4px 0 #8a3fd1;
}

.ranch-copy p { margin: 1rem 0 1.5rem; font-weight: 700; line-height: 1.6; color: #d9cdf0; font-size: 1.1rem; }
.ranch-copy .ctas { justify-content: flex-start; animation: none; }

.btn-moon { background: linear-gradient(180deg, #a463f0, #6d2fc2); color: #fff; box-shadow: 0 4px 0 #44188a, 0 10px 22px rgba(140, 80, 240, 0.4); }

/* ---------- Final escape sequence ---------- */
.escape {
  position: fixed;
  inset: 0;
  z-index: 160;
  overflow: hidden;
  background: radial-gradient(circle at 80% 18%, #3c2a7a, #120c2e 55%, #05030f);
}

.escape[hidden] { display: none; }
.escape .night-sky { opacity: 1; }

.escape-moon {
  position: absolute;
  right: 8%;
  top: 8%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d8, #f3d27e 55%, #c8a04a);
  box-shadow: 0 0 60px rgba(255, 230, 150, 0.6), inset -14px -10px 0 rgba(160, 120, 40, 0.35);
}

.escape-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: linear-gradient(180deg, #8a6228, #5c4320);
  border-top: 6px solid #b88a3e;
}

.rocket {
  position: absolute;
  left: 50%;
  bottom: 20%;
  width: 120px;
  margin-left: -60px;
}

.rocket svg { display: block; width: 100%; overflow: visible; }
.rocket .flame { opacity: 0; transform-box: fill-box; transform-origin: top; }

.jumper {
  position: absolute;
  left: 8%;
  bottom: 22%;
  width: 84px;
  height: 84px;
}

.jumper img { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--hay); object-fit: cover; }

.escape.go .jumper { animation: jump 1.1s cubic-bezier(.3, .1, .4, 1) 0.3s forwards; }
.escape.go .rocket { animation: launch 2.4s cubic-bezier(.5, 0, .7, .4) 1.5s forwards; }
.escape.go .rocket .flame { animation: flame 0.12s linear 1.4s infinite alternate; opacity: 1; }
.escape.go .escape-ground { animation: shakeY 0.15s linear 1.3s 12; }

.escape-end {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 1.2rem;
  text-align: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
}

.escape.go .escape-end { animation: fadeIn 0.8s ease 3.6s forwards; pointer-events: auto; }

.escape-end h2 {
  font-family: "Luckiest Guy", cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: 1;
  color: var(--hay-light);
  -webkit-text-stroke: 1.5px #2a1a4a;
  text-shadow: 4px 4px 0 #8a3fd1;
}

.escape-end p { color: #d9cdf0; font-weight: 700; font-size: 1.1rem; }
.escape-end .ctas { animation: none; }

/* ---------- Keyframes ---------- */
@keyframes bump { to { translate: 0 -3px; } }
@keyframes wheel { to { transform: rotate(360deg); } }
@keyframes starPulse { to { transform: scale(1.2); } }
@keyframes bumpText { 40% { transform: scale(1.4); color: #6dff8f; } }
@keyframes siren {
  0%, 100% { box-shadow: inset 0 0 90px rgba(255, 30, 30, 0.45); }
  50% { box-shadow: inset 0 0 90px rgba(40, 90, 255, 0.45); }
}
@keyframes toastIn { from { opacity: 0; translate: 0 -20px; scale: 0.9; } }
@keyframes toastOut { to { opacity: 0; translate: 0 -12px; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slam { from { opacity: 0; scale: 1.4; } }
@keyframes sweep {
  0% { transform: translate(-10vw, 20vh); }
  30% { transform: translate(35vw, 55vh); }
  60% { transform: translate(70vw, 25vh); }
  100% { transform: translate(110vw, 60vh); }
}
@keyframes lightning {
  0%, 100% { opacity: 0; }
  8% { opacity: 0.85; }
  14% { opacity: 0.1; }
  22% { opacity: 0.7; }
  40% { opacity: 0; }
}
@keyframes twinkle { from { opacity: 0.2; } to { opacity: 1; } }
@keyframes lanternFlicker {
  0%, 100% { opacity: 1; }
  40% { opacity: 0.85; }
  45% { opacity: 0.95; }
  70% { opacity: 0.8; }
}
@keyframes faceSwap { 50% { transform: scale(0.6) rotate(-20deg); } }
@keyframes stampSlam { from { opacity: 0; scale: 2.4; } 70% { scale: 0.92; } to { opacity: 1; scale: 1; } }
@keyframes trainRun { from { transform: translateX(-360px); } to { transform: translateX(calc(100vw + 20px)); } }
@keyframes wagonRun { from { transform: translateX(calc(100vw + 20px)); } to { transform: translateX(-140px); } }
@keyframes puff {
  from { opacity: 0.8; transform: translate(0, 0) scale(0.6); }
  to { opacity: 0; transform: translate(-30px, -26px) scale(1.6); }
}
@keyframes poof { to { opacity: 0; transform: scale(1.5) translateY(-10px); } }
@keyframes burst {
  from { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  to { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--rot)); }
}
@keyframes shake {
  0%, 100% { translate: 0 0; }
  20% { translate: -8px 2px; }
  40% { translate: 7px -2px; }
  60% { translate: -5px 1px; }
  80% { translate: 4px 0; }
}
@keyframes shakeY { 50% { translate: 2px -2px; } }
@keyframes eq { from { height: 10%; } to { height: 90%; } }
@keyframes marquee { to { transform: translateX(-100%); } }
@keyframes bellSwing {
  0%, 100% { rotate: 0deg; }
  15% { rotate: 22deg; }
  35% { rotate: -18deg; }
  55% { rotate: 12deg; }
  75% { rotate: -6deg; }
}
@keyframes wave { from { opacity: 0.9; transform: scale(0.4); } to { opacity: 0; transform: scale(2.2); } }
@keyframes ding { from { opacity: 0; translate: -50% 10px; scale: 0.6; } 30% { opacity: 1; scale: 1.1; } to { opacity: 0; translate: -50% -50px; } }
@keyframes camFlash { from { opacity: 0.95; } to { opacity: 0; } }
@keyframes printOut { from { opacity: 0; translate: 0 -40px; scale: 0.8; } }
@keyframes develop { from { filter: brightness(2.4) blur(6px) grayscale(1); } to { filter: none; } }
@keyframes tunnelIris {
  0% { clip-path: circle(0% at 50% 50%); }
  30%, 70% { clip-path: circle(80% at 50% 50%); }
  100% { clip-path: circle(0% at 50% 50%); }
}
@keyframes tunnelZoom { from { transform: scale(1); } to { transform: scale(1.6); } }
@keyframes knock { to { transform: rotateX(80deg) translateY(10px); opacity: 0; } }
@keyframes hitText { from { opacity: 1; translate: -50% -50%; } to { opacity: 0; translate: -50% -140%; } }
@keyframes cellarIn { from { opacity: 0; translate: 0 -30px; } }
@keyframes jump {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(calc(42vw - 60px), -45vh) rotate(200deg); }
  100% { transform: translate(calc(42vw - 30px), -12vh) rotate(360deg) scale(0.4); opacity: 0; }
}
@keyframes launch {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(0, -6vh) rotate(4deg); }
  100% { transform: translate(34vw, -90vh) rotate(32deg) scale(0.25); }
}
@keyframes flame { from { transform: scaleY(0.8); } to { transform: scaleY(1.3); } }


/* Never let the loader trap visitors, even if the script fails to load */
.js .loader { animation: loaderFailsafe 0.6s ease 9s forwards; }
@keyframes loaderFailsafe { to { opacity: 0; visibility: hidden; } }

/* Most Wanted stamp on the poster */
.poster .poster-most {
  left: 50%;
  top: 34%;
  right: auto;
  bottom: auto;
  translate: -50% 0;
  padding: 0.35rem 0.9rem 0.1rem;
  font-size: 1.7rem;
  border-width: 4px;
  transform: rotate(-14deg);
  background: rgba(255, 255, 255, 0.6);
  z-index: 2;
  animation: stampSlam 0.5s cubic-bezier(.2, 1.6, .4, 1) both;
}

/* Runaway chicken event */
.chicken-run {
  position: fixed;
  z-index: 65;
  left: -80px;
  bottom: 170px;
  border: 0;
  background: none;
  cursor: pointer;
  width: 64px;
  height: 64px;
  padding: 0;
  animation: chickenRun 6.8s linear forwards, chickenBob 0.22s ease-in-out infinite alternate;
}

@keyframes chickenRun { to { translate: calc(100vw + 160px) 0; } }
@keyframes chickenBob { from { rotate: 6deg; } to { rotate: -8deg; margin-bottom: 10px; } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) and (min-width: 641px) {
  .hud { bottom: 84px; }
}

@media (max-width: 1080px) {
  .hangout-grid { grid-template-columns: 1fr 1fr; }
  .bell-wrap { grid-column: 1 / -1; }
  .bounties { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .booth { grid-template-columns: 1fr; text-align: center; }
  .prints { justify-content: center; }
  .cellar-grid,
  .ranch-open { grid-template-columns: 1fr; }
  .ranch-copy { text-align: center; }
  .ranch-copy .ctas { justify-content: center; }
}

@media (max-width: 640px) {
  .hud { bottom: 80px; left: 8px; right: 8px; justify-content: space-between; padding: 0.3rem 0.3rem 0.3rem 0.6rem; gap: 0.35rem; }
  .hud .rep { margin-right: auto; }
  .hud, .inventory, .buddy { transition: translate 0.35s ease, opacity 0.35s ease; }
  .dock-hidden .hud, .dock-hidden .inventory { translate: 0 calc(100% + 100px); }
  .dock-hidden .buddy { translate: -140% 0; opacity: 0; }
  .hud-btn { width: 30px; height: 30px; font-size: 0.95rem; }
  .rep { min-width: 66px; }
  .stars svg { width: 12px; height: 12px; }
  .toasts { top: 12px; }
  .inventory { left: 8px; right: 8px; translate: none; justify-content: space-between; bottom: 8px; }
  .slot { flex: 1; width: auto; }
  .buddy { bottom: 132px; left: 8px; }
  .buddy-face, .buddy-face img { width: 48px; height: 48px; }
  .buddy-say { max-width: 180px; font-size: 0.85rem; margin-bottom: 0.8rem; }
  .hangout-grid { grid-template-columns: 1fr; }
  .bounties { grid-template-columns: repeat(2, 1fr); }
  .field { height: 330px; }
  .lane { height: 92px; }
  .lane:nth-of-type(2) { top: 116px; }
  .lane:nth-of-type(3) { top: 222px; }
  .target { width: 52px; height: 70px; margin-left: -26px; font-size: 2.8rem; line-height: 70px; }
  .rare-grid { gap: 1rem; }
  .trapdoor { width: 96px; height: 58px; bottom: 26px; right: 4%; }
  .stamp-mark { right: 0; font-size: 0.85rem; }
  .horizon { height: 120px; }
  .train { width: 260px; bottom: 46px; }
  .booth { padding: 1.4rem 1rem; }
  .print { width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .loader, .searchlight, .weather, .doors { display: none !important; }
  .escape-end { opacity: 1; pointer-events: auto; }
  .escape .rocket, .escape .jumper { display: none; }
}
.chicken-run svg { display: block; width: 100%; height: 100%; }
