:root {
  --bg: #F3FBF7;
  --ink: #1F2D3A;
  --muted: #5F6F7D;
  --card: #FFFFFF;
  --line: #D7E8E0;
  --main: #0E8C7A;
  --main-d: #08695B;
  --main-l: #E2F5EF;
  --good: #16A05F;
  --good-l: #E2F6EA;
  --warn: #C46A00;
  --warn-l: #FFF0D2;
  --bad: #D9442A;
  --bad-l: #FFE4DD;
  --sun: #FFB81F;
  --w: #0E8C7A;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Nunito", "Baloo 2", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 600; font-size: 18px; line-height: 1.35; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 900; }
h2 { font-size: 22px; font-weight: 900; }
h3 { font-size: 18px; font-weight: 800; }
.small { font-size: 15px; color: var(--muted); }
[hidden] { display: none !important; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.center { align-items: center; text-align: center; justify-content: center; }

/* buttons */
.btn { border: 0; border-radius: 18px; padding: 14px 20px; background: var(--main); color: #fff; font-weight: 900; font-size: 20px; box-shadow: 0 5px 0 var(--main-d); transition: transform .06s, box-shadow .06s; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--main-d); }
.btn.big { font-size: 24px; padding: 18px 24px; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn.green { background: var(--good); box-shadow: 0 5px 0 #0C7442; }
.btn.sun { background: var(--sun); color: #4A2E00; box-shadow: 0 5px 0 #C98A00; }
.btn.danger { background: var(--bad); box-shadow: 0 5px 0 #A52E19; }
.btn.small { font-size: 16px; padding: 10px 14px; border-radius: 14px; }
.btn:disabled { opacity: .45; }
.link { background: none; border: 0; color: var(--main); text-decoration: underline; font-weight: 800; padding: 6px; }

/* header, nav */
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hi { font-size: 28px; font-weight: 900; }
.sub { color: var(--muted); font-size: 16px; }
.pill { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 900; font-size: 18px; white-space: nowrap; }
.nav { display: flex; gap: 8px; margin-top: 16px; position: sticky; bottom: 0; background: var(--bg); padding-top: 8px; }
.nav button { flex: 1; border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 8px 4px; font-size: 22px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nav button span { font-size: 13px; font-weight: 800; color: var(--muted); }
.nav button.on { border-color: var(--main); background: var(--main-l); }
.nav button.on span { color: var(--main); }

/* home */
.exp { display: block; width: 100%; text-align: left; border: 0; border-radius: 24px; padding: 18px 20px; background: var(--main); color: #fff; box-shadow: 0 6px 0 var(--main-d); position: relative; overflow: hidden; }
.exp::after { content: "🔍"; position: absolute; right: 16px; top: 12px; font-size: 52px; }
.exp .qt { font-size: 26px; font-weight: 900; }
.exp .qs { font-size: 16px; opacity: .92; max-width: 75%; }
.exp .qgo { display: inline-block; margin-top: 12px; background: var(--sun); color: #4A2E00; border-radius: 999px; padding: 8px 18px; font-weight: 900; font-size: 20px; }
.exp.done { background: var(--good-l); color: #0B5E37; box-shadow: none; border: 2px solid #A9E3C3; }
.exp.done::after { content: "🏅"; }
.labs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lab { border: 0; border-radius: 22px; padding: 14px; text-align: left; background: var(--w); color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.18); min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; }
.lab:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.lab .li { font-size: 38px; }
.lab .ln { font-size: 20px; font-weight: 900; }
.lab .ls { font-size: 14px; opacity: .92; }
.bar { height: 8px; background: rgba(255,255,255,.35); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: #fff; }

/* lab list */
.whead { display: flex; align-items: center; gap: 12px; }
.back { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 22px; flex: none; }
.wtitle { font-size: 26px; font-weight: 900; color: var(--w); }
.clist { display: flex; flex-direction: column; gap: 10px; }
.citem { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-radius: 18px; padding: 10px 12px; border: 2px solid var(--line); background: #fff; }
.citem .cs { width: 52px; height: 52px; border-radius: 16px; background: #EEF3F1; display: grid; place-items: center; font-size: 30px; flex: none; position: relative; }
.citem .cn { flex: 1; font-weight: 800; font-size: 18px; }
.citem .cst { font-size: 14px; color: var(--muted); font-weight: 800; }
.cs.new { filter: grayscale(1); opacity: .35; }
.cs.explored { filter: grayscale(.6); }
.cs.remembered::after, .stk.remembered::after { content: "⭐"; position: absolute; right: -6px; top: -8px; font-size: 18px; }

/* flow screens */
.ftop { display: flex; align-items: center; gap: 10px; }
.xbtn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 20px; flex: none; }
.steps { flex: 1; display: flex; gap: 6px; justify-content: center; }
.steps i { font-style: normal; font-size: 13px; font-weight: 900; padding: 4px 10px; border-radius: 999px; background: #E6EFEB; color: var(--muted); }
.steps i.on { background: var(--w); color: #fff; }
.steps i.done { background: #CFE9DF; color: var(--main-d); }
.ctitle { text-align: center; color: var(--w); font-weight: 900; font-size: 15px; }
.bubble { display: flex; gap: 10px; align-items: flex-start; background: #fff; border-radius: 20px; padding: 12px 14px; border: 2px solid var(--line); }
.bubble p { font-size: 20px; font-weight: 800; flex: 1; padding-top: 4px; }
.spk { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--main-l); font-size: 20px; flex: none; }
.bigpic { font-size: 84px; text-align: center; line-height: 1.1; }
.bigpic .ico { width: 96px; height: 96px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 14px 16px; font-size: 21px; font-weight: 900; box-shadow: 0 5px 0 var(--line); display: flex; align-items: center; gap: 10px; text-align: left; }
.opt:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.opt .pic { font-size: 32px; }
.opt .pic .ico { width: 36px; height: 36px; }
.opt.right { border-color: var(--good); background: var(--good-l); box-shadow: 0 5px 0 #9EDDBB; }
.opt.wrong { border-color: #F2A08E; background: var(--bad-l); }
.opt.notsure { font-size: 17px; color: var(--muted); justify-content: center; }
.status { background: #fff; border: 2px dashed #B8DCCF; border-radius: 16px; padding: 10px 14px; font-size: 17px; min-height: 48px; text-align: center; }
.foot { margin-top: auto; display: flex; gap: 10px; justify-content: center; padding-top: 6px; }
.foot .btn { flex: 1; max-width: 300px; }
.result { border-radius: 22px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.result.yes { background: var(--good-l); border: 2px solid #A9E3C3; }
.result.surprise { background: #FFF6DA; border: 2px solid #F3D589; }
.result .rh { font-size: 24px; font-weight: 900; }
.idea { background: #fff; border-radius: 20px; border: 2px solid var(--line); padding: 14px; font-size: 19px; display: flex; gap: 10px; }
.idea b { color: var(--w); }
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.word { border: 2px solid var(--w); background: #fff; color: var(--w); border-radius: 999px; padding: 6px 12px; font-weight: 900; font-size: 16px; }
.reward { align-items: center; text-align: center; }
.sticker { font-size: 96px; animation: pop .4s ease-out; }
.card { background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.card h3 { display: flex; align-items: center; gap: 8px; }
.fact { background: #FFF8E1; border-color: #F3D589; }
.home-act { background: #EAF4FF; border-color: #BCD8F6; }

/* quiz */
.qpic { font-size: 70px; text-align: center; line-height: 1.1; }
.qpic .ico { width: 80px; height: 80px; }
.fb { border-radius: 18px; padding: 12px 14px; font-size: 18px; font-weight: 800; text-align: center; animation: pop .25s ease-out; display: flex; flex-direction: column; gap: 8px; }
.fb.good { background: var(--good-l); color: #0B5E37; border: 2px solid #9EDDBB; }
.fb.warn { background: var(--warn-l); color: #6A4300; border: 2px solid #F1C27A; }
.sortq { display: flex; flex-direction: column; gap: 10px; }
.sort-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sitem { border: 3px solid var(--line); background: #fff; border-radius: 16px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; min-width: 74px; font-size: 13px; font-weight: 800; }
.sitem .pic { font-size: 32px; }
.sitem .pic .ico { width: 34px; height: 34px; }
.sitem.sel { border-color: var(--sun); background: #FFF6DA; transform: scale(1.05); }
.sitem.ok { border-color: var(--good); background: var(--good-l); }
.sitem.no { border-color: var(--bad); background: var(--bad-l); }
.bins { display: grid; gap: 8px; grid-template-columns: repeat(var(--n), 1fr); }
.bin { border: 3px dashed var(--w); background: #fff; border-radius: 18px; min-height: 120px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bin .bh { font-weight: 900; font-size: 16px; display: flex; gap: 4px; align-items: center; }
.bin .bh .pic { font-size: 20px; }
.bin .bh .pic .ico { width: 22px; height: 22px; }
.bin .sitem { min-width: 0; width: 92%; padding: 4px; }
.bin .sitem .pic { font-size: 24px; }
.ordq .slots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.ordq .slot { width: 76px; min-height: 92px; border: 3px dashed var(--line); border-radius: 16px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; position: relative; }
.ordq .slot .n { position: absolute; top: 2px; left: 6px; color: var(--muted); font-size: 12px; }
.ordq .slot.full { border-style: solid; border-color: var(--w); }
.ordq .slot .pic { font-size: 34px; }
.ordq .slot .pic .ico { width: 38px; height: 38px; }
.ordq .slot.ok { border-color: var(--good); background: var(--good-l); }
.ordq .slot.no { border-color: var(--bad); background: var(--bad-l); }
.ordq .pool { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ordq .pool .sitem.used { opacity: .25; pointer-events: none; }

/* journal */
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 8px; font-weight: 900; }
.tabs button.on { background: var(--main); color: #fff; border-color: var(--main); }
.stickers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stk { aspect-ratio: 1; border-radius: 18px; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-size: 38px; position: relative; }
.stk.new { background: #EEF3F1; color: transparent; text-shadow: 0 0 0 #C9D6D0; }
.stk.explored { filter: grayscale(.7); opacity: .6; }
.wrow { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.wrow b { color: var(--main); }
.wrow span { flex: 1; font-size: 15px; }

/* overlays */
.overlay { position: fixed; inset: 0; background: rgba(31,45,58,.55); display: grid; place-items: center; z-index: 50; padding: 20px; }
.ocard { background: #fff; border-radius: 26px; padding: 22px; max-width: 400px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 12px; animation: pop .25s ease-out; }
.ocard .oicon { font-size: 64px; }
.obtns { display: flex; gap: 10px; justify-content: center; }
.obtns .btn { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 16px; font-weight: 800; z-index: 60; max-width: 90vw; text-align: center; animation: pop .2s ease-out; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
.confetti span { position: absolute; top: -40px; font-size: 28px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.shake { animation: shake .3s; }
.logo { font-size: 80px; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; font-weight: 800; }
input[type=text], select { font: inherit; font-size: 20px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: 3px solid #A9DCCB; }
.pic { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.ico { width: 1em; height: 1em; }

/* parent */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.metric .ml { font-size: 13px; color: var(--muted); font-weight: 800; }
.metric .mv { font-size: 24px; font-weight: 900; }
.panel { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row label { font-weight: 800; }
.row select { width: auto; min-width: 120px; font-size: 17px; padding: 8px 10px; }
.bstatus { border-radius: 12px; padding: 10px 12px; font-weight: 800; font-size: 16px; }
.bstatus.ok { background: var(--good-l); color: #0B5E37; }
.bstatus.amber { background: var(--warn-l); color: #6A4300; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.btnrow .btn { flex: 1 1 140px; }
details { border-top: 2px solid #E6F0EC; padding-top: 8px; }
summary { font-weight: 900; cursor: pointer; padding: 4px 0; }
.sk { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; padding: 4px 0; border-bottom: 1px solid #E6F0EC; }
.sk span:last-child { color: var(--muted); white-space: nowrap; }
.todo { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; border-bottom: 1px solid #E6F0EC; padding: 8px 0; }
.todo input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--main); }
.pinpad { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pindots { display: flex; gap: 14px; }
.pindots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--main); }
.pindots i.on { background: var(--main); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 320px; }
.key { height: 60px; border-radius: 16px; border: 2px solid var(--line); background: #fff; font-size: 28px; font-weight: 900; box-shadow: 0 4px 0 var(--line); }
.key.fn { background: #EEF3F1; }
.switch { width: 58px; height: 34px; border-radius: 99px; border: 0; background: #D0D8D4; position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--good); }
.switch.on::after { left: 28px; }

/* ================= experiments ================= */
.sim { display: flex; flex-direction: column; gap: 12px; }
.sim-card { background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 12px; }
.sim-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.sim-tray { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sim-obj { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 6px 8px; font-size: 30px; min-width: 70px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 3px 0 var(--line); }
.sim-obj small { font-size: 12px; font-weight: 800; color: var(--muted); }
.sim-obj .ico { width: 32px; height: 32px; }
.sim-obj.used { opacity: .5; }
.sim-obj:active { transform: translateY(2px); }
.pw { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 900; font-size: 15px; }
.pw.on { background: var(--w); color: #fff; border-color: var(--w); }
.lbl { font-weight: 900; color: var(--muted); font-size: 14px; min-width: 44px; }
.thermo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: var(--muted); }
.thermo input { flex: 1; accent-color: var(--w); height: 30px; }

/* L1 detector */
.det { display: flex; flex-direction: column; gap: 10px; }
.det-top { display: flex; align-items: center; gap: 12px; }
.det-item { font-size: 64px; width: 84px; height: 84px; display: grid; place-items: center; background: #EEF7F2; border-radius: 20px; }
.det-verdict { font-size: 22px; font-weight: 900; color: var(--muted); }
.det-verdict.yes { color: var(--good); }
.det-verdict.no { color: var(--bad); }
.det-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.det-sign { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 12px; background: #F1F4F3; font-size: 14px; transition: background .2s; }
.det-sign span { font-size: 22px; filter: grayscale(1); opacity: .5; }
.det-sign.on { background: var(--good-l); }
.det-sign.on span { filter: none; opacity: 1; }
.det-sign.off { background: var(--bad-l); }

/* L2 senses */
.sense { text-align: center; }
.sense-e { font-size: 80px; }
.sense-t { font-size: 20px; font-weight: 900; }
.sense-btns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sense-b { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 8px 2px; font-size: 13px; font-weight: 900; display: flex; flex-direction: column; align-items: center; }
.sense-b span { font-size: 30px; }
.sense-b.flash { background: var(--good-l); border-color: var(--good); }
.sense-count { text-align: center; color: var(--muted); font-size: 14px; }

/* L3 plants */
.pots { display: flex; gap: 8px; justify-content: center; }
.pot { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 130px; }
.pot-box { position: relative; width: 100%; height: 150px; background: #EAF7FF; border-radius: 14px 14px 0 0; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.pot-box.dark { background: #2A2F3A; }
.pot-dark { position: absolute; top: 6px; right: 8px; font-size: 22px; }
.plant { width: 90px; height: 126px; }
.pot-pot { width: 70%; height: 30px; background: #C46A3A; border-radius: 0 0 14px 14px; border-top: 6px solid #8A4A23; }
.pot-tg { display: flex; gap: 4px; }
.tg { width: 44px; height: 40px; border-radius: 12px; border: 2px solid var(--line); background: #F1F4F3; font-size: 20px; filter: grayscale(1); opacity: .5; }
.tg.on { filter: none; opacity: 1; background: #fff; border-color: var(--w); }
.pot-l { font-size: 12px; font-weight: 800; text-align: center; color: var(--muted); min-height: 32px; }
.daycount { font-weight: 900; font-size: 20px; color: var(--w); min-width: 70px; }

/* L4 life cycles */
.lc-tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.lc-tab { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 4px 8px; font-size: 26px; display: flex; flex-direction: column; align-items: center; }
.lc-tab small { font-size: 11px; font-weight: 800; }
.lc-tab.on { border-color: var(--w); background: var(--main-l); }
.lc { text-align: center; }
.lc-big { font-size: 90px; line-height: 1.1; }
.lc-big .ico { width: 100px; height: 100px; }
.lc-name { font-size: 24px; font-weight: 900; color: var(--w); }
.lc-ring { display: flex; align-items: center; justify-content: center; gap: 2px; flex-wrap: wrap; margin-top: 6px; }
.lc-ring span { font-size: 26px; opacity: .35; }
.lc-ring span .ico { width: 28px; height: 28px; }
.lc-ring span.on { opacity: 1; transform: scale(1.2); }
.lc-ring i { font-style: normal; color: var(--muted); }
.lc-slider { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.lc-slider input { flex: 1; accent-color: var(--w); height: 34px; }

/* L5 habitats */
.hab-q { display: flex; align-items: center; gap: 12px; justify-content: center; }
.hab-a { font-size: 64px; }
.hab-t { font-size: 20px; font-weight: 900; }
.hab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hab-z { min-height: 110px; border-radius: 18px; border: 3px solid rgba(0,0,0,.08); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px; font-size: 16px; }
.hab-in { display: flex; flex-wrap: wrap; justify-content: center; font-size: 30px; }
.hab-in .pop { animation: pop .4s ease-out; }
.z-ocean { background: #9FD3F5; }
.z-desert { background: #F5D99A; }
.z-ice { background: #EAF6FC; }
.z-forest { background: #A9DD9B; }

/* M1 tank */
.tank { position: relative; height: 230px; border-radius: 10px 10px 22px 22px; border: 4px solid #9CC6E0; border-top: 0; background: linear-gradient(#F3FBFF 0 22%, transparent 22%); overflow: hidden; }
.tank .water { position: absolute; left: 0; right: 0; bottom: 0; top: 30%; background: linear-gradient(#7CC4F0, #3E95D6); opacity: .75; }
.drop { position: absolute; font-size: 34px; transition: top 1s cubic-bezier(.3,.6,.4,1); display: flex; flex-direction: column; align-items: center; transform: translateX(-50%); z-index: 2; }
.drop small { font-size: 11px; font-weight: 900; background: #fff; border-radius: 8px; padding: 0 5px; }
.drop.bob { animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, 5px); } }

/* M2 particles */
.smg { align-items: stretch; flex-wrap: nowrap; }
.pbox { position: relative; flex: 1; height: 190px; border: 4px solid #8BB8D4; border-top-width: 2px; border-radius: 8px 8px 18px 18px; background: #F5FBFF; overflow: hidden; }
.pt { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #3E95D6; transition: left .8s, top .8s; }
.pbox.solid .pt { background: #6FB6E8; animation: jig .25s infinite alternate; transition: left .6s, top .6s; }
.pbox.liquid .pt { background: #2F86D6; transition: left .9s ease-in-out, top .9s ease-in-out; }
.pbox.gas .pt { background: #A9C8DE; transition: left .45s linear, top .45s linear; }
@keyframes jig { to { transform: translate(1.5px, -1.5px); } }
.pstate { width: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #fff; border: 2px solid var(--line); border-radius: 18px; }
.pbig { font-size: 52px; }
.pname { font-size: 20px; }
.pkind { color: var(--muted); font-weight: 900; font-size: 15px; text-transform: uppercase; }
.ptemp { text-align: center; font-weight: 900; font-size: 22px; color: var(--w); }

/* M3 colours */
.paints { display: flex; gap: 10px; justify-content: center; }
.paint { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 900; text-transform: capitalize; }
.paint i { width: 46px; height: 40px; border-radius: 6px 6px 16px 16px; background: var(--c); border: 2px solid rgba(0,0,0,.15); }
.paint.sel { border-color: var(--ink); transform: translateY(-4px); }
.bowlwrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bowl { width: 200px; height: 110px; border-radius: 0 0 110px 110px; background: #fff; border: 4px solid #C7D3CE; border-top: 0; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.mixc { width: 180px; height: 0; border-radius: 0 0 100px 100px; transition: height .4s, background .4s; }
.mixc.in, .mixc.swirl { height: 80px; }
.mixc:not(.in):not(.swirl) { height: 90px; }
.mixc.swirl { animation: swirl .5s linear infinite; }
@keyframes swirl { to { filter: hue-rotate(40deg); transform: rotate(360deg) scale(1.2); } }
.mixname { font-size: 20px; font-weight: 900; text-align: center; }
.made { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.made span { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 800; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 4px; }
.made span i { width: 20px; height: 20px; border-radius: 50%; background: var(--c); }

/* M4 dissolving */
.beaker { position: relative; width: 150px; height: 190px; border: 4px solid #A9C9DA; border-top: 0; border-radius: 0 0 22px 22px; background: #F7FCFF; overflow: hidden; flex: none; }
.gwater { position: absolute; left: 0; right: 0; bottom: 0; top: 18%; background: rgba(124,196,240,.45); transition: background .4s; }
.gwater.warm { background: rgba(255,205,175,.45); }
.gbits { position: absolute; inset: 0; }
.grain { position: absolute; width: 6px; height: 6px; border-radius: 2px; transition: top .9s ease-in, left .9s, opacity 1s; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.oillayer { position: absolute; left: 0; right: 0; top: 18%; height: 0; background: #F4D35E; opacity: .9; transition: height .8s; }
.oillayer.in { height: 14%; }
.oillayer.blobs { height: 6%; box-shadow: 0 40px 0 -10px #F4D35E, 30px 70px 0 -14px #F4D35E; }
.spoon { position: absolute; top: -6px; left: 50%; font-size: 40px; transform: rotate(160deg); transform-origin: center 70%; }
.spoon.go { animation: stir .5s linear infinite; }
@keyframes stir { 0% { transform: translateX(-30px) rotate(160deg); } 50% { transform: translateX(10px) rotate(200deg); } 100% { transform: translateX(-30px) rotate(160deg); } }
.gside { display: flex; flex-direction: column; gap: 8px; }

/* F1 push and pull */
.pitch { position: relative; height: 90px; background: linear-gradient(#BFE7A8, #8CCB6E); border-radius: 18px; overflow: hidden; }
.pitch .kid { position: absolute; left: 2%; bottom: 10px; font-size: 40px; }
.pitch .ball { position: absolute; left: 14%; bottom: 12px; font-size: 30px; }
.marks span { position: absolute; bottom: 0; transform: translateX(-30%); font-size: 11px; font-weight: 900; background: #fff; border-radius: 6px; padding: 0 4px; }
.power { gap: 6px; }
.cartrow { display: flex; align-items: center; gap: 4px; background: #F1F4F3; border-radius: 18px; padding: 6px; }
.cartrow .kid2 { font-size: 34px; }
.ctrack { position: relative; flex: 1; height: 50px; border-bottom: 4px solid #B9C4BF; }
.cart { position: absolute; bottom: 0; font-size: 36px; transition: left .6s ease-out; transform: translateX(-50%); }

/* F2 ramps */
.ramp { width: 100%; background: #F7FBFF; border-radius: 18px; border: 2px solid var(--line); }

/* F3 magnets */
.mag-area { position: relative; padding-top: 70px; }
.magnet { position: absolute; top: 4px; left: 40%; font-size: 44px; transform: rotate(180deg); transition: left .4s, top .4s; z-index: 2; }
.magnet.down { top: 14px; }
.mag-tray { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mag-o { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 6px 2px; font-size: 30px; display: flex; flex-direction: column; align-items: center; transition: transform .35s; }
.mag-o small { font-size: 11px; font-weight: 800; color: var(--muted); text-align: center; }
.mag-o .ico { width: 32px; height: 32px; }
.mag-o.lift { transform: translateY(-34px); border-color: var(--good); }
.mag-o.wiggle { animation: shake .4s 2; }
.mag-o.used { background: #F6FAF8; }
.bars { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.barrow { display: flex; gap: 70px; justify-content: center; width: 100%; }
.barrow .bar { display: flex; height: 34px; width: 110px; border-radius: 6px; overflow: hidden; margin: 0; background: none; transition: transform .5s cubic-bezier(.3,1.4,.5,1); }
.barrow .bar b { flex: 1; display: grid; place-items: center; color: #fff; font-weight: 900; }
.barrow .bar .n { background: #E2563B; }
.barrow .bar .s { background: #3B78E2; }
.barrow .b2.flip { flex-direction: row-reverse; }
.barrow .b2.near { transform: translateX(-70px); }
.barrow .b2.away { transform: translateX(40px); }

/* F4 circuit */
.circuit { width: 100%; background: #FBFDFC; border-radius: 18px; border: 2px solid var(--line); }
.circuit .wire { stroke: #C0392B; stroke-width: 5; stroke-linejoin: round; }
.circuit .batt { fill: #3C4350; }
.circuit .batt-top { fill: #9AA3AD; }
.circuit .bt { fill: #fff; font-size: 12px; font-weight: 900; }
.circuit .glass { fill: #F1F1E6; stroke: #B0B0A0; stroke-width: 2; transition: fill .3s; }
.circuit .rays line { stroke: #FFC21A; stroke-width: 3; stroke-linecap: round; opacity: 0; transition: opacity .3s; }
.circuit.lit .glass { fill: #FFE45C; stroke: #E0A800; }
.circuit.lit .rays line { opacity: 1; }
.circuit .lever { stroke: #333; stroke-width: 4; stroke-linecap: round; }
.circuit .gaplbl { font-size: 11px; font-weight: 800; fill: var(--muted); }
.gapobj { width: 56px; height: 56px; display: grid; place-items: center; font-size: 34px; }
.gapobj .ico { width: 38px; height: 38px; }

/* S1 day and night */
.earth { width: 100%; background: #10203A; border-radius: 18px; }
.earth .sunrays line { stroke: #FFC21A; stroke-width: 3; stroke-linecap: round; }
.earth .beams { stroke: #FFE58A; stroke-width: 2; stroke-dasharray: 6 6; fill: none; }
.earth .planet { transition: transform .8s ease-in-out; }
.earth .nightside { fill: #000; fill-opacity: .55; }
.skybox { display: flex; align-items: center; gap: 12px; justify-content: center; border-radius: 18px; padding: 12px; font-size: 20px; transition: background .5s, color .5s; }
.skybox .skyicon { font-size: 40px; }
.skybox.day { background: #BEE6FF; }
.skybox.dusk { background: #FFC994; }
.skybox.night { background: #23305A; color: #fff; }

/* S2 shadows */
.shadow { width: 100%; background: #2D3140; border-radius: 18px; }
.shadow .beam { fill: #FFF3B0; fill-opacity: .35; }
.shadow .shad { fill: #1B1E28; }

/* S3 sound */
.strings { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; background: #FFF4E5; border-radius: 18px; padding: 12px; }
.str { border: 0; background: none; padding: 8px 0; display: flex; align-items: center; gap: 8px; width: 100%; }
.str i { display: block; width: var(--w); max-width: 80%; height: 4px; background: #8A5A2B; border-radius: 2px; }
.str small { font-weight: 900; color: var(--muted); }
.str.vib i { animation: vib .06s linear 10 alternate; }
@keyframes vib { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
.drumwrap { display: flex; align-items: center; gap: 16px; justify-content: center; }
.drum { position: relative; font-size: 70px; width: 110px; height: 110px; display: grid; place-items: center; }
.drum .ring { position: absolute; inset: 20px; border: 3px solid #E2563B; border-radius: 50%; opacity: 0; }
.drum.soft { animation: shake .15s 2; }
.drum.hard { animation: shake .08s 6; }
.drum.soft .r1 { animation: ring .8s ease-out; }
.drum.hard .ring { animation: ring 1s ease-out; }
.drum.hard .r2 { animation-delay: .15s; }
.drum.hard .r3 { animation-delay: .3s; }
@keyframes ring { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: scale(1.8); } }
.drumbtns { display: flex; flex-direction: column; gap: 8px; }

/* S4 water cycle */
.wc { width: 100%; border-radius: 18px; border: 2px solid var(--line); }
.wc .wsun { cursor: pointer; }
.wc .glow { opacity: 0; }
.wc.s0 .wsun { animation: pulse 1.2s infinite; transform-origin: 50px 45px; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.wc .wisp { stroke: #BFDDF2; stroke-width: 4; fill: none; stroke-linecap: round; opacity: 0; }
.wc.s1 .wisp, .wc.s2 .wisp { animation: rise 1.6s linear infinite; }
.wc .w1 { animation-delay: .5s !important; }
.wc .w2 { animation-delay: 1s !important; }
@keyframes rise { from { opacity: .9; transform: translateY(0); } to { opacity: 0; transform: translateY(-70px); } }
.wc.s1 .glow, .wc.s2 .glow { opacity: 1; }
.wc .wcloud ellipse { fill: #fff; transition: fill .6s; }
.wc .wcloud { cursor: pointer; transform-origin: 200px 50px; transition: transform .6s; }
.wc.s1 .wcloud { animation: pulse 1.2s infinite; }
.wc.s2 .wcloud, .wc.s3 .wcloud { transform: scale(1.25); }
.wc.s2 .wcloud ellipse { fill: #B9C3CC; }
.wc.s3 .wcloud ellipse { fill: #8E9AA6; }
.wc .rdrop { stroke: #2F86D6; stroke-width: 3; stroke-linecap: round; opacity: 0; }
.wc.s3 .rdrop, .wc.s4 .rdrop { animation: rain .7s linear infinite; }
.wc .d1 { animation-delay: .15s !important; }
.wc .d2 { animation-delay: .3s !important; }
.wc .d3 { animation-delay: .45s !important; }
@keyframes rain { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(40px); } }
.wc.s4 .rdrop { animation: none; }
.wc .river, .wc .riverhit { cursor: pointer; }
.wc.s3 .river { stroke-dasharray: 4 10; animation: pulse 1.2s infinite; }
.wc.s4 .river { stroke-dasharray: 12 8; animation: flow .8s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -40; } }
.wc .wl { font-size: 12px; font-weight: 900; fill: #1F2D3A; opacity: 0; transition: opacity .4s; }
.wc.s1 .l0, .wc.s2 .l0, .wc.s3 .l0, .wc.s4 .l0 { opacity: 1; }
.wc.s2 .l1, .wc.s3 .l1, .wc.s4 .l1 { opacity: 1; }
.wc.s3 .l2, .wc.s4 .l2 { opacity: 1; }
.wc.s4 .l3 { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; }
}
