:root{--ink:#1f3939;--forest:#173a3a;--jade:#1c7d75;--mint:#77c5a9;--cream:#f6f3ed;--paper:#faf8f3;--line:#d9dfd9;--red:#d0644d;--gold:#e2ab5a;--shadow:0 24px 70px rgba(28,50,47,.19)}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#ceded8;color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.6}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #74c6aa;outline-offset:2px}#world{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none}.vignette{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse at 50% 50%,transparent 44%,rgba(35,74,68,.15) 100%);z-index:1}.hidden{display:none!important}.glass{background:rgba(255,255,250,.84);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 13px 36px rgba(26,60,54,.11);border:1px solid rgba(255,255,255,.83)}.topbar{position:fixed;top:0;left:0;right:0;z-index:10;height:97px;display:flex;align-items:center;padding:16px 34px;gap:26px;background:linear-gradient(180deg,rgba(247,249,244,.98),rgba(250,250,246,.86));border-bottom:1px solid rgba(83,109,99,.13)}.brand{display:flex;align-items:center;gap:13px;min-width:282px}.mark{background:#224c49;border-radius:15px;color:#d5f1df;font-size:29px;display:grid;place-items:center;width:47px;height:47px}.brand b{display:block;font-size:15px;font-weight:900;letter-spacing:.08em}.brand b span{font-weight:550;color:#79938a}.brand small,.topstats small{display:block;font-size:9px;font-weight:800;color:#87a09a;letter-spacing:.15em;margin-top:5px}.topstats{display:flex;gap:37px;margin-left:auto}.stat strong{display:block;color:#294e49;font-size:19px;letter-spacing:.03em;font-variant-numeric:tabular-nums;margin-top:5px}.stat em{font-size:13px;font-style:normal;font-weight:500;color:#94a9a1}.icon-btn{background:transparent;border:1px solid #d5e0d9;border-radius:50%;height:35px;width:35px;color:#44655e;font-size:18px;font-weight:650}.hud{position:fixed;inset:0;pointer-events:none;z-index:5}.mission-card{pointer-events:auto;position:absolute;top:118px;left:30px;width:308px;padding:25px;border-radius:18px}.eyebrow{font-size:10px;font-weight:900;letter-spacing:.18em;color:#869e94}.mini-dot,.online{display:inline-block;width:7px;height:7px;border-radius:50%;background:#68b59d;margin-right:6px}.mission-number{font-size:10px;letter-spacing:.14em;font-weight:800;color:#3d8b7a;margin:26px 0 7px}.mission-card h1{font-size:25px;line-height:1.09;letter-spacing:-.05em;margin:0;max-width:260px;font-weight:820}.mission-card p{font-size:12px;line-height:1.75;color:#71877f;margin:13px 0 20px}.mission-footer{display:flex;align-items:center;gap:14px}.mission-footer span{font-size:9px;letter-spacing:.13em;font-weight:900;white-space:nowrap;background:#e6eee9;padding:7px 10px;border-radius:6px}.progress{height:5px;background:#e1e9e2;flex:1;min-width:38px;border-radius:20px;overflow:hidden}.progress div{height:100%;width:0;background:#6eaf99;transition:width .3s;border-radius:20px}.controls{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);border-radius:50px;display:flex;align-items:center;gap:16px;padding:10px 18px;white-space:nowrap}.controls span{font-size:10px;font-weight:700;letter-spacing:.02em;color:#758c85}.controls kbd{font-family:inherit;display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:20px;margin:0 1px;padding:2px 5px;font-size:9px;background:white;border:1px solid #dde5df;border-bottom:2px solid #c6d4cb;border-radius:5px;color:#44665e}.floating-tip{position:absolute;bottom:94px;left:50%;transform:translateX(-50%);border-radius:30px;padding:10px 18px;background:rgba(26,58,55,.78);color:#e7f5ed;font-size:11px;font-weight:650;letter-spacing:.01em}.context{position:fixed;bottom:168px;left:50%;transform:translateX(-50%);display:flex;gap:13px;align-items:center;z-index:11;border-radius:13px;background:#233f3c;box-shadow:var(--shadow);color:white;padding:11px 19px 11px 10px;pointer-events:none}.context-key{width:33px;height:33px;border-radius:9px;background:#e4f3df;color:#285b4c;display:grid;place-items:center;font-weight:900}.context strong{display:block;font-size:11px;letter-spacing:.06em}.context small{color:#9bc6b6;display:block;font-size:10px;margin-top:2px}.toasts{position:fixed;left:50%;top:110px;transform:translateX(-50%);z-index:60;pointer-events:none;display:flex;align-items:center;flex-direction:column;gap:8px}.toast{background:#244c48;color:white;max-width:min(590px,90vw);border-radius:12px;box-shadow:0 16px 40px #1c3f3c55;padding:12px 21px;font-size:12px;line-height:1.5;animation:toastIn .3s both}.toast.bad{background:#9a4c43}.toast.good{background:#236f60}@keyframes toastIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.right-panel{position:fixed;z-index:25;right:0;top:0;bottom:0;width:min(425px,96vw);background:#fafbf7;box-shadow:-24px 0 90px #27473a30;transform:translateX(105%);transition:transform .34s cubic-bezier(.22,.8,.22,1);border-left:1px solid #e9eee7;display:flex;flex-direction:column}.right-panel.open{transform:translateX(0)}.panel-head{height:94px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:25px 28px;border-bottom:1px solid #e3eae4}.panel-mini{font-size:10px;font-weight:900;letter-spacing:.12em;color:#35564b}.panel-mini span{color:#a3b3ab;font-weight:650}.x-btn{font-size:26px;border:0;color:#86a196;background:transparent}.panel-body{overflow:auto;flex:1;display:flex;flex-direction:column;padding:29px 28px 23px}.panel-body h2{font-size:29px;line-height:1.1;margin:8px 0 11px;letter-spacing:-.055em;font-weight:800}.book-icon{display:grid;place-items:center;background:#eaf2e9;color:#47816e;width:57px;height:57px;font-size:33px;border-radius:14px;margin-bottom:26px}.accent{color:#4a957b}.muted{font-size:12px;color:#82958c;line-height:1.8;margin-top:0}.tab-row{display:flex;gap:7px;margin:20px 0 13px}.tab{border:1px solid #dce5da;background:#f2f5f0;color:#819589;border-radius:8px;padding:10px 13px;font-size:11px;font-weight:820}.tab.selected{background:#244e49;color:#fff;border-color:#244e49}.book-page{background:#fff;border:1px solid #e4e9e0;border-radius:13px;min-height:230px;padding:19px 18px;box-shadow:0 4px 16px #203f2b0b}.book-page h3{font-size:18px;margin:0 0 10px}.book-page .book-sub{font-size:10px;color:#6fa38f;font-weight:800;letter-spacing:.1em}.book-page p{font-size:12px;line-height:1.72;color:#5c7468}.book-page ol{padding-left:17px;font-size:12px;line-height:1.8;color:#48675d}.book-page li{margin:7px 0}.book-page .cite{font-size:10px;display:block;color:#4a8d78;word-break:break-word}.book-page .research{height:6px;background:#e0eae0;border-radius:8px;overflow:hidden;margin:18px 0}.book-page .research>div{height:100%;width:0%;background:#58a58d;border-radius:8px;transition:width .12s linear}.footnote{color:#9aaba1;font-size:10px;line-height:1.6;padding-top:22px;margin-top:auto}.chat-body{padding:24px 0 0}.chat-header{display:flex;align-items:center;gap:13px;padding:0 25px}.chat-header h2{margin:0 0 4px;font-size:26px}.chat-header small{font-size:9px;color:#7e998b;letter-spacing:.08em;font-weight:800}.avatar{width:49px;height:49px;background:#255950;color:#d8f6e9;border-radius:14px;display:grid;place-items:center;font-size:26px}.intro-chat{padding:16px 25px 13px;margin:0}.messages{flex:1;overflow-y:auto;padding:12px 24px;display:flex;flex-direction:column;align-items:flex-start;gap:14px;min-height:80px}.bubble{font-size:12px;max-width:90%;line-height:1.8;padding:12px 15px;border-radius:14px 14px 14px 3px;color:#44665c;background:#eff3ed;white-space:pre-wrap;overflow-wrap:anywhere;animation:toastIn .16s}.bubble.user{background:#245e55;color:#fff;margin-left:auto;border-radius:14px 14px 3px 14px}.bubble .bubble-label{display:block;font-size:9px;letter-spacing:.1em;opacity:.62;margin-bottom:4px;font-weight:850}.bubble .typing-dot{animation:blink .6s infinite}@keyframes blink{50%{opacity:0}}.chat-compose{padding:16px 24px 22px;border-top:1px solid #e8eee8;background:#fafbf7}.compose-inner{border:1px solid #dce7de;border-radius:14px;background:white;display:flex;padding:8px;align-items:flex-end}.compose-inner textarea{flex:1;resize:none;outline:none;border:none;padding:9px;line-height:1.4;max-height:100px;background:transparent;font-size:12px;color:#26483f}.send{height:33px;width:33px;background:#266b5a;color:#fff;border:0;border-radius:9px;font-size:22px}.chat-compose>small{display:block;font-size:9px;color:#a5b3a9;line-height:1.55;margin:9px 0 0}.modal-root{position:fixed;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:24px;background:#162f2b77;backdrop-filter:blur(5px)}.modal{width:min(485px,94vw);background:#fbfcf8;border-radius:21px;box-shadow:var(--shadow);padding:31px 34px;max-height:90vh;overflow:auto;animation:pop .2s ease both}@keyframes pop{from{transform:translateY(12px) scale(.98);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.modal .modal-tag{font-size:10px;letter-spacing:.14em;color:#64a18b;font-weight:900}.modal h2{font-size:26px;line-height:1.2;letter-spacing:-.055em;margin:12px 0}.modal p{font-size:12px;line-height:1.8;color:#6b8778}.modal label{display:block;color:#57736c;font-size:10px;font-weight:900;letter-spacing:.08em;margin-top:19px}.modal input,.modal select{border:1px solid #d5e4d6;border-radius:11px;padding:14px 15px;width:100%;background:white;margin-top:7px;color:#183d35;font-size:15px}.modal small{color:#96a89d;display:block;line-height:1.7;font-size:10px;margin:10px 0}.modal .modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}.primary{border:0;background:#235b4e;color:#fff;padding:13px 19px;border-radius:10px;font-weight:850;font-size:11px;letter-spacing:.06em;transition:transform .15s,background .15s}.primary:hover{background:#337f69;transform:translateY(-1px)}.secondary{border:1px solid #dce7dc;background:transparent;color:#5c7666;padding:12px 16px;border-radius:10px;font-size:11px;font-weight:850}.success-symbol{display:grid;place-items:center;width:60px;height:60px;border-radius:17px;background:#dcefe5;color:#3c9b79;font-size:28px;margin-bottom:20px}.result-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:25px 0}.result-stats div{background:#eff4ee;padding:13px 8px;border-radius:10px;text-align:center}.result-stats small{font-size:9px;font-weight:750;letter-spacing:.06em}.result-stats strong{font-size:20px;color:#315d51;display:block;margin-bottom:7px}.result-next{width:100%}.splash{position:fixed;z-index:100;inset:0;background:#eef4ee;display:grid;grid-template-columns:58% 42%;overflow:hidden}.splash-cover{position:relative;padding:clamp(34px,5vw,80px);display:flex;flex-direction:column;background:#f3f4ee}.splash-kicker{font-size:10px;font-weight:800;letter-spacing:.19em;color:#79988d}.splash-kicker span{padding:0 7px;color:#d3a768}.hero-symbol{font-size:49px;color:#57aa88;line-height:1;margin-top:clamp(26px,6vh,75px)}.splash h1{font-size:clamp(85px,12vw,180px);line-height:.78;letter-spacing:-.115em;font-weight:900;color:#224943;margin:24px 0 45px}.splash h1 i{font-style:normal;color:#67b99a}.splash-cover>p{font-size:clamp(16px,1.6vw,22px);line-height:1.47;color:#648078;letter-spacing:-.025em;margin:0}.splash-row{display:flex;align-items:center;gap:28px;margin-top:40px}.primary.big{background:#264f48;padding:20px 22px;border-radius:8px;font-size:11px;white-space:nowrap}.big span{padding-left:30px;font-size:17px}.hero-info{border-left:1px solid #cbdad1;padding-left:22px;line-height:1.8;color:#759187;font-weight:790;font-size:10px;letter-spacing:.06em}.splash-foot{font-size:9px;color:#96a9a0;font-weight:800;letter-spacing:.08em;margin-top:auto;padding-top:26px}.splash-foot span{padding:0 12px;color:#7dbca2}.splash-side{position:relative;background:linear-gradient(155deg,#245d56,#153c3b);overflow:hidden}.splash-side::before{content:'';position:absolute;inset:0;background:radial-gradient(circle at 45% 52%,#497f73 0,transparent 55%)}.side-number{position:absolute;top:52px;right:49px;color:#90b9a5;font-size:12px;letter-spacing:.15em;font-weight:750}.side-bottom{position:absolute;bottom:48px;right:51px;color:#b0d4c7;font-size:12px;text-align:right;font-weight:850;letter-spacing:.17em;line-height:1.8}.side-graphic{position:absolute;width:390px;height:430px;left:50%;top:51%;transform:translate(-50%,-50%);filter:drop-shadow(0 30px 30px #0e262451)}.graphic-orb{position:absolute;top:85px;left:126px;width:150px;height:270px;background:linear-gradient(125deg,#dce7dc,#a9c4b9 55%,#719b8d);border-radius:60% 58% 48% 54%/43% 47% 90% 90%;clip-path:polygon(7% 0,60% 0,89% 8%,100% 26%,96% 50%,82% 74%,51% 100%,21% 72%,10% 47%)}.graphic-petal{position:absolute;background:linear-gradient(135deg,#e3eee4,#799d90);width:140px;height:68px;top:100px;clip-path:polygon(0 53%,16% 10%,38% 0,100% 0,76% 37%,40% 82%,0 100%);border-radius:60%}.graphic-petal.p1{left:-7px;transform:rotate(-22deg)}.graphic-petal.p2{right:-8px;top:120px;transform:rotate(35deg) scaleX(-1)}.graphic-petal.p3{left:151px;top:64px;width:103px;height:39px;transform:rotate(7deg);opacity:.65}.graphic-ring{position:absolute;border:1px solid #bce1c34b;border-radius:50%;width:400px;height:330px;top:75px;left:-5px;transform:rotate(-35deg)}.graphic-ring.r2{transform:rotate(45deg);width:345px;height:430px;left:25px;top:2px}.graphic-shadow{position:absolute;left:110px;bottom:25px;width:185px;height:32px;background:#0b252360;filter:blur(17px);border-radius:50%}.loading{position:fixed;z-index:90;inset:0;background:#183f3a;color:#d7f3e5;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;font-size:11px;font-weight:850;letter-spacing:.16em}.loading-icon{font-size:52px;color:#84d5ae;animation:pulse 1.7s infinite}@keyframes pulse{50%{transform:scale(1.16);opacity:.5}}.loading small{color:#93b7ab;font-size:11px;letter-spacing:.04em;font-weight:500}.fatal{position:fixed;inset:auto 20% 13% 20%;z-index:150;background:white;color:#294b41;padding:20px 30px;border-radius:17px;box-shadow:var(--shadow)}.fatal h2{font-size:18px}.fatal p{font-size:13px;line-height:1.7}@media(max-width:1100px){.mission-card{width:256px;top:110px;left:16px;padding:20px}.mission-card h1{font-size:22px}.topbar{padding:12px 17px;height:88px}.topstats{gap:17px}.brand{min-width:245px}.splash h1{font-size:11vw}.splash-row{flex-direction:column;align-items:flex-start}.side-graphic{transform:translate(-50%,-50%) scale(.82)}}@media(max-width:750px){.brand{min-width:auto}.brand b span,.brand small{display:none}.topbar{height:66px}.topstats{gap:11px}.topstats small{font-size:7px}.stat strong{font-size:14px}.mission-card{top:76px;width:200px;padding:13px}.mission-card h1{font-size:18px}.mission-card p{font-size:11px;margin:9px 0}.mission-number{margin:12px 0 4px}.controls{bottom:9px;padding:7px 8px;gap:5px}.controls span{font-size:8px}.controls span:nth-child(4){display:none}.floating-tip{bottom:65px;font-size:9px}.splash{grid-template-columns:1fr}.splash-side{display:none}.splash-cover{padding:35px}.splash h1{font-size:104px;margin-bottom:34px}.splash-row{margin-top:25px}.splash-foot{font-size:8px}.topbar .mark{width:35px;height:35px}.modal-root{padding:12px}}@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation-duration:0.01ms!important;transition-duration:0.01ms!important}}

.modal .research{height:7px;background:#e1ece1;border-radius:20px;overflow:hidden;margin:24px 0 12px}.modal .research>div{height:100%;width:0;background:linear-gradient(90deg,#5e9d85,#a4d9b1);transition:width .1s linear}.right-panel a{color:#287f69}
.held-badge{position:absolute;left:31px;top:445px;background:#244d47;color:#e8f8ea;padding:13px 16px;border-radius:12px;box-shadow:0 9px 30px #21473b34;font-size:11px;font-weight:750;max-width:310px;display:flex;align-items:center;gap:9px;letter-spacing:.02em}.held-badge:before{content:'◉';color:#a4dbc2;font-size:16px}@media(max-width:750px){.held-badge{top:315px;left:15px;font-size:9px;max-width:210px}}

/* V2: high-contrast interactables and trilingual / sound controls */
:root{--jade:#008e48;--mint:#21e975;--forest:#17312f;--line:#cbdcd0}
.mini-dot,.online{background:#00db65;box-shadow:0 0 0 3px #19ea6633}
.brand .mark{background:#34444d;color:#36fb8d}
.mission-number{color:#087b40}.progress div{background:linear-gradient(90deg,#00b752,#30eb76)}
.header-actions{display:flex;align-items:center;gap:8px}
.lang-label{font-size:9px;font-weight:900;letter-spacing:.12em;color:#537769}
.language-select{min-width:59px;border:1px solid #95b9a2;padding:8px 7px;border-radius:9px;font-weight:850;color:#185138;background:#eefaf1;outline-offset:2px}
.language-select:hover,.icon-btn:hover{border-color:#00c65d;background:#e8ffed}
.icon-btn[aria-pressed="false"]{opacity:.56}
#sound-btn{font-size:19px}
.chat-suggest-label{font-size:9px;letter-spacing:.15em;color:#067f45;font-weight:850;margin-bottom:7px;display:block}
.chat-suggest{background:#dffce8;border:1px solid #28c56e;border-radius:8px;color:#076b37;font-size:10px;font-weight:900;letter-spacing:.06em;padding:11px 9px;margin:9px 0 8px;width:100%;transition:background .2s ease}
.chat-suggest:hover{background:#adf5c6}
.context{border:2px solid #27ed7b}.context-key{background:#2df57b;color:#104c2b}
.held-badge{background:#263c43}.held-badge:before{color:#22ec77}
.mission-footer span{background:#e0fae7;color:#067d3f}
@media(max-width:850px){.header-actions{gap:4px}.lang-label{display:none}.language-select{min-width:48px;padding:6px 2px}.header-actions .icon-btn{width:28px;height:28px;font-size:15px}}
.splash-lang{position:absolute;right:30px;top:24px;display:flex;gap:5px;z-index:4;border-radius:11px;padding:5px;background:#eef6efcc;box-shadow:0 6px 18px #1d49301b}
.splash-lang button{padding:8px 12px;border:1px solid transparent;background:transparent;border-radius:7px;font-size:11px;font-weight:900;color:#416e5b}
.splash-lang button.chosen{background:#176b42;color:#fff;box-shadow:0 3px 10px #12442b22}
.splash-lang button:hover{border-color:#10d66c}
@media(max-width:750px){.splash-lang{right:12px;top:12px}}
/* Splash mascot now matches the metallic-gray procedural player. */
.graphic-orb{background:linear-gradient(125deg,#cdd3d8,#8b9aa4 55%,#5d6d77)}
.graphic-petal{background:linear-gradient(135deg,#d7dde1,#657681)}
.graphic-ring{border-color:#6ff29a55}

/* V3 — scientific proportions and visible volume targets */
.mission-target{margin:13px 0 9px;padding:10px 11px;background:#e1ffea;border:1px solid #36ca71;border-left:4px solid #00bd56;border-radius:7px;color:#075b31;font-size:11px;font-weight:850;line-height:1.6;letter-spacing:.015em}
.book-ratio-title{font-size:10px;letter-spacing:.14em;color:#14824f;font-weight:900;margin-top:21px;margin-bottom:10px;text-transform:uppercase}
.book-ratios{background:#eafff0;border:1px solid #addec0;padding:15px 14px 15px 30px!important;border-radius:11px;color:#1c513a;font-weight:750;line-height:1.8;font-size:12px}
.book-ratio-hint{margin:10px 0 19px;color:#56776c;font-size:11px;line-height:1.55}
.research-percentage{font-variant-numeric:tabular-nums;font-size:28px!important;font-weight:900!important;color:#108348!important;text-align:center;margin:18px 0!important}
.research{height:12px!important;border-radius:20px!important;background:#e0e9e4!important;overflow:hidden}
.research>div{background:linear-gradient(90deg,#00ad4a,#42ec79)!important;height:100%!important;transition:width .065s linear}
#world:focus{outline:none}
/* Prevent flexbox from compressing long book pages; use natural panel scrolling. */
#book-view .book-page,#book-view .tab-row,#book-view .footnote{flex-shrink:0}

/* ================================================================
   V4: phone / tablet layout, original procedural graphics retained
   ================================================================ */
.touch-controls{display:none;position:fixed;inset:0;z-index:15;pointer-events:none;user-select:none;-webkit-user-select:none}
.touch-controls *{-webkit-tap-highlight-color:transparent}
.touch-left{position:absolute;left:calc(20px + env(safe-area-inset-left));bottom:calc(19px + env(safe-area-inset-bottom));display:flex;align-items:center;flex-direction:column;gap:7px;pointer-events:none}
.touch-stick{pointer-events:auto;position:relative;width:132px;height:132px;border-radius:50%;display:grid;place-items:center;touch-action:none;cursor:grab;background:rgba(18,54,48,.25);border:2px solid rgba(236,255,242,.65);box-shadow:0 10px 35px rgba(20,50,46,.20),inset 0 0 0 10px rgba(235,255,239,.1);backdrop-filter:blur(10px)}
.touch-stick.engaged{border-color:#37fc83;background:rgba(21,104,70,.39);cursor:grabbing}
.touch-stick-track{width:42px;height:42px;border:2px solid rgba(229,254,235,.52);border-radius:50%;pointer-events:none}
.touch-stick-track:after{content:'+';position:absolute;inset:0;display:grid;place-items:center;color:rgba(240,255,243,.5);font-size:21px;font-weight:400;pointer-events:none}
.touch-knob{position:absolute;top:calc(50% - 27px);left:calc(50% - 27px);width:54px;height:54px;border:2px solid #b9ffd3;background:linear-gradient(145deg,#32e986,#06a96d);border-radius:50%;box-shadow:inset 0 3px 8px rgba(255,255,255,.35),0 5px 14px rgba(3,43,27,.35);display:grid;place-items:center;pointer-events:none;will-change:transform}
.touch-knob span{width:17px;height:17px;border-radius:50%;border:3px solid rgba(237,255,244,.82)}
.touch-move-hint{font-size:10px;font-weight:900;letter-spacing:.13em;color:#f8fff9;text-shadow:0 2px 6px #163e38}
.touch-action{pointer-events:auto;position:absolute;right:calc(20px + env(safe-area-inset-right));bottom:calc(39px + env(safe-area-inset-bottom));width:128px;min-height:105px;padding:11px 9px;border-radius:24px;border:2px solid #b0ffd0;background:linear-gradient(150deg,#20e775,#00864b);color:#fff;box-shadow:0 9px 23px #15392e66,inset 0 2px 6px #b4ffd866;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-weight:900;font-size:12px;letter-spacing:.055em;touch-action:manipulation;transition:transform .12s,filter .12s}
.touch-action:active:not(:disabled){transform:scale(.94);filter:brightness(1.17)}
.touch-action:disabled{opacity:.62;filter:grayscale(.42);border-color:#c5d5ce;background:rgba(45,77,71,.74);box-shadow:0 8px 21px #123b2e44}
.touch-action-glyph{font-size:25px;line-height:1}
.touch-action small{font-size:9px;line-height:1.16;letter-spacing:0;text-align:center;max-width:114px;max-height:30px;overflow:hidden;font-weight:700}
.mission-toggle{display:none}
@media (pointer:coarse), (max-width:780px){
  html,body{overscroll-behavior:none;-webkit-text-size-adjust:100%}
  button,select,input,textarea{touch-action:manipulation}
  #world{touch-action:none}
  .touch-controls.is-active{display:block}
  .controls,.floating-tip{display:none!important}
  .context{bottom:calc(185px + env(safe-area-inset-bottom));left:50%;min-width:180px;max-width:50vw;padding:8px 12px;gap:7px;border-radius:14px;text-align:left}
  .context-key{display:none}
  .context strong{font-size:10px}.context small{font-size:9px}
  .topbar{height:57px;padding:7px calc(11px + env(safe-area-inset-left));gap:8px;align-items:center;justify-content:space-between}
  .topbar .mark{width:33px;height:33px;min-width:33px;border-radius:10px;font-size:22px}
  .brand{gap:7px;min-width:0}.brand b{font-size:12px;letter-spacing:.025em;white-space:nowrap}.brand b span{display:none}.brand small{display:none}
  .topstats{position:absolute;top:57px;left:0;right:0;height:33px;display:flex;justify-content:center;align-items:center;gap:24px;margin:0;background:rgba(242,251,245,.94);border-bottom:1px solid #d8e6dd}
  .topstats .stat{display:flex;gap:5px;align-items:center}.topstats small{display:inline;font-size:8px;margin:0;letter-spacing:.04em}.topstats strong{display:inline;font-size:12px;margin:0}
  .stat strong em{font-size:10px}
  .header-actions{gap:5px;margin-left:auto}.header-actions .icon-btn{width:33px;height:33px;font-size:17px;flex-shrink:0}.language-select{height:33px;min-width:53px;max-width:54px;font-size:12px;padding:5px 2px}
  .mission-card{top:99px;left:calc(10px + env(safe-area-inset-left));width:min(268px,calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)));padding:13px 14px 10px;border-radius:13px;box-shadow:0 7px 24px #173f2f27}
  .mission-toggle{display:grid;place-items:center;position:absolute;right:9px;top:8px;width:29px;height:29px;border:1px solid #b4dfc3;border-radius:8px;background:#e3ffe9;color:#176842;font-size:21px;line-height:1;z-index:1}
  .mission-card .eyebrow{font-size:9px;padding-right:24px}
  .mission-number{font-size:9px;margin:8px 0 3px}
  .mission-card h1{font-size:17px;letter-spacing:-.035em;line-height:1.16;padding-right:4px}
  .mission-card p{font-size:11px;margin:7px 0;line-height:1.35}
  .mission-target{padding:7px 9px;margin:8px 0 6px;font-size:10px;line-height:1.35}
  .mission-card .mission-footer{margin-top:8px}
  .mission-card.collapsed #mission-text,.mission-card.collapsed .mission-footer{display:none}
  .held-badge{top:auto;bottom:calc(183px + env(safe-area-inset-bottom));left:calc(10px + env(safe-area-inset-left));font-size:10px;max-width:min(250px,66vw);padding:8px 10px}
  .right-panel{width:100vw;max-width:none;top:var(--visible-top,0px);bottom:auto;height:var(--visible-height,100dvh);border:0;border-radius:0;overscroll-behavior:contain;transition:transform .25s ease-out}
  .panel-head{height:58px;padding:10px calc(17px + env(safe-area-inset-left));min-height:58px}
  .panel-mini{font-size:10px;letter-spacing:.09em}
  .panel-head .x-btn{display:grid;place-items:center;width:45px;height:45px;border-radius:12px;background:#e1f6e7;color:#1a5b39;font-size:30px;font-weight:700}
  .panel-body{padding:19px 17px calc(24px + env(safe-area-inset-bottom));overscroll-behavior:contain;-webkit-overflow-scrolling:touch;min-height:0}
  .panel-body h2{font-size:23px;margin:8px 0}
  .book-page{padding:16px 13px}
  .book-page p,.book-page ol,.book-ratios{font-size:13px;line-height:1.65}
  .tab-row{overflow-x:auto;flex-shrink:0;padding-bottom:4px;scrollbar-width:thin}
  .tab-row .tab{white-space:nowrap;flex-shrink:0}
  .chat-body{padding:13px 0 0;min-height:0;overflow:hidden}
  .chat-header{padding:0 18px}.chat-header h2{font-size:23px}
  .intro-chat{padding:0 18px;margin:10px 0 0;font-size:11px}
  .messages{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:10px 18px 16px;gap:12px;-webkit-overflow-scrolling:touch}
  .chat-compose{flex-shrink:0;padding:11px 14px calc(12px + env(safe-area-inset-bottom))}
  .chat-compose .compose-inner textarea{font-size:16px;min-height:45px;max-height:88px}
  .chat-suggest{font-size:11px;min-height:42px;margin:6px 0}
  .chat-compose>small{font-size:9px;margin-top:4px}
  .modal-root{top:var(--visible-top,0px);height:var(--visible-height,100dvh);bottom:auto;padding:calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));align-items:center}
  .modal{max-height:100%;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;max-width:min(440px,100%);padding:22px 18px}
  .modal input,.modal select{font-size:16px;min-height:43px}
  .modal .primary,.modal .secondary{min-height:44px}
  .toasts{top:calc(99px + env(safe-area-inset-top));max-width:92vw;z-index:65}
  .splash{height:100dvh;min-height:0;overflow-y:auto;display:block;background:#f1f6ee}
  .splash-cover{min-height:100dvh;padding:clamp(46px,8vh,80px) 25px calc(30px + env(safe-area-inset-bottom));display:flex;justify-content:center}
  .splash-lang{right:calc(10px + env(safe-area-inset-right));top:calc(10px + env(safe-area-inset-top))}
  .splash-kicker{font-size:9px;max-width:300px;line-height:1.5}
  .hero-symbol{font-size:36px;margin-top:14px}
  .splash h1{font-size:clamp(84px,22vw,132px);line-height:.81;margin:21px 0 29px}
  .splash-cover>p{font-size:16px;line-height:1.48}
  .splash-row{margin-top:22px;gap:15px;align-items:flex-start}
  .primary.big{font-size:11px;white-space:normal;text-align:left;width:min(335px,100%);min-height:62px;padding:17px 18px;display:flex;justify-content:space-between;align-items:center}
  .primary.big span{padding-left:0}
  .hero-info{font-size:9px;padding-left:12px;line-height:1.5}
  .splash-foot{font-size:8px;padding-top:18px;line-height:1.5}
  .splash-side{display:none}
  .fatal{inset:auto 12px 15% 12px}
}
@media (pointer:coarse) and (min-width:781px){
  .topbar{height:73px}
  .topstats{position:static;height:auto;background:transparent;border:0;margin-left:auto}
  .mission-card{top:85px}
  .touch-stick{width:144px;height:144px}
  .touch-action{width:145px;min-height:116px}
}
@media (max-height:530px) and (orientation:landscape){
  .touch-left{bottom:calc(7px + env(safe-area-inset-bottom))}
  .touch-stick{width:100px;height:100px}.touch-knob{width:44px;height:44px;top:calc(50% - 22px);left:calc(50% - 22px)}
  .touch-action{width:114px;min-height:82px;bottom:calc(14px + env(safe-area-inset-bottom));border-radius:18px}
  .touch-action-glyph{font-size:19px}.touch-action small{font-size:8px}
  .touch-move-hint{font-size:8px}
  .context{bottom:calc(116px + env(safe-area-inset-bottom));max-width:36vw}
  .held-badge{bottom:calc(145px + env(safe-area-inset-bottom))}
  .mission-card{top:97px;left:10px;padding:9px 11px;width:235px}
  .mission-card h1{font-size:14px}.mission-card p{font-size:10px}
  .mission-target{padding:6px 7px;font-size:9px}
  .splash-cover{padding:35px 30px;min-height:100dvh;align-items:flex-start}
  .splash h1{font-size:63px;margin:5px 0 10px}.hero-symbol{display:none}
  .splash-cover>p{font-size:12px}.splash-row{flex-direction:row;align-items:center;gap:10px;margin-top:12px}
  .primary.big{min-height:44px;padding:10px 13px;width:auto}
  .splash-foot{display:none}
  .panel-head{height:45px;min-height:45px}.panel-body{padding-top:10px}.chat-header h2{font-size:19px}
}
@media(prefers-reduced-motion:reduce){.touch-action{transition:none}.right-panel{transition:none}}

/* Honor notches and status bars in standalone iOS browsers. */
@media (pointer:coarse), (max-width:780px){
  .topbar{height:calc(57px + env(safe-area-inset-top));padding-top:calc(7px + env(safe-area-inset-top))}
  .topstats{top:calc(57px + env(safe-area-inset-top))}
  .mission-card{top:calc(99px + env(safe-area-inset-top))}
  .context{bottom:calc(185px + env(safe-area-inset-bottom))}
  .held-badge{bottom:calc(183px + env(safe-area-inset-bottom))}
}
@media (max-height:530px) and (orientation:landscape){
  .mission-card{top:calc(97px + env(safe-area-inset-top))}
  .context{bottom:calc(116px + env(safe-area-inset-bottom))}
  .held-badge{bottom:calc(145px + env(safe-area-inset-bottom))}
}
