:root {
  --sky: #9dd7ed;
  --sand: #e8bf72;
  --sand-dark: #bf8748;
  --earth: #6d4b36;
  --earth-dark: #3b2820;
  --leaf: #4f8d5c;
  --teal: #1f7a83;
  --ink: #20242a;
  --muted: #626a73;
  --panel: #fff9ea;
  --white: #ffffff;
  --accent: #d94f43;
  --gold: #f4c542;
  --blue: #3167b1;
  --shadow: 0 18px 35px rgba(44, 28, 16, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f5ead8;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100%;
  margin: 0;
}

body.modal-open {
  overflow: hidden;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 14px clamp(10px, 2.2vw, 24px) 112px;
  background:
    linear-gradient(180deg, rgba(157, 215, 237, 0.45), rgba(245, 234, 216, 0) 42%),
    #f5ead8;
}

.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 22% 20%, rgba(244, 197, 66, 0.28), transparent 28%),
    radial-gradient(circle at 76% 24%, rgba(31, 122, 131, 0.22), transparent 30%),
    rgba(32, 36, 42, 0.46);
}

.welcome-modal.is-hidden {
  display: none;
}

.welcome-card {
  width: min(92vw, 520px);
  padding: clamp(24px, 6vw, 42px);
  border: 4px solid #d94f43;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(244, 197, 66, 0.16), rgba(255, 249, 234, 0) 42%),
    #fff9ea;
  box-shadow: 0 28px 70px rgba(32, 24, 18, 0.34);
  text-align: center;
}

.welcome-kicker {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome-card h1 {
  margin-top: 8px;
  font-size: clamp(2.2rem, 9vw, 4.1rem);
  line-height: 0.95;
}

.welcome-card p:not(.welcome-kicker) {
  margin: 18px auto 0;
  max-width: 360px;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.35;
}

.welcome-button {
  margin-top: 24px;
  padding: 13px 20px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--teal);
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(31, 122, 131, 0.24);
}

.welcome-button:focus-visible {
  outline: 4px solid rgba(244, 197, 66, 0.72);
  outline-offset: 3px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  max-width: 1200px;
  margin: 0 auto 14px;
}

.eyebrow,
h1,
h2,
h3,
p {
  margin: 0;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.7rem);
  line-height: 0.9;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 2.15rem);
}

h3 {
  font-size: 1.05rem;
}

.scroll-cue {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid rgba(32, 36, 42, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-weight: 900;
}

.reset-button,
.food-button,
.room,
.tunnel-meerkat {
  border: 0;
  cursor: pointer;
}

.status-band {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto 14px;
  align-items: stretch;
}

.status-band > div,
.reset-button {
  min-height: 64px;
  padding: 12px 14px;
  border: 2px solid rgba(109, 75, 54, 0.14);
  border-radius: 8px;
  background: rgba(255, 249, 234, 0.88);
  box-shadow: 0 8px 18px rgba(44, 28, 16, 0.08);
}

.status-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-band strong {
  display: block;
  margin-top: 4px;
}

.reset-button {
  width: 64px;
  color: var(--ink);
  background: var(--white);
  font-size: 1.45rem;
}

.scene {
  max-width: 1200px;
  display: block;
  margin: 0 auto 42px;
  scroll-margin-top: 16px;
}

.scene-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.scene-heading p {
  max-width: 720px;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 650;
}

.topbar,
.status-band,
.scene-enclosure .scene-heading,
.scene-tunnels .scene-heading {
  display: none;
}

.primary-action {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--white);
  background: var(--accent);
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(217, 79, 67, 0.24);
}

.enclosure-stage,
.tunnel-stage {
  position: relative;
  overflow: hidden;
  min-height: 680px;
  border: 3px solid rgba(109, 75, 54, 0.2);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.enclosure-stage {
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.65) 0 32px, transparent 33px),
    linear-gradient(180deg, var(--sky) 0 46%, #cfe999 46% 48%, var(--sand) 48%);
}

.enclosure-stage > :not(.game-canvas):not(.game-help) {
  display: none;
}

.game-canvas {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.game-help {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 6;
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}

.game-help span {
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--white);
  background: rgba(32, 36, 42, 0.68);
  font-size: 0.72rem;
  font-weight: 900;
}

.party-complete .game-help {
  display: none;
}

.sun {
  position: absolute;
  top: 34px;
  right: 54px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 12px rgba(244, 197, 66, 0.22);
}

.cloud,
.cloud::before,
.cloud::after {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.cloud {
  width: 110px;
  height: 30px;
}

.cloud::before,
.cloud::after {
  content: "";
}

.cloud::before {
  left: 18px;
  bottom: 10px;
  width: 40px;
  height: 40px;
}

.cloud::after {
  right: 16px;
  bottom: 7px;
  width: 52px;
  height: 52px;
}

.cloud-a {
  top: 82px;
  left: 10%;
}

.cloud-b {
  top: 130px;
  left: 52%;
  transform: scale(0.78);
}

.grass {
  position: absolute;
  bottom: 72px;
  width: 58px;
  height: 45px;
  background:
    linear-gradient(110deg, transparent 43%, var(--leaf) 44% 54%, transparent 55%),
    linear-gradient(70deg, transparent 43%, #2f6f48 44% 54%, transparent 55%),
    linear-gradient(90deg, transparent 45%, #65a869 46% 54%, transparent 55%);
}

.grass-a {
  left: 8%;
}

.grass-b {
  right: 10%;
}

.grass-c {
  left: 42%;
  bottom: 40px;
}

.burrow-door {
  position: absolute;
  bottom: 46px;
  width: 148px;
  height: 78px;
  border-radius: 82px 82px 0 0;
  background: radial-gradient(circle at 50% 72%, #211712 0 47%, #6d4b36 48% 68%, #8b654b 69%);
  box-shadow: inset 0 8px 14px rgba(255, 255, 255, 0.16);
}

.door-a {
  left: 11%;
}

.door-b {
  right: 18%;
  transform: scale(0.82);
  opacity: 0.76;
}

.goal-net {
  position: absolute;
  right: 5%;
  bottom: 155px;
  width: 98px;
  height: 76px;
  border: 5px solid var(--blue);
  border-left-width: 10px;
  background:
    linear-gradient(90deg, transparent 0 21px, rgba(49, 103, 177, 0.28) 22px 25px, transparent 26px),
    linear-gradient(180deg, transparent 0 18px, rgba(49, 103, 177, 0.28) 19px 22px, transparent 23px);
  background-size: 26px 22px;
}

.puck-shot {
  position: absolute;
  left: 37%;
  bottom: 202px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #ffffff 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, #fff7d9 0 58%, #d9c57d 59% 100%);
  opacity: 0;
}

.puck-shot.is-flying {
  animation: puck-flight 1s ease-out;
}

@keyframes puck-flight {
  0% {
    opacity: 1;
    transform: translate(0, 0);
  }
  70% {
    opacity: 1;
    transform: translate(420px, -56px);
  }
  100% {
    opacity: 0;
    transform: translate(460px, -20px);
  }
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.confetti.is-active::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, #d94f43 0 4px, transparent 5px) 12% 12% / 90px 90px,
    radial-gradient(circle, #3167b1 0 4px, transparent 5px) 28% 30% / 110px 110px,
    radial-gradient(circle, #f4c542 0 4px, transparent 5px) 48% 18% / 95px 95px,
    radial-gradient(circle, #4f8d5c 0 4px, transparent 5px) 75% 26% / 120px 120px;
  animation: confetti-fall 1.25s ease-out;
}

@keyframes confetti-fall {
  from {
    opacity: 0;
    transform: translateY(-80px);
  }
  20% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(160px);
  }
}

.spark-burst,
.dust-puff {
  position: absolute;
  left: 50%;
  bottom: 170px;
  z-index: 8;
  width: 12px;
  height: 12px;
  pointer-events: none;
  opacity: 0;
}

.spark-burst.is-active {
  opacity: 1;
  animation: spark-pop 850ms ease-out;
}

.spark-burst.is-active::before {
  content: "";
  position: absolute;
  inset: -42px;
  background:
    radial-gradient(circle, #f4c542 0 5px, transparent 6px) 10% 40% / 42px 42px,
    radial-gradient(circle, #d94f43 0 4px, transparent 5px) 80% 26% / 48px 48px,
    radial-gradient(circle, #3167b1 0 4px, transparent 5px) 52% 72% / 44px 44px,
    radial-gradient(circle, #ffffff 0 4px, transparent 5px) 32% 10% / 38px 38px;
}

.dust-puff.is-active {
  opacity: 1;
  animation: dust-rise 900ms ease-out;
}

.dust-puff.is-active::before,
.dust-puff.is-active::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(143, 94, 52, 0.35);
  filter: blur(1px);
}

.dust-puff.is-active::before {
  left: -48px;
  top: 6px;
  width: 96px;
  height: 34px;
}

.dust-puff.is-active::after {
  left: -22px;
  top: -8px;
  width: 46px;
  height: 26px;
}

@keyframes spark-pop {
  from {
    transform: scale(0.35) rotate(0deg);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  to {
    transform: scale(1.75) rotate(24deg);
    opacity: 0;
  }
}

@keyframes dust-rise {
  from {
    transform: translateY(20px) scale(0.5);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  to {
    transform: translateY(-18px) scale(1.45);
    opacity: 0;
  }
}

.meerkat {
  position: absolute;
  width: 118px;
  height: 218px;
  border: 0;
  background: transparent;
  transform-origin: 50% 100%;
  --kat-scale: 1;
  --idle-delay: 0s;
  transform: translate3d(0, 0, 0) scale(var(--kat-scale));
  transition: filter 180ms ease;
}

.meerkat::before {
  content: "";
  position: absolute;
  left: 15px;
  bottom: 7px;
  width: 88px;
  height: 24px;
  border-radius: 50%;
  background: rgba(62, 38, 20, 0.23);
  filter: blur(3px);
}

.meerkat::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 72px;
  width: 40px;
  height: 14px;
  border-radius: 999px;
  background: #8b5735;
  transform: rotate(-24deg);
  transform-origin: left center;
}

.meerkat:hover,
.meerkat:focus-visible {
  outline: none;
  filter: drop-shadow(0 12px 10px rgba(64, 35, 19, 0.18));
  transform: translateY(-8px) scale(var(--kat-scale));
}

.meerkat.is-happy {
  animation: happy-hop 0.55s ease;
}

.meerkat.is-burrowing {
  animation: burrow-dive 820ms ease-in forwards;
}

.meerkat.is-underground {
  opacity: 0;
  pointer-events: none;
  transform: translateY(120px) scale(calc(var(--kat-scale) * 0.25));
}

.meerkat.is-returning {
  animation: burrow-return 780ms cubic-bezier(0.2, 1.4, 0.28, 1) forwards;
}

@keyframes meerkat-idle {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(var(--kat-scale));
  }
  35% {
    transform: translate3d(6px, -6px, 0) rotate(1.5deg) scale(var(--kat-scale));
  }
  70% {
    transform: translate3d(-5px, -2px, 0) rotate(-1deg) scale(var(--kat-scale));
  }
}

@keyframes happy-hop {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(var(--kat-scale));
  }
  45% {
    transform: translateY(-24px) rotate(-4deg) scale(var(--kat-scale));
  }
}

@keyframes burrow-dive {
  0% {
    opacity: 1;
    transform: translateY(0) scale(var(--kat-scale));
  }
  45% {
    opacity: 1;
    transform: translateY(-22px) rotate(7deg) scale(var(--kat-scale));
  }
  100% {
    opacity: 0;
    transform: translateY(130px) rotate(-12deg) scale(calc(var(--kat-scale) * 0.22));
  }
}

@keyframes burrow-return {
  0% {
    opacity: 0;
    transform: translateY(130px) scale(calc(var(--kat-scale) * 0.25));
  }
  65% {
    opacity: 1;
    transform: translateY(-28px) rotate(-3deg) scale(var(--kat-scale));
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(var(--kat-scale));
  }
}

.byte {
  left: 16%;
  bottom: 82px;
  --idle-delay: -0.4s;
}

.pucki {
  left: 36%;
  bottom: 66px;
  --idle-delay: -1.2s;
}

.braui {
  left: 56%;
  bottom: 118px;
  --idle-delay: -2.1s;
}

.kruemel {
  left: 72%;
  bottom: 74px;
  --idle-delay: -0.9s;
}

.professor {
  left: 4%;
  bottom: 56px;
  --idle-delay: -2.8s;
}

.speech {
  position: absolute;
  left: 50%;
  bottom: 195px;
  z-index: 5;
  width: max-content;
  max-width: 210px;
  padding: 8px 10px;
  border: 2px solid rgba(32, 36, 42, 0.12);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 18px rgba(44, 28, 16, 0.12);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.meerkat.has-speech .speech {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ears::before,
.ears::after {
  content: "";
  position: absolute;
  top: 42px;
  z-index: 1;
  width: 30px;
  height: 34px;
  border-radius: 50%;
  background: #a87345;
}

.ears::before {
  left: 18px;
}

.ears::after {
  right: 18px;
}

.body {
  position: absolute;
  left: 18px;
  bottom: 25px;
  width: 82px;
  height: 150px;
  border-radius: 48% 48% 42% 42%;
  background:
    linear-gradient(90deg, rgba(82, 48, 28, 0.28) 0 10%, transparent 11% 89%, rgba(82, 48, 28, 0.24) 90%),
    linear-gradient(90deg, #a46b3e, #c69058 48%, #9a6238);
  box-shadow: inset -12px 0 0 rgba(64, 35, 19, 0.08), inset 0 10px 0 rgba(255, 228, 177, 0.12);
  animation: body-bob 4.2s ease-in-out var(--idle-delay) infinite;
}

.body::before,
.body::after {
  content: "";
  position: absolute;
  top: 72px;
  width: 18px;
  height: 50px;
  border-radius: 999px;
  background: #8b5735;
  z-index: 2;
}

.body::before {
  left: -7px;
  transform: rotate(14deg);
}

.body::after {
  right: -7px;
  transform: rotate(-14deg);
}

.face {
  position: absolute;
  left: 13px;
  top: 18px;
  width: 56px;
  height: 58px;
  border-radius: 50%;
  background: #d8a36c;
  box-shadow: inset 0 -6px 0 rgba(116, 69, 39, 0.1);
}

.face::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 29px;
  width: 28px;
  height: 21px;
  border-radius: 50%;
  background: rgba(255, 226, 178, 0.42);
}

.face::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 3px;
  width: 9px;
  height: 16px;
  border-radius: 999px;
  background: rgba(75, 43, 25, 0.32);
}

.eyes::before,
.eyes::after {
  content: "";
  position: absolute;
  top: 21px;
  width: 7px;
  height: 9px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 65% 28%, #ffffff 0 1px, transparent 2px),
    #20140f;
}

.eyes::before {
  left: 17px;
}

.eyes::after {
  right: 17px;
}

.nose {
  position: absolute;
  left: 24px;
  top: 34px;
  width: 10px;
  height: 8px;
  border-radius: 50%;
  background: #3b2820;
  z-index: 2;
}

.nose::after {
  content: "";
  position: absolute;
  left: -5px;
  top: 7px;
  width: 20px;
  height: 9px;
  border-bottom: 2px solid #5d3826;
  border-radius: 50%;
}

.belly {
  position: absolute;
  left: 20px;
  bottom: 18px;
  width: 42px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 230, 178, 0.48);
  box-shadow: inset 0 9px 0 rgba(255, 255, 255, 0.16);
}

.belly::after {
  content: "";
  position: absolute;
  left: 15px;
  bottom: 0;
  width: 12px;
  height: 8px;
  border-radius: 999px;
  background: rgba(108, 62, 34, 0.18);
}

.nameplate {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  min-width: 84px;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(32, 36, 42, 0.82);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 850;
  transform: translateX(-50%);
}

.glasses {
  position: absolute;
  left: 11px;
  top: 17px;
  width: 15px;
  height: 12px;
  border: 2px solid #20242a;
  border-radius: 50%;
  box-shadow: 22px 0 0 -2px transparent, 22px 0 0 0 #20242a;
}

.glasses::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 14px;
  width: 10px;
  height: 2px;
  background: #20242a;
}

.laptop {
  position: absolute;
  left: 1px;
  bottom: 33px;
  width: 52px;
  height: 34px;
  border-radius: 5px;
  background: #35444f;
  box-shadow: inset 0 0 0 4px #5e7e8e;
}

.cup {
  position: absolute;
  right: 4px;
  bottom: 32px;
  width: 22px;
  height: 26px;
  border-radius: 4px 4px 8px 8px;
  background: var(--white);
}

.helmet {
  position: absolute;
  left: 25px;
  top: 35px;
  z-index: 4;
  width: 68px;
  height: 39px;
  border-radius: 36px 36px 10px 10px;
  background: var(--blue);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.12);
}

.stick {
  position: absolute;
  right: 1px;
  bottom: 30px;
  width: 9px;
  height: 112px;
  border-radius: 4px;
  background: #533522;
  transform: rotate(18deg);
}

.stick::after {
  content: "";
  position: absolute;
  right: -27px;
  bottom: -4px;
  width: 40px;
  height: 10px;
  border-radius: 4px;
  background: #533522;
}

.watch-rock {
  position: absolute;
  left: 3px;
  bottom: 8px;
  width: 112px;
  height: 54px;
  border-radius: 48% 48% 8px 8px;
  background: #7c776e;
}

.scope {
  position: absolute;
  right: 8px;
  top: 70px;
  width: 26px;
  height: 14px;
  border-radius: 6px;
  background: var(--teal);
}

.crown {
  position: absolute;
  left: 34px;
  top: 26px;
  z-index: 4;
  width: 50px;
  height: 34px;
  background:
    linear-gradient(135deg, transparent 0 22%, var(--gold) 23% 64%, transparent 65%),
    linear-gradient(45deg, transparent 0 22%, var(--gold) 23% 64%, transparent 65%),
    linear-gradient(90deg, var(--gold), var(--gold));
  background-position: 0 0, 17px 0, 0 19px;
  background-size: 25px 25px, 25px 25px, 50px 14px;
  background-repeat: no-repeat;
}

.mono-glass {
  position: absolute;
  right: 12px;
  top: 17px;
  width: 17px;
  height: 17px;
  border: 2px solid #20242a;
  border-radius: 50%;
}

.bowtie {
  position: absolute;
  left: 29px;
  top: 78px;
  width: 24px;
  height: 15px;
  background:
    linear-gradient(135deg, var(--accent) 0 49%, transparent 50%),
    linear-gradient(225deg, var(--accent) 0 49%, transparent 50%);
}

.map {
  position: absolute;
  right: 0;
  bottom: 42px;
  width: 42px;
  height: 52px;
  border-radius: 5px;
  background:
    linear-gradient(35deg, transparent 38%, #6d4b36 39% 43%, transparent 44%),
    #f2e2a2;
  border: 2px solid #b99a55;
}

.laptop,
.cup,
.helmet,
.stick,
.scope,
.crown,
.map {
  animation: prop-bob 4.2s ease-in-out var(--idle-delay) infinite;
}

@keyframes body-bob {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  35% {
    transform: translate(4px, -5px) rotate(1.5deg);
  }
  70% {
    transform: translate(-3px, -2px) rotate(-1deg);
  }
}

@keyframes prop-bob {
  0%,
  100% {
    translate: 0 0;
  }
  35% {
    translate: 3px -4px;
  }
  70% {
    translate: -2px -1px;
  }
}

.tunnel-stage {
  background:
    radial-gradient(circle at 20% 24%, rgba(255, 226, 158, 0.12) 0 60px, transparent 61px),
    linear-gradient(180deg, #7a553d, var(--earth-dark));
}

.tunnel-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.tunnel {
  display: none;
  position: absolute;
  border-radius: 999px;
  background: #2b1c17;
  box-shadow: inset 0 10px 18px rgba(255, 234, 184, 0.06);
}

.main-tunnel {
  left: 11%;
  right: 11%;
  top: 265px;
  height: 72px;
}

.branch {
  width: 210px;
  height: 48px;
}

.branch-server {
  left: 16%;
  top: 185px;
  transform: rotate(-28deg);
}

.branch-hockey {
  right: 14%;
  top: 188px;
  transform: rotate(30deg);
}

.branch-storage {
  left: 10%;
  top: 345px;
  transform: rotate(22deg);
}

.branch-birthday {
  left: 42%;
  top: 360px;
  transform: rotate(-23deg);
}

.branch-family {
  right: 16%;
  top: 356px;
  transform: rotate(-18deg);
}

.branch-secret {
  left: 44%;
  top: 128px;
  height: 40px;
  transform: rotate(90deg);
  opacity: 0;
}

.has-secret .branch-secret {
  opacity: 1;
}

.room {
  z-index: 3;
  position: absolute;
  display: none;
  place-items: center;
  gap: 5px;
  width: 168px;
  min-height: 92px;
  padding: 10px;
  border: 3px solid rgba(255, 228, 168, 0.12);
  border-radius: 8px;
  color: #c2b09b;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 8px, transparent 9px 18px),
    #4d372b;
  font-weight: 900;
  font-size: 0.96rem;
  text-align: center;
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.08);
}

.room.is-unlocked {
  color: var(--ink);
  border-color: rgba(244, 197, 66, 0.9);
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.8) 0 16px, transparent 17px),
    #f1d18a;
  box-shadow: 0 0 22px rgba(244, 197, 66, 0.48), inset 0 -10px 0 rgba(109, 75, 54, 0.08);
}

.room:not(.is-unlocked)::after {
  content: "verschlossen";
  display: block;
  width: 100%;
  padding: 3px 5px;
  border-radius: 5px;
  color: #fff3da;
  background: rgba(32, 20, 15, 0.55);
  font-size: 0.68rem;
}

.room-icon {
  font-size: 1.5rem;
}

.room span:last-child {
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.sleep-room {
  left: 6%;
  top: 238px;
}

.server-room {
  left: 17%;
  top: 76px;
}

.hockey-room {
  right: 12%;
  top: 78px;
}

.storage-room {
  left: 9%;
  bottom: 66px;
}

.birthday-room {
  left: 42%;
  bottom: 54px;
}

.family-room {
  right: 12%;
  bottom: 58px;
}

.secret-room {
  left: 43%;
  top: 42px;
  opacity: 0;
  pointer-events: none;
}

.secret-room.is-unlocked {
  opacity: 1;
  pointer-events: auto;
}

.tunnel-meerkat {
  display: none;
  position: absolute;
  z-index: 5;
  place-items: center;
  gap: 3px;
  width: 62px;
  height: 62px;
  padding: 0;
  border-radius: 999px;
  color: #fff7df;
  background: transparent;
  opacity: 0.72;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.26));
  animation: tunnel-scurry 7s ease-in-out infinite;
  --tx: 38px;
  --ty: 12px;
}

.tunnel-meerkat:hover,
.tunnel-meerkat:focus-visible,
.tunnel-meerkat.is-visiting {
  opacity: 1;
  outline: none;
  filter: drop-shadow(0 0 12px rgba(244, 197, 66, 0.75));
}

.tunnel-meerkat.is-tickled {
  animation: tunnel-giggle 520ms ease-in-out 3;
}

.tunnel-meerkat-face {
  position: relative;
  width: 42px;
  height: 44px;
  border-radius: 48% 48% 42% 42%;
  background:
    radial-gradient(circle at 35% 38%, #1e1510 0 3px, transparent 4px),
    radial-gradient(circle at 65% 38%, #1e1510 0 3px, transparent 4px),
    radial-gradient(circle at 50% 54%, #302017 0 4px, transparent 5px),
    linear-gradient(90deg, #9b633a, #d0965d 48%, #885432);
  border: 2px solid rgba(255, 226, 166, 0.2);
}

.tunnel-meerkat-face::before,
.tunnel-meerkat-face::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 15px;
  height: 16px;
  border-radius: 50%;
  background: #8f5a37;
}

.tunnel-meerkat-face::before {
  left: 1px;
}

.tunnel-meerkat-face::after {
  right: 1px;
}

.tunnel-meerkat-label {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(33, 22, 17, 0.72);
  font-size: 0.62rem;
  font-weight: 900;
}

.tunnel-byte {
  left: 29%;
  top: 202px;
  animation-delay: -0.4s;
}

.tunnel-pucki {
  right: 28%;
  top: 252px;
  --tx: -42px;
  --ty: 18px;
  animation-delay: -1.6s;
}

.tunnel-braui {
  left: 16%;
  bottom: 190px;
  --tx: 52px;
  --ty: -14px;
  animation-delay: -2.8s;
}

.tunnel-kruemel {
  right: 17%;
  bottom: 172px;
  --tx: -48px;
  --ty: -8px;
  animation-delay: -3.7s;
}

.tunnel-professor {
  left: 48%;
  top: 300px;
  --tx: 28px;
  --ty: 38px;
  animation-delay: -5.1s;
}

@keyframes tunnel-scurry {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  28% {
    transform: translate(var(--tx), var(--ty)) rotate(5deg);
  }
  56% {
    transform: translate(calc(var(--tx) * -0.35), calc(var(--ty) * 0.6)) rotate(-4deg);
  }
  78% {
    transform: translate(calc(var(--tx) * 0.5), calc(var(--ty) * -0.45)) rotate(3deg);
  }
}

@keyframes tunnel-giggle {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  35% {
    transform: translate(0, -10px) rotate(-9deg) scale(1.08);
  }
  70% {
    transform: translate(0, 3px) rotate(9deg) scale(0.96);
  }
}

.room-panel {
  display: none;
  margin-top: 12px;
  padding: 16px;
  border: 2px solid rgba(109, 75, 54, 0.14);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 20px rgba(44, 28, 16, 0.08);
}

.room-panel p {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 650;
}

.room-panel.is-final {
  border-color: var(--gold);
  background: #fff0b8;
}

.food-dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, minmax(78px, 1fr));
  gap: 8px;
  width: min(860px, calc(100vw - 28px));
  padding: 10px;
  border: 2px solid rgba(32, 36, 42, 0.1);
  border-radius: 8px;
  background: rgba(255, 249, 234, 0.96);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.viewing-tunnels .app-shell {
  padding-bottom: 18px;
}

.viewing-tunnels .food-dock {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  margin: 12px auto 0;
}

.food-button {
  position: relative;
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 64px;
  padding: 7px 6px;
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
}

.food-button.is-selected {
  color: var(--white);
  background: var(--teal);
}

.food-button.is-complete {
  color: #20301f;
  background: #d7ed9c;
  box-shadow:
    inset 0 0 0 2px rgba(47, 122, 75, 0.38),
    0 8px 18px rgba(47, 122, 75, 0.18);
}

.food-button.is-complete::after {
  content: "✓";
  position: absolute;
  right: 6px;
  top: 5px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: var(--white);
  background: #2f7a4b;
  font-size: 0.78rem;
  line-height: 1;
}

.food-button.is-selected.is-complete {
  color: var(--white);
  background: linear-gradient(135deg, #1f7a83 0 58%, #2f7a4b 59%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.32),
    0 10px 22px rgba(31, 122, 131, 0.22);
}

.tickle-button.is-selected {
  background: var(--accent);
}

.drag-ghost {
  position: fixed;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: rgba(255, 249, 234, 0.94);
  box-shadow: 0 16px 34px rgba(32, 24, 18, 0.28);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.drag-ghost .food-icon {
  transform: scale(1.1);
}

.food-icon {
  display: block;
  position: relative;
  width: 30px;
  height: 30px;
}

.bug-icon {
  border-radius: 50%;
  background: #2f6f48;
}

.bug-icon::before,
.bug-icon::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 13px;
  height: 2px;
  background: #173f2a;
}

.bug-icon::before {
  left: -8px;
  transform: rotate(35deg);
}

.bug-icon::after {
  right: -8px;
  transform: rotate(-35deg);
}

.coffee-icon {
  border-radius: 50%;
  background: #5a3828;
  box-shadow: inset 0 0 0 6px #8e6045;
}

.cake-icon {
  border-radius: 4px;
  background: linear-gradient(180deg, #ffeff2 0 35%, #d94f43 36% 52%, #f4c542 53%);
}

.energy-icon {
  border-radius: 5px;
  background: linear-gradient(135deg, #3167b1 0 50%, #f4c542 51%);
}

.seed-icon {
  border-radius: 55% 45% 55% 45%;
  background: #e4d065;
  transform: rotate(25deg);
}

.puck-icon {
  position: relative;
  height: 30px;
  margin-top: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, #ffffff 0 16%, transparent 17%),
    radial-gradient(circle at 50% 50%, #fff8dc 0 58%, #d9c57d 59% 100%);
  box-shadow:
    inset -4px -5px 0 rgba(127, 107, 48, 0.2),
    0 3px 7px rgba(49, 31, 16, 0.18);
}

.puck-icon::before,
.puck-icon::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(137, 115, 47, 0.5);
  border-radius: 50%;
  pointer-events: none;
}

.puck-icon::before {
  inset: 8px 6px 6px 8px;
  border-left-color: transparent;
  border-bottom-color: transparent;
}

.puck-icon::after {
  inset: 5px 10px 10px 5px;
  border-right-color: transparent;
  border-top-color: transparent;
}

.tickle-icon::before,
.tickle-icon::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: #d94f43;
}

.tickle-icon::before {
  left: 3px;
  top: 5px;
  width: 23px;
  height: 6px;
  transform: rotate(-28deg);
}

.tickle-icon::after {
  right: 2px;
  bottom: 5px;
  width: 23px;
  height: 6px;
  background: var(--gold);
  transform: rotate(31deg);
}

@media (max-width: 900px) {
  .app-shell {
    padding-bottom: 182px;
  }

  .topbar,
  .scene-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .view-switch {
    width: 100%;
  }

  .view-button {
    flex: 1;
  }

  .status-band {
    grid-template-columns: 1fr auto;
  }

  .status-band > div:first-child {
    grid-column: 1 / -1;
  }

  .enclosure-stage,
  .tunnel-stage {
    min-height: 690px;
  }

  .meerkat {
    --kat-scale: 0.86;
  }

  .meerkat:hover,
  .meerkat:focus-visible {
    transform: translateY(-6px) scale(var(--kat-scale));
  }

  .byte {
    left: 8%;
    bottom: 258px;
  }

  .pucki {
    left: 41%;
    bottom: 242px;
  }

  .braui {
    left: 65%;
    bottom: 330px;
  }

  .kruemel {
    left: 50%;
    bottom: 70px;
  }

  .professor {
    left: 8%;
    bottom: 72px;
  }

  .goal-net {
    right: 6%;
    bottom: 260px;
    transform: scale(0.8);
  }

  .food-dock {
    grid-template-columns: repeat(3, 1fr);
  }

  .tunnel-stage {
    min-height: 780px;
  }

  .main-tunnel {
    left: 42%;
    right: auto;
    top: 80px;
    width: 70px;
    height: 620px;
  }

  .branch,
  .branch-secret {
    display: none;
  }

  .room {
    width: min(46vw, 190px);
    font-size: 0.9rem;
  }

  .sleep-room {
    left: 7%;
    top: 92px;
  }

  .server-room {
    right: 7%;
    left: auto;
    top: 182px;
  }

  .hockey-room {
    left: 7%;
    right: auto;
    top: 282px;
  }

  .storage-room {
    right: 7%;
    left: auto;
    top: 382px;
    bottom: auto;
  }

  .birthday-room {
    left: 7%;
    top: 482px;
    bottom: auto;
  }

  .family-room {
    right: 7%;
    top: 582px;
    bottom: auto;
  }

  .secret-room {
    left: 50%;
    top: 680px;
    transform: translateX(-50%);
  }

  .tunnel-meerkat {
    width: 50px;
    height: 54px;
  }

  .tunnel-meerkat-face {
    width: 34px;
    height: 36px;
  }

  .tunnel-byte {
    left: 47%;
    top: 150px;
  }

  .tunnel-pucki {
    right: 48%;
    top: 258px;
  }

  .tunnel-braui {
    left: 47%;
    bottom: 330px;
  }

  .tunnel-kruemel {
    right: 43%;
    bottom: 232px;
  }

  .tunnel-professor {
    left: 48%;
    top: 452px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 8px 10px 88px;
  }

  .topbar {
    gap: 8px;
    margin-bottom: 10px;
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  h1 {
    font-size: clamp(1.9rem, 10vw, 2.45rem);
    line-height: 0.96;
  }

  h2 {
    font-size: clamp(1.35rem, 6.5vw, 1.75rem);
  }

  .scroll-cue {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .status-band {
    grid-template-columns: 1fr 52px;
    gap: 8px;
    margin-bottom: 10px;
  }

  .status-band > div,
  .reset-button {
    min-height: 52px;
    padding: 8px 10px;
  }

  .status-label {
    font-size: 0.66rem;
  }

  .status-band strong {
    margin-top: 2px;
    font-size: 0.94rem;
  }

  .reset-button {
    width: 52px;
    font-size: 1.3rem;
  }

  .scene {
    margin-bottom: 28px;
    scroll-margin-top: 8px;
  }

  .scene-heading {
    gap: 8px;
    margin-bottom: 8px;
  }

  .scene-heading p {
    margin-top: 4px;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .primary-action {
    width: 100%;
  }

  .enclosure-stage {
    min-height: 0;
    aspect-ratio: 9 / 16;
    border-width: 2px;
  }

  .game-help {
    left: 8px;
    top: 8px;
    gap: 5px;
  }

  .game-help span {
    padding: 6px 7px;
    font-size: 0.62rem;
  }

  .meerkat {
    --kat-scale: 0.8;
  }

  .meerkat:hover,
  .meerkat:focus-visible {
    transform: translateY(-5px) scale(var(--kat-scale));
  }

  .byte {
    left: -2%;
    bottom: 296px;
  }

  .pucki {
    left: 34%;
    bottom: 278px;
  }

  .braui {
    left: 57%;
    bottom: 392px;
  }

  .kruemel {
    left: 42%;
    bottom: 96px;
  }

  .professor {
    left: -2%;
    bottom: 88px;
  }

  .speech {
    max-width: 158px;
  }

  .door-a {
    left: 6%;
  }

  .door-b {
    right: 4%;
  }

  .food-dock {
    position: fixed;
    left: 50%;
    bottom: max(8px, env(safe-area-inset-bottom));
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
    width: calc(100vw - 12px);
    margin: 0;
    transform: translateX(-50%);
  }

  .food-button {
    gap: 3px;
    min-height: 58px;
    padding: 5px 2px;
    font-size: 0.66rem;
    line-height: 1;
    white-space: nowrap;
  }

  .food-icon {
    width: 25px;
    height: 25px;
  }

  .bug-icon::before,
  .bug-icon::after {
    top: 8px;
    width: 11px;
  }

  .bug-icon::before {
    left: -6px;
  }

  .bug-icon::after {
    right: -6px;
  }

  .puck-icon {
    height: 25px;
    margin-top: 0;
    box-shadow:
      inset -3px -4px 0 rgba(127, 107, 48, 0.2),
      0 3px 7px rgba(49, 31, 16, 0.18);
  }

  .viewing-tunnels .app-shell {
    padding-bottom: 16px;
  }

  .viewing-tunnels .food-dock {
    position: static;
    left: auto;
    bottom: auto;
    width: 100%;
    margin: 12px auto 0;
    transform: none;
  }
}
