@font-face {
  font-family: "Jakarta Local";
  src: url("font-jakarta.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jakarta Local";
  src: url("font-jakarta-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces Local";
  src: url("font-fraunces.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces Local";
  src: url("font-fraunces-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --green: #2e7d32;
  --green-deep: #1b5e20;
  --cream: #fff8e1;
  --orange: #ff9800;
  --ink: #1b3a1c;
  --soft: rgba(27, 58, 28, 0.72);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Jakarta Local", "Segoe UI", sans-serif;
  background: #143318 url("bg-sunset.webp") center/cover fixed;
}
button, input { font-family: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button, input, path { outline: none; }
button:focus-visible, input:focus-visible, path:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
a, u { text-decoration: none; color: inherit; }
input, textarea {
  text-decoration: none;
  caret-color: var(--green);
}
input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--cream) inset;
}
::selection { background: var(--green); color: var(--cream); }
* { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  background-color: var(--cream);
  background-image: linear-gradient(rgba(255, 248, 225, 0.9), rgba(255, 248, 225, 0.94)), url("bg-cream.webp");
  background-size: cover;
  overflow: hidden;
}
#splash, #onboard, #app { display: none; }
#splash.is-on, #onboard.is-on, #app.is-on { display: flex; }
#splash {
  position: absolute;
  inset: 0;
  z-index: 6;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--cream);
  background: #143318 url("bg-sunset.webp") center/cover;
  padding: 24px;
}
#splash img {
  width: 148px;
  height: 148px;
  object-fit: contain;
  animation: rise 1.5s ease both;
}
#splash h1, .scene h2, .leaf strong, .percent, .big, .gate-title strong, .top-copy strong {
  font-family: "Fraunces Local", Georgia, serif;
  font-weight: 600;
}
#splash h1 { margin: 0; font-size: 40px; letter-spacing: -0.03em; }
#splash p { margin: 0 0 8px; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid currentColor;
  border-radius: 12px;
  padding: 6px 10px;
  background: rgba(255, 248, 225, 0.92);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#splash .badge { color: var(--cream); background: rgba(20, 51, 24, 0.45); border-color: var(--cream); }
.badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  display: block;
}
#onboard {
  position: absolute;
  inset: 0;
  z-index: 4;
  flex-direction: column;
  padding: 16px 16px 22px;
  gap: 8px;
  overflow: auto;
}
.lane-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lane-track {
  height: 5px;
  border-radius: 99px;
  background: rgba(46, 125, 50, 0.16);
  overflow: hidden;
}
#lane-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--orange));
}
#lane-count, .kicker, .lead, .note, .demo, .place, .dayline {
  margin: 0;
}
#lane-count, .kicker {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scene { display: none; min-height: 0; }
.scene.on {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}
.scene h2 { margin: 0; font-size: clamp(26px, 8vw, 34px); letter-spacing: -0.03em; line-height: 0.95; }
.lead, .soft { color: var(--soft); line-height: 1.45; }
.fold-stage {
  flex: 1;
  min-height: 180px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  border-radius: 24px;
  background: url("bg-sunset.webp") center/cover;
  perspective: 900px;
}
.sheet {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf6, var(--cream));
  color: var(--ink);
  font-family: "Fraunces Local", Georgia, serif;
  font-size: 22px;
  position: relative;
  box-shadow: 0 14px 28px rgba(20, 51, 24, 0.18);
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sheet.left { transform-origin: right center; }
.sheet.right { transform-origin: left center; }
.sheet.left.folded { transform: perspective(700px) rotateY(62deg); }
.sheet.right.folded { transform: perspective(700px) rotateY(-62deg); }
.sheet::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 16px;
  opacity: 0;
  background: linear-gradient(90deg, rgba(27, 94, 32, 0.28), transparent);
}
.sheet.left::after { right: 0; }
.sheet.right::after { left: 0; transform: scaleX(-1); }
.sheet.folded::after { opacity: 1; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch {
  aspect-ratio: 1;
  border-radius: 18px;
  border: 3px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(27, 58, 28, 0.15);
}
.swatch.on { border-color: var(--ink); box-shadow: inset 0 0 0 4px var(--cream); }
#swatch-count { font-weight: 700; color: var(--green); }
.ask { margin: auto 0; text-align: center; display: grid; gap: 12px; justify-items: center; }
.ask img { width: 120px; height: 120px; object-fit: contain; }
.ask p { margin: 0; font-size: 20px; }
.row-btns, .mini { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  appearance: none;
  border: 0;
  background: var(--green-deep);
  color: var(--orange);
  border-radius: 18px;
  padding: 14px 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 152, 0, 0.55);
}
.btn.ghost {
  background: transparent;
  color: var(--green-deep);
  box-shadow: inset 0 0 0 1.5px var(--green-deep);
}
.btn.slim { padding: 8px 12px; letter-spacing: 0.04em; font-size: 12px; }
.btn:disabled, .mini button:disabled, .board-card:disabled {
  opacity: 0.45;
  cursor: default;
}
#app { min-height: 100dvh; flex-direction: column; }
.top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 8px;
}
.top img { width: 44px; height: 44px; object-fit: contain; }
.top-copy { display: flex; flex-direction: column; min-width: 0; }
.top-copy strong { font-size: 18px; line-height: 1.05; }
.top-copy em { font-style: normal; color: var(--green); font-size: 12px; font-weight: 700; }
#map {
  position: relative;
  flex: 1;
  min-height: calc(100dvh - 84px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  perspective: 1400px;
  background: var(--green-deep);
}
#map::before, #map::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
#map::before {
  left: 0; right: 0; top: 50%; height: 14px; transform: translateY(-50%);
  background: linear-gradient(180deg, transparent, rgba(20, 51, 24, 0.45), transparent);
}
#map::after {
  top: 0; bottom: 0; left: 50%; width: 16px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(20, 51, 24, 0.5), transparent);
}
.leaf {
  border: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 18px 22px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(var(--stripe, var(--green)), var(--stripe, var(--green))) top/100% 7px no-repeat,
    linear-gradient(160deg, rgba(255, 248, 225, 0.2), rgba(46, 125, 50, 0.1)),
    var(--cream);
  transition: transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.swing-left { transform-origin: right center; box-shadow: inset -14px 0 18px rgba(27, 94, 32, 0.12); }
.swing-right { transform-origin: left center; align-items: flex-end; text-align: right; box-shadow: inset 14px 0 18px rgba(27, 94, 32, 0.12); }
.leaf.opening.swing-left { transform: perspective(900px) rotateY(70deg); }
.leaf.opening.swing-right { transform: perspective(900px) rotateY(-70deg); }
.leaf img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 6px;
}
.leaf strong { font-size: clamp(22px, 7vw, 30px); line-height: 1; }
.leaf span { font-size: 13px; color: var(--soft); }
.map-seal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}
#gate { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.gate-head { padding: 8px 14px 0; display: grid; gap: 8px; }
.gate-title { display: flex; align-items: center; gap: 8px; }
.gate-title img { width: 36px; height: 36px; object-fit: contain; }
.gate-title strong { font-size: 26px; }
.mini button {
  border: 0;
  background: transparent;
  color: var(--soft);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
}
.mini button.on { background: var(--green); color: var(--cream); }
#gate-body { overflow: auto; padding: 8px 14px 28px; display: grid; gap: 12px; align-content: start; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chips button, .pin {
  border: 0;
  background: rgba(46, 125, 50, 0.08);
  color: var(--green-deep);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  white-space: nowrap;
}
.chips button.on { background: var(--green); color: var(--cream); }
.card {
  position: relative;
  background: rgba(255, 248, 225, 0.9);
  border-radius: 18px;
  padding: 14px 14px 14px 18px;
  box-shadow: 0 10px 24px rgba(27, 58, 28, 0.08);
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 9px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, rgba(27, 94, 32, 0.2), transparent);
}
.card.pinned { box-shadow: inset 0 0 0 1.5px var(--orange), 0 10px 24px rgba(27, 58, 28, 0.08); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag {
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card h3 { margin: 8px 0 6px; font-size: 18px; }
.card p { margin: 0; line-height: 1.45; }
.place { margin-top: 8px; color: var(--soft); font-size: 13px; }
.hero-sprite { width: 96px; height: 96px; object-fit: contain; }
.wheel {
  position: relative;
  width: min(68vw, 280px);
  aspect-ratio: 1;
  margin: 0 auto;
}
.wheel svg { width: 100%; height: 100%; display: block; }
.wheel path { cursor: pointer; }
.wheel path.picked { stroke: var(--ink); stroke-width: 1.8; }
.wheel path.lit { stroke: var(--orange); stroke-width: 2.4; filter: brightness(1.12); }
.orbit { position: absolute; inset: 0; pointer-events: none; }
.lamp {
  position: absolute;
  left: 50%;
  top: 18%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--cream);
  box-shadow: 0 0 14px 6px var(--orange);
}
.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
  background: var(--cream);
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div, .board-card, .answer, .log-item {
  background: rgba(255, 248, 225, 0.88);
  border-radius: 16px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.1);
}
.stats b, .big {
  display: block;
  font-family: "Fraunces Local", Georgia, serif;
  font-size: 28px;
  color: var(--green);
}
.stats span { color: var(--soft); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.demo {
  display: inline-flex;
  align-self: start;
  background: var(--green-deep);
  color: var(--orange);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dayline { color: var(--soft); }
.stack { display: grid; gap: 10px; }
.board-card, .answer {
  width: 100%;
  border: 0;
  text-align: left;
  color: inherit;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.board-card b, .answer b { font-weight: 700; }
.board-card em, .answer em { font-style: normal; color: var(--green); font-weight: 700; }
.answer.shut { color: var(--soft); }
.answer.missed { opacity: 0.7; }
.answer .bar { height: 6px; border-radius: 99px; background: rgba(46, 125, 50, 0.12); margin-top: 6px; overflow: hidden; }
.answer .bar span { display: block; height: 100%; background: var(--orange); }
.answer-copy { flex: 1; }
.percent { font-size: 84px; line-height: 0.85; color: var(--green); margin: 0; }
.pips { display: flex; gap: 6px; }
.pips span { width: 12px; height: 12px; border-radius: 50%; background: rgba(46, 125, 50, 0.16); }
.pips span.on { background: var(--orange); }
.line {
  display: flex;
  gap: 8px;
}
.line input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 16px;
  padding: 14px;
  background: #fffdf6;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px rgba(46, 125, 50, 0.25);
  font-size: 16px;
}
.week { display: flex; gap: 8px; }
.week span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(46, 125, 50, 0.12) url("stamp-log.png") center/18px no-repeat;
  opacity: 0.35;
}
.week span.on { opacity: 1; background-color: rgba(255, 152, 0, 0.2); }
.log-item { display: grid; gap: 4px; }
.log-item small { color: var(--soft); }
h2.panel { margin: 0; font-family: "Fraunces Local", Georgia, serif; font-size: 28px; letter-spacing: -0.03em; }
@media (min-width: 840px) {
  body { padding: 24px 0; }
  .shell {
    min-height: calc(100dvh - 48px);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  }
  #app { min-height: calc(100dvh - 48px); }
  #map { min-height: calc(100dvh - 150px); }
}
@media (max-width: 380px) {
  .badge { letter-spacing: 0.06em; padding: 5px 8px; }
  .leaf img { width: 56px; height: 56px; }
  .map-seal .badge { transform: scale(0.9); }
}
@media (max-height: 700px) {
  .leaf img { width: 52px; height: 52px; }
  #splash h1 { font-size: 32px; }
  .ask img { width: 84px; height: 84px; }
}
@keyframes rise {
  from { transform: translateY(10px) scale(0.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}
