:root {
  --ink: #172d35;
  --muted: #60747a;
  --paper: #fffaf0;
  --cyan: #bcecf2;
  --green: #62b84e;
  --orange: #ff6a21;
  --yellow: #ffc843;
  --red: #d74728;
  font-family: Inter, ui-rounded, "Avenir Next", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cyan);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 4px solid #1675a8; outline-offset: 4px; }
[hidden] { display: none !important; }
.game { position: relative; width: 100%; height: 100%; min-width: 680px; overflow: hidden; background: linear-gradient(#bcecf2 0 67%, #f4e1b9 67%); isolation: isolate; }
.game::before { position: absolute; inset: 0; content: ""; opacity: .22; pointer-events: none; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 14px 14px; mix-blend-mode: soft-light; }
.game.is-rumbling .volcano-stage { animation: rumble .12s linear infinite; }
.game.is-whoa::after { position: absolute; z-index: 45; inset: 0; content: ""; pointer-events: none; background: rgba(4, 31, 43, .35); animation: night-flash 1.35s ease-out both; }

.mission { position: absolute; z-index: 20; left: 24px; top: 22px; width: 326px; min-height: 108px; padding: 15px 19px; border: 2px solid rgba(27, 71, 75, .14); border-radius: 19px; background: rgba(255,250,240,.96); box-shadow: 0 8px 0 rgba(58,108,101,.12), 0 18px 38px rgba(36,87,86,.12); }
.mission > span { color: #18816e; font-size: 11px; font-weight: 950; letter-spacing: .13em; text-transform: uppercase; }
.mission h1 { margin: 3px 0 1px; font-size: 28px; line-height: 1.03; letter-spacing: -.045em; }
.mission p { margin: 5px 0 0; color: var(--muted); font-size: 13px; font-weight: 720; }
.compare { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.compare i { width: 62px; height: 7px; overflow: hidden; border-radius: 10px; background: linear-gradient(90deg, var(--yellow) var(--last-size, 42%), #d9dfd8 var(--last-size, 42%)); }
.compare b { color: var(--orange); }
.mute { position: absolute; z-index: 25; right: 20px; top: 20px; width: 48px; height: 48px; border: 2px solid rgba(22,73,78,.16); border-radius: 50%; color: #1e5e62; background: rgba(255,255,255,.86); box-shadow: 0 7px 18px rgba(27,74,76,.12); font-size: 21px; font-weight: 950; }
.mute .sound-off { display: none; }.mute[aria-pressed="true"] .sound-on { display: none; }.mute[aria-pressed="true"] .sound-off { display: inline; }

.volcano-stage { position: absolute; z-index: 2; left: 3%; top: 10%; width: min(72%, 760px); aspect-ratio: 3 / 2; transform-origin: 52% 75%; }
.cutaway { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 15px rgba(66,82,61,.18)); user-select: none; }
.magma-art { position: absolute; z-index: 2; left: 30.4%; top: 30%; width: 39%; height: 65%; object-fit: contain; opacity: var(--magma-opacity, .06); transform: scaleY(var(--magma-scale, .42)); transform-origin: 50% 92%; filter: saturate(1.18) contrast(1.12); transition: opacity .15s ease, transform .2s ease, filter .2s ease; pointer-events: none; }
.magma-mask { position: absolute; z-index: 3; left: 47.2%; bottom: 21%; width: 5.5%; height: 46%; overflow: hidden; border-radius: 80% 80% 10px 10px; transform-origin: bottom; pointer-events: none; }
.magma-mask i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--magma-height, 0%); border-radius: 999px 999px 8px 8px; background: linear-gradient(90deg, #f4521f, #ffe04e 45%, #ff6d20 82%); box-shadow: 0 0 19px #ff7526, inset 4px 0 6px rgba(255,224,91,.7); transition: height .22s cubic-bezier(.2,.8,.2,1); }
.gas-bubbles { position: absolute; z-index: 5; left: 36%; top: 58%; width: 28%; height: 25%; pointer-events: none; }
.gas-bubbles i { position: absolute; width: var(--size); height: var(--size); left: var(--x); bottom: var(--y); border: 2px solid rgba(255,247,159,.9); border-radius: 50%; background: rgba(255,191,43,.28); box-shadow: 0 0 9px #ff9e27; animation: bubble 1.3s ease-in-out infinite alternate; animation-delay: var(--delay); }
.eruption-art { position: absolute; z-index: 14; left: 26%; top: -29%; width: 48%; opacity: 0; transform: scale(.2) translateY(38%); transform-origin: 50% 93%; filter: saturate(1.2) contrast(1.1); pointer-events: none; }
.eruption-art.is-erupting { animation: erupt 1.35s cubic-bezier(.12,.84,.23,1) both; }
.eruption-art.is-gentle { width: 35%; left: 32.5%; top: -2%; animation-name: gentle-erupt; }
.ash-cloud { position: absolute; z-index: 13; left: 39%; top: 1%; width: 22%; aspect-ratio: 1; opacity: 0; border-radius: 50%; background: radial-gradient(circle at 30% 52%, #5a5d59 0 22%, transparent 23%), radial-gradient(circle at 57% 35%, #414746 0 27%, transparent 28%), radial-gradient(circle at 67% 65%, #686a62 0 24%, transparent 25%); pointer-events: none; }
.ash-cloud.is-showing { animation: ash 1.4s ease-out both; }

.part { position: absolute; z-index: 9; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: #163b3e; }
.part i { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; border: 3px solid #fff; border-radius: 50%; background: #15947d; box-shadow: 0 0 0 8px rgba(21,148,125,.2); transform: translate(-50%,-50%); animation: pulse 1.2s ease-in-out infinite; }
.part span { position: absolute; left: 50%; top: 50%; width: max-content; padding: 7px 10px; border-radius: 10px 10px 10px 3px; background: #fff; box-shadow: 0 7px 18px rgba(25,64,64,.18); font-size: 12px; font-weight: 900; opacity: 0; transform: translate(12px,-45%); transition: opacity .15s ease, transform .15s ease; }
.part.is-found i { background: var(--yellow); box-shadow: 0 0 0 7px rgba(255,200,67,.2); animation: none; }
.part.is-found span { opacity: 1; transform: translate(17px,-45%); }
.part-crater { left: 46%; top: 6%; }.part-vent { left: 46%; top: 38%; }.part-chamber { left: 46%; top: 73%; }.part-layers { left: 19%; top: 55%; }
.game:not([data-level="L1"]) .part { pointer-events: none; }.game:not([data-level="L1"]) .part i { display: none; }
.game:not([data-level="L1"]) .part span { opacity: 0; }

.prediction { position: absolute; z-index: 18; left: 8%; bottom: -15%; width: 54%; padding: 10px 14px 12px; border: 2px solid rgba(20,89,91,.15); border-radius: 16px; background: rgba(255,250,240,.97); box-shadow: 0 8px 20px rgba(37,73,70,.14); }
.prediction label { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 900; }
.prediction label span { color: var(--muted); }.prediction label strong { color: #d75025; }
input[type="range"] { width: 100%; height: 28px; margin: 3px 0 -4px; accent-color: var(--orange); cursor: grab; }
input[type="range"]:active { cursor: grabbing; }

.controls { position: absolute; z-index: 16; right: 23px; bottom: 24px; width: 282px; padding: 17px; border: 2px solid rgba(72,69,48,.15); border-radius: 23px; background: rgba(255,250,240,.97); box-shadow: 0 10px 0 rgba(97,82,45,.12), 0 24px 50px rgba(56,73,61,.18); }
.control-readout { padding: 1px 2px 13px; }.control-readout > span, .heat-control > span { color: var(--muted); font-size: 10px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.pressure-track { position: relative; height: 13px; margin: 8px 0 5px; overflow: hidden; border-radius: 99px; background: #dfe6df; box-shadow: inset 0 2px 4px rgba(42,51,41,.16); }
.pressure-track i { display: block; width: var(--pressure, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #65c879, var(--yellow) 55%, var(--orange) 78%, var(--red)); transition: width .18s ease-out; }
.pressure-track b { position: absolute; left: var(--pressure, 0%); top: -3px; width: 3px; height: 19px; background: #18383a; transform: translateX(-2px); transition: left .18s ease-out; }
.control-readout > strong { color: #1f7668; font-size: 13px; }
.heat-control { position: relative; display: block; padding: 10px 12px 7px; border: 1px solid rgba(209,98,34,.18); border-radius: 14px; background: #fff3d5; }
.heat-control i { position: absolute; right: 13px; top: 8px; color: var(--orange); font-style: normal; }
.pump { position: relative; width: 100%; min-height: 82px; margin-top: 12px; padding: 10px 12px 9px 78px; border: 0; border-radius: 15px; color: #17373b; background: #dceff0; box-shadow: 0 6px 0 #8abfc1; text-align: left; transition: transform .12s ease, box-shadow .12s ease; }
.pump:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #8abfc1; }.pump:active, .pump.is-pumping { transform: translateY(5px); box-shadow: 0 1px 0 #8abfc1; }
.pump > span { position: absolute; left: 20px; bottom: 12px; width: 42px; height: 43px; border: 5px solid #20585e; border-radius: 8px; background: #64aeb5; }
.pump > span::before { position: absolute; left: 9px; bottom: 34px; width: 14px; height: 30px; content: ""; border: 5px solid #20585e; border-bottom: 0; border-radius: 7px 7px 0 0; }
.pump strong, .pump small { display: block; }.pump strong { font-size: 14px; }.pump small { margin-top: 3px; color: #547276; font-size: 11px; font-weight: 800; }
.release { width: 100%; min-height: 53px; margin-top: 13px; padding: 8px 14px; border: 0; border-radius: 14px; color: #402617; background: var(--yellow); box-shadow: 0 6px 0 #c48324; font-weight: 950; transition: transform .12s ease; }
.release:hover { transform: translateY(-2px); }.release:active { transform: translateY(5px); }.release span { margin-right: 8px; }

.toast { position: absolute; z-index: 60; left: 42%; bottom: 25px; max-width: 390px; padding: 11px 16px; border-radius: 999px; color: #fff; background: #173b3e; box-shadow: 0 10px 25px rgba(20,51,51,.28); font-size: 13px; font-weight: 850; opacity: 0; transform: translate(-50%, 12px); transition: .18s ease; pointer-events: none; }
.toast.is-showing { opacity: 1; transform: translate(-50%,0); }
.success, .finish { position: absolute; z-index: 80; left: 50%; top: 50%; width: min(440px, 55vw); padding: 29px 33px 28px; border: 2px solid rgba(255,255,255,.56); border-radius: 28px; color: #fff; background: rgba(18,55,57,.96); box-shadow: 0 30px 90px rgba(21,49,46,.46); text-align: center; transform: translate(-50%,-50%); }
.success::before, .finish::before { position: fixed; z-index: -1; inset: -100vh -100vw; content: ""; background: rgba(18,48,47,.28); }
.success-mark, .finish-icon { display: grid; width: 66px; height: 66px; margin: -2px auto 14px; place-items: center; border-radius: 50%; color: #29431d; background: var(--yellow); box-shadow: 0 0 0 11px rgba(255,200,67,.12); font-size: 33px; font-weight: 950; animation: pop .45s cubic-bezier(.2,.9,.25,1.25); }
.success small, .finish small { color: #8fe0ba; font-size: 11px; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.success h2, .finish h2 { margin: 5px 0 8px; font-size: 33px; line-height: 1.05; letter-spacing: -.045em; }.success p, .finish p { margin: 0 auto 21px; max-width: 340px; color: #d6e7e3; font-size: 14px; line-height: 1.5; }
.success button, .finish button { min-width: 190px; min-height: 51px; padding: 10px 18px; border: 0; border-radius: 14px; color: #153536; background: var(--yellow); box-shadow: 0 6px 0 #c38426; font-weight: 950; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes pulse { 50% { box-shadow: 0 0 0 15px rgba(21,148,125,0); transform: translate(-50%,-50%) scale(1.08); } }
@keyframes bubble { to { transform: translateY(-8px) scale(1.12); opacity: .7; } }
@keyframes rumble { 25% { transform: translate(2px,-1px) rotate(.12deg); } 75% { transform: translate(-2px,1px) rotate(-.12deg); } }
@keyframes erupt { 0% { opacity: 0; transform: scale(.2) translateY(38%); } 18% { opacity: 1; } 60% { opacity: 1; transform: scale(1.08) translateY(0); } 100% { opacity: 0; transform: scale(1.16) translateY(-8%); } }
@keyframes gentle-erupt { 0% { opacity: 0; transform: scale(.2) translateY(34%); } 24% { opacity: .95; } 65% { opacity: .9; transform: scale(.68) translateY(3%); } 100% { opacity: 0; transform: scale(.72) translateY(-5%); } }
@keyframes ash { 0% { opacity: 0; transform: translateY(50px) scale(.3); } 45% { opacity: .82; } 100% { opacity: 0; transform: translateY(-90px) scale(1.5); } }
@keyframes pop { from { opacity: 0; transform: scale(.4) rotate(-15deg); } }
@keyframes night-flash { 0% { opacity: 0; } 24% { opacity: 1; } 100% { opacity: 0; } }
@media (max-height: 720px) { .volcano-stage { top: 6%; width: min(68%, 700px); }.controls { bottom: 15px; }.mission { top: 14px; }.prediction { bottom: -9%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
