:root{--paper:#eee7d7;--ink:#24251f;--muted:#777566;--red:#a43d2b;--line:#bfb7a3;--serif:Georgia,'Yu Mincho','Hiragino Mincho ProN','Noto Serif CJK JP',serif;--sans:Arial,'Hiragino Sans','Noto Sans CJK JP',sans-serif}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--paper);color:var(--ink)}body{font-family:var(--sans);-webkit-tap-highlight-color:transparent}button,select,input{font:inherit}button{cursor:pointer;touch-action:manipulation}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid var(--red);outline-offset:5px}button{color:inherit}button:disabled{cursor:default;opacity:.32}a{color:var(--red)}.sr-only{position:absolute;top:0;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.loading{display:grid;place-content:center;min-height:100dvh;text-align:center}.loading span{font:80px var(--serif)}.eyebrow{font-size:10px;text-transform:uppercase;letter-spacing:.27em;color:var(--muted)}.brand{border:0;background:none;text-align:left;padding:0;display:flex;gap:14px;align-items:center}.brand b{font:30px var(--serif);letter-spacing:.12em}.brand span{font:22px var(--serif);border-left:1px solid var(--line);padding-left:15px}.topbar{display:flex;align-items:center;justify-content:space-between;padding:30px 4.6vw;position:relative;z-index:5}.top-actions{display:flex;align-items:center;gap:22px}.text-btn{background:none;border:0;font-size:12px;letter-spacing:.05em;padding:10px 0;border-bottom:1px solid transparent}.text-btn:hover{border-color:var(--ink)}.icon-btn{background:none;border:1px solid var(--line);min-height:42px;min-width:42px;display:grid;place-content:center;border-radius:50%;font-size:18px;padding:8px}.icon-btn:hover{border-color:var(--ink)}.landscape{position:absolute;inset:0;width:100%;height:100%;z-index:-2}.title-art{position:absolute;right:1%;top:9%;width:65%;height:85%;z-index:-1}.primary{background:var(--ink);color:var(--paper);border:1px solid var(--ink);min-height:51px;padding:14px 28px;letter-spacing:.06em;font-size:12px;display:inline-flex;align-items:center;justify-content:center;gap:28px}.primary:hover{background:#3b3b30;transform:translateY(-1px)}.primary.red{background:var(--red);border-color:var(--red)}.secondary{border:1px solid var(--line);background:transparent;min-height:46px;padding:12px 22px;font-size:12px;letter-spacing:.03em}.secondary:hover{border-color:var(--ink);background:#ffffff2a}.seal{background:var(--red);color:var(--paper);font:17px var(--serif);writing-mode:vertical-rl;padding:7px 6px;letter-spacing:.14em;transform:rotate(-3deg)}.seal-tag{display:flex;align-items:center;gap:16px}.screen{min-height:100dvh;position:relative;isolation:isolate}.screen-header{margin:6vh auto 38px;max-width:1120px;padding:0 30px;display:flex;justify-content:space-between;align-items:end;gap:25px}.screen-header h1{font:clamp(32px,5vw,60px)/1.1 var(--serif);margin:16px 0}.screen-header p{font-size:13px;color:var(--muted);line-height:1.8;max-width:420px}.paths{display:grid;grid-template-columns:repeat(3,1fr);gap:22px;max-width:1120px;margin:0 auto;padding:0 30px}.path-card{border:1px solid var(--line);background:#f9f3e62b;padding:30px 27px;position:relative;text-align:left;min-height:315px;transition:transform .2s}.path-card:hover{transform:translateY(-5px);border-color:var(--ink)}.path-card .path-glyph{font:68px var(--serif);margin:30px 0 25px;display:block}.path-card h2{font:26px var(--serif);margin:0 0 14px}.path-card p{font-size:12px;line-height:1.7;color:var(--muted);min-height:43px}.path-card .arrow{position:absolute;bottom:26px;right:27px;font-size:22px}.path-card .progress{width:70%;height:2px;background:#c7bdac;margin-top:25px}.path-card .progress span{display:block;height:2px;background:var(--red)}.path-footer{max-width:1060px;margin:30px auto;display:flex;justify-content:space-between;align-items:center;gap:15px;font-size:11px;color:var(--muted);padding:0 20px}.dojo-grid{max-width:1000px;margin:0 auto;padding:0 30px 70px;display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.glyph-card{padding:20px 10px;background:#fff5;border:1px solid var(--line);text-align:center;position:relative}.glyph-card .glyph{display:block;font:50px var(--serif);margin:10px}.glyph-card .caption{font-size:11px;color:var(--muted)}.glyph-card .done{position:absolute;top:10px;right:10px;color:var(--red);font-size:12px}.tabs{display:flex;gap:4px;margin:20px 0}.tabs button{border:0;border-bottom:2px solid transparent;background:none;padding:12px 18px;font-size:13px}.tabs .selected{border-color:var(--red);color:var(--red)}
/* The complete battlefield is the writing surface. No separate worksheet. */
.battle{height:100dvh;min-height:420px;position:relative;overflow:hidden;isolation:isolate;user-select:none;-webkit-user-select:none}.battle .landscape{z-index:0}.battle .fighters{position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none}.battle .topbar{position:absolute;left:0;right:0;top:0;padding-top:max(20px,env(safe-area-inset-top));padding-bottom:10px}.battle .brand b{font-size:24px}.battle .brand span{font-size:18px}.battle .top-actions{gap:14px}.battle-title{position:absolute;top:28px;left:50%;transform:translateX(-50%);text-align:center;z-index:6;max-width:46%}.battle-title .eyebrow{white-space:nowrap}.encounter-name{font:20px var(--serif);margin:7px 0 8px}.seals{display:flex;justify-content:center;gap:5px}.seals span{width:21px;height:4px;background:var(--ink);transform:skew(-14deg)}.seals .broken{background:#a43d2b33}.lives{position:absolute;left:4.6vw;top:84px;z-index:7;display:flex;gap:8px}.life{width:15px;height:19px;background:var(--ink);clip-path:polygon(50% 0,65% 30%,90% 54%,99% 75%,83% 94%,55% 100%,24% 94%,3% 75%,7% 48%,34% 27%);transform:rotate(-8deg)}.life.empty{background:#24251f22;outline:1px solid #24251f55}.life-number{font-size:10px;color:var(--muted);align-self:center;margin-left:4px}.target{position:absolute;z-index:4;top:20%;left:5%;max-width:180px;padding-left:16px;border-left:2px solid var(--red)}.target .glyph{font:clamp(44px,5vw,68px)/1.1 var(--serif);display:block;margin:10px 0}.target .meaning{font:21px var(--serif);margin:10px 0}.target .reading{font-size:12px;line-height:1.8;color:#66675c}.target .script{font-size:10px;text-transform:uppercase;letter-spacing:.18em;color:var(--muted)}.battle canvas,.guide{position:absolute;inset:0;width:100%;height:100%;z-index:3}.battle canvas{touch-action:none;cursor:crosshair}.guide{z-index:2;pointer-events:none}.guide .ghost{stroke:#272b21;opacity:.105;stroke-width:3.9;fill:none;stroke-linecap:round;stroke-linejoin:round}.guide .next-guide{stroke:#a43d2b;opacity:.2;stroke-width:4;fill:none;stroke-linecap:round}.guide .guide-num{font:4px Arial;fill:#7b3e2d;opacity:.7}.guide .start-dot{fill:#a43d2b;opacity:.5}.guide .guide-arrow{fill:none;stroke:#a43d2b;stroke-width:.8;opacity:.45}.battle[data-phase='strike'] canvas,.battle[data-phase='strike'] .guide,.battle[data-phase='strike'] .target{visibility:hidden}.slash-streak,.ink-particles{opacity:0}.battle[data-phase='split'] .armor{opacity:0}.battle[data-phase='split'] .ink-particles{opacity:1}.battle .armor[hidden]{display:none}.battle-toolbar{position:absolute;bottom:max(26px,env(safe-area-inset-bottom));left:4.6vw;right:4.6vw;z-index:8;display:grid;grid-template-columns:1fr auto 1fr;align-items:end;gap:18px}.brush-tools{display:flex;gap:7px;align-items:center}.tool{background:#eee7d7bb;border:1px solid #aaa38c80;min-width:42px;min-height:42px;padding:10px 12px;font-size:11px}.tool:hover{border-color:var(--ink)}.freeze-label{text-align:center;max-width:330px;min-height:46px;display:flex;flex-direction:column;justify-content:center}.freeze-label strong{font:16px var(--serif);letter-spacing:.02em;font-weight:400}.freeze-label small{font-size:10px;margin-top:8px;color:var(--muted);letter-spacing:.08em}.resolve-group{justify-self:end;display:flex;gap:8px}.resolve-group .primary{min-height:47px;padding:13px 23px}.left-handed .brush-tools{grid-column:3;grid-row:1;justify-self:end}.left-handed .freeze-label{grid-column:2;grid-row:1}.left-handed .resolve-group{grid-column:1;grid-row:1;justify-self:start}.result-word{position:absolute;z-index:6;top:31%;left:50%;transform:translateX(-50%);font:italic clamp(30px,6vw,70px) var(--serif);text-align:center;pointer-events:none;opacity:0;white-space:nowrap}.result-word.show{animation:result-in 1.4s forwards}.tutorial-ribbon{position:absolute;z-index:7;left:50%;top:17%;transform:translateX(-50%);font:italic 16px var(--serif);color:#6d6c5e;text-align:center;max-width:55%;pointer-events:none}.drawing-mode{position:absolute;top:116px;right:4.6vw;z-index:7}.drawing-mode select{font-size:11px;border:0;background:transparent;color:var(--muted);padding:8px}.battle-note{position:absolute;z-index:7;right:4.6vw;top:84px;font-size:10px;color:var(--red);letter-spacing:.08em}.battle.finished .guide,.battle.finished canvas,.battle.finished .target{visibility:hidden}.high-contrast .guide .ghost{opacity:.2}.high-contrast .guide .next-guide{opacity:.35}.high-contrast{--muted:#504f44}.result-panel{background:#f2ecdfed;padding:40px;max-width:520px;border:1px solid var(--line);text-align:center;box-shadow:0 25px 70px #443d2420}.result-panel h1{font:48px var(--serif);font-weight:400;margin:22px 0 12px}.result-panel p{font-size:13px;line-height:1.8;color:var(--muted)}.result-panel .result-glyphs{font:34px var(--serif);letter-spacing:.25em;margin:25px 0}.result-panel .actions{display:flex;gap:12px;justify-content:center;margin:25px 0 0}.result-overlay{position:absolute;inset:0;z-index:10;display:grid;place-items:center;padding:25px;background:#eee7d744}.battle .save-warning{position:absolute;z-index:9;bottom:94px;left:50%;transform:translateX(-50%);font-size:11px;color:var(--red);max-width:80%;text-align:center}.save-warning:empty{display:none}dialog{max-width:570px;width:calc(100% - 34px);max-height:calc(100dvh - 40px);padding:0;border:1px solid var(--line);background:#f2ecdf;color:var(--ink);box-shadow:0 30px 130px #2223}dialog::backdrop{background:#302c2466;backdrop-filter:blur(5px)}.modal-head{display:flex;justify-content:space-between;align-items:start;padding:30px 32px 18px;gap:20px}.modal-head h2{font:32px var(--serif);font-weight:400;margin:5px 0}.modal-body{padding:0 32px 32px}.setting-row{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:15px 0;border-bottom:1px solid #bfb7a355;font-size:13px}.setting-row select{padding:8px 10px;background:transparent;border:1px solid var(--line);max-width:190px}.setting-row input{accent-color:var(--red);width:18px;height:18px}.setting-note{font-size:11px;line-height:1.8;color:var(--muted);margin:18px 0}.tutorial-steps{list-style:none;counter-reset:steps;margin:0;padding:0}.tutorial-steps li{counter-increment:steps;padding:20px 0 20px 42px;position:relative;font-size:13px;line-height:1.8;border-bottom:1px solid #bfb7a355}.tutorial-steps li:before{content:'0' counter(steps);position:absolute;left:0;color:var(--red);font:22px var(--serif)}.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:25px}.credits{font-size:12px;line-height:1.9}.credits p{margin:0 0 18px}.pause-actions{display:grid;gap:10px}.small-glyph{font:22px var(--serif)}
@keyframes result-in{0%{opacity:0;translate:0 10px}25%,78%{opacity:1;translate:0 0}100%{opacity:0}}.reduced-motion *, .reduced-motion *:before{animation-duration:.15s!important;transition-duration:.05s!important}
@media(min-width:1500px){.title-art{right:8%;width:57%}.battle .target{left:8%;top:24%}}
@media(max-width:760px){.topbar{padding:22px 6vw}.top-actions{gap:13px}.top-actions .eyebrow{display:none}.brand b{font-size:24px}.brand span{font-size:18px}.title-art{right:-24%;top:14%;width:100%;height:73%;opacity:.88}.seal{font-size:14px}.screen-header{margin-top:3vh;display:block;padding:0 22px;margin-bottom:22px}.paths{grid-template-columns:1fr;gap:12px;padding:0 22px}.path-card{min-height:175px;padding:22px 23px 23px 110px}.path-card .path-glyph{position:absolute;left:23px;top:38px;font-size:52px;margin:0}.path-card p{min-height:0;margin-bottom:0}.path-card h2{margin:8px 0}.path-card .progress{margin-top:19px}.path-card .arrow{bottom:20px}.path-footer{display:block;line-height:2;padding:0 22px}.dojo-grid{grid-template-columns:repeat(4,1fr);gap:9px;padding:0 22px 35px}.glyph-card{padding:16px 4px}.glyph-card .glyph{font-size:42px;margin:3px}.tabs button{padding:10px 13px}.battle-title{top:24px;max-width:42%}.battle-title .eyebrow{font-size:8px;letter-spacing:.1em}.encounter-name{font-size:16px}.battle .brand span{display:none}.battle .brand b{font-size:20px}.battle .top-actions .text-btn{display:none}.lives{left:6vw;top:78px;gap:6px}.life{width:13px;height:17px}.life-number{display:none}.battle-note{right:6vw;top:78px;font-size:9px}.target{top:130px;left:6vw;max-width:85%;display:grid;grid-template-columns:auto auto 1fr;column-gap:12px;align-items:center;padding-left:10px;border-left-width:1px}.target .script{grid-column:1 / 4;font-size:8px}.target .glyph{font-size:36px;margin:7px 0}.target .meaning{font-size:18px;margin:7px 0}.target .reading{font-size:10px;max-width:180px}.drawing-mode{top:99px;right:6vw}.tutorial-ribbon{top:29%;font-size:13px;max-width:80%;width:80%}.battle-toolbar{left:6vw;right:6vw;bottom:max(22px,env(safe-area-inset-bottom));grid-template-columns:1fr auto;row-gap:15px;align-items:center}.freeze-label{grid-column:1/3;grid-row:1;max-width:100%;min-height:38px}.freeze-label strong{font-size:15px}.brush-tools{grid-row:2;gap:4px}.resolve-group{grid-row:2}.tool{min-width:36px;padding:10px 8px;font-size:10px}.resolve-group .primary{min-height:44px;padding:12px 17px;font-size:11px;gap:8px}.left-handed .brush-tools{grid-row:2;grid-column:2;justify-self:end}.left-handed .freeze-label{grid-column:1/3;grid-row:1}.left-handed .resolve-group{grid-row:2;grid-column:1}.result-word{top:40%}.battle .save-warning{bottom:130px}.result-panel{padding:30px 22px}.result-panel h1{font-size:38px}.result-panel .actions{flex-wrap:wrap}.modal-head{padding:25px 24px 15px}.modal-body{padding:0 24px 25px}.modal-head h2{font-size:28px}}
@media(max-height:550px) and (min-width:600px){.topbar{padding-top:17px;padding-bottom:15px}.title-art{top:0;height:100%}.battle .topbar{padding-top:12px}.battle-title{top:15px}.lives{top:63px}.target{top:29%;left:4.6vw;display:block;max-width:150px}.target .glyph{font-size:36px}.target .meaning{font-size:16px}.target .reading{font-size:10px}.battle-toolbar{bottom:17px;grid-template-columns:1fr auto 1fr;gap:12px}.brush-tools{grid-column:1;grid-row:1}.freeze-label{grid-column:2;grid-row:1;max-width:240px}.resolve-group{grid-column:3;grid-row:1}.tutorial-ribbon{top:23%;font-size:13px}.battle-note{top:63px}.drawing-mode{top:87px}.battle .fighters{height:100%;top:0}.screen-header{margin:1vh auto 10px}.screen-header h1{font-size:34px}.path-card{min-height:230px}.path-card .path-glyph{font-size:45px;margin:12px 0}.result-panel{padding:18px 35px}.result-panel h1{margin:10px 0;font-size:32px}.result-panel .result-glyphs{margin:12px 0}.result-panel .actions{margin-top:15px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

/* Small completion/voice polish; original scene composition remains unchanged. */
.auto-finish-label{font-size:10px;letter-spacing:.05em;color:var(--muted);max-width:160px;text-align:right;line-height:1.6}@media(max-width:760px){.auto-finish-label{max-width:115px;font-size:9px}}
/* Approved original identity, kept as original pixels. */
.brand .logo-pixels{display:block;width:88px;height:55px;padding:0;border:0;background-image:url('./assets/approved-enso-cover.png');background-repeat:no-repeat;background-size:195px 110px;background-position:-1px -27px;mix-blend-mode:multiply}.brand .sr-only{padding:0;border:0}.path-card.selected,.path-card:hover,.path-card:focus-visible{border-color:var(--red);box-shadow:inset 3px 0 0 var(--red)}.path-card.selected h2,.path-card:hover h2{color:var(--red)}.lesson-header-actions{display:flex;gap:12px;align-items:center}.lesson-list{max-width:1060px;margin:0 auto;padding:0 30px;display:grid;grid-template-columns:1fr 1fr;gap:12px}.lesson-card{display:grid;grid-template-columns:35px 1fr auto 14px;align-items:center;gap:15px;padding:20px;background:#fff2;border:1px solid var(--line);text-align:left;min-height:88px}.lesson-card strong{font:19px var(--serif);font-weight:400;display:block}.lesson-card small{display:block;color:var(--muted);font-size:10px;margin-top:7px}.lesson-number{font:22px var(--serif);color:var(--muted)}.lesson-glyphs{font:23px var(--serif);letter-spacing:.1em}.lesson-card.selected{border-color:var(--red);box-shadow:inset 3px 0 0 var(--red)}.lesson-card.selected .lesson-number,.lesson-card.selected .lesson-check{color:var(--red)}.lesson-card:not(:disabled):hover{background:#fff5;border-color:var(--red)}.lesson-card:disabled{opacity:.4}.boss-lesson{grid-column:1/-1}.lesson-check{font-size:18px}
/* The light changes at encounter boundaries only; all ink follows the palette. */
.guide .ghost{stroke:var(--ink)}.guide .next-guide,.guide .guide-arrow{stroke:var(--red)}.guide .guide-num,.guide .start-dot{fill:var(--red)}.life{background:var(--ink)}.battle canvas{transition:opacity .4s ease}.battle[data-phase='split'] canvas,.battle[data-phase='armor'] canvas{opacity:.2!important}.battle[data-phase='ready'] canvas,.battle[data-phase='cinematic'] canvas,.battle[data-cinematic] canvas,.battle[data-cinematic] .guide,.battle[data-cinematic] .target,.battle[data-cinematic] .tutorial-ribbon{visibility:hidden}.battle[data-cinematic] .battle-toolbar,.battle[data-cinematic] .drawing-mode,.battle[data-cinematic] .battle-note{opacity:0;pointer-events:none}.battle[data-cinematic] .topbar,.battle[data-cinematic] .battle-title,.battle[data-cinematic] .lives{opacity:0;pointer-events:none}.cinematic-overlay{position:absolute;inset:0;z-index:12;pointer-events:none;overflow:hidden}.cinema-bar{position:absolute;left:0;right:0;height:9%;background:#111610;opacity:.9}.cinema-bar.top{top:0}.cinema-bar.bottom{bottom:0}.cinematic-copy{position:absolute;left:8%;top:26%;max-width:40%;color:var(--ink);animation:cinema-copy-in .6s ease-out both}.cinematic-copy h2{font:clamp(30px,5vw,68px)/1.1 var(--serif);margin:20px 0}.cinematic-copy p{font:italic 16px/1.7 var(--serif);max-width:270px}.skip-cinematic{position:absolute;right:5%;bottom:3%;pointer-events:auto;border:1px solid #ece5d477;color:#ece5d4;background:none;padding:9px 20px;font-size:11px;letter-spacing:.1em;min-height:40px}.skip-cinematic:hover,.skip-cinematic:focus-visible{background:#ece5d425}.battle[data-cinematic='boss-intro'] .cinematic-copy{left:auto;right:7%;top:27%;text-align:right}.battle[data-cinematic='boss-intro'] .cinematic-copy p{margin-left:auto}.battle[data-cinematic='boss-defeat'] .cinematic-copy{left:50%;top:27%;transform:translateX(-50%);text-align:center;max-width:70%;width:70%}.battle[data-cinematic='boss-defeat'] .cinematic-copy p{max-width:none}@keyframes cinema-copy-in{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}
@media(max-width:760px){.brand .logo-pixels{width:73px;height:46px;background-size:162px 91px;background-position:-1px -23px}.lesson-list{grid-template-columns:1fr;padding:0 22px}.lesson-card{gap:10px;padding:16px}.lesson-header-actions{margin-top:20px}.cinematic-copy{left:7%;top:23%;max-width:65%}.cinematic-copy h2{font-size:34px}.cinematic-copy p{font-size:13px;max-width:200px}.battle[data-cinematic='boss-intro'] .cinematic-copy{right:7%;top:22%;max-width:70%}.battle[data-cinematic='boss-defeat'] .cinematic-copy{top:25%;max-width:85%;width:85%}}
@media(max-height:550px) and (min-width:600px){.lesson-list{grid-template-columns:1fr 1fr}.cinematic-copy{top:21%}.cinematic-copy h2{font-size:34px;margin:12px 0}.cinematic-copy p{font-size:12px}.brand .logo-pixels{width:67px;height:42px;background-size:148px 83px;background-position:-1px -21px}.cinema-bar{height:8%}.skip-cinematic{bottom:1%;min-height:30px;padding:6px 18px}}

.world-reward{position:absolute;z-index:8;top:23%;left:50%;transform:translateX(-50%);font:italic 16px var(--serif);color:var(--red);text-align:center;pointer-events:none}.world-reward:empty{display:none}@media(max-width:760px){.world-reward{top:32%;font-size:13px;max-width:80%;width:80%}}.battle[data-cinematic] .world-reward{visibility:hidden}

.setting-row input[type="range"]{width:155px;height:24px}.battle[data-paused="true"] .cinematic-copy{animation-play-state:paused}

.top-actions .text-btn:is(:hover,:focus-visible){color:var(--red);border-color:var(--red)}
/* Brush Lab */
.brush-lab{height:100dvh;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr);padding-bottom:16px;background:var(--paper)}
.brush-lab .screen-header{width:100%;max-width:1180px;margin:0 auto;padding:0 24px 16px}.brush-lab .screen-header h1{font-size:32px;margin:0}
.brush-lab-grid{width:100%;max-width:1180px;min-height:0;margin:0 auto;padding:0 24px;display:grid;grid-template-columns:minmax(220px,.75fr) minmax(0,1.6fr);gap:24px}
.brush-selector{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-content:start;overflow-y:auto;min-height:0;padding:2px 8px 4px 2px}
.brush-option{display:flex;align-items:center;gap:10px;min-height:64px;padding:10px 12px;border:1px solid rgba(35,47,46,.18);border-radius:8px;background:rgba(255,252,244,.62);color:#263433;text-align:left;cursor:pointer;transition:transform .18s ease,border-color .18s ease,background .18s ease}
.brush-option:hover{transform:translateY(-2px);border-color:rgba(163,61,50,.6)}
.brush-option.selected{border-color:#a33d32;background:#fffaf0;box-shadow:0 4px 14px rgba(48,42,34,.1)}
.brush-option strong,.brush-option small{display:block}.brush-option strong{font-size:12px;letter-spacing:.02em}.brush-option small{margin-top:3px;font-size:10px;opacity:.66}
.brush-swatch{display:block;flex:none;width:22px;height:38px;border-radius:50%;background:var(--swatch);transform:rotate(22deg);box-shadow:inset 5px 0 0 rgba(255,255,255,.18),0 2px 5px rgba(30,30,24,.18)}
.brush-stage{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;padding:12px;border:1px solid var(--line);background:#f9f6ed}
.brush-stage-head,.brush-stage-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.brush-stage-head{padding-bottom:8px;font-size:12px}.brush-stage canvas{display:block;width:100%;height:100%;min-height:0;touch-action:none;border:1px solid var(--line);background:#f9f6ed;cursor:crosshair}
.brush-stage-actions{justify-content:flex-end;flex-wrap:wrap;padding-top:8px}.brush-stage-actions button{min-height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px;font-size:12px}
@media(max-width:800px){.brush-lab-grid{grid-template-columns:minmax(170px,.7fr) minmax(0,1.4fr);padding:0 16px;gap:12px}.brush-lab .screen-header{padding:0 16px 12px}.brush-selector{grid-template-columns:1fr}}
@media(max-width:460px){.brush-lab-grid{grid-template-columns:1fr;grid-template-rows:minmax(100px,.7fr) minmax(220px,1fr)}.brush-selector{grid-template-columns:1fr 1fr}.brush-lab{min-height:600px}}
.circular-seal{position:absolute;left:50%;top:52%;width:clamp(86px,13vw,148px);aspect-ratio:1;display:grid;place-items:center;border:2px solid rgba(163,61,50,.78);border-radius:50%;color:#a33d32;opacity:0;transform:translate(-50%,-50%) scale(.55) rotate(-18deg);pointer-events:none;z-index:8}.circular-seal span{font-family:serif;font-size:clamp(34px,5vw,58px);font-weight:700}.circular-seal.seal-animate{animation:circular-seal-in 1.2s cubic-bezier(.16,.76,.24,1) forwards}@keyframes circular-seal-in{0%{opacity:0;transform:translate(-50%,-50%) scale(.55) rotate(-18deg)}35%{opacity:.95;transform:translate(-50%,-50%) scale(1.04) rotate(2deg)}72%{opacity:.72;transform:translate(-50%,-50%) scale(.98) rotate(0)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.12) rotate(0)}}

/* Battle coordinates stay native to the viewport. Menus and the Lab may be portrait. */
.battle{min-height:0}
.rotate-gate[hidden]{display:none}
body:has(.rotate-gate:not([hidden])){overflow:hidden}
.rotate-gate{position:fixed;inset:0;z-index:50;width:100%;height:100dvh;overflow:hidden;display:grid;place-items:center;background:#f3ebdc;border:0;border-radius:0;padding:0;margin:0}
.rotate-gate>img{width:100%;height:100%;object-fit:contain;pointer-events:none}
.battle[data-paused='true'] *, .battle[data-paused='true'] *::before, .battle[data-paused='true'] *::after{animation-play-state:paused!important}
@media(max-height:450px) and (orientation:landscape){.battle .topbar{padding-top:max(8px,env(safe-area-inset-top))}.battle-toolbar{bottom:max(9px,env(safe-area-inset-bottom))}.battle-title{top:12px}.lives{top:58px}.battle .target{top:26%}.battle .tutorial-ribbon{top:24%}}

body.in-battle{overflow:hidden}
@media(max-height:550px) and (min-width:600px){
}
/* Player ink is always black sumi, by day and by night. */
.battle canvas{--ink:#151513}

/* The original title art gets its own framed space; controls never crop or cover it. The bitmap's own edge painting stays as drawn. */
.home{position:relative;isolation:isolate;height:100dvh;min-height:0;overflow:hidden;background:var(--paper)}
.home .topbar{position:absolute;inset:max(16px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) auto auto;padding:0;justify-content:flex-end}
.home .approved-cover{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:left center;z-index:-1}
.home .actions{position:absolute;left:20px;right:20px;bottom:max(24px,env(safe-area-inset-bottom));display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px;margin:0}
.home button{min-height:44px}
/* One brush control for title, level and defeat, from the unchanged menu-brush.svg. The mask maps the painted stroke onto the
   full width; each half keeps only its organic left end, and the second half is mirrored, so both ends are complete and the
   blunt tip never shows. The side padding is the label's painted margin. Level controls swap in their own strokes below. */
:is(.home,.level-select,.defeat-panel) .menu-action{position:relative;isolation:isolate;display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;color:#eee7d7;padding:14px 32px;min-height:54px;font:600 clamp(16px,1.8vw,21px) var(--serif);letter-spacing:.03em;white-space:nowrap}
:is(.home,.level-select,.defeat-panel) .menu-action::before,:is(.home,.level-select,.defeat-panel) .menu-action::after{content:'';position:absolute;inset:0;z-index:-1;background:#24251f;mask:url('./assets/menu-brush.svg') 28.62% 50%/116.82% 100% no-repeat;clip-path:inset(0 40% 0 0)}
:is(.home,.level-select,.defeat-panel) .menu-action::after{transform:scaleX(-1)}
:is(.home,.level-select,.defeat-panel) .menu-action:is(:hover,:focus-visible){color:#eee7d7;background:transparent;outline-offset:3px}
:is(.home,.level-select,.defeat-panel) .menu-action:is(:hover,:focus-visible)::before,:is(.home,.level-select,.defeat-panel) .menu-action:is(:hover,:focus-visible)::after{background:#a43d2b}
:is(.home,.level-select,.defeat-panel) .menu-action:active{transform:translateY(1px)}
@media(max-height:450px){.home .actions{gap:8px;bottom:12px}.home .actions .menu-action{min-height:44px;padding:8px 20px;font-size:14px}}

/* Level choice: the original battlefield, gently subdued, behind one centered stack of uniform brush choices.
   The full-screen dialog keeps its focus, label and Escape. */
#modal[data-kind='knowledge']{inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;background:#f5eddc;box-shadow:none;overflow:hidden}
#modal[data-kind='knowledge']::backdrop{background:#f5eddc;backdrop-filter:none}
#modal .level-art{position:absolute;inset:0;height:auto;opacity:.72;pointer-events:none}
/* The backdrop copy keeps combat's hidden armor hidden. */
#modal .level-art .armor{display:none}
.level-select{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:clamp(6px,2vh,24px) 16px}
.level-select h2{margin:0 0 clamp(8px,5vh,45px);font:italic 400 clamp(22px,6.4vh,58px)/1.1 var(--serif);color:var(--ink);text-align:center}
.level-choices{display:flex;flex-direction:column;gap:clamp(5px,.5vh,6px);width:clamp(200px,24.9vw,395px)}
.level-select .level-choice{width:100%;min-height:clamp(44px,9.9vh,98px);padding:8px 30px;font-size:clamp(17px,4vh,38px);font-weight:400}
.level-select .level-menu{margin-top:clamp(10px,6vh,54px);min-width:clamp(120px,13vw,210px);min-height:clamp(44px,6.7vh,66px);padding:8px 28px;font-size:clamp(15px,2.5vh,24px);font-weight:400}
@media(max-height:450px){.level-select h2{margin-bottom:8px}.level-select .level-menu{margin-top:10px}}
/* Each level control is one row of level-brush-atlas.png, a different painted stroke with rough ends and solid ink under the label.
   The atlas rows are not equal bands and carry transparent margins, so each row's painted alpha bounds, not its band, are
   fitted to the button: one mask-size per stroke and a centring position per row. The narrower Menu stroke keeps its painted area. */
.level-select .menu-action::before{mask:url('./assets/level-brush-atlas.png') 52% 5.24%/110% 600% no-repeat;clip-path:none}
.level-select .menu-action::after{content:none}
.level-select .level-choice:nth-child(2)::before{mask-position:54% 28.43%}
.level-select .level-choice:nth-child(3)::before{mask-position:53% 51.03%}
.level-select .level-choice:nth-child(4)::before{mask-position:55% 73.97%;mask-size:109% 600%}
.level-select .level-menu::before{mask-position:55.6% 95.53%;mask-size:120% 680%}

/* Defeat, the only black world: the word, one line, an ivory Retry brush and a plain Menu right of the planted katana.
   The scene is aria-hidden art under real text and buttons; the battle tools step away behind it. */
.battle[data-result='defeat'] :is(.topbar,.battle-title,.lives,.target,.guide,canvas,.ink-onset,.circular-seal,.world-reward,.battle-toolbar){visibility:hidden}
.defeat-overlay{padding:0;overflow:hidden;background:#131312}
.defeat-scene{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
/* Centered on the 1586×992 composition's text column (x≈62.9%, y≈51%); the art's slice crop keeps that column aligned. */
.defeat-panel{position:absolute;z-index:1;left:62.9%;top:51%;transform:translate(-50%,-50%);width:max-content;max-width:calc(100% - 24px);display:flex;flex-direction:column;align-items:center;text-align:center;color:#ebe4d4;text-shadow:0 1px 12px #000a}
.defeat-panel h1{margin:0 0 clamp(2px,1vh,10px);font:400 clamp(34px,11vh,112px)/1.1 var(--serif);letter-spacing:.02em}
.defeat-panel .defeat-vow{margin:0 0 clamp(10px,4.3vh,43px);font:400 clamp(13px,2.5vh,25px)/1.3 var(--serif);letter-spacing:.16em;color:#cfc8b8}
.defeat-panel .defeat-retry{min-width:clamp(176px,31vw,500px);min-height:clamp(44px,11.5vh,114px);padding:8px 40px;font-size:clamp(18px,4.4vh,44px);font-weight:400;color:#1a1917;text-shadow:none}
.defeat-panel .defeat-retry::before,.defeat-panel .defeat-retry::after{background:#e3dccb}
.defeat-panel .defeat-menu{margin-top:clamp(6px,2.4vh,24px);min-width:88px;min-height:44px;padding:8px 20px;font:clamp(17px,2.5vh,24px) var(--serif);letter-spacing:.04em;color:inherit}
.defeat-panel .defeat-menu:is(:hover,:focus-visible){color:#fff;border-color:#ebe4d4}
.defeat-overlay :focus-visible{outline:2px solid #ebe4d4;outline-offset:4px}

/* Retry shares the exact authored painted level-mask mapping. */
.defeat-panel .defeat-retry::before{mask:url('./assets/level-brush-atlas.png') 52% 5.24%/110% 600% no-repeat;clip-path:none}
.defeat-panel .defeat-retry::after{content:none}
/* Shared utility controls keep the battle icon vocabulary and usable targets. */
.utility-action,.home-nav{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:44px;min-height:44px}.utility-action .icon,.home-nav .icon,.icon-btn .icon,.brush-stage-actions .icon{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}.top-actions .utility-action{padding:10px 12px;background:var(--paper);border:1px solid var(--line);border-radius:50%;font-size:0;gap:0}.top-actions .utility-action .icon{width:24px;height:24px}.text-btn{min-height:44px;min-width:44px}.icon-btn{min-width:44px;min-height:44px}
dialog[open]:not([data-kind="knowledge"]){display:flex;flex-direction:column;overflow:hidden}.modal-head{flex:none;padding:16px 24px;align-items:center;background:#f2ecdf;border-bottom:1px solid var(--line)}.modal-head h2{margin:0}.modal-body{min-height:0;overflow-y:auto;padding:0 24px 24px;overscroll-behavior:contain}.setting-row{min-height:48px}.setting-row input[type="checkbox"]{min-width:24px;min-height:24px}.setting-row input[type="range"]{min-height:44px}.pause-actions .secondary,.pause-actions .text-btn{display:flex;gap:12px;align-items:center;justify-content:center;min-height:48px}.brush-lab .topbar{padding:12px 24px}.brush-lab .top-actions{gap:8px}
@media(max-height:450px){.brush-lab .topbar{padding:6px 16px}.brush-lab .screen-header{padding-bottom:8px}.brush-lab .screen-header h1{font-size:24px}.brush-option{min-height:48px;padding:8px}.brush-option small{display:none}.brush-stage-actions{gap:4px}.brush-stage-actions button{padding:6px 8px;font-size:11px}.modal-head{padding:8px 16px}.modal-head h2{font-size:26px}.brush-stage-head{font-size:11px}.home .topbar{top:12px;right:16px}}

/* The selected video scene and original complete logo, projected without redrawing either asset. */
.home .home-composition{position:absolute;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none}
.title-reveal-brushes path{stroke-dasharray:1;stroke-dashoffset:0}
.home[data-reveal='true'] .title-reveal-brushes path{stroke-dashoffset:1;animation:title-brush .55s linear forwards}
@keyframes title-brush{to{stroke-dashoffset:0}}
.reduced-motion .home .title-reveal-brushes path{animation:none;stroke-dashoffset:0}
@media(prefers-reduced-motion:reduce){.home .title-reveal-brushes path{animation:none;stroke-dashoffset:0}}

.home .title-subtitle{font:italic 56px var(--serif);fill:var(--ink)}
