:root {
  color-scheme: dark;
  --ink: #15343a;
  --night: #092f35;
  --paper: #fff9e9;
  --cream: #f8edce;
  --teal: #197b78;
  --teal-dark: #0e514f;
  --coral: #f16643;
  --coral-dark: #a93425;
  --gold: #f6bd45;
  --purple: #765284;
  --muted: #667777;
  font-family: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; min-width: 1060px; min-height: 650px; overflow: hidden; }
body { margin: 0; color: var(--ink); background: var(--night); }
button { color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid #fff2a8; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.lesson { height: 100%; padding: 12px; }
.world { position: relative; height: 100%; min-height: 626px; overflow: hidden; isolation: isolate; border: 1px solid rgba(255,255,255,.21); border-radius: 26px; background: #124e53 url("art/world-01.webp") center/cover no-repeat; box-shadow: 0 9px 0 #06252a, 0 24px 60px rgba(0,0,0,.35); }
.world-shade { position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg,rgba(4,34,39,.16),rgba(4,34,39,.08) 40%,rgba(3,26,30,.32)), radial-gradient(circle at 50% 50%,transparent 0 30%,rgba(6,35,40,.24) 100%); }

.hud { position: absolute; z-index: 10; left: 20px; right: 20px; top: 17px; height: 69px; display: grid; grid-template-columns: 220px 1fr auto; align-items: center; gap: 16px; }
.mission-chip,.difficulty-card,.scoreboard { border: 1px solid rgba(15,44,48,.18); background: rgba(255,249,233,.95); box-shadow: 0 5px 0 rgba(8,45,48,.24), 0 12px 30px rgba(0,0,0,.12); backdrop-filter: blur(9px); }
.mission-chip { height: 69px; display: flex; flex-direction: column; justify-content: center; padding: 10px 16px; border-radius: 15px; }
.mission-chip span,.difficulty-card span,.scoreboard span,.field-journal > span,.cycle-heading span,.target-flag span,.specimen-tag span { color: var(--muted); font-size: 10px; font-weight: 1000; letter-spacing: .1em; text-transform: uppercase; }
.mission-chip strong { margin-top: 3px; font-size: 16px; }
.difficulty-card { justify-self: center; width: min(340px,100%); display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 15px; border-radius: 15px; }
.difficulty-card span b { color: var(--ink); font-size: 16px; }.difficulty-card strong { font-size: 12px; }
.difficulty-card > i { grid-column: 1/-1; height: 7px; overflow: hidden; border-radius: 999px; background: #d8e0d8; }
.difficulty-card > i b { display: block; width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--gold),var(--coral),var(--purple)); transition: width 220ms ease-out; }
.scoreboard { height: 69px; display: flex; padding: 7px; border-radius: 15px; }
.scoreboard > div { min-width: 70px; display: grid; place-content: center; padding: 0 10px; text-align: center; }
.scoreboard > div + div { border-left: 1px solid #d9dfd6; }
.scoreboard strong { display: block; margin-top: 3px; font-size: 21px; line-height: 1; }.scoreboard strong i { color: var(--coral); font-size: 13px; font-style: normal; }

.mascot-panel { position: absolute; z-index: 3; left: 20px; top: 104px; bottom: 20px; width: 220px; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; background: linear-gradient(rgba(11,68,70,.28),rgba(4,40,43,.58)); box-shadow: inset 0 0 50px rgba(255,255,255,.07); }
.speech { position: absolute; z-index: 3; left: 13px; right: 13px; top: 14px; min-height: 82px; display: grid; place-items: center; padding: 12px 13px; border: 2px solid var(--ink); border-radius: 16px 16px 16px 4px; background: var(--paper); box-shadow: 0 5px 0 rgba(6,32,34,.28); font-size: 13px; font-weight: 900; line-height: 1.28; text-align: center; }
.mascot-panel img { position: absolute; left: -4px; right: -4px; bottom: 90px; width: 228px; height: 330px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 10px 8px rgba(1,20,22,.3)); transform-origin: 50% 90%; transition: transform 180ms ease-out, filter 180ms ease-out; }
.mascot-panel.is-cheering img { animation: mascot-cheer 600ms cubic-bezier(.2,.8,.25,1.25); filter: drop-shadow(0 10px 8px rgba(1,20,22,.3)) drop-shadow(0 0 18px rgba(246,189,69,.7)); }
.mascot-panel.is-oops img { animation: mascot-oops 420ms ease-out; }
.mascot-panel.is-thinking img { transform: rotate(-1.5deg); }
.field-journal { position: absolute; left: 13px; right: 13px; bottom: 13px; min-height: 80px; padding: 10px 12px; border: 1px solid #d2c79e; border-radius: 13px; background: rgba(255,249,233,.94); text-align: center; }
.journal-dots { display: flex; justify-content: center; gap: 9px; margin: 7px 0 5px; }.journal-dots i { width: 12px; height: 12px; border: 2px solid #71817b; border-radius: 50%; background: transparent; }.journal-dots i.is-current { border-color: var(--coral-dark); background: var(--gold); box-shadow: 0 0 0 4px rgba(241,102,67,.14); }.journal-dots i.is-complete { border-color: var(--teal-dark); background: var(--teal); }
.field-journal strong { font-size: 11px; }

.lab-card { position: absolute; z-index: 4; left: 256px; right: 328px; top: 104px; bottom: 20px; display: grid; grid-template-rows: auto minmax(260px,1fr) 31px auto; padding: 20px 25px 22px; overflow: hidden; border: 1px solid #d7cdaa; border-radius: 22px; background: rgba(255,249,233,.965); box-shadow: 0 8px 0 rgba(7,47,48,.26), 0 22px 42px rgba(0,0,0,.2); }
.challenge-heading { text-align: center; }.challenge-heading > span { color: var(--coral-dark); font-size: 10px; font-weight: 1000; letter-spacing: .12em; text-transform: uppercase; }.challenge-heading h1 { margin: 5px 0 5px; font-size: clamp(27px,2.8vw,40px); line-height: 1; letter-spacing: -.045em; }.challenge-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.experiment { position: relative; min-height: 260px; display: grid; place-items: center; align-content: center; padding: 10px 0 2px; }
.target-flag { position: absolute; z-index: 5; right: 4px; top: 16px; min-width: 116px; padding: 7px 11px; border: 2px solid var(--teal-dark); border-radius: 10px; background: #def3e8; box-shadow: 0 4px 0 #b3d9ca; text-align: center; }.target-flag strong { display: block; margin-top: 1px; color: var(--teal-dark); font-size: 14px; }
.rock-plinth { position: relative; width: min(280px,55%); aspect-ratio: 1; display: grid; place-items: center; }
.rock-plinth::after { position: absolute; z-index: -1; left: 17%; right: 17%; bottom: 5%; height: 16%; content: ""; border-radius: 50%; background: rgba(17,45,43,.2); filter: blur(8px); }
.rock-plinth img { z-index: 3; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 8px rgba(18,43,41,.19)); transition: transform 240ms ease-out, opacity 160ms ease-out; }
.rock-plinth.is-transforming img { animation: rock-transform 700ms cubic-bezier(.2,.8,.25,1); }
.rock-plinth.is-pop img { animation: rock-pop 420ms cubic-bezier(.2,.8,.25,1.3); }
.transform-rings { position: absolute; z-index: 1; inset: 12%; pointer-events: none; }.transform-rings i { position: absolute; inset: 0; opacity: 0; border: 3px solid var(--gold); border-radius: 50%; }.rock-plinth.is-transforming .transform-rings i { animation: ring-out 720ms ease-out both; }.rock-plinth.is-transforming .transform-rings i:nth-child(2){animation-delay:100ms}.rock-plinth.is-transforming .transform-rings i:nth-child(3){animation-delay:200ms}
.magma-blob { position: relative; z-index: 3; width: 82%; height: 64%; border: 5px solid #682620; border-radius: 45% 55% 48% 52% / 62% 56% 44% 38%; background: radial-gradient(circle at 52% 65%,#ffd55b 0 12%,#ff8a26 34%,#e43e25 70%,#842720 100%); box-shadow: inset 0 0 22px #ffcc4d,0 0 26px rgba(255,101,38,.56),0 14px 9px rgba(14,33,31,.2); animation: magma-breathe 1.8s ease-in-out infinite; }.magma-blob i { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #ffe47a; animation: magma-bubble 1.2s ease-in-out infinite; }.magma-blob i:nth-child(1){left:22%;top:32%}.magma-blob i:nth-child(2){right:24%;top:21%;animation-delay:.35s}.magma-blob i:nth-child(3){left:49%;bottom:18%;animation-delay:.7s}
.sediment-pile { position: relative; z-index: 3; width: 78%; height: 52%; }.sediment-pile i { position: absolute; bottom: 10%; width: 36%; aspect-ratio: 1.2; border: 4px solid #653d28; border-radius: 45%; background: #d69a48; box-shadow: inset 0 7px rgba(255,220,129,.4); }.sediment-pile i:nth-child(1){left:2%;transform:rotate(-8deg)}.sediment-pile i:nth-child(2){left:24%;bottom:2%;background:#b86d46}.sediment-pile i:nth-child(3){right:4%;transform:rotate(11deg);background:#e3b85b}.sediment-pile i:nth-child(4){left:38%;bottom:31%;width:29%;background:#8b7254}.sediment-pile i:nth-child(5){left:15%;bottom:34%;width:23%;background:#e0a556}
.specimen-tag { position: absolute; left: 50%; bottom: 3px; min-width: 255px; transform: translateX(-50%); padding: 7px 16px; border: 1px solid #cbc3a9; border-radius: 11px; background: rgba(255,255,255,.88); box-shadow: 0 4px 0 rgba(71,78,67,.1); text-align: center; }.specimen-tag strong { display: block; margin-top: 2px; font-size: 12px; }
.feedback { min-height: 31px; display: grid; place-items: center; color: var(--teal-dark); font-size: 13px; font-weight: 900; text-align: center; }.feedback.is-error { color: var(--coral-dark); }
.action-area { min-height: 88px; display: flex; align-items: center; justify-content: center; }
.choice-grid { width: min(650px,100%); display: grid; grid-template-columns: repeat(var(--columns,3),1fr); gap: 10px; }
.choice,.primary { min-height: 64px; border: 2px solid #b7c2b8; border-radius: 14px; background: white; box-shadow: 0 5px 0 #d4d9d0; font-weight: 1000; transition: transform 140ms ease-out,box-shadow 140ms ease-out,border-color 140ms ease-out; }.choice:hover,.primary:hover { transform: translateY(-2px); }.choice:active,.primary:active { transform: translateY(4px); }
.choice { position: relative; padding: 8px 9px; font-size: 14px; }.choice .process-icon { display: block; margin-bottom: 4px; font-size: 23px; }.choice small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.1; }.choice:hover { border-color: var(--teal); box-shadow: 0 7px 0 #c8ddda; }.choice:active { box-shadow: 0 1px 0 #c8ddda; }
.choice.type-choice { font-size: 16px; }.choice.type-choice small { font-size: 11px; }
.primary { min-width: 230px; padding: 0 24px; border-color: var(--teal-dark); color: white; background: var(--teal); box-shadow: 0 6px 0 var(--teal-dark); font-size: 16px; }.primary:hover { box-shadow: 0 8px 0 var(--teal-dark); }.primary:active { box-shadow: 0 2px 0 var(--teal-dark); }.primary.is-coral { border-color: var(--coral-dark); background: var(--coral); box-shadow: 0 6px 0 var(--coral-dark); }

.cycle-panel { position: absolute; z-index: 3; right: 20px; top: 104px; bottom: 20px; width: 292px; padding: 14px 13px 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; color: white; background: rgba(7,48,53,.88); box-shadow: inset 0 0 50px rgba(255,255,255,.05),0 7px 0 rgba(2,28,31,.28); backdrop-filter: blur(7px); }
.cycle-heading { padding: 3px 6px 0; text-align: center; }.cycle-heading span { color: #9dc6c0; }.cycle-heading strong { display: block; margin-top: 2px; font-size: 17px; }
.cycle-map { width: 100%; height: calc(100% - 73px); min-height: 360px; overflow: visible; }.cycle-arrow { fill: none; stroke: rgba(255,255,255,.45); stroke-width: 5; stroke-linecap: round; transition: stroke 180ms ease-out,filter 180ms ease-out; }.cycle-arrow.is-active { stroke: var(--gold); filter: drop-shadow(0 0 6px rgba(246,189,69,.8)); animation: arrow-pulse 520ms ease-out; }.cycle-map marker path { fill: rgba(255,255,255,.6); }.cycle-node circle { fill: #174f54; stroke: rgba(255,255,255,.45); stroke-width: 3; transition: fill 180ms ease-out,stroke 180ms ease-out,transform 180ms ease-out; transform-box: fill-box; transform-origin: center; }.cycle-node text { fill: #dbeeed; font-size: 9px; font-weight: 1000; letter-spacing: .04em; text-anchor: middle; }.cycle-node .node-icon { fill: var(--gold); font-size: 18px; }.cycle-node.is-current circle { fill: var(--coral-dark); stroke: #fff1b0; transform: scale(1.08); filter: drop-shadow(0 0 10px rgba(246,189,69,.52)); }.cycle-node.is-target circle { stroke: #6fe1c8; stroke-width: 5; stroke-dasharray: 7 5; }.cycle-key { margin-top: -7px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; color: #d5e5e1; background: rgba(0,0,0,.13); font-size: 11px; font-weight: 800; line-height: 1.25; text-align: center; }
.cycle-arrow.secondary-arrow { stroke-width: 3; stroke-dasharray: 5 7; opacity: .72; }

.celebration { position: absolute; z-index: 20; left: 50%; top: 52%; pointer-events: none; }.celebration i { position: absolute; width: 14px; height: 14px; opacity: 0; border-radius: 4px; background: var(--gold); }.celebration.is-bursting i { animation: crystal-burst 780ms ease-out both; }
.toast { position: absolute; z-index: 30; left: 50%; bottom: 31px; max-width: 70%; padding: 10px 18px; opacity: 0; transform: translate(-50%,12px); border-radius: 999px; color: white; background: var(--ink); box-shadow: 0 5px 18px rgba(0,0,0,.24); pointer-events: none; font-size: 13px; font-weight: 900; transition: opacity 150ms ease-out,transform 150ms ease-out; }.toast.is-showing { opacity: 1; transform: translate(-50%,0); }
.world.is-miss .lab-card { animation: gentle-shake 410ms ease-out; }
.world.is-level-up .lab-card { animation: level-glow 820ms ease-out; }

@keyframes mascot-cheer { 0%,100%{transform:translateY(0) rotate(0)} 35%{transform:translateY(-17px) rotate(-4deg)} 65%{transform:translateY(-6px) rotate(4deg)} }
@keyframes mascot-oops { 25%{transform:translateX(-5px) rotate(-3deg)} 60%{transform:translateX(5px) rotate(3deg)} }
@keyframes rock-transform { 0%{transform:scale(1) rotate(0);opacity:1} 42%{transform:scale(.38) rotate(-13deg);opacity:.25} 62%{transform:scale(.42) rotate(10deg);opacity:.2} 100%{transform:scale(1) rotate(0);opacity:1} }
@keyframes rock-pop { 0%{transform:scale(.72)} 60%{transform:scale(1.1)} 100%{transform:scale(1)} }
@keyframes ring-out { from{opacity:.9;transform:scale(.3)} to{opacity:0;transform:scale(1.35)} }
@keyframes magma-breathe { 50%{transform:scale(1.035) rotate(1deg);filter:brightness(1.08)} }
@keyframes magma-bubble { 0%,100%{transform:translateY(6px) scale(.7);opacity:.55} 50%{transform:translateY(-9px) scale(1.05);opacity:1} }
@keyframes arrow-pulse { 50%{stroke-width:8} }
@keyframes gentle-shake { 20%{transform:translateX(-5px)} 45%{transform:translateX(4px)} 70%{transform:translateX(-2px)} }
@keyframes level-glow { 45%{box-shadow:0 8px 0 rgba(7,47,48,.26),0 0 0 10px rgba(246,189,69,.37),0 22px 42px rgba(0,0,0,.2)} }
@keyframes crystal-burst { 0%{opacity:0;transform:translate(0,0) rotate(0) scale(.2)} 28%{opacity:1} 100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(190deg) scale(1.15)} }

@media (max-height: 735px) { .hud{top:11px}.mascot-panel,.lab-card,.cycle-panel{top:89px;bottom:14px}.lab-card{padding-top:15px;padding-bottom:15px;grid-template-rows:auto minmax(225px,1fr) 28px auto}.mascot-panel img{height:285px}.rock-plinth{width:230px}.action-area{min-height:76px}.choice,.primary{min-height:57px}.cycle-map{min-height:330px} }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; } }
