@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;600;700&family=Fredoka:wght@500;600;700&display=swap");

:root {
  color-scheme: dark;
  --cream: #fff2cf;
  --cream-soft: #f8ddb0;
  --amber: #ffb449;
  --amber-bright: #ffd06d;
  --navy: #071827;
  --ink: #152035;
  --glass: rgba(7, 24, 39, 0.68);
  --glass-strong: rgba(8, 25, 39, 0.88);
  --line: rgba(255, 231, 178, 0.22);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
  font-family: "DM Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--navy);
}

body.is-booting #scene {
  opacity: 0;
}

body.is-booting .boot-veil {
  opacity: 1;
  visibility: visible;
}

#scene {
  opacity: 1;
  transition: opacity 900ms ease;
}

.boot-veil {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(40, 70, 95, 0.45), transparent 55%),
    #071827;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 700ms ease, visibility 700ms ease;
}

.boot-veil__mark {
  color: rgba(255, 230, 180, 0.55);
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

#scene {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100svh;
  min-height: 540px;
  overflow: hidden;
  background: #071827;
  color: var(--cream);
}

.background-layers,
.world-props,
.character-layer,
.ui-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-fill {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
}

.layer-sky {
  z-index: 0;
}

.layer-moon {
  position: absolute;
  z-index: 5;
  top: -30%;
  left: 50%;
  width: min(57vw, 920px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  object-fit: contain;
  opacity: 0.86;
  mix-blend-mode: screen;
}

.layer-far-pines {
  z-index: 10;
}

.layer-mid-pines {
  z-index: 20;
}

.layer-foreground-left {
  z-index: 30;
  object-position: left center;
}

.layer-foreground-right {
  z-index: 31;
  object-position: right center;
}

.layer-ground {
  z-index: 40;
  object-position: center bottom;
}

.scene-asset {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.string-lights {
  position: absolute;
  z-index: 50;
  top: 17%;
  left: 27%;
  width: 46%;
}

.prop-string-lights {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  display: block;
  filter:
    drop-shadow(0 0 4px rgba(255, 220, 145, 0.45))
    drop-shadow(0 0 12px rgba(255, 165, 58, 0.22));
}

.string-bulb {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 3.4%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 210, 0.95) 0 18%, rgba(255, 196, 92, 0.55) 38%, rgba(255, 150, 40, 0.12) 68%, transparent 78%);
  transform: translate(-50%, -50%) scale(0.9);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: string-bulb-twinkle var(--dur, 2.6s) ease-in-out var(--delay, 0s) infinite;
}

@keyframes string-bulb-twinkle {
  0%,
  100% {
    opacity: 0.42;
    transform: translate(-50%, -50%) scale(0.78);
    filter: blur(0.2px);
  }
  14% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.28);
    filter: blur(0);
  }
  28% {
    opacity: 0.62;
    transform: translate(-50%, -50%) scale(0.92);
  }
  41% {
    opacity: 0.18;
    transform: translate(-50%, -50%) scale(0.55);
  }
  54% {
    opacity: 0.88;
    transform: translate(-50%, -50%) scale(1.12);
  }
  72% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.86);
  }
}

.prop-sign-left {
  z-index: 55;
  bottom: 18%;
  left: 3.5%;
  width: 14%;
}

.prop-sign-right {
  z-index: 55;
  right: 2.5%;
  bottom: 16%;
  width: 10.5%;
}

/* Owl and branch share one wrapper so the feet stay on the limb when the
   scene resizes. Sit point is the mossy mid-right of the perch artwork. */
.owl-perch-group {
  position: absolute;
  z-index: 63;
  top: 28%;
  left: 6%;
  width: 26%;
}

.owl-perch-group .prop-owl-perch {
  position: relative;
  z-index: 1;
  top: auto;
  left: auto;
  width: 100%;
  display: block;
}

.prop-squirrel-perch {
  z-index: 62;
  bottom: 9.5%;
  right: 6.5%;
  width: 12%;
}

.character {
  position: absolute;
  aspect-ratio: 1;
  transform-origin: 50% 100%;
  pointer-events: none;
}

.character-motion {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
}

.character-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
  filter:
    brightness(var(--character-brightness, 1))
    saturate(var(--character-saturation, 1))
    drop-shadow(0 9px 10px rgba(0, 0, 0, 0.28))
    drop-shadow(0 0 14px rgba(255, 130, 45, var(--character-glow, 0.08)));
  transition: filter 500ms ease;
}

.character-frame--primary {
  opacity: 1;
}

.character-frame--secondary {
  opacity: 0;
}

/* Hard cut between poses — soft crossfades looked holographic online. */
.character.is-showing-secondary .character-frame--primary {
  opacity: 0;
}

.character.is-showing-secondary .character-frame--secondary {
  opacity: 1;
}

.character--bear {
  z-index: 64;
  bottom: 25%;
  left: 20%;
  width: clamp(190px, 20vw, 390px);
}

.character--owl {
  z-index: 2;
  top: 3%;
  left: 39%;
  width: 40%;
}

.character--owl .character-frame {
  filter:
    brightness(var(--character-brightness, 1))
    saturate(var(--character-saturation, 1))
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.character--squirrel {
  z-index: 74;
  right: 13.5%;
  bottom: 17%;
  width: clamp(108px, 11vw, 214px);
}

.character--bunny {
  z-index: 75;
  bottom: 15%;
  left: 25%;
  width: clamp(105px, 10.5vw, 205px);
}

.character--fox {
  z-index: 71;
  right: 25%;
  bottom: 19%;
  width: clamp(135px, 13.5vw, 260px);
}

#bonfire {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#bonfire::before {
  position: absolute;
  z-index: 67;
  bottom: 8.5%;
  left: 50%;
  width: 34%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 139, 35, 0.22), rgba(255, 106, 20, 0.08) 46%, transparent 72%);
  content: "";
  filter: blur(18px);
  transform: translateX(-50%);
  animation: clearing-fire-glow 1.4s ease-in-out infinite alternate;
}

/* Back wall, then the logs, then the flame, then the front wall.
   All three pit pieces share one box so the new art stays aligned. */
.bonfire-base,
.bonfire-logs,
.bonfire-front-stones {
  position: absolute;
  bottom: 12.5%;
  left: 50%;
  width: 26%;
  height: auto;
  transform: translateX(-50%);
  object-fit: contain;
  user-select: none;
}

.bonfire-logs {
  z-index: 69;
}

.bonfire-base {
  z-index: 68;
  filter:
    brightness(1.02)
    saturate(1.06)
    drop-shadow(0 15px 16px rgba(31, 8, 0, 0.38))
    drop-shadow(0 -3px 9px rgba(255, 116, 25, 0.18));
  animation: wood-firelight 1.15s ease-in-out infinite alternate;
}

.bonfire-front-stones {
  z-index: 73;
  filter: brightness(1.04) saturate(1.08) drop-shadow(0 -2px 10px rgba(255, 126, 30, 0.22));
  animation: stone-firelight 1.15s ease-in-out infinite alternate;
}

@keyframes clearing-fire-glow {
  from {
    opacity: 0.58;
    transform: translateX(-50%) scale(0.94);
  }
  to {
    opacity: 0.92;
    transform: translateX(-50%) scale(1.04);
  }
}

@keyframes wood-firelight {
  from {
    filter:
      brightness(1.01)
      saturate(1.04)
      drop-shadow(0 15px 16px rgba(31, 8, 0, 0.38))
      drop-shadow(0 -3px 7px rgba(255, 112, 22, 0.14));
  }
  to {
    filter:
      brightness(1.075)
      saturate(1.14)
      drop-shadow(0 15px 16px rgba(31, 8, 0, 0.38))
      drop-shadow(0 -4px 13px rgba(255, 132, 31, 0.28));
  }
}

@keyframes stone-firelight {
  from {
    filter: brightness(1.01) saturate(1.04) drop-shadow(0 -2px 8px rgba(255, 120, 26, 0.16));
  }
  to {
    filter: brightness(1.09) saturate(1.16) drop-shadow(0 -3px 14px rgba(255, 138, 36, 0.32));
  }
}

.flame-stack,
.fire-effects {
  position: absolute;
  left: 50%;
  bottom: 19.4%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
}

/* Growth is carried by the artwork and by the wrapper widening from its
   bottom-centre anchor, so a bigger fire genuinely towers over the ring. */
.flame-stack {
  width: calc(26% * var(--flame-scale, 1));
  transition: width 320ms ease;
  animation: fire-live 1.05s ease-in-out infinite alternate;
}

/* The same flame is drawn twice: once behind the wood and once in front, so
   the logs sit inside the fire instead of the fire sitting on the logs. */
.flame-stack--back {
  z-index: 69;
  opacity: 0.9;
  filter:
    brightness(0.86)
    saturate(1.12)
    blur(0.6px)
    drop-shadow(0 0 22px rgba(255, 108, 14, 0.38));
  animation-duration: 1.35s;
}

.flame-stack {
  z-index: 70;
  filter:
    drop-shadow(0 0 18px rgba(255, 121, 18, 0.46))
    drop-shadow(0 0 38px rgba(255, 78, 8, 0.2));
}

/* Stage 0: cold pit — no flame, no smoke, no ground glow. */
#bonfire.is-cold::before,
#bonfire.is-cold .flame-stack,
#bonfire.is-cold .flame-stack--front::before,
#bonfire.is-cold .fire-effect {
  opacity: 0 !important;
  animation: none !important;
  visibility: hidden;
}

/* Stage 1: smoke only — hide the flame stacks, keep a soft ambient plume. */
#bonfire.is-smoke-only::before {
  opacity: 0.22;
  animation: none;
  background: radial-gradient(ellipse, rgba(120, 120, 130, 0.16), transparent 70%);
}

#bonfire.is-smoke-only .flame-stack,
#bonfire.is-smoke-only .flame-stack--front::before,
#bonfire.is-smoke-only .fire-effect--embers {
  opacity: 0 !important;
  animation: none !important;
  visibility: hidden;
}

#bonfire.is-smoke-only .fire-effect--smoke {
  opacity: 0.3;
  filter: blur(1.5px);
  animation: ambient-smoke 4.2s ease-in-out infinite alternate;
  visibility: visible;
}

@keyframes ambient-smoke {
  from {
    opacity: 0.18;
    transform: translate3d(-2%, 4%, 0) scale(0.78);
  }
  to {
    opacity: 0.34;
    transform: translate3d(3%, -10%, 0) scale(1.05);
  }
}

.fire-effects {
  width: 26%;
}

#bonfire.is-fed .flame-stack {
  animation: fire-fed 950ms cubic-bezier(0.18, 0.72, 0.24, 1) both;
}

#bonfire.is-fed::before {
  animation: clearing-fire-burst 950ms ease-out both;
}

.flame-stack--front::before {
  position: absolute;
  right: 14%;
  bottom: 7%;
  left: 14%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 158, 45, 0.62), rgba(255, 95, 18, 0.16) 55%, transparent 78%);
  content: "";
  filter: blur(13px);
  animation: fire-glow 0.9s ease-in-out infinite alternate;
}

@keyframes fire-live {
  from {
    transform: translateX(-50%) scaleX(0.985) scaleY(0.975);
  }
  to {
    transform: translateX(-50%) scaleX(1.018) scaleY(1.035);
  }
}

@keyframes fire-fed {
  0% { transform: translateX(-50%) scale(0.98); }
  24% { transform: translateX(-50%) scale(1.18, 1.24); }
  58% { transform: translateX(-50%) scale(1.08, 1.12); }
  100% { transform: translateX(-50%) scale(1); }
}

@keyframes clearing-fire-burst {
  0% { opacity: 0.65; transform: translateX(-50%) scale(0.92); }
  30% { opacity: 1; transform: translateX(-50%) scale(1.28); }
  100% { opacity: 0.82; transform: translateX(-50%) scale(1); }
}

@keyframes fire-glow {
  from {
    opacity: 0.55;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1.12);
  }
}

.flame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  user-select: none;
  will-change: opacity;
}

.flame.is-visible {
  opacity: 1;
}

.flame-flare {
  z-index: 3;
  transition-duration: 90ms;
}

.flame-flare.is-visible {
  animation: flare-bloom 360ms ease-out both;
}

/* Smoke drifts up behind the flame; only the embers belong in front of it. */
.fire-effects--behind {
  z-index: 66;
}

.fire-effects--front {
  z-index: 74;
}

.pit-fuel {
  position: absolute;
  z-index: 71;
  left: 50%;
  bottom: 24.5%;
  width: 16%;
  height: 12%;
  transform: translateX(-50%);
  pointer-events: none;
}

.pit-item {
  position: absolute;
  left: 50%;
  bottom: 18%;
  height: 78%;
  width: auto;
  max-width: 78%;
  transform: translateX(-50%);
  transform-origin: 50% 80%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  animation: pit-item-burn 2.1s ease-in forwards;
}

.pit-item--tinder { height: 56%; left: 40%; animation-duration: 1.6s; }
.pit-item--twigs { height: 68%; left: 58%; animation-duration: 1.8s; }
.pit-item--moneySmall { height: 52%; left: 44%; animation-duration: 1.7s; }
.pit-item--moneyMedium { height: 64%; left: 52%; animation-duration: 2.1s; }
.pit-item--moneyLarge { height: 78%; left: 56%; animation-duration: 2.5s; }
.pit-item--log { height: 86%; left: 50%; animation-duration: 2.8s; }

@keyframes pit-item-burn {
  0% { opacity: 1; filter: brightness(1.12) saturate(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); transform: translateX(-50%) scale(1.12) rotate(-8deg); }
  18% { opacity: 1; filter: brightness(1) saturate(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); transform: translateX(-50%) scale(1) rotate(3deg); }
  55% { opacity: 1; filter: brightness(0.72) saturate(1.35) hue-rotate(-12deg) drop-shadow(0 0 6px rgba(255, 110, 20, 0.45)); transform: translateX(-50%) scale(0.88) rotate(-4deg); }
  100% { opacity: 0; filter: brightness(0.15) saturate(0.4) hue-rotate(-20deg); transform: translateX(-50%) scale(0.28) rotate(12deg); }
}

.fire-effect {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  will-change: transform, opacity;
}

.fire-effect--embers {
  mix-blend-mode: screen;
}

.fire-effect--smoke {
  opacity: 0;
  filter: blur(1px);
}

.fire-effect--embers.is-active {
  animation: embers-rise 700ms ease-out both;
}

.fire-effect--smoke.is-active {
  animation: smoke-rise 900ms ease-out both;
}

@keyframes flare-bloom {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  25% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes embers-rise {
  0% {
    opacity: 0;
    transform: translateY(8%) scale(0.72);
  }
  24% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: translateY(-18%) scale(1.08);
  }
}

@keyframes smoke-rise {
  0% {
    opacity: 0;
    transform: translateY(7%) scale(0.55);
  }
  28% {
    opacity: 0.26;
  }
  100% {
    opacity: 0;
    transform: translateY(-13%) scale(0.9);
  }
}

.ui-layer {
  z-index: 100;
}

.site-header {
  position: absolute;
  top: max(14px, 2.2vh);
  right: clamp(18px, 2.8vw, 54px);
  left: clamp(18px, 2.8vw, 54px);
  display: grid;
  grid-template-columns: minmax(150px, 250px) 1fr minmax(170px, 230px);
  align-items: center;
  gap: 24px;
  pointer-events: auto;
}

.brand-logo {
  display: block;
  width: clamp(154px, 13vw, 235px);
  max-height: 78px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 5px 13px rgba(0, 0, 0, 0.32));
}

.mode-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(2px, 0.35vw, 7px);
  padding: 5px;
  border: 1px solid rgba(255, 238, 198, 0.13);
  border-radius: 999px;
  background: rgba(5, 21, 35, 0.5);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(12px);
}

.mode-nav__item {
  min-height: 36px;
  padding: 0 clamp(10px, 1vw, 18px);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 244, 216, 0.58);
  font-size: clamp(0.7rem, 0.75vw, 0.86rem);
  font-weight: 700;
  white-space: nowrap;
}

.mode-nav__item.is-active {
  background: linear-gradient(180deg, #fff5d7, #f2d89e);
  color: #563119;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22), inset 0 1px white;
}

.mode-nav__item:disabled {
  cursor: default;
}

.wallet {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 7px 6px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.wallet__balance {
  display: grid;
  line-height: 1.05;
}

.wallet__balance span {
  color: rgba(255, 241, 207, 0.6);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wallet__balance strong {
  color: #fff4d7;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(0.9rem, 1vw, 1.08rem);
}

.wallet__top-up {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #efad4a;
  color: #412410;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.wallet__top-up:hover {
  background: #ffc466;
  transform: translateY(-1px);
}

.hero-copy {
  position: absolute;
  z-index: 102;
  top: clamp(88px, 12vh, 132px);
  left: 50%;
  width: min(42vw, 620px);
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.48);
}

.hero-copy__eyebrow {
  margin: 0 0 5px;
  color: var(--amber-bright);
  font-size: clamp(0.64rem, 0.75vw, 0.8rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.7rem, 2.45vw, 2.85rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero-copy h1 span,
.hero-copy h1 strong {
  display: block;
}

.hero-copy h1 span {
  color: #fff8df;
  font-weight: 600;
}

.hero-copy h1 strong {
  margin-top: 4px;
  color: #ffc75e;
  font-weight: 700;
}

.communal-total {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin: 9px 0 0;
  padding: 6px 13px;
  border: 1px solid rgba(255, 225, 162, 0.16);
  border-radius: 999px;
  background: rgba(5, 20, 33, 0.4);
  backdrop-filter: blur(8px);
}

.communal-total span {
  color: #fff3cf;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(0.9rem, 1.05vw, 1.12rem);
  font-weight: 600;
}

.communal-total small {
  color: rgba(255, 242, 208, 0.62);
  font-size: clamp(0.58rem, 0.65vw, 0.7rem);
}

#online-count::before {
  content: "·";
  margin: 0 7px 0 2px;
}

.thought-panel {
  position: absolute;
  z-index: 103;
  top: clamp(250px, 34vh, 340px);
  left: 50%;
  width: min(33vw, 460px);
  padding: 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 230, 174, 0.18);
  border-radius: 18px;
  background: rgba(7, 24, 39, 0.62);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.thought-panel label {
  display: block;
  margin: 0 2px 6px;
  color: var(--cream-soft);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.thought-panel__controls {
  display: flex;
  gap: 7px;
}

.thought-panel input {
  min-width: 0;
  flex: 1;
  height: 39px;
  padding: 0 13px;
  border: 1px solid rgba(255, 238, 199, 0.13);
  border-radius: 11px;
  outline: none;
  background: rgba(2, 14, 25, 0.62);
  color: #fff8e7;
  font-size: 0.76rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.thought-panel input::placeholder {
  color: rgba(255, 242, 213, 0.39);
}

.thought-panel input:focus {
  border-color: rgba(255, 190, 91, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 177, 72, 0.1);
}

.thought-panel button {
  min-width: 78px;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffc767, #e99b36);
  color: #45240f;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}

.thought-panel button:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.thought-panel p {
  margin: 6px 2px 0;
  color: rgba(255, 242, 214, 0.42);
  font-size: 0.58rem;
}

.item-tray {
  position: absolute;
  z-index: 110;
  right: clamp(12px, 2vw, 32px);
  bottom: max(12px, 1.7vh);
  left: clamp(12px, 2vw, 32px);
  display: flex;
  align-items: stretch;
  gap: 12px;
  height: clamp(76px, 10.5vh, 105px);
  padding: 8px;
  border: 1px solid rgba(255, 229, 174, 0.2);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(12, 31, 44, 0.86), rgba(5, 20, 32, 0.91));
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.34), inset 0 1px rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.item-tray__intro {
  display: flex;
  width: clamp(116px, 10vw, 160px);
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  padding: 0 9px;
  border-right: 1px solid rgba(255, 233, 190, 0.14);
}

.item-tray__intro span {
  color: #ffe3a9;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(0.9rem, 1.08vw, 1.18rem);
  font-weight: 600;
}

.item-tray__intro small {
  margin-top: 2px;
  color: rgba(255, 242, 215, 0.5);
  font-size: clamp(0.56rem, 0.62vw, 0.68rem);
}

.item-list {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.burn-item {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(44px, 39%) 1fr;
  align-items: center;
  gap: clamp(4px, 0.55vw, 9px);
  padding: 5px clamp(6px, 0.75vw, 12px);
  overflow: hidden;
  border: 1px solid rgba(255, 229, 177, 0.11);
  border-radius: 15px;
  background: rgba(255, 244, 220, 0.055);
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.burn-item::after {
  position: absolute;
  inset: auto -20% -60% 15%;
  height: 70%;
  border-radius: 50%;
  background: rgba(255, 153, 44, 0.14);
  filter: blur(18px);
  content: "";
  opacity: 0;
  transition: opacity 180ms ease;
}

.burn-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 197, 104, 0.36);
  background: rgba(255, 238, 205, 0.1);
}

.burn-item:hover::after {
  opacity: 1;
}

.burn-item:active {
  transform: translateY(1px) scale(0.985);
}

.burn-item__image {
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  max-height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.28));
  transition: transform 180ms ease;
}

.burn-item:hover .burn-item__image {
  transform: rotate(-3deg) scale(1.06);
}

.burn-item__copy {
  z-index: 1;
  display: grid;
  min-width: 0;
}

.burn-item__name {
  overflow: hidden;
  color: #fff5dd;
  font-size: clamp(0.68rem, 0.8vw, 0.9rem);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.burn-item__price {
  margin-top: 2px;
  color: #ffc569;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(0.64rem, 0.74vw, 0.82rem);
  font-weight: 600;
}

.burn-fly {
  position: fixed;
  z-index: 500;
  margin: 0;
  object-fit: contain;
  pointer-events: none;
  will-change: transform, opacity;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.34));
}

.thought-note {
  position: fixed;
  z-index: 500;
  width: 50px;
  height: 34px;
  border: 1px solid #c9a56b;
  border-radius: 2px;
  background: linear-gradient(#fff8e4, #f3e2b6);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  will-change: transform, opacity;
}

.thought-note::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 46%;
  background:
    linear-gradient(135deg, transparent 49%, #e4c48a 50%) left / 51% 100% no-repeat,
    linear-gradient(225deg, transparent 49%, #e4c48a 50%) right / 51% 100% no-repeat;
  border-bottom: 1px solid rgba(160, 112, 52, 0.45);
  content: "";
}

.thought-note::after {
  position: absolute;
  right: 8px;
  bottom: 7px;
  left: 8px;
  height: 2px;
  background: rgba(92, 62, 28, 0.16);
  box-shadow: 0 -5px 0 rgba(92, 62, 28, 0.12);
  content: "";
}

.toast {
  position: absolute;
  z-index: 700;
  top: 92px;
  left: 50%;
  padding: 10px 16px;
  border: 1px solid rgba(255, 227, 171, 0.25);
  border-radius: 999px;
  background: rgba(7, 21, 34, 0.92);
  box-shadow: var(--shadow);
  color: #ffefc8;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.top-up-modal {
  width: min(92vw, 440px);
  max-height: min(92vh, 760px);
  padding: 28px;
  overflow: auto;
  border: 1px solid rgba(255, 223, 159, 0.25);
  border-radius: 26px;
  outline: none;
  background: #0c2232;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.55), inset 0 1px rgba(255, 255, 255, 0.07);
  color: #fff2d1;
  text-align: center;
}

.top-up-modal.is-checkout {
  width: min(94vw, 480px);
}

.top-up-modal::backdrop {
  background: rgba(1, 9, 16, 0.68);
  backdrop-filter: blur(6px);
}

.top-up-modal__glow {
  position: absolute;
  top: -130px;
  left: 50%;
  width: 300px;
  height: 250px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(255, 153, 52, 0.22);
  filter: blur(45px);
  pointer-events: none;
}

.top-up-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 245, 220, 0.72);
  font-size: 1.25rem;
  cursor: pointer;
}

.top-up-modal__eyebrow {
  position: relative;
  margin: 0 0 7px;
  color: #ffc668;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.top-up-modal h2 {
  position: relative;
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: 1.8rem;
}

.top-up-modal > p:not(.top-up-modal__eyebrow),
#top-up-picker > p:not(.top-up-modal__eyebrow),
#top-up-checkout > p:not(.top-up-modal__eyebrow) {
  position: relative;
  margin: 8px auto 22px;
  color: rgba(255, 243, 217, 0.62);
  font-size: 0.86rem;
  line-height: 1.5;
}

.top-up-options {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.top-up-options button {
  min-height: 48px;
  border: 1px solid rgba(255, 222, 159, 0.16);
  border-radius: 13px;
  background: rgba(255, 245, 220, 0.07);
  color: #ffdb91;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}

.top-up-options button:hover {
  transform: translateY(-2px);
  background: rgba(255, 190, 86, 0.16);
}

.top-up-custom {
  position: relative;
  margin-top: 16px;
}

.top-up-custom label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 243, 217, 0.55);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-up-custom__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.top-up-custom__field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(255, 222, 159, 0.16);
  border-radius: 13px;
  background: rgba(255, 245, 220, 0.07);
  color: #ffdb91;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
}

.top-up-custom input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff2d1;
  font: inherit;
  outline: none;
}

.top-up-custom input::-webkit-outer-spin-button,
.top-up-custom input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.top-up-custom button {
  min-width: 72px;
  border: 0;
  border-radius: 13px;
  background: #ffb03a;
  color: #3a2208;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.top-up-custom button:hover {
  background: #ffc15d;
}

.top-up-checkout {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.top-up-checkout h2,
.top-up-checkout .top-up-modal__eyebrow,
.top-up-checkout > p {
  text-align: center;
}

.top-up-checkout__mount {
  order: 4;
  min-height: 120px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
}

.top-up-checkout__mount iframe {
  border: 0 !important;
}

.top-up-back {
  order: 5;
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 222, 159, 0.16);
  border-radius: 13px;
  background: rgba(255, 245, 220, 0.07);
  color: #ffdb91;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  cursor: pointer;
}

.top-up-back:hover {
  background: rgba(255, 190, 86, 0.16);
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: minmax(130px, 180px) 1fr minmax(155px, 190px);
    gap: 12px;
  }

  .brand-logo {
    width: 170px;
  }

  .mode-nav__item {
    padding-inline: 10px;
  }

  .prop-sign-right {
    display: none;
  }

  .character--bear,
  .character--owl,
  .character--squirrel,
  .character--bunny,
  .character--fox {
    scale: 0.92;
  }

  .item-tray__intro {
    width: 105px;
  }

  .item-list {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .item-list::-webkit-scrollbar {
    display: none;
  }

  .burn-item {
    min-width: 138px;
    flex: 1 0 138px;
  }
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 150px 1fr;
  }

  .mode-nav {
    position: absolute;
    top: 58px;
    left: 50%;
    transform: translateX(-50%);
  }

  .mode-nav__item:not(.is-active) {
    display: none;
  }

  .wallet {
    grid-column: 2;
    grid-row: 1;
  }

  .hero-copy {
    top: 105px;
    width: 64vw;
  }

  .thought-panel {
    top: 270px;
    width: min(52vw, 430px);
  }

  .prop-sign-left,
  .prop-sign-right {
    display: none;
  }

  .item-tray__intro {
    display: none;
  }
}

@media (max-width: 680px) {
  #scene {
    min-height: 100svh;
    height: 100svh;
  }

  .scene-fill {
    object-position: center bottom;
  }

  .layer-sky,
  .layer-far-pines,
  .layer-mid-pines,
  .layer-foreground-left,
  .layer-foreground-right,
  .layer-ground {
    width: auto;
    min-width: 100%;
    left: 50%;
    transform: translateX(-50%);
  }

  .layer-sky,
  .layer-far-pines,
  .layer-mid-pines,
  .layer-ground {
    height: 100%;
  }

  .layer-foreground-left,
  .layer-foreground-right {
    height: 100%;
    opacity: 0.78;
  }

  .layer-moon {
    top: -8%;
    width: 90vw;
  }

  .site-header {
    top: max(10px, env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    grid-template-columns: minmax(100px, 118px) 1fr;
    gap: 8px;
  }

  .brand-logo {
    width: 112px;
    max-height: 48px;
  }

  .mode-nav {
    display: none;
  }

  .wallet {
    gap: 6px;
    max-width: 100%;
    padding: 5px 5px 5px 10px;
  }

  .wallet__balance span {
    font-size: 0.58rem;
  }

  .wallet__balance strong {
    font-size: 0.86rem;
  }

  .wallet__top-up {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 0.82rem;
  }

  .hero-copy {
    top: max(64px, calc(env(safe-area-inset-top) + 52px));
    width: calc(100vw - 24px);
    text-align: center;
  }

  .hero-copy__eyebrow {
    display: none;
  }

  .hero-copy h1 {
    font-size: clamp(1.35rem, 6.4vw, 1.85rem);
    line-height: 1.12;
  }

  .hero-copy h1 span,
  .hero-copy h1 strong {
    display: block;
  }

  .communal-total {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 0;
    margin-top: 8px;
    padding: 7px 12px;
    max-width: 100%;
  }

  .communal-total span {
    font-size: 0.92rem;
  }

  .communal-total small {
    font-size: 0.62rem;
  }

  #online-count::before {
    margin: 0 5px 0 3px;
  }

  .thought-panel {
    top: max(188px, calc(env(safe-area-inset-top) + 172px));
    width: calc(100vw - 24px);
    padding: 9px;
    border-radius: 16px;
  }

  .thought-panel label {
    margin-bottom: 5px;
    font-size: 0.6rem;
  }

  .thought-panel__controls {
    gap: 6px;
  }

  .thought-panel input {
    height: 42px;
    padding: 0 12px;
    font-size: 0.84rem;
  }

  .thought-panel button {
    flex: 0 0 auto;
    min-width: 92px;
    height: 42px;
    padding-inline: 12px;
    font-size: 0.84rem;
  }

  .thought-panel p {
    display: none;
  }

  .string-lights {
    top: 26%;
    left: 10%;
    width: 80%;
    opacity: 0.9;
  }

  .prop-squirrel-perch,
  .character--squirrel,
  .character--bear {
    display: none;
  }

  .owl-perch-group {
    top: 26%;
    left: -6%;
    width: 48%;
  }

  .character--owl {
    top: 4%;
    left: 36%;
    width: 38%;
    scale: 1;
  }

  .character--bunny {
    bottom: 19%;
    left: 10%;
    width: 17%;
    scale: 1;
  }

  .character--fox {
    right: 8%;
    bottom: 19%;
    width: 20%;
    scale: 1;
  }

  .bonfire-base,
  .bonfire-logs,
  .bonfire-front-stones {
    bottom: 14%;
    width: min(72vw, 340px);
  }

  .flame-stack,
  .fire-effects {
    bottom: 18.8%;
    width: min(62vw, 290px);
  }

  .pit-fuel {
    bottom: 23%;
    width: min(38vw, 170px);
    height: 8%;
  }

  .flame-stack {
    width: calc(min(62vw, 290px) * var(--flame-scale, 1));
  }

  .item-tray {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    height: 88px;
    padding: 7px;
    border-radius: 18px;
  }

  .item-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 22px), transparent);
  }

  .item-list::-webkit-scrollbar {
    display: none;
  }

  .burn-item {
    min-width: 148px;
    flex: 0 0 148px;
    grid-template-columns: 56px 1fr;
    min-height: 72px;
    padding: 5px 10px;
    scroll-snap-align: start;
  }

  .burn-item__image {
    max-height: 56px;
  }

  .burn-item__name {
    font-size: 0.84rem;
    overflow: visible;
    text-overflow: clip;
  }

  .burn-item__price {
    font-size: 0.78rem;
  }

  .toast {
    top: max(108px, calc(env(safe-area-inset-top) + 92px));
    width: max-content;
    max-width: calc(100vw - 28px);
    text-align: center;
  }

  .top-up-modal {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: auto;
    padding: 22px 16px calc(18px + env(safe-area-inset-bottom));
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 22px;
  }

  .top-up-modal.is-checkout {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: max(10px, env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
  }

  .top-up-modal__glow {
    display: none;
  }

  .top-up-modal__close {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    z-index: 5;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 1.35rem;
  }

  .top-up-modal.is-checkout .top-up-modal__close {
    top: max(8px, env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.12);
  }

  .top-up-modal__eyebrow {
    font-size: 0.64rem;
  }

  .top-up-modal h2,
  #top-up-picker h2,
  #top-up-checkout h2 {
    font-size: clamp(1.45rem, 6.5vw, 1.75rem);
  }

  #top-up-picker > p:not(.top-up-modal__eyebrow),
  #top-up-checkout > p:not(.top-up-modal__eyebrow) {
    margin: 6px auto 16px;
    font-size: 0.82rem;
  }

  .top-up-options {
    gap: 8px;
  }

  .top-up-options button {
    min-height: 52px;
    font-size: 1.05rem;
  }

  .top-up-custom {
    margin-top: 14px;
  }

  .top-up-custom label {
    font-size: 0.62rem;
  }

  .top-up-custom__row {
    gap: 8px;
  }

  .top-up-custom__field {
    min-height: 48px;
  }

  .top-up-custom input {
    font-size: 1.05rem;
  }

  .top-up-custom button {
    min-width: 78px;
    min-height: 48px;
    font-size: 1rem;
  }

  .top-up-checkout__mount {
    margin-top: 4px;
    border-radius: 14px;
    min-height: min(58dvh, 420px);
  }

  .top-up-modal.is-checkout .top-up-checkout__mount {
    order: 4;
    min-height: calc(100dvh - 148px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .top-up-back {
    order: 3;
    width: auto;
    margin: 0 auto 8px;
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    background: transparent;
    font-size: 0.8rem;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .top-up-modal.is-checkout #top-up-checkout-status {
    order: 2;
    margin-bottom: 8px;
    font-size: 0.74rem;
  }
}

@media (max-width: 380px) {
  .brand-logo {
    width: 96px;
    max-height: 42px;
  }

  .wallet {
    padding-left: 8px;
  }

  .wallet__balance span {
    display: none;
  }

  .hero-copy h1 {
    font-size: 1.28rem;
  }

  .thought-panel {
    top: max(168px, calc(env(safe-area-inset-top) + 154px));
  }

  .thought-panel button {
    min-width: 84px;
    font-size: 0.78rem;
  }

  .burn-item {
    min-width: 136px;
    flex-basis: 136px;
  }
}

@media (max-height: 780px) and (min-width: 681px) {
  .site-header {
    top: 10px;
  }

  .brand-logo {
    max-height: 58px;
  }

  .hero-copy {
    top: 72px;
  }

  .hero-copy__eyebrow {
    display: none;
  }

  .thought-panel {
    top: 216px;
  }

  .thought-panel p {
    display: none;
  }

  .string-lights {
    top: 20%;
  }

  .item-tray {
    height: 78px;
    bottom: 9px;
  }

  .burn-item__image {
    max-height: 60px;
  }
}

.fire-debug {
  position: fixed;
  z-index: 1000;
  top: 96px;
  right: 18px;
  display: grid;
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100vh - 118px);
  gap: 9px;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid rgba(255, 205, 112, 0.38);
  border-radius: 16px;
  background: rgba(4, 16, 27, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color: #fff0c8;
  font-size: 0.75rem;
  pointer-events: auto;
}

.fire-debug__stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
}

.fire-debug__stats strong {
  color: #ffc861;
}

.fire-debug__buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.fire-debug button {
  min-height: 32px;
  border: 1px solid rgba(255, 218, 150, 0.22);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffe4ad;
  font-weight: 700;
  cursor: pointer;
}

.fire-debug button:hover {
  background: rgba(255, 182, 71, 0.2);
}

.fire-debug__characters {
  display: grid;
  gap: 7px;
}

.fire-debug__characters section {
  display: grid;
  gap: 5px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 218, 150, 0.13);
}

.fire-debug__characters section > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fire-debug__characters section > div:last-child {
  justify-content: flex-start;
}

.fire-debug__characters span {
  color: rgba(255, 240, 200, 0.62);
  font-size: 0.68rem;
}

.fire-debug__characters b {
  color: #ffc861;
}

.fire-debug__characters button {
  min-height: 27px;
  padding-inline: 8px;
  text-transform: capitalize;
}

@media (prefers-reduced-motion: reduce) {
  #scene {
    transition: none;
  }

  .boot-veil {
    transition: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .string-bulb {
    animation: none;
    opacity: 0.7;
  }
}
