:root{color-scheme:dark;--bg:#090d16;--panel:#111725;--ink:#e9e4d3;--muted:#9aabbd;--gold:#e8bd75;--cyan:#8bd6d5;--line:#303f50}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 30% 0,#20273c,var(--bg) 70%);color:var(--ink);font-family:ui-monospace,'Courier New',monospace}button,input{font:inherit}button{background:#192334;border:1px solid #4a5c70;border-radius:4px;padding:12px 16px;color:var(--ink);cursor:pointer;transition:background .15s}button:hover:not(:disabled){background:#2c3a4e;border-color:var(--gold)}button:disabled{opacity:.4;cursor:default}button.gold{background:var(--gold);color:#211b14;border-color:var(--gold);font-weight:bold}button:focus-visible,summary:focus-visible,canvas:focus-visible{outline:2px solid var(--cyan);outline-offset:4px}[hidden]{display:none!important}.site-head{max-width:1120px;margin:auto;padding:22px 24px;display:flex;justify-content:space-between;align-items:center;gap:24px;font-size:11px;letter-spacing:.1em;border-bottom:1px solid var(--line)}.site-head a{color:var(--gold);text-decoration:none}.site-head span{color:var(--muted)}.site-head button{font-size:11px;padding:8px}main{max-width:1040px;margin:auto;padding:32px 24px}.title-page{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:30px;min-height:75vh}.title-art img{width:100%;max-height:650px;object-fit:contain;filter:drop-shadow(0 0 30px #dba55425);animation:hovering 6s ease-in-out infinite}.eyebrow{color:var(--gold);font-size:11px;letter-spacing:.18em;text-transform:uppercase;line-height:1.6}h1,h2,h3{font-family:Georgia,serif;font-weight:normal}h1{font-size:clamp(46px,7vw,88px);line-height:1.02;margin:18px 0 26px}h1 em{color:var(--gold);font-weight:normal}h2{margin:4px 0 12px;font-size:28px}.intro{font:21px/1.7 Georgia,serif}.description{color:var(--muted);font-size:13px;line-height:1.9}.title-actions{display:flex;flex-wrap:wrap;gap:12px;margin:30px 0}.small{font-size:11px;color:var(--muted);line-height:1.8}details{border-top:1px solid var(--line);margin-top:24px;padding:16px 0;font-size:12px;line-height:1.8}summary{cursor:pointer;color:var(--cyan)}.game-heading,.modal-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}.hud{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;background:var(--panel);border:1px solid var(--line);font-size:12px;margin:14px 0 0}.hud label{display:flex;align-items:center;gap:8px}progress{height:9px;width:100px;accent-color:var(--gold)}.world-wrap{position:relative;border:1px solid var(--line);background:#080c15}#world{display:block;width:100%;height:auto;image-rendering:pixelated;outline:none}.world-footer{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:14px 0}.world-footer p{font-size:12px;color:var(--cyan);line-height:1.7;max-width:700px}.area-toast{position:absolute;top:18px;left:50%;transform:translateX(-50%);padding:10px 20px;background:#090d16ed;border:1px solid var(--gold);font-size:12px;text-align:center;pointer-events:none;opacity:0;transition:opacity .2s;width:max-content;max-width:90%}.area-toast.visible{opacity:1}.touch-pad{display:grid;grid-template-columns:repeat(3,52px);grid-template-rows:repeat(2,44px);justify-content:center;gap:5px}.touch-pad button:first-child{grid-column:2}.touch-pad button:nth-child(2){grid-column:1;grid-row:2}.touch-pad button:nth-child(3){grid-column:2;grid-row:2}.touch-pad button:nth-child(4){grid-column:3;grid-row:2}[data-key]{touch-action:none;user-select:none;padding:8px}.controls{text-align:center}dialog{background:var(--panel);color:var(--ink);border:1px solid #687485;border-radius:8px;padding:28px;width:min(850px,94vw);max-height:92dvh;overflow:auto;box-shadow:0 20px 100px #0009}dialog::backdrop{background:#03060ce3}.dialog-layout{display:grid;grid-template-columns:230px 1fr;gap:28px;align-items:center}.dialog-layout img{width:100%;max-height:340px;object-fit:contain;border-radius:12px}.dialog-text{white-space:pre-line;font:18px/1.8 Georgia,serif}.dialog-buttons{display:grid;gap:10px;margin-top:24px}.dialog-buttons button{text-align:left}.battle-top{display:grid;grid-template-columns:170px 1fr;gap:24px;align-items:center}.battle-top img{width:170px;height:180px;object-fit:contain;animation:hovering 5s ease-in-out infinite;border-radius:10px}.battle-top p:not(.eyebrow){font:16px/1.6 Georgia,serif;min-height:48px}.meters{display:flex;flex-wrap:wrap;gap:16px;font-size:10px}.meters label{display:flex;align-items:center;gap:7px}.meters progress{width:85px;accent-color:var(--cyan)}.battle-status{display:flex;justify-content:space-between;font-size:12px;padding:14px 0;gap:12px;color:var(--gold)}#arena{display:block;width:100%;height:auto;border:3px solid #d0d3c5;background:#03050a;touch-action:none}#battleMessage{min-height:42px;font-size:12px;line-height:1.7;color:var(--cyan)}.battle-actions{display:grid;grid-template-columns:repeat(6,1fr);gap:7px}.battle-actions button{font-size:11px;padding:12px 5px}.battle-actions .mercy-ready{border-color:var(--gold);color:var(--gold);box-shadow:0 0 18px #e8bd7525}.battle-move{display:flex;justify-content:center;gap:8px;margin-top:16px}.battle-move button{min-width:44px}.journey-map{list-style:none;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:12px}.journey-map li{border-left:3px solid var(--line);padding:14px;background:#0c111b;font-size:12px;line-height:1.8}.journey-map li.current{border-color:var(--gold)}.journey-map li.done{border-color:var(--cyan)}.journey-map strong{display:block;color:var(--gold)}.setting{display:flex;gap:12px;align-items:center;margin:24px 0;font-size:13px;flex-wrap:wrap}.setting input[type=file]{max-width:100%}.ending{text-align:center;max-width:900px;margin:40px auto}.ending h1{font-size:clamp(38px,6vw,66px)}.ending-cards{display:grid;grid-template-columns:1fr 1fr;gap:16px;text-align:left;margin:36px 0}.ending-card{padding:20px;border:1px solid var(--line);background:var(--panel)}.ending-card img{float:left;width:80px;height:100px;object-fit:contain;margin:0 16px 8px 0;border-radius:6px}.ending-card h3{font-size:22px;margin:0 0 12px}.ending-card p{font-size:12px;line-height:1.8}.ending-card .fate{color:var(--cyan);text-transform:uppercase;font-size:10px;letter-spacing:.12em}#endingStats{font-size:12px;color:var(--muted);line-height:1.8;margin-bottom:28px}@keyframes hovering{50%{transform:translateY(-5px)}}@media(max-width:680px){main{padding:18px 12px}.site-head{padding:14px 12px}.site-head span{display:none}.title-page{grid-template-columns:1fr;gap:0}.title-art{order:2}.title-art img{max-height:360px}.title-copy h1{font-size:64px}.title-copy .intro{font-size:20px}.hud{font-size:10px;padding:10px}.hud progress{width:65px}.game-heading h2{font-size:23px}.game-heading button{font-size:11px;padding:10px}.world-footer{align-items:flex-start;gap:8px}.world-footer button{font-size:11px;white-space:nowrap;padding:12px}.world-footer p{font-size:11px;margin-top:0}.dialog-layout{grid-template-columns:1fr;gap:12px}.dialog-layout img{height:170px}.dialog-text{font-size:16px}.battle-top{grid-template-columns:90px 1fr;gap:12px}.battle-top img{width:90px;height:120px}.battle-top h2{font-size:24px}.battle-top .eyebrow{font-size:8px}.battle-top p:not(.eyebrow){font-size:13px}.battle-actions{grid-template-columns:repeat(3,1fr)}dialog{padding:18px;max-height:94dvh}.battle-status{font-size:10px}.ending-cards,.journey-map{grid-template-columns:1fr}.meters progress{width:60px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.dialog-layout:has(img[hidden]){grid-template-columns:1fr}.battle-actions:has(button:nth-child(7)){grid-template-columns:repeat(6,1fr)}.battle-actions button:last-child:nth-child(7){grid-column:1/-1;padding:7px;color:var(--muted)}@media(max-width:680px){.battle-actions:has(button:nth-child(7)){grid-template-columns:repeat(3,1fr)}.world-footer{flex-wrap:wrap}.world-footer p{width:100%}}
/* Frame the richer room art like a small illustrated stage. */
.world-wrap{border-color:#63708070;border-radius:5px;overflow:hidden;box-shadow:0 18px 45px #0005,0 0 0 4px #111827}.hud{background:linear-gradient(110deg,#192332,#101723);border-color:#55627160;border-radius:5px 5px 0 0}.game-heading h2{text-shadow:0 2px 12px #0007}.world-footer button.gold{box-shadow:0 3px 0 #8a673f}.battle-top img{filter:drop-shadow(0 5px 12px #0006)}#arena{border-color:#cdbf9b;box-shadow:0 0 0 4px #080e17,0 0 30px #8bd6d510}
.escape-panel{background:#0a101b;border:1px solid #687d8755;padding:18px;margin:18px 0}.escape-panel button{font-size:12px;min-height:44px}.dial-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;text-align:center}.dial-grid p{font-size:10px;color:var(--gold);letter-spacing:.12em}.dial-grid button{width:100%}.vessel-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-bottom:18px}.vessel-grid>div{height:130px;border:2px solid #7c9fba;border-radius:5px 5px 20px 20px;position:relative;overflow:hidden;background:#131e30}.water-fill{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(#65d4d4aa,#246488);border-top:2px solid #a2f0e0;transition:height .35s}.vessel-grid span{position:absolute;inset:0;display:grid;place-items:center;color:#fff;text-shadow:0 1px 4px #000;font-size:18px}.pour-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.graft-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.graft-grid button{height:65px;background:#202931;color:#c3c7c2}.graft-grid .living{background:#34482b;border-color:#93ba6d;color:#e2f5c4;box-shadow:inset 0 0 20px #a5d87b12}.note-buttons{display:flex;gap:8px;flex-wrap:wrap;margin:15px 0}.entered-sequence{font-size:14px;line-height:1.7;color:var(--gold);min-height:45px}.cipher-display{font-size:26px;letter-spacing:.2em;color:var(--cyan)}.escape-panel label,#escapeNotebook label{display:block;font-size:12px;margin-top:18px;line-height:1.8}.escape-panel input,#escapeNotebook textarea{display:block;width:100%;padding:12px;margin:8px 0;background:#080f1c;border:1px solid #687d87;color:var(--ink);font:inherit}.escape-panel input{text-transform:uppercase;letter-spacing:.25em;font-size:20px}#escapeNotebook{margin:24px 0}#escapeNotebook details{padding:12px 0}#escapeNotebook p{font-size:12px;line-height:1.8}.dialog-layout:has(#escapePanel){grid-template-columns:1fr}#storyDialog:has(#escapePanel){width:min(760px,94vw)}@media(max-width:500px){.escape-panel{padding:12px}.pour-grid{grid-template-columns:1fr 1fr}.dial-grid{gap:5px}.dial-grid button{padding:8px 3px}.dial-grid p{font-size:9px}.graft-grid button{font-size:11px;padding:5px}.vessel-grid>div{height:95px}.cipher-display{font-size:22px}}

.puzzle-feedback{position:relative;display:flex;align-items:center;justify-content:center;gap:12px;min-height:82px;margin:8px 0 18px;border-radius:8px;overflow:hidden;font-size:12px;letter-spacing:.12em}.puzzle-feedback.victory{color:#ffe2a0;border:1px solid #e8bd7570;background:radial-gradient(ellipse,#e8bd7524,transparent 75%);animation:deduction-glow 1.4s ease-out}.feedback-emblem{display:inline-block;font-size:38px}.victory .feedback-emblem{animation:deduction-star .8s ease-out}.puzzle-feedback i{position:absolute;left:50%;top:50%;font-style:normal;pointer-events:none;opacity:0;animation:deduction-spark 1.3s var(--delay) ease-out forwards}.setback{color:#a9b7d3;background:#8797bd12;border:1px solid #8797bd40}.setback .feedback-emblem{animation:deduction-sigh .65s ease-out}@keyframes deduction-glow{0%{box-shadow:inset 0 0 32px #e8bd7580}100%{box-shadow:inset 0 0 0 transparent}}@keyframes deduction-star{0%{transform:scale(.35) rotate(-100deg)}65%{transform:scale(1.2) rotate(12deg)}100%{transform:scale(1) rotate(0)}}@keyframes deduction-spark{0%{opacity:0;transform:translate(-50%,-50%) scale(.3)}25%{opacity:1}100%{opacity:0;transform:translate(var(--x),var(--y)) scale(1.2)}}@keyframes deduction-sigh{0%{transform:translateY(-7px);opacity:.4}100%{transform:translateY(0);opacity:1}}@media(prefers-reduced-motion:reduce){.puzzle-feedback i{display:none}.puzzle-feedback,.puzzle-feedback *{animation:none!important}}
/* Touch layouts use the available landscape viewport, including notch insets. */
html{background:#090d16}#world,#arena{image-rendering:auto;touch-action:none}button{touch-action:manipulation}#fullscreenBtn{position:fixed;right:max(8px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));z-index:5;font-size:12px;min-height:44px;background:#162333ee}#rotateDialog{text-align:center;width:min(440px,92vw);padding:32px 24px;line-height:1.7}#rotateDialog::backdrop{background:#090d16fa}.rotate-phone{font-size:70px;color:var(--gold);animation:turn-phone 2.6s ease-in-out infinite}@keyframes turn-phone{0%,20%{transform:rotate(0)}65%,100%{transform:rotate(-90deg)}}
.touch-device button,.touch-device summary{min-height:44px}.touch-device input,.touch-device textarea{font-size:16px}.touch-device dialog{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.touch-device #fullscreenBtn{font-size:11px}.touch-device .controls{display:none}
@media(orientation:landscape){
 .touch-device:has(#play:not([hidden])) body{overflow:hidden}
 .touch-device:has(#play:not([hidden])) .site-head{position:fixed;right:max(10px,env(safe-area-inset-right));top:4px;padding:0;border:0;z-index:3}.touch-device:has(#play:not([hidden])) .site-head a,.touch-device:has(#play:not([hidden])) .site-head span{display:none}
 .touch-device:has(#play:not([hidden])) main{max-width:none;padding:0;margin:0}
 .touch-device #play{height:100dvh;padding:6px max(10px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));display:grid;grid-template-columns:minmax(0,1fr) 158px;grid-template-rows:40px 1fr;gap:6px 10px}
 .touch-device .game-heading{grid-column:1;grid-row:1;gap:8px}.touch-device .game-heading .eyebrow{display:none}.touch-device .game-heading h2{font-size:19px;margin:0}.touch-device #journalBtn{font-size:11px;padding:6px;min-height:36px}
 .touch-device .hud{position:absolute;bottom:max(10px,env(safe-area-inset-bottom));left:max(14px,env(safe-area-inset-left));z-index:2;padding:5px 8px;margin:0;font-size:10px;gap:8px;pointer-events:none;background:#0c1425e8}.touch-device .hud>span:first-child,.touch-device #namesLabel{display:none}.touch-device .hud progress{width:52px}
 .touch-device .world-wrap{grid-column:1;grid-row:2;align-self:center;justify-self:center;width:min(100%,calc((100dvh - 58px - env(safe-area-inset-bottom))*12/7));box-shadow:none;overflow:hidden}.touch-device #world{width:100%;height:auto}
 .touch-device .world-footer{grid-column:2;grid-row:2;display:flex;flex-direction:column;justify-content:flex-start;gap:8px;padding:0 0 145px;overflow:auto;align-items:stretch}.touch-device .world-footer p{width:auto;font-size:12px;line-height:1.45;margin:0}.touch-device .world-footer button{font-size:12px;padding:8px;white-space:normal}
 .touch-device #touchPad{position:fixed;right:max(10px,env(safe-area-inset-right));bottom:max(52px,calc(env(safe-area-inset-bottom) + 48px));grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,44px);gap:4px;background:#090d16ed;z-index:2}.touch-device .area-toast{top:6px;font-size:12px;padding:7px 10px}
 .touch-device dialog{max-height:calc(100dvh - 12px - env(safe-area-inset-bottom));width:min(850px,calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));padding:16px}.touch-device .dialog-layout{grid-template-columns:100px 1fr;gap:16px}.touch-device .dialog-layout:has(img[hidden]){grid-template-columns:1fr}.touch-device .dialog-layout img{max-height:150px}.touch-device .dialog-text{font-size:17px;line-height:1.55}.touch-device .dialog-buttons{gap:8px;margin-top:14px}.touch-device .dialog-buttons button{font-size:14px}
 .touch-device #battleDialog{padding:12px}.touch-device .battle-top{grid-template-columns:64px 1fr;gap:12px}.touch-device .battle-top img{width:64px;height:72px}.touch-device .battle-top h2{font-size:20px;margin:0}.touch-device .battle-top .eyebrow{display:none}.touch-device .battle-top p:not(.eyebrow){font-size:13px;min-height:0;margin:4px 0}.touch-device .battle-status{padding:5px 0}.touch-device #arena{width:min(100%,calc((100dvh - 154px)*3));margin:0 auto}.touch-device #battleMessage{font-size:12px;min-height:0;margin:8px 0}.touch-device .battle-actions{grid-template-columns:repeat(6,1fr)}.touch-device .battle-move{margin-top:8px;position:sticky;bottom:0;background:#111725;padding:4px}.touch-device .battle-move button{min-width:56px;min-height:44px}
 .touch-device #battleDialog[data-phase=dodge] .battle-top,.touch-device #battleDialog[data-phase=strike] .battle-top{display:none}.touch-device #battleDialog[data-phase=dodge] #arena,.touch-device #battleDialog[data-phase=strike] #arena{width:min(100%,calc((100dvh - 142px)*3))}
}
/* An uninterrupted touch stage; navigation lives at the in-world rest lantern. */
@media(orientation:landscape){
 .touch-device .site-head{padding:8px max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left));gap:12px}.touch-device .site-head span{display:none}
 .touch-device main{padding:12px max(20px,env(safe-area-inset-right)) 56px max(20px,env(safe-area-inset-left))}
 .touch-device .title-page{grid-template-columns:minmax(150px,.7fr) minmax(0,1.3fr);min-height:0;gap:22px;align-items:start}.touch-device .title-art{order:0;position:sticky;top:12px}.touch-device .title-art img{max-height:calc(100dvh - 86px);width:100%;object-fit:contain}.touch-device .title-copy h1{font-size:clamp(34px,6vw,60px);margin:6px 0 12px}.touch-device .title-copy .eyebrow{margin:0;font-size:10px}.touch-device .title-copy .intro{font-size:18px;line-height:1.4;margin:10px 0}.touch-device .title-copy .description{font-size:12px;line-height:1.6}.touch-device .title-actions{margin:16px 0;gap:8px}.touch-device .title-actions button{font-size:13px;padding:10px 14px}.touch-device .title-copy>.small{display:none}
 .touch-device:has(#play:not([hidden])) .site-head,.touch-device:has(#play:not([hidden])) #fullscreenBtn,.touch-device #play .game-heading,.touch-device #play .hud,.touch-device #play #objective,.touch-device #play #exploreBtn,.touch-device #play .controls,.touch-device #play .area-toast{display:none!important}
 .touch-device #play{position:fixed;inset:0;height:100dvh;display:block;padding:0;background:radial-gradient(ellipse,#1c2532,#080c15 80%);isolation:isolate}
 .touch-device #play .world-wrap{position:absolute;inset:0;margin:auto;width:min(100vw,calc(100dvh * 12 / 7));height:min(100dvh,calc(100vw * 7 / 12));border:0;border-radius:0;box-shadow:none;align-self:auto;justify-self:auto}
 .touch-device #world{width:100%;height:100%;object-fit:contain}
 .touch-device #play .world-footer{display:contents}
 .touch-device #play #touchPad{left:max(12px,env(safe-area-inset-left));right:auto;bottom:max(12px,env(safe-area-inset-bottom));grid-template-columns:repeat(3,46px);grid-template-rows:repeat(2,44px);gap:4px;background:transparent;z-index:3;opacity:.8}
 .touch-device #play #touchPad button{background:#101b2dcc;border-color:#c7d4dd70;border-radius:12px;font-size:18px;box-shadow:0 2px 8px #0006}.touch-device #play #touchPad button:active{background:#56657a;opacity:1}
 .touch-device #play #interactBtn{position:fixed;right:max(18px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom));width:62px;height:62px;min-height:62px;padding:0;border-radius:50%;font-size:30px;background:#e8bd75d9;box-shadow:0 3px 16px #0008;z-index:3}
}
.difficulty-picker{border:1px solid var(--line);border-radius:8px;padding:14px;margin:20px 0}.difficulty-picker legend{color:var(--gold);font-size:14px;padding:0 8px}.difficulty-picker label{display:grid;grid-template-columns:22px 1fr;gap:3px 8px;padding:10px;cursor:pointer;border:1px solid transparent;border-radius:5px}.difficulty-picker label:has(input:checked){background:#e8bd7515;border-color:var(--gold)}.difficulty-picker input{grid-row:span 2;align-self:center;accent-color:var(--gold);width:18px;height:18px}.difficulty-picker strong{font-size:14px}.difficulty-picker span{font-size:12px;line-height:1.5;color:var(--muted)}.difficulty-picker .small{margin:10px 0 0}@media(orientation:landscape){.touch-device .difficulty-picker{padding:8px;margin:14px 0}.touch-device .difficulty-picker label{padding:8px}}
