:root {
  --forest-deep: #07100a;
  --forest-mid: #172b20;
  --forest-light: #274539;
  --moon-warm: #e8dfaa;
  --path-warm: #c9b16e;
  --text-main: #f5eed6;
  --text-muted: #b4c0b5;
  --line-soft: rgba(229, 221, 178, 0.26);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Heiti TC", sans-serif;
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  min-width: 320px;
  background: var(--forest-deep);
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100svh;
  color: var(--text-main);
  background:
    radial-gradient(ellipse at 50% -6%, rgba(221, 226, 170, 0.25), transparent 31%),
    linear-gradient(180deg, var(--forest-light) 0%, var(--forest-mid) 42%, var(--forest-deep) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  inset-block: -7vh;
  width: min(24vw, 300px);
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 0 32px rgba(0, 0, 0, 0.32));
}

body::before {
  left: 0;
  background:
    radial-gradient(ellipse at 2% 4%, #050a06 0 27%, transparent 28%),
    radial-gradient(ellipse at 35% -2%, #0b1710 0 22%, transparent 23%),
    linear-gradient(84deg, #040905 0 23%, #101e14 24% 35%, transparent 36%);
}

body::after {
  right: 0;
  background:
    radial-gradient(ellipse at 98% 6%, #050a06 0 28%, transparent 29%),
    radial-gradient(ellipse at 63% -2%, #0b1710 0 22%, transparent 23%),
    linear-gradient(276deg, #040905 0 23%, #101e14 24% 35%, transparent 36%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid var(--moon-warm);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.forest-stage {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: calc(100svh - 104px);
  padding: clamp(22px, 5vw, 56px) 16px 40px;
  place-items: center;
}

.forest-scene {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.forest-scene::before {
  content: "";
  position: absolute;
  inset: 8% 8% 18%;
  opacity: 0.34;
  background: repeating-linear-gradient(
    93deg,
    transparent 0 72px,
    rgba(8, 26, 17, 0.62) 73px 77px,
    transparent 78px 136px
  );
  -webkit-mask-image: linear-gradient(180deg, #000 0 76%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0 76%, transparent 100%);
}

.forest-scene::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12vh;
  width: min(66vw, 650px);
  height: 80vh;
  transform: translateX(-50%);
  clip-path: polygon(49% 0, 51% 0, 88% 100%, 12% 100%);
  background: linear-gradient(
    180deg,
    rgba(232, 223, 170, 0.02) 0%,
    rgba(201, 177, 110, 0.12) 42%,
    rgba(165, 132, 76, 0.27) 100%
  );
  filter: blur(0.2px);
}

.tree {
  position: absolute;
  bottom: -8%;
  width: 38px;
  height: 108%;
  border-radius: 58% 44% 35% 52%;
  background: linear-gradient(90deg, #040805 0%, #0d1a10 48%, #060e08 100%);
  box-shadow: inset -6px 0 10px rgba(43, 72, 43, 0.15), 0 0 22px rgba(0, 0, 0, 0.2);
}

.tree::before {
  content: "";
  position: absolute;
  top: 19%;
  width: 146px;
  height: 16px;
  border-radius: 100%;
  background: #08120b;
}

.tree-l1 {
  left: -13px;
  transform: rotate(-2deg);
}

.tree-l1::before {
  left: 6px;
  transform: rotate(22deg);
  transform-origin: left center;
}

.tree-l2 {
  left: 8vw;
  bottom: 9%;
  width: 18px;
  height: 77%;
  opacity: 0.58;
  transform: rotate(2deg);
}

.tree-l2::before {
  left: 4px;
  width: 90px;
  height: 10px;
  transform: rotate(17deg);
  transform-origin: left center;
}

.tree-r1 {
  right: -13px;
  transform: rotate(2deg);
}

.tree-r1::before {
  right: 6px;
  transform: rotate(-22deg);
  transform-origin: right center;
}

.tree-r2 {
  right: 8vw;
  bottom: 8%;
  width: 18px;
  height: 75%;
  opacity: 0.56;
  transform: rotate(-2deg);
}

.tree-r2::before {
  right: 4px;
  width: 92px;
  height: 10px;
  transform: rotate(-18deg);
  transform-origin: right center;
}

.fireflies {
  position: absolute;
  top: 25%;
  left: calc(50% - 95px);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ecd98d;
  box-shadow:
    157px 43px 0 #e5d384,
    22px 156px 0 #d7cb78,
    131px 286px 0 #ebd985,
    58px 430px 0 #cfc87b;
  opacity: 0.66;
  filter: drop-shadow(0 0 5px #e7cf72);
  animation: firefly-breathe 5.4s ease-in-out infinite alternate;
}

.screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 720px;
  min-width: 0;
  min-height: min(720px, calc(100svh - 136px));
  margin: auto;
  padding: clamp(20px, 4vw, 36px) clamp(2px, 2vw, 16px);
  align-content: center;
  text-align: left;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.68);
  animation: screen-in 620ms ease-out both;
}

.screen--mission {
  min-height: auto;
  padding-block: 8px 32px;
  align-content: start;
}

.screen--home,
.screen--choice,
.screen--offscreen,
.screen--fallback {
  max-width: 680px;
}

.screen--home,
.screen--offscreen,
.screen--fallback {
  text-align: center;
}

.screen-top {
  display: flex;
  min-width: 0;
  margin-bottom: clamp(34px, 9vh, 82px);
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: #c2cebf;
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
}

.screen-label {
  margin: 0 0 10px;
  color: #ddc879;
  font-size: 0.79rem;
  font-weight: 780;
  letter-spacing: 0.14em;
  line-height: 1.6;
  text-transform: uppercase;
}

h1,
h2,
p,
ol,
ul {
  overflow-wrap: anywhere;
}

h1,
h2 {
  font-family: "Songti TC", "Songti SC", Georgia, serif;
  font-weight: 600;
}

h1 {
  max-width: 680px;
  margin: 0 0 18px;
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h2 {
  margin: 30px 0 8px;
  color: #eadb9f;
  font-size: clamp(1.25rem, 4vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

p,
li {
  margin-top: 0;
  color: #d0d9ce;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.screen--home > p:not(.screen-label),
.screen--offscreen > p:not(.screen-label),
.screen--fallback > p:not(.screen-label) {
  max-width: 590px;
  margin-inline: auto;
}

.moon {
  width: 76px;
  height: 76px;
  margin: 0 auto clamp(36px, 8vh, 72px);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #fff7c7 0 8%, var(--moon-warm) 43%, #bfb987 100%);
  box-shadow: 0 0 30px rgba(228, 225, 166, 0.42), 0 0 86px rgba(169, 199, 148, 0.22);
}

.moon--small {
  width: 58px;
  height: 58px;
  margin-block: 22px 42px;
}

.wind {
  position: relative;
  width: 164px;
  height: 96px;
  margin: 24px auto 46px;
}

.wind::before,
.wind::after {
  content: "";
  position: absolute;
  left: 8px;
  width: 142px;
  height: 38px;
  border-top: 2px solid rgba(189, 219, 174, 0.74);
  border-radius: 50%;
  filter: drop-shadow(0 0 5px rgba(145, 185, 130, 0.34));
}

.wind::before {
  top: 22px;
  transform: rotate(-7deg);
}

.wind::after {
  top: 57px;
  left: 34px;
  width: 112px;
  transform: rotate(8deg);
}

.primary-button,
.quiet-button,
.back-button,
.choice-button {
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.primary-button {
  display: flex;
  width: 100%;
  margin-top: clamp(20px, 5vh, 42px);
  padding: 16px 19px;
  border: 1px solid #eadb9f;
  border-radius: 14px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #172217;
  background: linear-gradient(135deg, #eadb9f, var(--path-warm));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  font-weight: 820;
  text-align: left;
  text-shadow: none;
}

.primary-button:hover {
  transform: translateY(-2px);
}

.back-button,
.quiet-button {
  width: fit-content;
  max-width: 100%;
  padding: 10px 0;
  color: #c7d0c5;
  background: transparent;
  font-size: 1rem;
  text-align: left;
}

.back-button {
  margin: -18px 0 12px;
  justify-self: start;
}

.back-button:hover,
.quiet-button:hover {
  color: var(--moon-warm);
}

.choice-grid {
  display: grid;
  min-width: 0;
  margin-top: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.choice-button {
  position: relative;
  min-width: 0;
  padding: 14px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  color: #e4e9e1;
  background: #0d1b12;
  font-size: 1rem;
  font-weight: 700;
}

.choice-button:hover {
  border-color: rgba(232, 223, 170, 0.65);
}

.choice-button[aria-pressed="true"] {
  border-width: 2px;
  border-color: var(--moon-warm);
  color: #fff1bf;
  background: #3a3320;
}

[data-selected-marker] {
  display: inline-grid;
  width: 22px;
  height: 22px;
  margin-inline-start: 0.4em;
  border-radius: 50%;
  place-items: center;
  color: var(--forest-deep);
  background: var(--moon-warm);
  font-size: 0.8rem;
  text-shadow: none;
}

.mission-progress {
  margin-bottom: 18px;
  align-items: center;
}

.progress-grid {
  display: flex;
  max-width: 152px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.progress-grid i {
  display: block;
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.progress-grid i.is-current {
  background: #e0c87a;
  box-shadow: 0 0 7px rgba(224, 200, 122, 0.78);
}

.mission-mark {
  display: grid;
  width: 72px;
  height: 80px;
  margin: 28px auto 24px;
  border: 1px solid rgba(229, 204, 130, 0.42);
  border-radius: 67% 33% 64% 36% / 42% 55% 45% 58%;
  place-items: center;
  color: #f5dd93;
  background: #5b4829;
  font: 500 2rem/1 Georgia, serif;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  transform: rotate(-7deg);
}

.mission-mark span {
  transform: rotate(7deg);
}

.meta-row {
  display: flex;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-row span {
  padding: 7px 10px;
  border: 1px solid rgba(228, 216, 165, 0.3);
  border-radius: 999px;
  color: #e5dfc6;
  background: #0b1710;
  font-size: 0.9rem;
  line-height: 1.25;
}

.screen--mission ol {
  display: grid;
  margin: 0;
  padding: 0;
  counter-reset: forest-step;
  list-style: none;
  gap: 12px;
}

.screen--mission ol li {
  display: grid;
  min-width: 0;
  margin: 0;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  counter-increment: forest-step;
}

.screen--mission ol li::before {
  content: counter(forest-step);
  display: grid;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border: 1px solid rgba(229, 210, 143, 0.42);
  border-radius: 50%;
  place-items: center;
  color: #ead58e;
  background: #0b1710;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
}

.closing {
  padding-left: 14px;
  border-left: 3px solid var(--path-warm);
  color: #f1e4b8;
}

.quiet-button {
  margin-top: 16px;
  border-bottom: 1px solid rgba(232, 223, 170, 0.48);
}

.safety-panel {
  margin-top: 12px;
  padding: 18px 18px 8px;
  border-left: 2px solid #9db38c;
  background: #102218;
}

.safety-panel ul {
  margin: 0;
  padding-left: 20px;
}

.fine-print,
.progress-warning {
  margin-top: 18px !important;
  color: var(--text-muted) !important;
  font-size: 1rem !important;
}

.progress-warning {
  padding: 8px 12px;
  border-left: 2px solid var(--path-warm);
}

noscript {
  position: relative;
  z-index: 2;
  display: block;
  width: min(calc(100% - 32px), 720px);
  margin: 0 auto 24px;
}

noscript section {
  padding: 20px;
  border-left: 2px solid var(--moon-warm);
  background: #102218;
}

[data-site-footer] {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 32px), 720px);
  margin: 0 auto;
  padding: 24px 0 30px;
  border-top: 1px solid rgba(180, 192, 181, 0.28);
  color: #9caaa0;
  font-size: 0.875rem;
  line-height: 1.75;
  text-align: center;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes firefly-breathe {
  from { opacity: 0.42; }
  to { opacity: 0.76; }
}

@media (max-width: 600px) {
  body::before,
  body::after {
    width: 20vw;
    opacity: 0.66;
  }

  .forest-stage {
    min-height: calc(100svh - 120px);
    padding-inline: 16px;
  }

  .forest-scene::after {
    width: 92vw;
  }

  .tree-l2 { left: 13vw; }
  .tree-r2 { right: 13vw; }

  .screen {
    min-height: calc(100svh - 136px);
    padding-inline: 0;
  }

  .screen--mission {
    min-height: auto;
  }

  .screen-top {
    margin-bottom: 38px;
  }

  .mission-progress {
    margin-bottom: 14px;
  }

  .choice-grid {
    gap: 7px;
  }

  .choice-button {
    padding-inline: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
