@font-face{font-family:Pixel;src:url('assets/pixel-zh.ttf?v=12');font-display:swap}
:root{color-scheme:dark;--gold:#f0cc85;--muted:#9bb0bc;--red:#ffa38c;--ice:#a2e9ff}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#07121e}body,button{font-family:Pixel,"PingFang SC",sans-serif}button{color:inherit;border:0;cursor:pointer;background:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button:focus-visible{outline:2px solid #fff1b5;outline-offset:6px}button:disabled{cursor:wait;opacity:.35}button,kbd{user-select:none}kbd{font:11px Pixel,monospace}button svg{pointer-events:none}button i{font-style:normal}.game{position:fixed;inset:0;overflow:hidden;color:#f3e8d3;isolation:isolate;background:#0c1a2c}#battle{position:absolute;width:100%;height:100%;object-fit:cover;image-rendering:pixelated;touch-action:none;cursor:crosshair}.atmosphere{position:absolute;inset:0;pointer-events:none;background:linear-gradient(#07111f88 0%,transparent 20%,transparent 68%,#060e20af 100%);box-shadow:inset 0 0 100px #02091455}.screen-grain{position:absolute;inset:0;pointer-events:none;opacity:.035;background:repeating-linear-gradient(transparent 0px,transparent 3px,#000 3px,#000 4px);z-index:15}
.game-tools{position:absolute;right:max(28px,env(safe-area-inset-right));top:max(25px,env(safe-area-inset-top));display:flex;gap:9px;z-index:40}.tool{font-family:system-ui,sans-serif;width:34px;height:34px;font-size:21px;display:grid;place-items:center;color:#e7d6b6;opacity:.7;text-shadow:2px 2px #071018;transition:opacity .15s,transform .15s}.tool:hover{opacity:1;transform:translateY(-2px)}.tool:disabled{opacity:.18;cursor:default}.tool[aria-pressed=false]{opacity:.35}.tool[aria-pressed=false]:after{content:'';position:absolute;width:22px;height:1px;background:#e7d6b6;transform:rotate(-40deg)}
.hud{position:absolute;inset:0;pointer-events:none;z-index:5}.player-vitals{position:absolute;left:max(31px,env(safe-area-inset-left));top:29px;display:flex;align-items:center;gap:12px}.portrait{width:53px;height:57px;position:relative;overflow:hidden;background:linear-gradient(120deg,#49392b,#132631);border:2px solid #917449;box-shadow:0 0 0 2px #101c27,0 3px 0 3px #060f16;clip-path:polygon(7px 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%,0 7px)}.portrait img{position:absolute;width:100%;height:100%;max-width:none;left:0;top:0;object-fit:contain;image-rendering:pixelated}.player-info{width:166px}.vitals-heading{display:flex;justify-content:space-between;font-size:13px;color:#ebdfc8;text-shadow:2px 2px #07101b}.vitals-heading>span:last-child{font:10px Pixel,monospace;color:#c7d6ca}.health-frame{height:12px;margin:8px 0 6px;padding:2px;background:#0a101b;border:1px solid #a9a172;box-shadow:0 2px #050b10;position:relative;transform:skewX(-8deg)}.health-fill{width:100%;height:100%;background:linear-gradient(#e1f9a0 0 20%,#8ab868 20% 70%,#4d7945 70%);transition:width .25s}.health-frame:after{content:'';position:absolute;inset:2px;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(20% - 2px),#10281d88 calc(20% - 2px),#10281d88 20%)}.condition{font-size:10px;color:#adbeaa;text-shadow:1px 2px #07111d;letter-spacing:1px}.boss-vitals{position:absolute;left:50%;top:29px;transform:translateX(-50%);width:min(29vw,365px);text-align:center}.boss-name{display:flex;align-items:center;justify-content:center;gap:14px;text-shadow:2px 2px #07101b;font-size:17px;letter-spacing:3px;color:#c6dbe8}.boss-name i{font-size:7px;font-style:normal;color:#a9c4de}.boss-health-frame{height:10px;background:#0c1520;border:1px solid #778fa4;margin-top:9px;padding:2px;box-shadow:0 0 0 2px #0d1924,0 3px #02070e;clip-path:polygon(5px 0,calc(100% - 5px) 0,100% 50%,calc(100% - 5px) 100%,5px 100%,0 50%)}#enemy-bar{height:100%;background:linear-gradient(#dae5ff 0 25%,#91acd9 25% 70%,#627aab 70%);width:100%;transition:width .2s}.boss-details{display:flex;justify-content:space-between;margin:7px 5px;color:#b6bdcf;font-size:10px;text-shadow:2px 2px #07101b}#wave-number{color:#e9cb8e}
.title-screen{position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse 46% 31% at 50% 32%,#06101e68,transparent);z-index:10}.title-lockup{position:absolute;top:8%;left:50%;transform:translateX(-50%);width:90%;text-align:center;text-shadow:0 3px #07121f,0 0 25px #07121f}.academy-name{font:12px Georgia,serif;letter-spacing:6px;color:#cfb984;margin:0 0 13px}.title-stars{color:#e1c48a;font:13px Georgia,serif;letter-spacing:10px;margin-bottom:9px}.title-stars span{font-size:22px;display:inline-block;transform:translateY(2px);margin:0 16px}.cn-academy{font-size:17px;letter-spacing:6px;color:#ead4a9;margin:10px 0 14px}.title-lockup h1{font-family:Pixel,serif;font-size:clamp(54px,7vw,108px);font-weight:400;letter-spacing:8px;line-height:1.1;margin:0;color:#ffe5a7;text-shadow:0 3px #a47c48,0 6px #263031,4px 6px #071222,0 0 40px #07121f,0 0 55px #061222}.title-tagline{font-size:13px;color:#d1d9d3;letter-spacing:5px;margin-top:24px}.start-menu{position:absolute;left:50%;top:61%;transform:translateX(-50%);text-align:center;pointer-events:auto}.game-button{position:relative;min-width:215px;display:flex;align-items:center;justify-content:center;gap:25px;background:#d7b16b;color:#29251e;font-size:23px;letter-spacing:3px;padding:17px 28px;clip-path:polygon(6px 0,calc(100% - 6px) 0,calc(100% - 6px) 4px,100% 4px,100% calc(100% - 5px),calc(100% - 6px) calc(100% - 5px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 5px),0 calc(100% - 5px),0 5px,6px 5px);box-shadow:inset 0 4px #ffedaf,inset 0 -5px #73512d,inset 4px 0 #f3d395,inset -4px 0 #937044;text-shadow:0 1px #ffe9ae;transition:filter .15s,transform .15s}.game-button i{font-size:13px}.game-button:hover{filter:brightness(1.15);transform:translateY(-2px)}.game-button:active{transform:translateY(2px)}.start-menu>p{font-size:12px;letter-spacing:2px;color:#d0d9d3;text-shadow:2px 2px #06111c;margin-top:18px;white-space:nowrap}.title-location{position:absolute;bottom:25px;left:32px;font-size:12px;letter-spacing:3px;color:#b3c5d0;text-shadow:2px 2px #07111b}.title-location i{margin:0 8px;font-style:normal;color:#e5c994}.art-credit{position:absolute;bottom:28px;right:32px;font:8px Pixel,monospace;letter-spacing:2px;color:#748fa4}
.spell-dock{position:absolute;bottom:max(22px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;gap:21px;z-index:8;align-items:center}.dock-line{position:absolute;left:-45px;right:-45px;top:43px;height:1px;background:linear-gradient(90deg,transparent,#a8a38477 30%,#a8a38477 70%,transparent);pointer-events:none}.rune-slot{padding:0 2px;position:relative;width:81px;text-align:center;color:#94a5bb;--spell:#ffa38c}.rune-slot[data-spell="circle"]{--spell:#eed18d}.rune-slot[data-spell="triangle"]{--spell:#a4e4f5}.rune-frame{display:block;margin:0 auto 8px;width:65px;height:65px;position:relative;background:linear-gradient(145deg,#142436ed,#081426e8);border:2px solid #78879d;box-shadow:inset 0 0 0 3px #081522,0 3px #040a13;clip-path:polygon(7px 0,calc(100% - 7px) 0,100% 7px,100% calc(100% - 7px),calc(100% - 7px) 100%,7px 100%,0 calc(100% - 7px),0 7px);transition:transform .15s}.rune-frame svg{width:100%;height:100%;fill:none;stroke:var(--spell);stroke-width:3;filter:drop-shadow(0 0 4px var(--spell));padding:7px}.rune-slot kbd{position:absolute;right:2px;top:-5px;z-index:2;background:#101e2c;box-shadow:0 1px 0 1px #080d18;color:#ced6d2;padding:2px 4px;font-size:10px}.rune-slot strong{font-weight:400;font-size:12px;letter-spacing:1px;text-shadow:2px 2px #040914;white-space:nowrap}.rune-slot.recognized{color:#f8dfad}.rune-slot.recognized .rune-frame{border-color:#f1cf86;background:linear-gradient(145deg,#3b3e3b,#17283c);box-shadow:inset 0 0 0 3px #26313a,0 0 20px #ffd98e66}.rune-slot.casting .rune-frame{animation:rune-flash .45s ease-out}.rune-slot.on-cooldown .rune-frame:after{content:'';position:absolute;inset:0;background:#050e27aa;animation:cooldown .18s linear forwards;transform-origin:bottom}.battle-hint,.pause-hint{position:absolute;bottom:32px;color:#b5c2c8;font-size:12px;text-shadow:2px 2px #06121e;z-index:4;pointer-events:none}.battle-hint{left:33px;display:flex;align-items:center;gap:9px}.battle-hint b{font-weight:400;color:#6f8b9c}.pause-hint{right:34px;font-size:11px;color:#8fa2b1}.pause-hint kbd{padding:3px 5px;border:1px solid #71869755;margin-right:6px;font-size:9px}.mouse-icon{display:block;width:12px;height:18px;border:1px solid #b5c2c8;border-radius:5px;position:relative}.mouse-icon:after{content:'';position:absolute;top:2px;left:4px;width:2px;height:5px;background:#f9d5a0}
.rune-guide{position:absolute;left:50%;top:42%;transform:translate(-50%,-25%);width:190px;text-align:center;pointer-events:none;z-index:4;opacity:.85}.rune-guide svg{width:140px;height:140px;overflow:visible;filter:drop-shadow(0 0 6px #dfd18f44)}#guide-path{stroke:#e6cf8fa0;fill:none;stroke-width:2;stroke-dasharray:4 7;animation:guide-dash 15s linear infinite}#guide-start{fill:#fff1ba;filter:drop-shadow(0 0 5px #fff1ba)}.rune-guide>span{display:block;white-space:nowrap;font-size:12px;letter-spacing:1px;color:#c7d0c7;text-shadow:2px 2px #071522;margin-top:10px}.cast-feedback{position:absolute;top:64%;left:50%;transform:translateX(-50%);color:#f6dca2;font-size:14px;letter-spacing:1px;text-shadow:2px 2px #091121,0 0 10px #07101b;pointer-events:none;text-align:center;width:80%;z-index:6;transition:opacity .15s}.cast-feedback:empty{opacity:0}.enemy-intent{position:absolute;top:27%;right:13%;display:flex;align-items:center;gap:12px;padding:9px 15px 12px;background:#13253cce;box-shadow:inset 0 1px #8bafcd55,0 2px #060e18;pointer-events:none;z-index:7;animation:warning-pulse .9s ease-in-out infinite}.intent-rune{font-size:39px;color:#f2d99a;text-shadow:0 0 10px #ffdda088}.enemy-intent strong{display:block;font-size:14px;color:#e8ecff;font-weight:400;margin-bottom:6px}.enemy-intent>div>span{font-size:11px;color:#e3c999}.intent-countdown{position:absolute;left:0;right:0;bottom:0;height:3px;background:#101a30}#intent-bar{display:block;background:#d9dafa;height:100%;width:100%}.spell-callout{position:absolute;left:50%;top:26%;transform:translateX(-50%);text-align:center;pointer-events:none;z-index:7;animation:cast-title .8s ease-out both}.spell-callout>span{display:block;font:10px Georgia,serif;letter-spacing:6px;color:var(--effect-color,#ffe6b0);text-shadow:0 0 15px var(--effect-color)}.spell-callout strong{display:block;font-size:36px;font-weight:400;letter-spacing:6px;color:#fff2d3;text-shadow:0 3px #13213a,0 0 30px var(--effect-color);margin-top:9px}.wave-banner{position:absolute;top:35%;left:50%;transform:translateX(-50%);text-align:center;pointer-events:none;z-index:8;animation:wave-entrance 1.8s ease both;width:90%;padding:21px 0;background:linear-gradient(90deg,transparent,#07142988,transparent)}.wave-banner>span{font:9px Georgia,serif;letter-spacing:5px;color:#d4c5a5}.wave-banner strong{display:block;font-size:33px;font-weight:400;letter-spacing:7px;color:#f2dbac;text-shadow:2px 3px #101a2d;margin-top:12px}
.menu-screen{position:absolute;inset:0;display:grid;place-items:center;background:#071321c7;backdrop-filter:blur(4px);z-index:30}.menu-content{text-align:center;display:flex;align-items:center;flex-direction:column}.menu-eyebrow{font:10px Georgia,serif;color:#bdad89;letter-spacing:4px;margin:0 0 22px}.menu-content h2{font-weight:400;font-size:54px;letter-spacing:6px;color:#ffe2a8;text-shadow:0 3px #6f5133,0 6px #091522;margin:0 0 37px}.menu-content>.game-button{margin-bottom:18px}.menu-link{display:block;color:#b8c4cb;font-size:17px;letter-spacing:2px;padding:13px 30px}.menu-link:hover{color:#ffe1a7;text-shadow:0 0 12px #e6cc8f55}.menu-footnote{font-size:11px;color:#71899b;margin-top:28px;letter-spacing:2px}.help-content{max-width:560px;text-align:center;padding:22px;display:flex;flex-direction:column;align-items:center}.help-content h2{font-weight:400;font-size:35px;color:#ffe0a1;margin:0 0 22px}.help-content>p:not(.menu-eyebrow){font-size:13px;color:#bbcbd2;line-height:2}.help-spells{display:flex;gap:46px;margin:10px 0}.help-spells>div{display:flex;flex-direction:column;align-items:center}.help-rune{font:62px Georgia,serif;text-shadow:0 0 25px currentColor}.attack{color:var(--red)}.shield{color:var(--gold)}.ice{color:var(--ice)}.help-spells strong{font-size:17px;font-weight:400;margin-top:10px;color:#e9e1c7}.help-spells small{font-size:11px;color:#a4bac9;margin-top:9px}.help-content .help-note{font-size:11px!important;color:#8ba2b4!important;margin:20px 0 27px}.result-emblem{font-size:61px;color:#f7db9e;text-shadow:0 0 30px #e6c98888;margin-bottom:15px}.end-screen{background:radial-gradient(ellipse,#102439c9,#06121edb)}#result-detail{font-size:14px;line-height:1.9;color:#a8bfca;max-width:350px;margin:-16px 0 31px}.end-screen[data-result=lost] .result-emblem{color:#90a5be}.portrait-note{display:none}
[hidden]{display:none!important}@keyframes guide-dash{to{stroke-dashoffset:-110}}@keyframes warning-pulse{50%{filter:brightness(1.3)}}@keyframes cast-title{0%{opacity:0;translate:0 14px;scale:.92}20%{opacity:1;translate:0 0;scale:1}75%{opacity:1}100%{opacity:0;translate:0 -6px}}@keyframes wave-entrance{0%{opacity:0;scale:.96}18%,75%{opacity:1;scale:1}100%{opacity:0;scale:1.03}}@keyframes rune-flash{0%{filter:brightness(2.6)}100%{filter:brightness(1)}}@keyframes cooldown{to{transform:scaleY(0)}}
@media(min-width:1600px){.player-info{width:190px}.game-tools{right:36px;top:33px}.player-vitals{top:35px;left:40px}.boss-vitals{top:35px}.spell-dock{bottom:30px;gap:26px}.rune-frame{width:72px;height:72px}.rune-slot{width:90px}.rune-slot strong{font-size:14px}.title-lockup{top:10%}.start-menu{top:62%}}
@media(max-height:580px) and (min-aspect-ratio:1/1){.title-lockup{top:6%}.academy-name{font-size:9px;margin-bottom:3px}.title-stars{font-size:9px;margin-bottom:3px}.title-stars span{font-size:15px}.cn-academy{font-size:12px;margin:6px 0 8px}.title-lockup h1{font-size:55px}.title-tagline{font-size:10px;margin-top:13px}.start-menu{top:60%}.game-button{font-size:17px;padding:12px 22px;min-width:185px}.start-menu>p{font-size:10px;margin-top:12px}.player-vitals{top:17px;left:20px}.portrait{width:38px;height:40px}.portrait img{position:absolute;width:100%;height:100%;max-width:none;left:0;top:0;object-fit:contain;image-rendering:pixelated}.player-info{width:125px}.vitals-heading{font-size:11px}.health-frame{height:9px;margin:5px 0}.boss-vitals{top:17px}.boss-name{font-size:13px}.boss-details{font-size:8px;margin-top:5px}.game-tools{top:13px;right:17px;gap:4px}.tool{width:27px;height:27px;font-size:18px}.spell-dock{bottom:13px;gap:18px}.rune-frame{width:49px;height:49px;margin-bottom:6px}.rune-slot{width:65px}.rune-slot strong{font-size:10px}.rune-slot kbd{font-size:8px}.dock-line{top:32px}.battle-hint,.pause-hint{bottom:20px;font-size:9px}.battle-hint{left:20px}.pause-hint{right:20px}.rune-guide{top:37%;width:160px}.rune-guide svg{width:105px;height:105px}.rune-guide>span{font-size:10px}.menu-content h2{font-size:36px;margin-bottom:22px}.menu-eyebrow{margin-bottom:15px;font-size:8px}.menu-link{font-size:14px;padding:10px 25px}.menu-footnote{margin-top:13px}.title-location{font-size:9px;left:20px;bottom:17px}.art-credit{right:20px;bottom:20px;font-size:7px}.help-content h2{font-size:26px;margin-bottom:10px}.help-spells{margin:0}.help-rune{font-size:40px}.help-spells strong{font-size:13px}.help-content>p:not(.menu-eyebrow){font-size:11px}.help-content .help-note{margin:12px 0 17px}.result-emblem{font-size:36px;margin-bottom:10px}#result-detail{font-size:11px;margin:0 0 18px}.enemy-intent{top:22%;right:10%;padding:5px 9px 7px;gap:8px}.intent-rune{font-size:28px}.enemy-intent strong{font-size:11px}.enemy-intent>div>span{font-size:9px}}
@media(max-aspect-ratio:1/1){.title-lockup{top:13%}.academy-name{font-size:9px;letter-spacing:4px}.title-lockup h1{font-size:clamp(40px,12vw,76px);letter-spacing:3px}.cn-academy{font-size:14px}.title-tagline{font-size:11px;letter-spacing:2px}.start-menu{top:53%}.game-button{font-size:21px;min-width:210px}.title-location{font-size:10px;bottom:55px;left:20px}.art-credit{right:20px;bottom:57px;font-size:6px;letter-spacing:1px}.game-tools{top:17px;right:12px;gap:2px}.tool{font-size:18px;width:29px;height:29px}.player-vitals{left:15px;top:20px;gap:8px}.portrait{width:36px;height:40px}.portrait img{position:absolute;width:100%;height:100%;max-width:none;left:0;top:0;object-fit:contain;image-rendering:pixelated}.player-info{width:117px}.vitals-heading{font-size:10px}.vitals-heading>span:last-child{font-size:8px}.health-frame{height:9px;margin:5px 0}.condition{font-size:8px}.boss-vitals{top:103px;width:61vw}.boss-name{font-size:15px}.boss-details{font-size:9px}.spell-dock{bottom:75px;gap:18px}.rune-slot{width:74px}.rune-frame{width:59px;height:59px}.rune-slot strong{font-size:11px}.battle-hint{bottom:36px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:11px}.pause-hint{display:none!important}.portrait-note{display:block;position:absolute;bottom:13px;text-align:center;width:100%;font-size:9px;color:#71899b;pointer-events:none;letter-spacing:1px}.rune-guide{top:44%}.rune-guide svg{width:112px;height:112px}.rune-guide>span{font-size:10px}.cast-feedback{top:63%;font-size:12px}.enemy-intent{right:12%;top:27%;gap:9px;padding:7px 12px 10px}.enemy-intent strong{font-size:12px}.enemy-intent>div>span{font-size:10px}.intent-rune{font-size:30px}.spell-callout{top:24%;width:90%}.spell-callout strong{font-size:29px}.spell-callout>span{font-size:8px;letter-spacing:4px}.wave-banner strong{font-size:27px;letter-spacing:4px}.help-content{padding:24px}.help-content h2{font-size:28px}.help-content>p:not(.menu-eyebrow){font-size:12px}.help-spells{gap:23px}.help-rune{font-size:49px}.help-spells strong{font-size:14px}.help-spells small{font-size:9px}.help-content .help-note{font-size:10px!important}.menu-content h2{font-size:43px}.menu-eyebrow{font-size:9px;letter-spacing:3px}}
@media(prefers-reduced-motion:reduce){.rune-guide path,.enemy-intent{animation:none}.game-button,.rune-frame{transition:none}}
/* Game menus remain inside the scene; no site navigation or external panels. */
.title-menu-links{display:flex;align-items:center;justify-content:center;gap:23px;margin-top:18px}.title-menu-links button{font-size:15px;color:#c9d7db;padding:7px 0;text-shadow:2px 2px #06121d;white-space:nowrap}.title-menu-links button:hover{color:#ffe6a8}.title-menu-links button:before{content:'◆';font-size:6px;color:#d0b379;margin-right:7px;vertical-align:middle}.start-menu>p{font-size:10px;margin-top:10px;color:#91a9b7}.start-menu.has-save #start-button{background:none;box-shadow:none;clip-path:none;color:#becbd4;font-size:14px;min-width:0;margin:12px auto 0;padding:3px;letter-spacing:2px;text-shadow:2px 2px #05121f}.start-menu.has-save #start-button i{display:none}.start-menu.has-save .title-menu-links{margin-top:6px}.title-location small{display:block;color:#a2b3bf;font-size:10px;letter-spacing:1px;margin-top:8px}.title-lockup h1{font-size:96px}.start-menu{top:59%}.combo-display{position:absolute;top:112px;left:36px;display:flex;align-items:baseline;gap:8px;color:#ffdf9c;text-shadow:2px 3px #111c28,0 0 13px #efc77977}.combo-display strong{font-size:35px;font-weight:400}.combo-display>span{font-size:13px;letter-spacing:2px}.practice-indicator{position:absolute;left:50%;transform:translateX(-50%);top:91px;text-align:center;font-size:13px;color:#efdb9e;letter-spacing:2px;pointer-events:none}.practice-indicator>span{margin-right:7px}.practice-indicator small{display:block;font-size:10px;color:#a6bdc6;letter-spacing:1px;margin-top:9px}.menu-content h2{margin-bottom:24px}.menu-content>.game-button{margin-bottom:12px}.menu-link{padding:11px 30px}.menu-footnote{margin-top:17px}.book-panel,.settings-panel{padding:30px 36px;width:min(650px,90vw);background:linear-gradient(135deg,#1e303bfa,#101d2bfa);position:relative;border:2px solid #ad9261;box-shadow:0 0 0 4px #07111e,inset 0 0 0 4px #0c1825,0 20px 80px #030a12aa;clip-path:polygon(8px 0,calc(100% - 8px) 0,calc(100% - 8px) 4px,100% 4px,100% calc(100% - 7px),calc(100% - 8px) calc(100% - 7px),calc(100% - 8px) 100%,8px 100%,8px calc(100% - 7px),0 calc(100% - 7px),0 7px,8px 7px)}.panel-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:23px}.panel-header h2{font-size:28px;letter-spacing:4px;color:#f4d99e;font-weight:400;margin:0}.panel-header .menu-eyebrow{font-size:8px;letter-spacing:3px;margin-bottom:10px}.panel-close{font:28px Georgia,serif;color:#a1b2ba;padding:0 2px}.panel-close:hover{color:#ffe3a7}.book-tabs{display:flex;gap:0;border-bottom:1px solid #64716c88}.book-tab{flex:1;padding:12px 4px;color:#7f9aad;font-size:24px;border-bottom:2px solid transparent;display:flex;align-items:center;justify-content:center;gap:9px}.book-tab>span{font-size:13px;letter-spacing:1px}.book-tab.selected{color:#f0d196;border-bottom-color:#dec28a;background:linear-gradient(transparent,#d5b87915)}.book-lesson{display:grid;grid-template-columns:1fr 1.1fr;gap:26px;margin:27px 0 20px;align-items:center}.book-rune{display:flex;flex-direction:column;align-items:center}.book-rune svg{width:185px;height:185px;overflow:visible}.book-rune path{fill:none;stroke-width:3;stroke-linejoin:round;stroke-linecap:round}.book-rune #book-ghost-path{stroke:#73899344;stroke-dasharray:3 7}.book-rune #book-path{stroke:var(--book-color,#ffc39c);stroke-dasharray:100;stroke-dashoffset:100;filter:drop-shadow(0 0 6px var(--book-color,#ffc39c));animation:book-draw 3s ease-in-out infinite}.book-rune circle{fill:#ffeab6}.book-rune>span{font-size:9px;color:#92a9b6;margin-top:12px;white-space:nowrap}.book-rune b{font-weight:400;margin:0 7px;color:#cfb686}.book-details>span{font:8px Georgia,serif;letter-spacing:2px;color:#8eaaae}.book-details h3{font-size:29px;font-weight:400;color:#f0ddb2;letter-spacing:3px;margin:9px 0 14px}.book-effect{font-size:13px;color:#f4c69d}.book-details>p:not(.book-effect){font-size:12px;line-height:1.9;color:#b2c1c8;margin:15px 0}.book-tolerance{font-size:10px;line-height:1.8;color:#88b6b2;border-top:1px solid #586e6c55;padding-top:12px}.book-tolerance>span{color:#d7c28b;margin-right:4px}.panel-actions{display:flex;align-items:center;justify-content:center;gap:18px;border-top:1px solid #586e6c55;padding-top:22px}.panel-actions .game-button{font-size:17px;padding:13px 22px;min-width:175px}.panel-actions .menu-link{font-size:13px;padding:13px 20px}.settings-panel{width:min(540px,90vw)}.setting-row{padding:20px 0;display:flex;align-items:center;justify-content:space-between;gap:15px;border-bottom:1px solid #48616b66}.setting-row strong{font-size:17px;color:#dfd8c2;font-weight:400}.setting-row small{display:block;font-size:10px;color:#88a3b2;margin-top:7px}.option-group{display:flex;border:1px solid #5d747d;background:#0c1c2d;box-shadow:inset 0 2px #060d15;padding:3px;flex-shrink:0}.option-group button{font-size:12px;color:#8ca5b5;padding:8px 11px;min-width:52px}.option-group button[aria-pressed=true]{background:#b9a16e;color:#17222b;box-shadow:inset 0 2px #e8d39e,inset 0 -2px #716649}.volume-control{display:flex;align-items:center;gap:8px}.volume-control>button{font:20px system-ui,sans-serif;color:#e6cb95}.volume-control>button[aria-pressed=false]{opacity:.35}.volume-control input{accent-color:#d9b878;width:115px;cursor:pointer}.settings-panel .panel-actions{border-top:0;padding-top:25px}.result-stats{display:flex;gap:35px;margin:-6px 0 28px}.result-stats>div{display:flex;flex-direction:column;align-items:center}.result-stats strong{font-size:27px;color:#e8d4a4;font-weight:400}.result-stats span{font-size:10px;color:#8ea8b8;letter-spacing:1px;margin-top:8px}@keyframes book-draw{0%{stroke-dashoffset:100;opacity:.7}60%,85%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
@media(max-height:580px) and (min-aspect-ratio:1/1){.title-lockup h1{font-size:60px}.title-menu-links{margin-top:9px;gap:17px}.title-menu-links button{font-size:11px;padding:4px}.start-menu>p{font-size:8px}.start-menu{top:58%}.menu-content h2{font-size:30px;margin-bottom:17px}.menu-content>.game-button{margin-bottom:9px}.menu-link{font-size:12px;padding:7px 26px}.menu-footnote{margin-top:12px}.book-panel,.settings-panel{padding:18px 27px;max-height:96vh;overflow:auto}.panel-header{margin-bottom:12px}.panel-header h2{font-size:23px}.book-tabs button{padding:7px;font-size:20px}.book-tab>span{font-size:11px}.book-lesson{margin:13px 0 9px;gap:20px}.book-rune svg{width:130px;height:130px}.book-details h3{font-size:24px;margin:6px 0 9px}.book-effect{font-size:11px}.book-details>p:not(.book-effect){font-size:10px;margin:8px 0}.book-tolerance{font-size:9px;padding-top:8px}.panel-actions{padding-top:14px}.panel-actions .game-button{font-size:14px;padding:11px 20px}.setting-row{padding:12px 0}.setting-row strong{font-size:14px}.setting-row small{font-size:9px}.option-group button{font-size:10px;padding:6px 10px}.settings-panel .panel-actions{padding-top:15px}.combo-display{top:80px;left:23px}.combo-display strong{font-size:26px}.combo-display span{font-size:10px}.practice-indicator{top:73px;font-size:10px}.practice-indicator small{font-size:8px}.result-stats{gap:25px;margin:0 0 17px}.result-stats strong{font-size:22px}}
@media(max-aspect-ratio:1/1){.title-lockup h1{font-size:60px}.start-menu{top:51%}.title-menu-links{gap:18px;margin-top:14px}.title-menu-links button{font-size:12px}.title-menu-links button:before{font-size:4px;margin-right:4px}.combo-display{top:166px;left:20px}.combo-display strong{font-size:29px}.combo-display span{font-size:11px}.practice-indicator{top:171px;font-size:11px}.practice-indicator small{font-size:9px}.book-panel,.settings-panel{padding:24px;width:91vw;max-height:93dvh;overflow:auto}.panel-header h2{font-size:25px}.book-tab{font-size:22px;gap:5px}.book-tab>span{font-size:11px}.book-lesson{grid-template-columns:1fr;gap:20px;margin:22px 0}.book-rune svg{width:140px;height:140px}.book-details h3{font-size:25px;margin:7px 0 10px}.book-details{width:100%;text-align:center}.book-details>p:not(.book-effect){font-size:12px;max-width:280px;margin:10px auto}.book-tolerance{font-size:10px}.panel-actions .game-button{font-size:15px;min-width:155px;padding:12px 18px}.panel-actions{gap:6px}.panel-actions .menu-link{padding:10px 14px}.setting-row{padding:18px 0;gap:10px}.setting-row strong{font-size:14px}.setting-row small{font-size:9px}.option-group button{font-size:11px;padding:8px;min-width:44px}.volume-control input{width:92px}.result-stats{gap:25px}.result-stats strong{font-size:24px}}
@media(min-width:540px) and (max-aspect-ratio:1/1){.book-lesson{grid-template-columns:1fr 1.1fr;gap:22px;margin:26px 0}.book-rune svg{width:170px;height:170px}.book-details{text-align:left}.book-details>p:not(.book-effect){margin:12px 0}.book-panel{padding:28px}.portrait-note{display:none}}

/* The spell legend is passive: every point beneath it remains drawable. */
.spell-dock{pointer-events:none;user-select:none;align-items:flex-start}.rune-slot{cursor:default}.rune-slot small{display:block;margin-top:7px;color:#91a7b6;font-size:9px;white-space:nowrap;letter-spacing:1px}.dock-caption{position:absolute;left:50%;bottom:calc(100% + 13px);transform:translateX(-50%);font-size:10px;letter-spacing:3px;white-space:nowrap;color:#c5d6cf;text-shadow:2px 2px #07111d}.rune-slot.recognized{color:var(--spell)}.rune-slot.recognized .rune-frame{border-color:var(--spell)}.rune-guide{width:320px}.auto-guide-symbols{font:42px Georgia,serif;letter-spacing:13px;color:#dbcfaa;text-shadow:0 0 12px #ddd5ab33}.auto-guide-symbols i{font-size:15px;font-style:normal;color:#617c89}.rune-guide[data-lesson=true] .auto-guide-symbols,.rune-guide[data-lesson=false] #guide-svg{display:none}.rune-guide[data-lesson=false]{top:43%;opacity:.8}.rune-guide[data-lesson=false]>span{font-size:12px;letter-spacing:1px}.spell-dock .dock-line{display:none}@media(max-height:580px) and (min-aspect-ratio:1/1){.rune-slot small{font-size:8px;margin-top:4px}.dock-caption{font-size:8px;bottom:calc(100% + 8px)}}@media(max-aspect-ratio:1/1){.rune-slot small{font-size:8px}.rune-guide[data-lesson=false]{top:45%}.rune-guide[data-lesson=false]>span{font-size:11px}.dock-caption{letter-spacing:2px}}

/* Readable, keyboard-contained game menus. Existing generated frames are retained. */
button:disabled{cursor:not-allowed}
.game:has(>.menu-screen:not([hidden]))>.game-tools{visibility:hidden;pointer-events:none}
#settings-screen .settings-panel{width:min(620px,92vw);max-height:92dvh;overflow:auto;padding:36px 42px}
#settings-screen .panel-header{margin-bottom:20px}
#settings-screen .setting-row{padding:20px 0;gap:24px}
#settings-screen .setting-row strong{font-size:18px}
#settings-screen .setting-row small{font-size:13px;line-height:1.7;color:#b6c6cf;max-width:25em}
#settings-screen .option-group button{font-size:14px;min-width:58px;min-height:40px;padding:9px 12px}
#settings-screen .volume-control>button{min-width:44px;min-height:44px}
#settings-screen .volume-control input{height:32px}
#settings-screen .panel-close,#help-screen .panel-close{min-width:44px;min-height:44px}
#pause-screen,#end-screen{overflow:auto;padding:28px 16px}
#pause-screen .menu-content,#end-screen .menu-content{max-width:100%;max-height:100%;overflow:auto;padding:12px 18px}
#pause-screen .menu-link,#end-screen .menu-link{min-height:44px;font-size:16px}
#pause-screen .menu-footnote,#end-screen .result-stats span{font-size:12px;color:#b2c4cd;line-height:1.7}
#end-screen #result-detail{font-size:14px;line-height:1.9;max-width:36em}
#stage .dock-caption{font-size:12px;letter-spacing:1px}
#stage .rune-slot strong{font-size:12px}
@media(max-width:600px){
 #settings-screen .settings-panel{padding:24px;width:92vw}
 #settings-screen .setting-row{display:grid;grid-template-columns:1fr;gap:12px;padding:16px 0}
 #settings-screen .setting-row strong{font-size:17px}
 #settings-screen .setting-row small{font-size:12px}
 #settings-screen .option-group{width:max-content}
 #settings-screen .option-group button{min-height:42px;min-width:96px}
 #settings-screen .volume-control{justify-content:space-between}
 #settings-screen .volume-control input{width:calc(100% - 60px)}
 #settings-screen .panel-actions{padding-top:18px}
 #stage .dock-caption,#stage .rune-slot strong{font-size:11px}
 #pause-screen .menu-content h2{font-size:36px;margin-bottom:16px}
}
@media(max-height:580px) and (min-aspect-ratio:1/1){
 #settings-screen .settings-panel{padding:22px 30px}
 #settings-screen .setting-row{padding:12px 0}
 #pause-screen .menu-content h2{font-size:28px;margin-bottom:12px}
 #pause-screen .menu-link{min-height:36px;padding:8px 24px;font-size:14px}
}

.rune-slot{position:relative}.rune-slot.recovering .rune-frame{opacity:.48}.rune-slot.recovering::after{content:attr(data-recovery);position:absolute;left:0;right:0;top:36%;text-align:center;color:#fff0c9;font-size:14px;text-shadow:0 2px 3px #000;pointer-events:none}
.enemy-intent strong{font-size:14px}.enemy-intent #intent-tip{font-size:12px;line-height:1.7;max-width:310px}
@media(max-width:560px){.enemy-intent{max-width:86vw}.enemy-intent strong{font-size:12px}.enemy-intent #intent-tip{font-size:11px}.rune-slot.recovering::after{font-size:12px}}

/* Accessible drawing uses the existing generated wand as its visible pen. */
#battle:focus{outline:none}
.keyboard-pen{position:absolute;z-index:8;width:40px;height:40px;transform:translate(-96.8%,-2.3%);pointer-events:none;image-rendering:pixelated}
.keyboard-drawing-help{position:absolute;left:24px;bottom:26px;z-index:8;display:grid;gap:5px;max-width:calc(100% - 48px);pointer-events:none;color:#c9d4d8;text-shadow:1px 2px 3px #03101e;font-size:12px;line-height:1.5}
.keyboard-drawing-help strong{color:#f3d89b;font-weight:400}.keyboard-drawing-help small{font-size:11px;color:#a9bec8}
.keyboard-setting-note{color:#b6c6cf;font-size:12px;line-height:1.8;margin:20px 0 0}.keyboard-setting-note strong{display:block;color:#efdbb0;margin-bottom:4px}
@media(max-width:700px){.keyboard-drawing-help{left:16px;bottom:16px;font-size:10px;max-width:70vw}.keyboard-drawing-help small{font-size:9px}}
.battle-tactics{position:absolute;top:106px;left:50%;transform:translateX(-50%);width:min(520px,51vw);padding:10px 18px;background:#0a1826d9;border-top:1px solid #9c835d8c;text-align:center;color:#c7d8d7;text-shadow:1px 2px #06111b;line-height:1.65}
.battle-tactics strong{display:block;color:#eed3a1;font-size:15px;font-weight:400}.battle-tactics>span{display:block;font-size:12px}.battle-tactics small{display:block;font-size:11px;color:#c9bc91;margin-top:4px}.battle-tactics small:empty{display:none}
@media(max-height:580px) and (min-aspect-ratio:1/1){.battle-tactics{top:78px;padding:6px 12px;max-width:480px}.battle-tactics strong{font-size:13px}.battle-tactics>span{font-size:11px}}
@media(max-aspect-ratio:1/1){.battle-tactics{top:178px;width:90vw;padding:8px 12px}.battle-tactics strong{font-size:13px}.battle-tactics>span{font-size:12px}}
