
:root{--bg:#08141b;--room:#10252c;--edge:#608f7d;--text:#e9f1ed;--soft:#acc5c2;--mint:#91f1c3;--gold:#ffdda0;--font:70px;color-scheme:dark}
*{box-sizing:border-box}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}body{margin:0;background:var(--bg);color:var(--text);min-height:100vh}.ambient{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse 55% 42% at 75% 7%,#20463d28,transparent 85%);z-index:-1}button{font:inherit;cursor:pointer}button:focus-visible,.viewport:focus-visible{outline:2px solid var(--mint);outline-offset:3px}.shell{width:min(1360px,100%);margin:auto;padding:0 29px}.topbar{height:85px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #30474c;gap:15px}.brand{color:#f0f6ef;text-decoration:none;font-size:23px;font-weight:850;letter-spacing:-.04em;display:flex;align-items:center}.brand svg{width:32px;height:32px;margin-right:9px;color:var(--mint)}.brand span{color:var(--mint)}.topright{display:flex;align-items:center;gap:22px}.version{font-size:10px;letter-spacing:.16em;font-weight:800;color:#88aca0}.langs{display:flex;border:1px solid #405d57;border-radius:8px;padding:3px;gap:3px}.langs button{padding:5px 10px;border:0;border-radius:6px;background:transparent;color:#b5cfc5;font-size:11px;font-weight:800}.langs button[aria-pressed=true]{color:#07251b;background:#a4ebc1}.kicker,.overline{font-size:11px;letter-spacing:.18em;color:var(--mint);font-weight:850}.kicker{margin-top:39px}.beacon{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--mint);margin-right:8px}.hero{display:flex;justify-content:space-between;gap:40px;align-items:center;padding:10px 0 29px}.hero h1{font-size:clamp(38px,5vw,61px);line-height:1.09;margin:9px 0 17px;letter-spacing:-.055em}.hero p:not(.overline){line-height:1.8;font-size:15px;color:#bad2c9;max-width:650px}.hero-sketch{width:270px;flex:0 0 270px;stroke:#5d8c7c;stroke-width:2;fill:none}.hero-sketch .hero-trail{stroke:var(--mint);stroke-width:3}.hero-sketch .hero-text{stroke:#80ac9d;stroke-width:5;opacity:.65}.hero-sketch .hero-dot{fill:var(--gold);stroke:none}.chips{display:flex;gap:8px;flex-wrap:wrap}.chips span{padding:6px 9px;border:1px solid #37574c;color:#acd9c1;border-radius:5px;font-size:10px;font-weight:800}.shelf-head{display:flex;align-items:end;justify-content:space-between;gap:15px;margin:29px 0 15px}.shelf-head h2{font-size:25px;letter-spacing:-.03em;margin:0}.shelf-head span,.footnote{color:#8da9a5;font-size:11px}.books{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}.book{border:1px solid #334f50;background:linear-gradient(140deg,#183239,#0b2027);color:var(--text);text-align:left;padding:23px;min-height:181px;border-radius:11px;display:flex;flex-direction:column;gap:8px}.book:hover{border-color:var(--mint);background:#183b35}.book .num{font-size:10px;color:var(--mint);letter-spacing:.12em}.book strong{font-size:18px}.book .desc{font-size:12px;line-height:1.5;color:#a4bab4}.book .bookbottom{margin-top:auto;display:flex;justify-content:space-between;color:#cbe7d5;font-size:10px;font-weight:750;padding-top:9px}.footnote{line-height:1.8;margin:20px 0 40px}.game{padding-top:19px}.game-top{display:flex;align-items:center;justify-content:space-between;gap:20px}.game-top p{font-size:21px;font-weight:750;letter-spacing:-.035em;margin:9px 0}.progress{font-size:18px;font-weight:850;color:var(--mint);font-variant-numeric:tabular-nums}.text-button{border:1px solid #385c55;border-radius:7px;background:transparent;color:#c3e3d5;padding:9px 13px;font-size:11px;font-weight:750}.text-button:hover{background:#1b3b33}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:15px;border:1px solid #2b4c49;border-radius:9px;background:#112b2d;padding:9px 14px;margin:13px 0 11px}.stats{display:flex;gap:20px}.stats>div{display:flex;align-items:baseline;gap:8px}.stats strong{font-size:21px;color:#b4ffd6;font-variant-numeric:tabular-nums}.stats small{font-size:9px;color:#a4c2b9;letter-spacing:.08em;font-weight:750}.prefs{display:flex;align-items:center;gap:8px}.prefs button{border:1px solid #4f7464;border-radius:5px;color:#c8e9d5;background:#15362f;font-size:13px;padding:4px 9px}.prefs output{font-size:11px;min-width:36px;color:#c0dccd}.prefs label{display:flex;align-items:center;gap:5px;font-size:10px;color:#b7cfc1}.prefs input{accent-color:#8af2b8}.viewport{height:clamp(410px,64vh,650px);background:#0d2027;border:1px solid #34564c;border-radius:11px;overflow:hidden;position:relative;cursor:text;touch-action:pan-y;isolation:isolate}.viewport-vignette{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 90px #050f154d}.world{position:absolute;left:0;top:0;will-change:transform;transform:translate3d(0,0,0)}#paths,.objects{position:absolute;inset:0;width:100%;height:100%}.room{position:absolute;padding:24px 28px 27px;background:transparent;overflow:visible;pointer-events:none;font-size:var(--font);line-height:1.58;text-align:left;letter-spacing:normal;hyphens:none;overflow-wrap:break-word}.room p{margin:0 0 .85em;white-space:normal}.room p:last-child{margin-bottom:0}.room p.dialogue{margin-left:.3em;padding-left:12px;border-left:2px solid #507569}.word{display:inline;white-space:nowrap}.char{color:#d7e9e2;position:relative;box-decoration-break:clone;font-variant-ligatures:none}.char.space{white-space:pre-wrap}.char.typed{color:#83e6b4}.char.active{background:#fee6a7;color:#102a24;border-radius:2px;outline:1px solid #fee6a7;outline-offset:1px}.char.space.active{background:none;outline:none;box-shadow:inset 0 -3px #fee6a7}.char.wrong{color:#fff;background:#a4484b}.corridor-glyph{position:absolute;white-space:pre;font-family:ui-monospace,"Cascadia Mono",Consolas,monospace;font-size:calc(var(--font) * .84);line-height:1;min-width:.6em;text-align:center;transform:translate(-50%,-50%);user-select:none;pointer-events:none;letter-spacing:normal}.corridor-glyph.space{background:transparent!important;outline:0!important;box-shadow:none!important}.corridor-glyph.active:not(.space){box-shadow:0 0 0 1px #213c32;outline:none}.room-shape{fill:var(--room);stroke:var(--edge);stroke-width:3;vector-effect:non-scaling-stroke}.route-outer{fill:none;stroke:var(--edge);stroke-width:48;stroke-linejoin:miter;stroke-linecap:butt}.route-inner{fill:none;stroke:var(--room);stroke-width:42;stroke-linejoin:miter;stroke-linecap:butt}.room-shape.active{stroke:#b8e8c6}.room-shape.done{stroke:#3e9476}.playfoot{padding:12px 2px 24px}.statusline{display:flex;justify-content:space-between;gap:14px;font-size:12px;color:#b6cabc;line-height:1.4}.pause{color:var(--gold);font-weight:700}.controls{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}.mainbutton{background:#a0eabd;color:#12281d;border:1px solid #9deab9;border-radius:7px;padding:10px 16px;font-size:12px;font-weight:850}.message{min-height:18px;color:#93b5a8;font-size:11px;margin-bottom:0}.message.bad{color:#ffb0a5}.capture{position:fixed;width:1px;height:1px;opacity:.01;bottom:0;left:50%;border:0;padding:0;pointer-events:none;font-size:16px}.finish{text-align:center;padding:70px 0 80px}.finish .star{font-size:45px;color:var(--gold)}.finish h1{font-size:clamp(40px,5vw,70px);margin:8px 0}.finish>p{color:#b4c9c1}.finish h2{font-size:23px}.done-stats{font-size:12px}.finish-buttons{display:flex;gap:9px;justify-content:center;margin:24px}.finish h3{text-align:left;margin-top:62px;font-size:19px}footer{border-top:1px solid #233d3c;color:#89a59b;display:flex;justify-content:space-between;gap:15px;padding:23px 0 30px;font-size:10px;font-weight:750;letter-spacing:.04em}
@media(max-width:860px){.hero-sketch{width:175px;flex:0 0 175px}.books{grid-template-columns:repeat(2,1fr)}.version{display:none}}
@media(max-width:610px){.shell{padding:0 12px}.topbar{height:65px}.brand{font-size:21px}.topright{gap:10px}.hero{padding:0 0 14px}.hero h1{font-size:36px}.hero-sketch{display:none}.hero p:not(.overline){font-size:13px}.shelf-head{flex-wrap:wrap}.books{grid-template-columns:1fr}.book{min-height:152px}.game-top{gap:8px}.game-top p{font-size:16px}.game-top .text-button{padding:7px}.toolbar{align-items:flex-start;padding:8px;flex-wrap:wrap}.stats strong{font-size:18px}.stats small{font-size:8px}.prefs{margin-left:auto}.viewport{height:clamp(410px,65vh,570px)}.room{padding:17px 18px 21px}.statusline{flex-direction:column;gap:4px}.controls .mainbutton{flex:1}.controls .text-button{font-size:10px;padding:8px}}
@media(prefers-reduced-motion:reduce){.world{will-change:auto}}
[hidden]{display:none!important}

.measure{position:absolute;left:-5000px;top:0;visibility:hidden;pointer-events:none}

.import-row{display:flex;align-items:center;gap:15px;flex-wrap:wrap;margin-top:21px}.import-button{display:inline-flex;border:1px solid #487e64;padding:11px 15px;background:#173831;color:#b5efd0;border-radius:8px;font-size:11px;font-weight:800;cursor:pointer}.import-button:hover{background:#255244}.import-row>span{font-size:11px;line-height:1.5;color:#9dbab0}

/* 0.5.1 — Optional symbol assistance, legible spaces and smooth visual-only caret.
   The canonical stream, geometry, typing progression, clock and camera remain 0.5. */
:root{--reading-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.room,.corridor-glyph{font-family:var(--reading-font);font-weight:400}
.char.space.active{background:#f9d89137;outline:1px solid #ffdda0;box-shadow:inset 0 -3px 0 #ffdda0;border-radius:2px}
.corridor-glyph.space:not(.active){background:transparent!important;outline:0!important;box-shadow:none!important}
.corridor-glyph.space.active{background:#f9d8913d!important;outline:1px solid #ffdda0!important;box-shadow:inset 0 -2px 0 #ffdda0!important;min-width:.65em;border-radius:3px}
/* The active character remains readable; only its outline glides, never blinks. */
.typing-glow{position:absolute;left:0;top:0;width:12px;height:21px;border:1.5px solid #ffdda0b3;border-radius:4px;box-shadow:0 0 12px #ffdda037;pointer-events:none;z-index:3;will-change:transform;transition:transform 117ms cubic-bezier(.2,.65,.25,1),width 117ms ease,height 117ms ease;}
.symbol-pref{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:13px;font-size:11px;color:#b6cabc}
.symbol-pref>span:first-child{font-size:10px;font-weight:800;letter-spacing:.08em;color:#bcd7ca}
.symbols-toggle{background:#173b34;color:#d2f8e3;border:1px solid #65947e;border-radius:6px;padding:7px 12px;font-size:10px;font-weight:850;letter-spacing:.04em}
.symbols-toggle[aria-pressed=false]{color:#f9dca5;border-color:#9b8356;background:#3b3124}
#symbols-help{font-size:11px;color:#8eaaa0}
@media(prefers-reduced-motion:reduce){.typing-glow{transition:none;will-change:auto}}
/* GOLD CONTOUR: SVG-only rendering correction. 0.5 geometry, camera,
   animation, letters, paragraphs and typing kernel are frozen. */
.room-fill{fill:var(--room);stroke:none}
.room-shape{fill:none}
/* Match the room boundary to the tunnel: neither changes colour independently. */
.room-shape.active,.room-shape.done{stroke:var(--edge)}
/* 0.5.3: visual silhouette only. All key, cursor and camera authorities are frozen. */
.unified-silhouette{fill:var(--room);stroke:var(--edge);stroke-width:3;stroke-linejoin:miter;stroke-linecap:square;vector-effect:non-scaling-stroke}

/* GOLD 0.6.3 page-finish transition. Does not affect the ghost or camera. */
.page-turn{position:absolute;inset:0;z-index:35;pointer-events:none;overflow:hidden;opacity:0;transition:opacity .18s ease;background:linear-gradient(110deg,transparent 20%,#e1f9e70f 70%,transparent);}
.page-turn.active{opacity:1}
.page-turn::before{content:"";position:absolute;inset:-15% -10%;transform:translateX(115%) skewX(-7deg);background:linear-gradient(92deg,transparent 0%,#98dfb70f 31%,#d7eddc38 56%,#132e36c9 63%,#122830e8 84%,transparent 100%);box-shadow:-12px 0 35px #9ceab51c;}
.page-turn.active::before{animation:mazefold-page-turn 850ms cubic-bezier(.28,.67,.13,.99) both}
.page-turn .turn-word{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.96);opacity:0;color:#c6efcd;white-space:nowrap;font-size:clamp(13px,2vw,21px);letter-spacing:.12em;font-weight:700;text-shadow:0 0 18px #baf3cf55}
.page-turn.active .turn-word{animation:mazefold-turn-word 850ms ease both}
@keyframes mazefold-page-turn{0%{transform:translateX(110%) skewX(-7deg)}100%{transform:translateX(-120%) skewX(-7deg)}}
@keyframes mazefold-turn-word{10%{opacity:0;transform:translate(-50%,-42%) scale(.96)}35%{opacity:1;transform:translate(-50%,-50%) scale(1)}75%{opacity:.9}100%{opacity:0;transform:translate(-50%,-58%) scale(1.02)}}
.finish:not([hidden]){animation:mazefold-finish-enter .45s cubic-bezier(.16,.7,.2,1) both}
@keyframes mazefold-finish-enter{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.page-turn,.page-turn::before,.page-turn .turn-word,.finish:not([hidden]){transition:none!important;animation:none!important}}

/* MAZEFOLD WRITE LAB 0.7 — editorial navigation only. Does not alter ghost, stage, or typography. */
.classic-library{gap:17px}.classic-head{gap:12px}.classic-head h2{margin-bottom:10px}.classic-chapters{max-height:390px}.classic-chapter[aria-current="true"]{border-color:#9fe9c0;background:#1a4235}.classic-chapter .chapter-progress{white-space:nowrap}
.classic-chapter:focus-visible,.classic-btn:focus-visible,.book-shortcuts button:focus-visible,.story-dialog button:focus-visible,.story-dialog a:focus-visible{outline:2px solid #bcf4d0;outline-offset:3px}
.classic-chapter .chapter-state{font-size:10px;font-weight:700;color:#a8ebbf;min-width:22px}.classic-chapter .chapter-state.muted{color:#7d9a92}
.chapter-nav{display:flex;align-items:center;gap:7px;justify-content:center;flex-wrap:wrap;color:#bde1ce;font-size:11px;line-height:1.5;padding:4px 2px 8px}
.chapter-nav[hidden],.chapter-nav button[hidden]{display:none!important}.chapter-nav button{font-size:11px;border:1px solid #4c7868;padding:7px 11px;border-radius:8px;background:#1b4037;color:#def4e6}.chapter-nav button:hover{background:#285547}.chapter-nav strong{color:#d8e9de;font-size:11px;max-width:450px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.classic-index-top{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:8px}
.classic-chapter-group{display:grid;gap:7px}
.classic-chapter-title{font-size:15px;font-weight:750;color:#edfff2}
.classic-subinfo{font-size:11px;color:#9cbbae;line-height:1.7}
.classic-bookshelf{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;margin:14px 0}
.classic-book-tile{border:1px solid #4a6b5c;background:#102f2e;color:#e1f6e8;border-radius:10px;padding:17px;display:grid;gap:9px;text-align:left;font:inherit;cursor:pointer}
.classic-book-tile:hover{border-color:#adf0c6;background:#17463a}.classic-book-tile .eyebrow{font-size:10px;letter-spacing:.13em;color:#96d8b2;font-weight:800}.classic-book-tile strong{font-size:17px;line-height:1.3}.classic-book-tile small{font-size:11px;line-height:1.6;color:#bdd5c5}.classic-book-tile .completion{font-size:11px;color:#bee5c8}
.book-shortcuts{display:flex;gap:8px;flex-wrap:wrap}.book-shortcuts a,.book-shortcuts button{border:1px solid #47685c;border-radius:7px;color:#c8e5d0;background:#143930;padding:9px 12px;font-size:11px;font-weight:750;text-decoration:none}.book-shortcuts a:hover,.book-shortcuts button:hover{background:#205342}
.story-dialog{width:min(710px,calc(100vw - 30px));max-height:min(82vh,760px);background:#10282f;border:1px solid #5b8876;border-radius:13px;padding:21px;color:#e1f2e6;box-shadow:0 12px 60px #000b;overflow:auto}
.story-dialog::backdrop{background:#051115b5;backdrop-filter:blur(3px)}
.story-dialog h2{font-size:23px;line-height:1.25;letter-spacing:-.035em;margin:10px 0 5px}
.story-dialog .dialog-head{display:flex;gap:16px;justify-content:space-between;align-items:start}.story-dialog .dialog-head button{border:1px solid #53786b;border-radius:8px;padding:6px 11px;color:#e7f5eb;background:#214637;font-size:14px}
.story-dialog p{color:#a9c9b8;font-size:12px;line-height:1.8}.story-dialog .classic-chapters{display:grid;grid-template-columns:1fr 1fr;max-height:none;overflow:visible;margin-top:20px}
.story-dialog .dialog-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}
.story-dialog .dialog-actions button,.story-dialog .dialog-actions a{border:1px solid #6c977c;border-radius:8px;background:#194236;color:#e0f3e4;padding:10px 13px;text-decoration:none;font-size:12px;font-weight:750}
.story-dialog .dialog-actions .primary{background:#a9eac4;color:#102a1d}
.story-dialog .rest-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}.story-dialog .rest-links a{display:grid;gap:5px;border:1px solid #4d7166;padding:15px;border-radius:9px;text-decoration:none;color:#e0f1e7}.story-dialog .rest-links a span{font-size:11px;color:#a6c0b2}
.classic-recs button{margin:7px 7px 0 0}.classic-note strong{color:#d8e9db}
@media(max-width:610px){.chapter-nav{justify-content:flex-start}.chapter-nav strong{max-width:220px}.story-dialog{padding:14px}.story-dialog .classic-chapters{grid-template-columns:1fr}.story-dialog .rest-links{grid-template-columns:1fr}}

/* Completion should stay centered; never stretch recommendations into a 3-column grid. */
#finish #recommend{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:11px;max-width:600px;margin:24px auto 0}
#finish #recommend p{margin:0;text-align:center;max-width:530px}
#finish #recommend .classic-next-button{width:min(100%,390px);margin:0}
#finish .finish-buttons{flex-wrap:wrap}

