:root {
  --ink: #16221a;
  --paper: #f3efe4;
  --paper-deep: #e6e0d2;
  --cider: #d5a832;
  --apple: #d85535;
  --leaf: #315d42;
  --sea: #3d7885;
  --white: #fffdf7;
  --muted: #626c63;
  --line: rgba(22, 34, 26, 0.16);
  --glass: rgba(255, 253, 247, 0.72);
  --shadow: 0 24px 70px rgba(25, 37, 28, 0.14);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --topbar-height: 88px;
  --nav-height: 72px;
  color-scheme: light;
  font-family: "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-width: 320px;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
.file-button:focus-within {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

svg {
  display: block;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-150%);
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.app {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 640px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 85%, rgba(213, 168, 50, 0.12), transparent 36%),
    linear-gradient(145deg, #f6f2e9, var(--paper));
}

.camera-video,
.tracking-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  pointer-events: none;
}

.camera-video {
  z-index: -5;
  opacity: 0;
  filter: grayscale(1) contrast(0.82) brightness(1.12);
  transition: opacity 500ms var(--ease-out);
}

.app.is-camera-visual .camera-video {
  opacity: 0.07;
}

.tracking-canvas {
  z-index: 55;
}

.atmosphere {
  position: fixed;
  z-index: -3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.atmosphere__orb {
  position: absolute;
  width: 42vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.13;
  animation: ambient-drift 16s var(--ease-in-out) infinite alternate;
}

.atmosphere__orb--cider {
  left: -12vw;
  bottom: -20vw;
  background: var(--cider);
}

.atmosphere__orb--sea {
  top: -20vw;
  right: -14vw;
  background: var(--sea);
  animation-delay: -7s;
}

.atmosphere__grain {
  position: absolute;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

@keyframes ambient-drift {
  to { transform: translate3d(5vw, -3vh, 0) scale(1.08); }
}

.topbar {
  position: fixed;
  z-index: 70;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: max(16px, env(safe-area-inset-top)) clamp(20px, 4vw, 64px) 12px;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--apple);
  color: var(--white);
}

.brand__mark svg {
  width: 24px;
  fill: currentColor;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0.08em;
}

.brand strong {
  font-size: 14px;
  font-weight: 800;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.journey-status {
  display: flex;
  align-items: baseline;
  justify-self: center;
  gap: 3px;
  min-width: 126px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.46);
  backdrop-filter: blur(16px) saturate(1.2);
  font-size: 15px;
  font-weight: 750;
}

.journey-status__label {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.status-pill,
.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.66);
  backdrop-filter: blur(18px) saturate(1.3);
  cursor: pointer;
  transition: background-color 160ms ease, transform 140ms var(--ease-out), border-color 160ms ease;
}

.status-pill {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b918b;
  box-shadow: 0 0 0 4px rgba(139, 145, 139, 0.12);
}

.status-pill.is-live .status-dot {
  background: #318559;
  box-shadow: 0 0 0 4px rgba(49, 133, 89, 0.15);
}

.status-pill.is-error .status-dot {
  background: var(--apple);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.icon-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: calc(var(--topbar-height) + 12px) clamp(24px, 5vw, 78px) calc(var(--nav-height) + 32px);
  opacity: 0;
  transform: translate3d(0, 18px, 0);
}

.scene[hidden] {
  display: none;
}

.scene.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.scene.is-entering {
  animation: scene-enter 480ms var(--ease-out) both;
}

.scene.is-exiting {
  animation: scene-exit 190ms var(--ease-out) both;
  pointer-events: none;
}

@keyframes scene-enter {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
}

@keyframes scene-exit {
  to { opacity: 0; transform: translate3d(0, -8px, 0); }
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--leaf);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  margin-top: 0;
  letter-spacing: -0.045em;
}

h1,
h2 {
  line-height: 0.92;
}

h1 {
  max-width: 820px;
  margin-bottom: 28px;
  font-size: clamp(58px, 7.8vw, 126px);
  font-weight: 780;
}

h1 em {
  color: var(--apple);
  font-style: normal;
  font-weight: 450;
}

h2 {
  margin-bottom: 24px;
  font-size: clamp(48px, 6.3vw, 96px);
  font-weight: 740;
}

h3 {
  line-height: 1.05;
}

.primary-button,
.secondary-button,
.text-button,
.back-button,
.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  gap: 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 140ms var(--ease-out), background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.primary-button {
  padding: 0 24px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

.primary-button svg,
.secondary-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondary-button,
.file-button {
  padding: 0 22px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.7);
  color: var(--ink);
}

.text-button,
.back-button {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.back-button {
  gap: 6px;
}

.back-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.danger-text {
  color: #9e3322;
}

.welcome-actions,
.place-actions,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}

.scene--welcome {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(360px, 0.86fr);
  align-items: center;
  gap: 2vw;
}

.welcome-copy {
  position: relative;
  z-index: 2;
  padding-left: clamp(0px, 3vw, 48px);
}

.welcome-copy__intro {
  max-width: 590px;
  margin: 0 0 34px;
  color: #465048;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.48;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 470px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-visual {
  position: relative;
  display: grid;
  place-items: center;
  height: min(76vh, 780px);
}

.apple-hero {
  width: min(43vw, 590px);
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 28px 54px rgba(29, 49, 33, 0.16));
}

.apple-hero__body {
  transform-origin: 50% 60%;
  animation: apple-breathe 7s var(--ease-in-out) infinite alternate;
}

.apple-hero__leaf {
  transform-origin: 305px 134px;
  animation: leaf-sway 5s var(--ease-in-out) infinite alternate;
}

@keyframes apple-breathe {
  to { transform: scale(1.025) translateY(-4px); }
}

@keyframes leaf-sway {
  to { transform: rotate(4deg); }
}

.gesture-hint {
  position: absolute;
  right: 4%;
  bottom: 8%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.68);
  backdrop-filter: blur(16px);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.gesture-hint i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple);
  animation: pulse-dot 1.8s ease infinite;
}

@keyframes pulse-dot {
  50% { box-shadow: 0 0 0 7px rgba(216, 85, 53, 0.12); }
}

.bottom-nav {
  position: fixed;
  z-index: 65;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--nav-height);
  padding: 6px;
  transform: translateX(-50%);
}

.glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: var(--glass);
  box-shadow: 0 14px 40px rgba(24, 43, 30, 0.1), inset 0 0 0 1px rgba(22, 34, 26, 0.07);
  backdrop-filter: blur(22px) saturate(1.35);
}

.bottom-nav button {
  display: flex;
  align-items: center;
  min-width: 132px;
  min-height: 58px;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: color 160ms ease, background-color 160ms ease, transform 140ms var(--ease-out);
}

.bottom-nav button.is-active {
  background: var(--ink);
  color: var(--white);
}

.bottom-nav svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app[data-scene="welcome"] .bottom-nav,
.app[data-scene="welcome"] .journey-status,
.app[data-scene="welcome"] .brand,
.app[data-scene="welcome"] #helpButton,
.app[data-scene="welcome"] #settingsButton,
.app[data-scene="welcome"] #fullscreenButton {
  opacity: 0;
  pointer-events: none;
}

.scene--map {
  display: grid;
  grid-template-columns: minmax(240px, 0.68fr) minmax(500px, 1.6fr);
  grid-template-rows: 1fr;
  align-items: start;
  gap: 18px;
}

.map-heading {
  position: relative;
  z-index: 4;
  padding-top: clamp(34px, 7vh, 88px);
}

.map-heading h2 {
  font-size: clamp(46px, 5.6vw, 88px);
}

.map-heading > p:last-child {
  max-width: 410px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.territory-map {
  position: relative;
  align-self: center;
  width: 100%;
  height: min(68vh, 680px);
  min-height: 510px;
  border-radius: 50% 38% 42% 35% / 44% 40% 46% 37%;
}

.territory-map__terrain {
  position: absolute;
  inset: 4% 0 0;
  width: 100%;
  height: 96%;
  overflow: visible;
  filter: drop-shadow(0 28px 54px rgba(46, 70, 51, 0.16));
}

.place-nodes {
  position: absolute;
  inset: 0;
}

.place-node {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.93);
  box-shadow: 0 12px 30px rgba(30, 49, 35, 0.14), 0 0 0 1px rgba(22, 34, 26, 0.11);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 180ms var(--ease-out), background-color 180ms ease, color 180ms ease;
}

.place-node::before {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid color-mix(in srgb, var(--node-color), transparent 52%);
  border-radius: 50%;
  opacity: 0.6;
}

.place-node svg {
  width: 30px;
  fill: none;
  stroke: var(--node-color);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.place-node__label {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.84);
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.place-node.is-visited {
  background: var(--node-color);
}

.place-node.is-visited svg {
  stroke: var(--white);
}

.place-node.is-active {
  transform: translate(-50%, -50%) scale(1.1);
}

.place-node.is-active::before {
  animation: node-ring 1.2s ease infinite;
}

@keyframes node-ring {
  50% { transform: scale(1.16); opacity: 0; }
}

.map-sea-label {
  position: absolute;
  top: 12%;
  right: 3%;
  color: rgba(61, 120, 133, 0.65);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.18em;
  transform: rotate(-8deg);
}

.map-legend {
  position: absolute;
  bottom: 3%;
  right: 5%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.map-legend span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--leaf);
}

.place-preview {
  position: absolute;
  z-index: 12;
  right: clamp(24px, 5vw, 78px);
  bottom: calc(var(--nav-height) + 38px);
  width: min(350px, 26vw);
  min-width: 290px;
  padding: 20px 22px;
  transition: transform 220ms var(--ease-out), opacity 180ms ease;
}

.place-preview .eyebrow {
  margin-bottom: 8px;
  font-size: 9px;
}

.place-preview h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.place-preview p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.place-preview.is-updating {
  opacity: 0;
  transform: translateY(8px);
}

.scene--place {
  display: grid;
  grid-template-columns: minmax(380px, 0.95fr) minmax(420px, 1.05fr);
  align-items: center;
  gap: 7vw;
}

.scene--place > .back-button {
  position: absolute;
  z-index: 5;
  top: calc(var(--topbar-height) + 12px);
  left: clamp(24px, 5vw, 78px);
}

.place-portrait {
  position: relative;
  justify-self: end;
  width: min(43vw, 590px);
  height: min(72vh, 720px);
  border-radius: 52% 48% 34% 66% / 48% 34% 66% 52%;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--place-color, var(--leaf));
}

.place-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(12, 30, 20, 0.35));
  pointer-events: none;
}

#placeArtwork {
  width: 100%;
  height: 100%;
}

.place-story {
  max-width: 650px;
}

.place-story h2 {
  font-size: clamp(66px, 8vw, 128px);
}

.place-story__lead {
  max-width: 620px;
  margin: 0 0 28px;
  color: #424e45;
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.55;
}

.place-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.place-highlights li {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.45);
  font-size: 11px;
  font-weight: 650;
}

.place-prompt {
  margin: 0 0 28px;
  color: var(--leaf);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.place-index {
  position: absolute;
  right: 4vw;
  bottom: 8vh;
  color: rgba(22, 34, 26, 0.06);
  font-size: clamp(140px, 18vw, 280px);
  font-weight: 800;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.scene--challenges {
  display: grid;
  grid-template-columns: minmax(330px, 0.78fr) minmax(560px, 1.22fr);
  align-items: center;
  gap: 6vw;
}

.section-intro {
  padding-left: clamp(0px, 3vw, 40px);
}

.section-intro > p:last-child {
  max-width: 450px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.challenge-list {
  display: grid;
  gap: 1px;
  border-top: 1px solid var(--line);
}

.challenge-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 145px;
  padding: 18px 18px 18px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms var(--ease-out), background-color 180ms ease;
}

.challenge-card__number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.challenge-card h3 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3vw, 46px);
}

.challenge-card p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.challenge-card__meta {
  display: grid;
  justify-items: end;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challenge-card__arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.challenge-card__arrow svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.challenge-card.is-complete::after {
  content: "COMPLETADO";
  position: absolute;
  top: 18px;
  right: 78px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--leaf);
  color: var(--white);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.scene--game {
  padding-left: clamp(24px, 7vw, 110px);
  padding-right: clamp(24px, 7vw, 110px);
}

.game-topline {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 360px) 1fr;
  align-items: center;
  gap: 24px;
}

.game-timer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.62);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 750;
}

.game-timer i {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: color-mix(in srgb, var(--cider), transparent 60%);
  transform-origin: left center;
  transform: scaleX(1);
}

.game-score {
  justify-self: end;
  font-size: 18px;
  font-weight: 760;
}

.game-heading {
  position: absolute;
  top: calc(var(--topbar-height) + 100px);
  left: clamp(24px, 7vw, 110px);
  z-index: 5;
  max-width: 520px;
  pointer-events: none;
}

.game-heading h2 {
  margin-bottom: 12px;
  font-size: clamp(44px, 5vw, 74px);
}

.game-heading > p:last-of-type {
  max-width: 430px;
  color: var(--muted);
  line-height: 1.5;
}

.game-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 12px;
  border: 1px solid rgba(22, 34, 26, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.72);
  color: var(--ink);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.game-mode-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--apple), transparent 80%);
}

.game-arena {
  position: absolute;
  inset: calc(var(--topbar-height) + 72px) clamp(24px, 7vw, 110px) calc(var(--nav-height) + 24px);
  overflow: hidden;
  border: 1px solid rgba(22, 34, 26, 0.1);
  border-radius: 40px;
  background:
    linear-gradient(rgba(255,255,255,.32), rgba(255,255,255,.1)),
    radial-gradient(circle at 75% 30%, rgba(213, 168, 50, 0.22), transparent 30%),
    #dfe4d5;
}

.game-ready {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(243, 239, 228, 0.84);
  backdrop-filter: blur(20px) saturate(1.08);
}

.game-ready__content {
  width: min(620px, 100%);
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 32px;
  background: rgba(255, 253, 247, 0.82);
  box-shadow: var(--shadow);
  text-align: center;
  animation: ready-enter 260ms var(--ease-out) both;
}

.game-ready__tag {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--apple), transparent 86%);
  color: var(--apple);
  font-size: 9px;
  font-weight: 820;
  letter-spacing: 0.11em;
}

.game-ready h3 {
  margin: 20px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 500;
  line-height: 0.98;
}

.game-ready p {
  max-width: 500px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.55;
}

.game-ready__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 18px;
}

.game-ready small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

@keyframes ready-enter {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
}

.app[data-game="harvest"] .game-heading {
  color: var(--white);
  text-shadow: 0 2px 22px rgba(7, 17, 10, 0.34);
}

.app[data-game="harvest"] .game-heading > p:last-of-type { color: rgba(255, 255, 255, 0.8); }
.app[data-game="harvest"] .game-mode-badge { border-color: rgba(255, 255, 255, 0.28); background: rgba(17, 39, 24, 0.72); color: var(--white); }

.harvest-game {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(10, 29, 17, 0.77) 0%, rgba(10, 29, 17, 0.28) 44%, rgba(10, 29, 17, 0.05) 72%),
    linear-gradient(0deg, rgba(8, 24, 14, 0.5), transparent 45%),
    url("assets/pumarada-stock.jpg") center / cover no-repeat,
    #2d5637;
  isolation: isolate;
  user-select: none;
}

.harvest-game::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 73% 32%, transparent 0 23%, rgba(15, 37, 22, 0.12) 56%, rgba(9, 25, 15, 0.48));
  pointer-events: none;
}

.harvest-scene-label {
  position: absolute;
  z-index: 4;
  right: 28px;
  top: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.harvest-scene-label span { width: 26px; height: 1px; background: currentColor; }

.harvest-status {
  position: absolute;
  z-index: 7;
  top: 52px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(330px, 34%);
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 18px;
  background: rgba(250, 246, 231, 0.9);
  box-shadow: 0 16px 36px rgba(7, 24, 13, 0.22);
  backdrop-filter: blur(12px);
}

.harvest-status > i {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 2px solid var(--apple);
  border-radius: 48% 52% 45% 55%;
  background: radial-gradient(circle at 34% 26%, #f1b08c 0 8%, var(--apple) 10% 100%);
  box-shadow: inset -5px -7px 9px rgba(106, 25, 11, 0.17);
}

.harvest-status strong,
.harvest-status small { display: block; }
.harvest-status strong { margin-bottom: 3px; font-size: 11px; }
.harvest-status small { color: var(--muted); font-size: 9px; line-height: 1.35; }

.harvest-sequence {
  position: absolute;
  z-index: 4;
  left: 26px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(12, 31, 18, 0.7);
  color: var(--white);
  backdrop-filter: blur(9px);
  font-size: 8px;
  font-weight: 730;
  letter-spacing: 0.04em;
}

.harvest-sequence span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.harvest-sequence b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--cider); color: var(--ink); font-size: 8px; }
.harvest-sequence > i { width: 16px; height: 1px; background: rgba(255, 255, 255, 0.35); }

.apple-target {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  width: clamp(58px, 5.8vw, 84px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 242, 221, 0.62);
  border-radius: 48% 52% 50% 50%;
  background: radial-gradient(circle at 32% 24%, #f39a68 0 8%, #df5f3c 10% 46%, #a83222 100%);
  box-shadow: inset -9px -12px 17px rgba(88, 19, 12, 0.2), 0 13px 24px rgba(7, 25, 13, 0.32);
  cursor: grab;
  touch-action: none;
  transform: translate(-50%, -50%);
  transition: left 320ms var(--ease-out), top 320ms var(--ease-out), opacity 260ms ease, box-shadow 180ms ease, transform 220ms var(--ease-out);
  animation: apple-tree-sway 2.8s var(--ease-in-out) var(--delay, 0s) infinite alternate;
}

.apple-target::before {
  content: "";
  position: absolute;
  top: -17%;
  left: 50%;
  width: 8%;
  height: 24%;
  border-radius: 99px;
  background: #6a4626;
  transform: rotate(8deg);
}

.apple-target::after {
  content: "";
  position: absolute;
  top: -12%;
  left: 55%;
  width: 30%;
  height: 20%;
  border-radius: 100% 0 100% 0;
  background: #477753;
  transform: rotate(-18deg);
}

.apple-target__shine {
  width: 18%;
  height: 30%;
  border-radius: 50%;
  background: rgba(255, 240, 218, 0.46);
  filter: blur(1px);
  transform: translate(-75%, -55%) rotate(18deg);
}

.apple-target__hint {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  display: none;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 8px;
  font-weight: 820;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
}

.apple-target:focus-visible { outline: 3px solid var(--white); outline-offset: 7px; }
.apple-target.is-armed { box-shadow: 0 0 0 9px rgba(255, 253, 247, 0.76), 0 0 0 17px rgba(213, 168, 50, 0.7), 0 14px 26px rgba(7, 25, 13, 0.3); }
.apple-target.is-armed .apple-target__hint { display: block; }
.apple-target.is-carried { z-index: 12; cursor: grabbing; animation: none; transition: none; transform: translate(-50%, -50%) scale(1.08) rotate(-4deg); box-shadow: 0 22px 38px rgba(6, 22, 11, 0.42), 0 0 0 6px rgba(255, 255, 255, 0.52); }
.apple-target.is-returning { animation: none; pointer-events: none; }
.apple-target.is-collected { z-index: 11; opacity: 0; animation: none; pointer-events: none; transform: translate(-50%, -50%) scale(0.42) rotate(12deg); }

.harvest-crate {
  position: absolute;
  z-index: 6;
  right: 4.5%;
  bottom: 5%;
  width: clamp(190px, 23vw, 300px);
  height: clamp(145px, 19vw, 220px);
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 22px 22px rgba(6, 22, 11, 0.34));
  transition: transform 180ms var(--ease-out), filter 180ms ease;
}

.harvest-crate:focus-visible { outline: 3px solid var(--white); outline-offset: 6px; border-radius: 18px; }
.harvest-crate.is-ready { filter: drop-shadow(0 22px 24px rgba(6, 22, 11, 0.34)) drop-shadow(0 0 14px rgba(238, 194, 77, 0.7)); }
.harvest-crate.is-hovered { transform: translateY(-4px) scale(1.035); }

.harvest-crate__mouth {
  position: absolute;
  z-index: 1;
  top: 12%;
  right: 8%;
  left: 8%;
  height: 29%;
  overflow: hidden;
  border: 8px solid #8d572d;
  border-radius: 50%;
  background: #2f1a10;
  box-shadow: inset 0 8px 14px rgba(0, 0, 0, 0.45);
}

.harvest-crate__body {
  position: absolute;
  z-index: 2;
  right: 10%;
  bottom: 15%;
  left: 10%;
  height: 62%;
  border: 5px solid #684020;
  border-radius: 6px 6px 14px 14px;
  background: repeating-linear-gradient(0deg, #ad7138 0 22%, #70451f 23% 27%, #bd7e40 28% 48%);
  box-shadow: inset 13px 0 rgba(255, 214, 143, 0.11), inset -14px 0 rgba(55, 29, 12, 0.17);
  transform: perspective(420px) rotateX(-5deg);
}

.harvest-crate__body::before,
.harvest-crate__body::after { content: ""; position: absolute; top: -4px; bottom: -4px; width: 13px; border-radius: 3px; background: #71451f; }
.harvest-crate__body::before { left: 10px; }
.harvest-crate__body::after { right: 10px; }
.harvest-crate__body > i { position: absolute; right: 0; left: 0; height: 3px; background: rgba(59, 31, 14, 0.6); }
.harvest-crate__body > i:nth-child(1) { top: 29%; }
.harvest-crate__body > i:nth-child(2) { top: 59%; }
.harvest-crate__body > i:nth-child(3) { top: 88%; }

.harvest-crate__label {
  position: absolute;
  z-index: 5;
  right: 16%;
  bottom: 0;
  left: 16%;
  padding: 7px 8px;
  border-radius: 999px;
  background: rgba(15, 35, 21, 0.9);
  color: var(--white);
  font-size: 8px;
  font-weight: 820;
  letter-spacing: 0.09em;
  transition: background-color 180ms ease, color 180ms ease;
}

.harvest-crate.is-ready .harvest-crate__label { background: var(--cider); color: var(--ink); }

.harvest-crate__apples > span {
  position: absolute;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 229, 204, 0.65);
  border-radius: 48% 52% 50% 50%;
  background: radial-gradient(circle at 32% 24%, #ee986b, #c4442d 62%, #85271d);
  animation: crate-apple-in 280ms var(--ease-out) both;
}

.harvest-crate__apples > span:nth-child(1) { left: 8%; top: 18%; }
.harvest-crate__apples > span:nth-child(2) { left: 29%; top: 7%; }
.harvest-crate__apples > span:nth-child(3) { left: 50%; top: 18%; }
.harvest-crate__apples > span:nth-child(4) { left: 68%; top: 5%; }
.harvest-crate__apples > span:nth-child(5) { left: 20%; top: 38%; }
.harvest-crate__apples > span:nth-child(6) { left: 57%; top: 38%; }

@keyframes apple-tree-sway {
  to { transform: translate(-50%, calc(-50% - 6px)) rotate(2.5deg); }
}

@keyframes crate-apple-in {
  from { opacity: 0; transform: translateY(-18px) scale(0.7); }
}

.pour-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  outline: none;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.pour-scene:active { cursor: grabbing; }

.pour-scene:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: -7px;
}

.pour-status {
  position: absolute;
  z-index: 7;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  padding: 11px 14px;
  border: 1px solid rgba(22, 34, 26, 0.12);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.84);
  box-shadow: 0 12px 30px rgba(22, 34, 26, 0.08);
}

.pour-status > i {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border: 2px solid var(--leaf);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--leaf), transparent 82%);
}

.pour-status strong,
.pour-status small { display: block; }
.pour-status strong { margin-bottom: 2px; font-size: 11px; }
.pour-status small { color: var(--muted); font-size: 9px; line-height: 1.35; }

.pour-meter {
  position: absolute;
  z-index: 7;
  right: 24px;
  bottom: 24px;
  width: min(280px, 34%);
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(22, 34, 26, 0.9);
  color: var(--white);
}

.pour-meter > span {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
}

.pour-meter i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2ce64, var(--cider));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 120ms linear;
}

.pour-meter b {
  display: block;
  margin-top: 8px;
  font-size: 8px;
  font-weight: 780;
  letter-spacing: 0.12em;
}

.pour-object {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  pointer-events: none;
  transform-origin: center;
  will-change: transform;
}

.pour-object img {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 22px 24px rgba(22, 34, 26, 0.18));
  user-select: none;
}

.pour-bottle {
  width: clamp(130px, 15vw, 205px);
  aspect-ratio: 2 / 3;
}

.pour-glass {
  width: clamp(185px, 22vw, 290px);
  aspect-ratio: 1;
}

.pour-liquid-window {
  position: absolute;
  z-index: 2;
  left: 29%;
  right: 29%;
  bottom: 20.5%;
  height: 56%;
  overflow: hidden;
  border-radius: 2px 2px 19% 19%;
}

.pour-liquid-window i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #f3d46a, #c89220);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform 120ms linear;
}

.pour-liquid-window b {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 251, 216, 0.9);
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: opacity 160ms ease, transform 120ms linear;
}

.pour-quarter-line {
  position: absolute;
  z-index: 5;
  right: 27%;
  bottom: 34.5%;
  left: 27%;
  border-top: 2px dashed rgba(22, 34, 26, 0.48);
}

.pour-quarter-line b {
  position: absolute;
  right: -24px;
  top: -9px;
  color: var(--ink);
  font-size: 10px;
}

.pour-stream {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.pour-scene.is-pouring .pour-stream { opacity: 1; }

.pour-stream path {
  fill: none;
  stroke-linecap: round;
}

.pour-stream__halo {
  stroke: rgba(255, 245, 186, 0.38);
  stroke-width: 14;
}

.pour-stream__liquid {
  stroke: #d7a82f;
  stroke-width: 5;
  stroke-dasharray: 14 7;
  animation: cider-stream 560ms linear infinite;
}

.pour-scene.is-spilling .pour-stream__liquid { stroke: #b97b25; }
.pour-scene.is-aligned .pour-status > i,
.pour-scene.is-perfect .pour-status > i { background: var(--leaf); }

@keyframes cider-stream {
  to { stroke-dashoffset: -42; }
}

.pour-floor {
  position: absolute;
  z-index: 1;
  right: 7%;
  bottom: 10%;
  left: 7%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(22, 34, 26, 0.18), transparent);
}

.pour-pointer-help {
  position: absolute;
  z-index: 6;
  left: 24px;
  bottom: 24px;
  max-width: 270px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.quiz-game {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 80%, rgba(216, 85, 53, 0.23), transparent 25%),
    radial-gradient(circle at 40% 10%, rgba(213, 168, 50, 0.3), transparent 28%),
    linear-gradient(135deg, #e6e2ca, #d6ddcc 56%, #b9d2ce);
}

.quiz-game::before {
  content: "?";
  position: absolute;
  left: 8%;
  bottom: -16%;
  color: rgba(255, 253, 247, 0.42);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(300px, 36vw, 610px);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.quiz-game__culture {
  position: absolute;
  left: 6%;
  bottom: 7%;
  display: grid;
  color: rgba(22, 34, 26, 0.68);
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 820;
  letter-spacing: 0.15em;
  line-height: 0.9;
}

.quiz-game__culture b { color: var(--apple); font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5vw, 78px); font-weight: 500; letter-spacing: -0.055em; }
.quiz-game__culture i { margin-top: 15px; font-size: 8px; font-style: normal; letter-spacing: 0.17em; }

.quiz-card {
  position: absolute;
  z-index: 3;
  top: 4.5%;
  right: 3.5%;
  bottom: 4.5%;
  display: flex;
  flex-direction: column;
  width: min(58%, 710px);
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 28px 60px rgba(22, 34, 26, 0.14);
  backdrop-filter: blur(18px) saturate(1.05);
}

.quiz-card__topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 8px; font-weight: 790; letter-spacing: 0.1em; }
.quiz-counter { color: color-mix(in srgb, var(--apple), var(--ink) 42%); }
.quiz-pass { display: flex; align-items: center; gap: 6px; }
.quiz-pass i { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 4px rgba(49, 93, 66, 0.12); }

.quiz-progress {
  --quiz-progress: 0%;
  position: relative;
  flex: 0 0 auto;
  height: 3px;
  margin: 15px 0 clamp(22px, 3vh, 34px);
  overflow: hidden;
  border-radius: 99px;
  background: rgba(22, 34, 26, 0.09);
}

.quiz-progress::after { content: ""; position: absolute; inset: 0; width: var(--quiz-progress); border-radius: inherit; background: linear-gradient(90deg, var(--apple), var(--cider)); transition: width 280ms var(--ease-out); }
.quiz-kicker { margin: 0 0 10px; color: var(--leaf); font-size: 8px; font-weight: 830; letter-spacing: 0.13em; }

.quiz-question {
  max-width: 610px;
  margin: 0 0 clamp(18px, 2.6vh, 28px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 2.7vw, 43px);
  font-weight: 500;
  line-height: 1.06;
  text-wrap: balance;
}

.quiz-answers { display: grid; gap: 9px; }

.quiz-answer {
  display: grid;
  grid-template-columns: 38px 1fr 22px;
  align-items: center;
  gap: 13px;
  min-height: 60px;
  padding: 9px 14px 9px 11px;
  border: 1px solid rgba(22, 34, 26, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms var(--ease-out), box-shadow 180ms ease;
}

.quiz-answer > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(22, 34, 26, 0.07); font-size: 10px; font-weight: 820; transition: background-color 180ms ease, color 180ms ease; }
.quiz-answer b { font-size: clamp(11px, 1.1vw, 14px); font-weight: 700; line-height: 1.3; }
.quiz-answer > i { display: grid; place-items: center; }
.quiz-answer svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quiz-answer:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.quiz-answer:disabled { cursor: default; opacity: 1; }
.quiz-answer.is-correct { border-color: rgba(49, 93, 66, 0.55); background: rgba(49, 93, 66, 0.12); box-shadow: inset 4px 0 var(--leaf); }
.quiz-answer.is-correct > span { background: var(--leaf); color: var(--white); }
.quiz-answer.is-wrong { border-color: rgba(216, 85, 53, 0.58); background: rgba(216, 85, 53, 0.1); box-shadow: inset 4px 0 var(--apple); }
.quiz-answer.is-wrong > span { background: var(--apple); color: var(--white); }

.quiz-feedback {
  min-height: 34px;
  margin: auto 0 0;
  padding-top: 15px;
  border-top: 1px solid rgba(22, 34, 26, 0.09);
  color: var(--muted);
  font-size: 10px;
  font-weight: 630;
  line-height: 1.45;
}

.quiz-feedback.is-correct { color: var(--leaf); }
.quiz-feedback.is-wrong { color: color-mix(in srgb, var(--apple), var(--ink) 42%); }

.game-result {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(243, 239, 228, 0.78);
  backdrop-filter: blur(18px);
  animation: result-enter 420ms var(--ease-out) both;
}

.game-result__content {
  max-width: 560px;
  padding: 48px;
  text-align: center;
}

.game-result__seal {
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  border: 2px solid var(--leaf);
  border-radius: 50%;
  color: var(--leaf);
  font-size: 30px;
  font-weight: 800;
  transform: rotate(-8deg);
}

.game-result__seal svg {
  width: 44px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.game-result h3 {
  margin-bottom: 12px;
  font-size: 48px;
}

.game-result p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.5;
}

@keyframes result-enter {
  from { opacity: 0; }
}

.scene--souvenir {
  display: grid;
  grid-template-columns: minmax(340px, 0.8fr) minmax(450px, 1.2fr);
  align-items: center;
  gap: 7vw;
}

.souvenir-copy {
  max-width: 600px;
  padding-left: clamp(0px, 3vw, 44px);
}

.souvenir-copy > p:nth-of-type(2) {
  max-width: 470px;
  color: var(--muted);
  line-height: 1.55;
}

.souvenir-options {
  display: grid;
  gap: 18px;
  max-width: 500px;
  margin: 30px 0;
}

.souvenir-options > label:not(.toggle-row),
.editor-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.souvenir-options input[type="text"],
.editor-grid input[type="text"],
.editor-grid select,
.editor-grid textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.68);
  color: var(--ink);
}

.editor-grid textarea {
  min-height: 106px;
  padding-top: 13px;
  resize: vertical;
  line-height: 1.45;
}

.postcard-wrap {
  position: relative;
  justify-self: center;
  height: min(72vh, 740px);
  aspect-ratio: 4 / 5;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 30px;
  background: rgba(255,255,255,.42);
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

#postcardCanvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: var(--ink);
}

.postcard-badge {
  position: absolute;
  right: 24px;
  bottom: 24px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  color: var(--ink);
  font-size: 9px;
  font-weight: 750;
}

.gesture-cursor {
  --dwell: 0deg;
  position: fixed;
  z-index: 150;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity 160ms ease;
}

.gesture-cursor.is-visible {
  opacity: 1;
}

.gesture-cursor__progress {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--apple) var(--dwell), rgba(255,255,255,.52) 0);
  mask: radial-gradient(circle, transparent 57%, #000 59%);
}

.gesture-cursor i {
  width: 12px;
  height: 12px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--apple);
  box-shadow: 0 4px 15px rgba(50, 30, 20, 0.24);
  transition: transform 120ms var(--ease-out), background-color 120ms ease;
}

.gesture-cursor.is-pinching i {
  background: var(--cider);
  transform: scale(1.5);
}

.gesture-cursor.is-harvest {
  width: 72px;
  height: 72px;
}

.gesture-cursor.is-harvest .gesture-cursor__progress {
  background: rgba(255, 253, 247, 0.34);
  box-shadow: inset 0 0 0 2px rgba(255, 253, 247, 0.9), 0 10px 30px rgba(22, 34, 26, 0.16);
}

.gesture-cursor.is-harvest i {
  width: 22px;
  height: 22px;
  border-width: 3px;
  background: var(--apple);
}

.gesture-cursor.is-harvest.is-hand-open i {
  background: var(--leaf);
  transform: scale(1.14);
}

.gesture-cursor.is-harvest.is-hand-closed i {
  border-radius: 7px;
  background: var(--cider);
  transform: scale(0.82);
}

.gesture-cursor.is-harvest b {
  top: calc(100% + 8px);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.gesture-cursor b {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(22, 34, 26, 0.86);
  color: var(--white);
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
  transform: translateX(-50%);
}

.camera-coach {
  position: fixed;
  z-index: 68;
  left: clamp(16px, 4vw, 54px);
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 330px;
  padding: 12px 16px 12px 12px;
  border-radius: 20px;
}

.camera-coach[hidden] {
  display: none;
}

.camera-coach__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--white);
}

.camera-coach svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.camera-coach strong,
.camera-coach small {
  display: block;
}

.camera-coach strong {
  margin-bottom: 2px;
  font-size: 11px;
}

.camera-coach small {
  color: var(--muted);
  font-size: 9px;
}

.modal {
  position: fixed;
  z-index: 120;
  width: min(920px, calc(100vw - 32px));
  max-height: min(780px, calc(100dvh - 32px));
  padding: clamp(28px, 5vw, 64px);
  overflow: auto;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 36px;
  background: rgba(247, 244, 235, 0.92);
  box-shadow: 0 32px 100px rgba(25, 35, 28, 0.25);
  color: var(--ink);
  opacity: 0;
  transform: translateY(22px) scale(0.97);
  transition: opacity 220ms var(--ease-out), transform 300ms var(--ease-drawer), display 300ms allow-discrete, overlay 300ms allow-discrete;
}

.modal[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .modal[open] { opacity: 0; transform: translateY(22px) scale(0.97); }
}

.modal::backdrop {
  background: rgba(18, 29, 21, 0.42);
  backdrop-filter: blur(10px);
  transition: opacity 220ms var(--ease-out), display 300ms allow-discrete, overlay 300ms allow-discrete;
}

.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.calibration-modal {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 48px;
  align-items: center;
}

.calibration-visual {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(213, 168, 50, 0.28), rgba(49, 93, 66, 0.12));
}

.calibration-hand {
  position: relative;
  width: 98px;
  height: 130px;
  border-radius: 42px 42px 50px 50px;
  background: var(--ink);
  transform: rotate(-8deg);
  transition: transform 300ms var(--ease-out);
}

.calibration-hand span {
  position: absolute;
  bottom: 96px;
  width: 20px;
  border-radius: 18px 18px 0 0;
  background: var(--ink);
}

.calibration-hand span:nth-child(1) { left: 0; height: 80px; transform: rotate(-18deg); transform-origin: bottom; }
.calibration-hand span:nth-child(2) { left: 21px; height: 112px; }
.calibration-hand span:nth-child(3) { left: 43px; height: 126px; }
.calibration-hand span:nth-child(4) { left: 65px; height: 114px; }
.calibration-hand span:nth-child(5) { left: 86px; height: 88px; transform: rotate(7deg); transform-origin: bottom; }
.calibration-hand i { position: absolute; left: 40px; bottom: -56px; width: 40px; height: 80px; border-radius: 0 0 16px 16px; background: var(--ink); }

.calibration-hand.is-pinch span:nth-child(1) { transform: translate(26px, -5px) rotate(40deg); }
.calibration-hand.is-pinch span:nth-child(2) { transform: translate(-5px, 15px) rotate(-24deg); transform-origin: bottom; }

.calibration-copy h2,
.info-modal h2,
.settings-heading h2 {
  font-size: clamp(42px, 5vw, 70px);
}

.calibration-copy > p:nth-of-type(2),
.settings-heading > p:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.calibration-progress {
  display: flex;
  gap: 7px;
  margin: 28px 0;
}

.calibration-progress i {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: rgba(22, 34, 26, 0.15);
}

.calibration-progress i.is-active,
.calibration-progress i.is-done {
  background: var(--apple);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 34px 0;
  background: var(--line);
}

.help-grid article {
  padding: 28px;
  background: rgba(247, 244, 235, 0.98);
}

.help-grid article > span {
  color: var(--apple);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.help-grid h3 {
  margin: 18px 0 8px;
  font-size: 25px;
}

.help-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-modal {
  width: min(980px, calc(100vw - 32px));
}

.settings-tabs {
  display: flex;
  gap: 4px;
  margin: 30px 0;
  padding: 5px;
  border-radius: 16px;
  background: rgba(22, 34, 26, 0.07);
}

.settings-tabs button {
  flex: 1;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.settings-tabs button.is-active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 5px 16px rgba(22, 34, 26, 0.08);
}

.settings-panel {
  display: grid;
  gap: 1px;
}

.settings-panel[hidden] {
  display: none;
}

.range-row,
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.range-row strong,
.range-row small,
.toggle-row strong,
.toggle-row small {
  display: block;
}

.range-row strong,
.toggle-row strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.range-row small,
.toggle-row small {
  color: var(--muted);
  font-size: 10px;
}

.range-row input[type="range"] {
  width: min(230px, 34vw);
  accent-color: var(--leaf);
}

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.toggle-row i {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border-radius: 99px;
  background: #b8beb8;
  cursor: pointer;
  transition: background-color 180ms ease;
}

.toggle-row i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 7px rgba(22, 34, 26, 0.2);
  transition: transform 180ms var(--ease-out);
}

.toggle-row input:checked + i {
  background: var(--leaf);
}

.toggle-row input:checked + i::after {
  transform: translateX(20px);
}

.settings-panel > .secondary-button {
  justify-self: start;
  margin-top: 24px;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.editor-grid__wide {
  grid-column: 1 / -1;
}

.editor-divider {
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.editor-grid input[type="color"] {
  width: 100%;
  height: 50px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.editor-actions {
  margin-top: 28px;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toast {
  position: fixed;
  z-index: 160;
  left: 50%;
  bottom: calc(var(--nav-height) + 36px);
  max-width: min(480px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: 999px;
  background: rgba(22, 34, 26, 0.92);
  color: var(--white);
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 180ms var(--ease-out), transform 220ms var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (hover: hover) and (pointer: fine) {
  .primary-button:hover { transform: translateY(-2px); background: #29372d; }
  .secondary-button:hover,
  .file-button:hover { transform: translateY(-2px); border-color: rgba(22, 34, 26, 0.35); }
  .text-button:hover,
  .back-button:hover { color: var(--apple); }
  .icon-button:hover,
  .status-pill:hover { background: rgba(255,255,255,.9); }
  .place-node:hover { transform: translate(-50%, -50%) scale(1.08); }
  .challenge-card:hover { transform: translateX(10px); background: rgba(255,255,255,.28); }
  .bottom-nav button:hover:not(.is-active) { color: var(--ink); background: rgba(255,255,255,.48); }
  .apple-target:hover:not(.is-carried):not(.is-collected) { box-shadow: 0 0 0 6px rgba(255, 253, 247, 0.48), 0 16px 28px rgba(7, 25, 13, 0.34); }
  .harvest-crate:hover { transform: translateY(-3px); }
  .quiz-answer:hover:not(:disabled) { border-color: rgba(22, 34, 26, 0.34); background: rgba(255, 255, 255, 0.82); transform: translateX(4px); }
}

.primary-button:active,
.secondary-button:active,
.icon-button:active,
.status-pill:active,
.bottom-nav button:active {
  transform: scale(0.97);
}

@media (max-width: 1050px) {
  :root { --topbar-height: 82px; }
  .scene--welcome { grid-template-columns: 1.1fr .9fr; }
  .scene--map { grid-template-columns: minmax(260px, .7fr) minmax(420px, 1.3fr); }
  .place-preview { display: none; }
  .scene--place { gap: 4vw; }
  .scene--challenges { grid-template-columns: .8fr 1.2fr; gap: 4vw; }
  .challenge-card { min-height: 130px; }
}

@media (max-width: 800px) {
  :root { --topbar-height: 74px; --nav-height: 66px; }
  body { overflow: auto; }
  .app { min-height: 720px; }
  .topbar { grid-template-columns: 1fr auto; padding-inline: 16px; }
  .journey-status { display: none; }
  .status-pill { width: 44px; padding: 0; justify-content: center; }
  .status-pill #cameraLabel { display: none; }
  .topbar__actions { gap: 6px; }
  #fullscreenButton { display: none; }
  .scene { padding: calc(var(--topbar-height) + 14px) 18px calc(var(--nav-height) + 30px); overflow-y: auto; }
  .scene--welcome { display: block; padding-top: calc(var(--topbar-height) + 7vh); }
  .welcome-copy { padding: 0; }
  h1 { font-size: clamp(48px, 15vw, 74px); }
  .welcome-copy__intro { max-width: 92%; font-size: 16px; }
  .welcome-visual { position: absolute; z-index: -1; right: -28%; bottom: -12%; width: 80%; height: 60%; opacity: .46; }
  .apple-hero { width: 100%; }
  .gesture-hint { display: none; }
  .privacy-note { max-width: 85%; }
  .bottom-nav { width: calc(100% - 24px); height: var(--nav-height); bottom: max(10px, env(safe-area-inset-bottom)); }
  .bottom-nav button { flex: 1; min-width: 0; min-height: 54px; padding: 0 8px; }
  .bottom-nav button span { font-size: 10px; }
  .scene--map { display: block; }
  .map-heading { padding-top: 20px; }
  .map-heading h2 { font-size: clamp(44px, 13vw, 66px); }
  .territory-map { height: 500px; min-height: 500px; margin-top: -18px; }
  .place-node { width: 58px; height: 58px; }
  .place-node svg { width: 24px; }
  .place-node__label { top: calc(100% + 10px); padding: 4px 8px; font-size: 9px; }
  .scene--place { display: block; padding-top: calc(var(--topbar-height) + 68px); }
  .scene--place > .back-button { top: calc(var(--topbar-height) + 4px); left: 18px; }
  .place-portrait { width: 100%; height: 42vh; min-height: 320px; margin-bottom: 34px; border-radius: 38% 62% 36% 64% / 52% 35% 65% 48%; }
  .place-story { padding-bottom: 80px; }
  .place-story h2 { font-size: clamp(58px, 17vw, 92px); }
  .place-index { display: none; }
  .scene--challenges { display: block; }
  .section-intro { padding: 26px 0 34px; }
  .section-intro h2 { font-size: clamp(48px, 14vw, 72px); }
  .challenge-list { padding-bottom: 80px; }
  .challenge-card { grid-template-columns: 38px 1fr; min-height: 150px; padding-right: 4px; }
  .challenge-card p,
  .help-grid p { font-size: 14px; }
  .challenge-card__meta { display: none; }
  .challenge-card.is-complete::after { right: 6px; }
  .game-topline { grid-template-columns: auto 1fr auto; gap: 10px; }
  .game-topline .back-button { font-size: 0; width: 44px; }
  .game-topline .back-button svg { width: 22px; }
  .game-score { font-size: 13px; }
  .game-heading { top: calc(var(--topbar-height) + 82px); left: 32px; right: auto; width: 44%; }
  .game-heading > .eyebrow,
  .game-heading h2 { display: none; }
  .game-heading > p:last-of-type {
    margin: 0;
    padding: 9px 11px;
    border-radius: 13px;
    background: rgba(255, 253, 247, 0.8);
    color: var(--ink);
    font-size: 9px;
    line-height: 1.35;
  }
  .app[data-game="pour"] .game-heading { display: none; }
  .game-mode-badge { display: none; }
  .game-arena { inset: calc(var(--topbar-height) + 66px) 18px calc(var(--nav-height) + 22px); border-radius: 28px; }
  .game-ready { padding: 16px; }
  .game-ready__content { padding: 28px 20px; border-radius: 24px; }
  .game-ready__actions { display: grid; }
  .app[data-game="harvest"] .game-heading > p:last-of-type { background: rgba(12, 31, 18, 0.78); color: var(--white); }
  .harvest-game { background-position: 58% center; }
  .harvest-scene-label { top: 12px; right: 12px; }
  .harvest-status { top: auto; right: 12px; bottom: 12px; left: 12px; width: auto; max-width: none; padding: 9px 11px; }
  .harvest-status > i { width: 23px; height: 23px; }
  .harvest-status small { font-size: 8px; }
  .harvest-sequence { display: none; }
  .apple-target { width: 54px; }
  .harvest-crate { right: 2%; bottom: 17%; width: 164px; height: 126px; }
  .harvest-crate__label { right: 8%; left: 8%; }
  .harvest-crate__apples > span { width: 18px; height: 18px; }
  .quiz-game::before { left: -8%; bottom: -8%; opacity: 0.68; }
  .quiz-game__culture { display: none; }
  .quiz-card { top: 64px; right: 10px; bottom: 10px; left: 10px; width: auto; padding: 18px; border-radius: 20px; }
  .quiz-card__topline { gap: 8px; }
  .quiz-pass { font-size: 7px; }
  .quiz-progress { margin: 10px 0 14px; }
  .quiz-kicker { margin-bottom: 6px; }
  .quiz-question { margin-bottom: 13px; font-size: clamp(22px, 6.8vw, 30px); }
  .quiz-answers { gap: 7px; }
  .quiz-answer { grid-template-columns: 34px 1fr 18px; min-height: 52px; padding: 7px 10px 7px 8px; border-radius: 13px; }
  .quiz-answer > span { width: 32px; height: 32px; }
  .quiz-answer b { font-size: 12px; }
  .quiz-feedback { min-height: 30px; padding-top: 10px; font-size: 9px; }
  .pour-status { top: 14px; right: 14px; max-width: 54%; }
  .pour-meter { right: 14px; bottom: 14px; width: 46%; }
  .pour-bottle { width: clamp(112px, 31vw, 155px); }
  .pour-glass { width: clamp(160px, 43vw, 220px); }
  .pour-pointer-help { left: 14px; bottom: 14px; width: 42%; }
  .scene--souvenir { display: block; padding-bottom: 100px; }
  .souvenir-copy { padding: 30px 0 34px; }
  .souvenir-copy h2 { font-size: clamp(52px, 15vw, 76px); }
  .postcard-wrap { width: 100%; height: auto; }
  .camera-coach { display: none; }
  .calibration-modal { grid-template-columns: 1fr; gap: 24px; }
  .calibration-visual { width: 200px; justify-self: center; }
  .help-grid { grid-template-columns: 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-grid__wide { grid-column: auto; }
  .modal { padding: 52px 22px 28px; border-radius: 26px; }
}

@media (max-height: 720px) and (min-width: 801px) {
  .app { min-height: 600px; }
  h1 { font-size: clamp(54px, 7vw, 88px); margin-bottom: 20px; }
  .welcome-copy__intro { margin-bottom: 22px; }
  .privacy-note { margin-top: 16px; }
  .welcome-visual { height: 72vh; }
  .territory-map { min-height: 450px; height: 66vh; }
  .place-portrait { height: 66vh; }
  .challenge-card { min-height: 108px; }
  .challenge-card h3 { font-size: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }

  .scene,
  .modal,
  .place-preview,
  .gesture-cursor,
  .toast {
    transition-duration: 1ms !important;
  }

  .atmosphere__orb,
  .apple-hero__body,
  .apple-hero__leaf,
  .apple-target,
  .pour-stream__liquid,
  .place-node.is-active::before {
    animation: none !important;
  }

  .game-ready__content { animation: none !important; }
}
