*{box-sizing:border-box}html,body{margin:0;background:#070b13;color:#f5f0e9;font-family:system-ui,-apple-system,"Noto Sans JP",sans-serif;overscroll-behavior:none}body{min-height:100svh;display:grid;place-items:center;background:radial-gradient(ellipse at top,#202637,#070b13 65%)}button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid #e5c788;outline-offset:4px}button:disabled{cursor:default;opacity:.4}.game-shell{width:min(1120px,100%);padding:22px 32px 16px}.topbar{display:flex;align-items:center;justify-content:space-between;height:48px;margin-bottom:16px}.brand{font-family:serif;font-weight:700;font-size:22px;letter-spacing:.12em}.brand span{font:12px system-ui;letter-spacing:.25em;margin-left:20px;color:#b5a183}.top-actions{display:flex;gap:8px}.top-actions button{border:1px solid #465063;border-radius:5px;background:#131b29;height:36px;min-width:40px;font-size:12px}.arena{position:relative;isolation:isolate;aspect-ratio:16/9;overflow:hidden;border:1px solid #475163;border-radius:8px;background:#111928;box-shadow:0 20px 80px #0008}canvas{display:block;width:100%;height:100%;touch-action:none}.hud{position:absolute;inset:22px 24px auto;display:flex;justify-content:space-between;pointer-events:none}.life{width:32%;max-width:300px}.hud-label{display:flex;justify-content:space-between;gap:8px;font-size:13px;margin-bottom:6px;text-shadow:0 2px 3px #000}.hud-label span:last-child{color:#c5c9d3;font-size:12px}.bar{height:8px;background:#0009;border:1px solid #ffffff35;transform:skewX(-14deg)}.bar i{display:block;width:100%;height:100%;background:#dcc295;transition:width .15s}.prayer{height:3px;background:#ffffff30;margin-top:6px}.prayer i{display:block;width:0;height:100%;background:#d4a7ee;transition:width .2s}.small{font-size:11px;color:#cab8d4}.score{text-align:right;display:flex;flex-direction:column;gap:3px;text-shadow:0 2px 4px #000}.score strong{font-size:24px;font-weight:400;font-variant-numeric:tabular-nums;letter-spacing:.1em}.score span{font-size:12px;color:#d8dbe2}.boss-hud{position:absolute;width:40%;left:30%;top:24px}.boss-hud .bar i{background:#dc7279}.boss-hud~.hud .life{max-width:220px}.toast{position:absolute;left:0;right:0;top:28%;text-align:center;font-family:serif;font-size:27px;letter-spacing:.14em;text-shadow:0 3px 12px #000;color:#f2d4a4;pointer-events:none;transition:opacity .2s}.overlay{position:absolute;inset:0;display:grid;place-items:center;background:linear-gradient(90deg,#050a14dc,#050a1490 55%,#050a1440);overflow:auto}.screen{text-align:center;width:min(580px,92%);padding:24px 10px}.chapter{font-size:11px;color:#e0c59c;letter-spacing:.25em;margin-bottom:14px}h1,h2{font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-weight:500;margin:0;letter-spacing:.09em}h1{font-size:clamp(28px,5vw,58px);text-shadow:0 2px 28px #000}h2{font-size:32px;margin-bottom:20px}.subtitle{display:flex;align-items:center;justify-content:center;gap:18px;color:#d5b994;letter-spacing:.5em;font-family:serif;font-size:18px;margin:14px 0 22px}.subtitle span{width:42px;height:1px;background:#bca479}.story{font-size:14px;line-height:2;color:#d5d9e0;margin:0 0 24px}.primary{display:block;border:1px solid #e3cca6;background:#e3cca6;color:#191722;min-width:240px;padding:14px 35px;margin:0 auto;font-weight:650;letter-spacing:.1em;border-radius:3px;box-shadow:0 0 25px #e3cca619}.primary:active{transform:scale(.98)}.quick-help{font-size:12px;line-height:1.9;color:#b7bece;margin:16px 0}.start-foot{border-top:1px solid #ffffff24;margin:20px auto 0;padding-top:14px;font-size:11px;color:#afb7c4;max-width:310px;display:flex;justify-content:space-between}.scene-caption{position:absolute;bottom:12px;left:20px;font-size:10px;color:#b2bbcb;letter-spacing:.1em;pointer-events:none}.controls{display:flex;align-items:center;justify-content:space-between;padding:18px 4px 12px;gap:12px;touch-action:none;user-select:none;-webkit-user-select:none}.move-controls,.attack-controls{display:flex;align-items:center;gap:12px}.control{border:1px solid #526077;background:linear-gradient(#202b3b,#141d2c);height:70px;width:76px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;box-shadow:0 4px 0 #02050b;touch-action:none;user-select:none}.control span{font-size:10px;color:#95a1b7}.control:active,.control.held{transform:translateY(3px);filter:brightness(1.4);box-shadow:0 1px 0 #02050b}.move{font-size:22px;color:#c5cedc}.attack{width:112px;height:80px;font-size:24px;font-family:serif;color:#e8cda7;border-color:#b89c72;background:linear-gradient(#453d36,#241f21)}.special{width:100px;font-family:serif;color:#d1b4ed}.special:not(:disabled){border-color:#c3a0e6;box-shadow:0 0 18px #d1b4ed40}.dodge{font-size:16px}footer{display:flex;justify-content:space-between;gap:12px;color:#8b96a9;font-size:11px;padding:8px 4px}.secondary{display:block;margin:14px auto 0;background:transparent;border:1px solid #ffffff40;padding:10px 26px;border-radius:3px;font-size:14px}.result{display:flex;justify-content:center;gap:55px;margin:28px 0;color:#c4b599;font-size:11px;letter-spacing:.1em}.result strong{display:block;margin-top:10px;color:#fff;font-size:26px;font-weight:500}#endStory{font-size:14px;line-height:1.8;white-space:pre-line;color:#c5ccda}.hidden{display:none!important}
@media(max-width:640px){body{display:block;background:#090e19}.game-shell{padding:0;min-height:100svh;display:flex;flex-direction:column}.topbar{margin:0;padding:0 16px;height:54px;flex-shrink:0}.brand{font-size:18px}.brand span{font-size:10px;margin-left:12px}.arena{aspect-ratio:auto;flex:1;min-height:360px;height:calc(100svh - 206px);max-height:760px;border-radius:0;border-left:0;border-right:0}.controls{padding:16px 12px 10px;gap:6px}.move-controls,.attack-controls{gap:7px}.control{height:62px;width:48px;border-radius:10px}.move{font-size:18px}.dodge{font-size:14px}.special{width:66px;font-size:12px}.special span{font-size:9px}.attack{width:70px;height:76px;font-size:23px}.hud{inset:17px 14px auto}.life{width:44%}.hud-label{font-size:12px}.hud-label span:last-child{font-size:10px}.score strong{font-size:20px}.boss-hud{top:86px;width:66%;left:17%}.screen{padding:25px 8px}h1{font-size:36px}.chapter{font-size:9px;letter-spacing:.18em}.story{font-size:13px}.subtitle{font-size:17px}.primary{min-width:230px}.scene-caption{bottom:10px;font-size:9px;left:14px}footer{padding:3px 15px max(12px,env(safe-area-inset-bottom));font-size:10px;justify-content:center}.keyboard{display:none}.toast{font-size:22px;top:32%}}
@media(max-height:520px) and (min-width:641px){.game-shell{padding:6px 18px;width:940px}.topbar{height:30px;margin-bottom:5px}.arena{height:calc(100svh - 144px);aspect-ratio:auto}.controls{padding:8px 0 0}.control{height:49px}.attack{height:55px}footer{padding:5px;font-size:10px}.screen{padding:8px}.chapter{margin-bottom:4px}h1{font-size:32px}.subtitle{margin:5px 0;font-size:15px}.story{margin:5px 0;font-size:12px;line-height:1.7}.primary{padding:9px 25px}.quick-help{margin:7px 0;font-size:11px}.start-foot{display:none}.hud{inset:14px 20px auto}}

.jump{color:#b7dce8;border-color:#557b93;font-size:17px}
@media(max-width:640px){
 .controls{padding-left:8px;padding-right:8px;gap:5px}
 .move-controls{display:grid;grid-template-columns:48px 48px;gap:7px}
 .jump{grid-column:1 / 3;width:auto;height:42px;flex-direction:row;gap:8px}
 .attack-controls{gap:7px}
 .control.jump span{font-size:9px}
 .arena{height:calc(100svh - 242px)}
 .start-foot{font-size:10px}
}
@media(max-width:360px){
 .move-controls{grid-template-columns:44px 44px;gap:6px}
 .move-controls .move,.attack-controls .dodge{width:44px}
 .attack-controls{gap:6px}
 .attack-controls .special{width:62px}
 .attack-controls .attack{width:64px}
}

.hud{background:linear-gradient(#0710209c,#07102045);padding:10px 12px;border-radius:5px;inset:12px 12px auto}.hud-label{font-size:14px}.boss-hud{top:95px;background:#081323a8;padding:8px 10px;border-radius:4px}.scene-caption{background:#071020a8;padding:4px 8px;border-radius:3px;font-size:12px}.quick-help{font-size:13px}.start-foot{font-size:12px;max-width:350px}#playHint{font-size:12px;line-height:1.6}.keyboard{font-size:10px}.toast{top:30%;font-size:24px}.brand span{font-size:12px}
@media(max-width:640px){.hud{inset:8px 8px auto;padding:9px}.hud-label{font-size:12px}.boss-hud{top:90px}.scene-caption{font-size:11px}.start-foot{font-size:11px}.arena{min-height:320px}.toast{font-size:20px}.game-shell{min-height:100svh}.quick-help{font-size:12px}}

/* Compact right HUD and thumb-operated controls. */
.boss-hud{left:auto;right:22px;top:112px;width:230px;max-width:43%;pointer-events:none}.boss-hud .hud-label{flex-wrap:wrap;font-size:13px}.boss-hud .hud-label span:last-child{font-size:11px}
.move-controls{display:flex}.stick{position:relative;width:128px;height:128px;border-radius:50%;border:2px solid #54647c;background:radial-gradient(circle,#101827 45%,#29384c 70%,#080e19 72%);box-shadow:inset 0 6px 14px #0009,0 4px 0 #030711;touch-action:none}.stick-arrows{position:absolute;inset:0;display:grid;place-items:center;color:#8391a8;font-size:22px}.stick-knob{position:absolute;left:28%;top:28%;width:44%;height:44%;border-radius:50%;border:1px solid #92a0b7;background:radial-gradient(circle at 35% 25%,#8292a8,#344359 62%,#1a2638);box-shadow:0 5px 8px #0009;pointer-events:none}.attack-controls{display:grid;grid-template-columns:auto auto;gap:9px}.evasion-controls{display:flex;gap:9px;grid-column:1 / 3;justify-content:flex-end}.evasion-controls .control{width:76px;height:48px;flex-direction:row;font-size:16px}.evasion-controls span{display:none}.attack-controls .special,.attack-controls .attack{height:62px}.controls{align-items:center}
@media(max-width:640px){.boss-hud{right:17px;left:auto;top:106px;width:180px;max-width:43%;padding:6px 8px}.boss-hud .hud-label{gap:3px;font-size:12px}.boss-hud .hud-label span:last-child{font-size:10px}.move-controls{display:flex}.stick{width:120px;height:120px}.controls{padding:10px 16px;gap:12px}.attack-controls{gap:7px;grid-template-columns:70px 76px}.evasion-controls{gap:7px}.evasion-controls .control{width:73px;height:44px}.attack-controls .special{width:70px;height:58px}.attack-controls .attack{width:76px;height:58px}.arena{height:calc(100svh - 220px)}}
@media(max-height:520px) and (min-width:641px){.stick{width:94px;height:94px}.attack-controls{display:flex}.evasion-controls .control{height:49px}.attack-controls .attack,.attack-controls .special{height:55px}.boss-hud{top:92px}.arena{height:calc(100svh - 155px)}}

/* Score and boss health share one compact right-aligned stack. */
.right-hud{display:flex;flex-direction:column;align-items:flex-end;gap:6px;width:145px;max-width:43%}.score{gap:2px}.score strong{font-size:17px;letter-spacing:.06em}.score span{font-size:11px}.right-hud .boss-hud{position:static;inset:auto;width:100%;max-width:none;padding:5px 6px}.right-hud .boss-hud .hud-label{margin-bottom:4px;font-size:12px;gap:2px}.right-hud .boss-hud .hud-label span:last-child{display:none}.right-hud .boss-hud .bar{height:5px}#fullscreen{display:none}
@media(max-width:640px),(pointer:coarse){#fullscreen{display:block}.topbar{gap:8px}.top-actions{gap:5px}.brand span{display:none}.game-shell{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}.score strong{font-size:15px}.right-hud{width:120px}.score span{font-size:11px}}
.game-shell:fullscreen,.game-shell:-webkit-full-screen,.game-shell.expanded{width:100%;height:100dvh;min-height:0;max-width:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:grid;grid-template-rows:46px minmax(0,1fr) auto auto;background:#090e19;overflow:hidden}
.game-shell.expanded{position:fixed;inset:0;z-index:100}
.game-shell:is(:fullscreen,.expanded) .topbar{height:46px;margin:0;padding:0 12px}.game-shell:is(:fullscreen,.expanded) .arena{width:100%;height:100%;min-height:0;max-height:none;aspect-ratio:auto;border-radius:0}.game-shell:is(:fullscreen,.expanded) .controls{padding:8px 16px}.game-shell:is(:fullscreen,.expanded) footer{padding:4px 12px;font-size:11px}.game-shell:is(:fullscreen,.expanded) .keyboard{display:none}
@media(orientation:landscape) and (max-height:600px){.game-shell:is(:fullscreen,.expanded){grid-template-rows:36px minmax(0,1fr) 88px}.game-shell:is(:fullscreen,.expanded) .topbar{height:36px}.game-shell:is(:fullscreen,.expanded) footer{display:none}.game-shell:is(:fullscreen,.expanded) .stick{width:82px;height:82px}.game-shell:is(:fullscreen,.expanded) .attack-controls{display:flex}.game-shell:is(:fullscreen,.expanded) .evasion-controls .control{width:64px;height:48px}.game-shell:is(:fullscreen,.expanded) .attack-controls>.control{height:55px}.game-shell:is(:fullscreen,.expanded) .screen{padding:6px}.game-shell:is(:fullscreen,.expanded) .story,.game-shell:is(:fullscreen,.expanded) .start-foot{display:none}.game-shell:is(:fullscreen,.expanded) h1{font-size:28px}.game-shell:is(:fullscreen,.expanded) .subtitle{margin:5px 0}.game-shell:is(:fullscreen,.expanded) .chapter{margin-bottom:5px}.game-shell:is(:fullscreen,.expanded) .quick-help{margin:6px 0}.game-shell:is(:fullscreen,.expanded) .primary{padding:8px 24px}}

.cinema{position:absolute;inset:0;z-index:10;background:#000;display:flex;flex-direction:column;justify-content:center}.cinema video{display:block;width:100%;min-height:0;max-height:calc(100% - 44px);object-fit:contain}.movie-tools{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;padding:6px 10px;color:#d7c6aa;font-size:12px}.movie-tools .secondary{margin:0;padding:8px 12px;font-size:13px}

.control.charge-ready{border-color:#f1d3ff;box-shadow:0 0 18px #ce8aff99;background:linear-gradient(#614377,#2c233b)}#chargeLabel{font-size:10px;white-space:nowrap}.charge-ready #chargeLabel{color:#fff0ff}

.audio-warning{position:fixed;inset:0;z-index:200;background:#090e19;color:#f5f0e9;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px}.audio-warning p{font-size:clamp(19px,4vw,26px);letter-spacing:.05em;margin:0 0 18px}.audio-warning span{font-size:14px;line-height:1.9;color:#bfc8d6}

.character-screen h2{margin:6px 0 12px}.character-cards{display:grid;grid-template-columns:1fr 1fr;gap:12px}.character-card{display:flex;align-items:center;flex-direction:column;padding:12px 8px;border:1px solid #596077;border-radius:10px;background:#101a2be8;color:#eee;cursor:pointer}.character-card[aria-pressed="true"]{border-color:#ecd09b;background:#3d3441;box-shadow:0 0 0 2px #ecd09b55}.character-card img{height:135px;max-width:100%;object-fit:contain;filter:drop-shadow(0 3px 7px #0008)}.character-card strong{font-size:18px;margin-top:6px}.character-card span{font-size:11px;color:#d6c4a7;margin-top:4px}#characterDescription{font-size:12px;line-height:1.7;min-height:40px;margin:12px 0}.character-screen .primary{margin-top:0}.reselect{display:block;margin:12px auto 0}.character-card:focus-visible{outline:3px solid #fff;outline-offset:2px}@media(max-height:650px){.character-card img{height:78px}.character-card{padding:7px}.character-screen h2{font-size:22px;margin:4px 0 8px}#characterDescription{margin:8px 0;min-height:0}.character-screen{padding:14px}}

.next-secret{display:block;margin:10px auto 0;font-size:13px;padding:8px 18px;opacity:.85}

.ranking{text-align:left;margin:12px 0;font-size:13px}.ranking label{display:block;margin-bottom:6px}.rank-input{display:flex;gap:8px}.rank-input input{min-width:0;flex:1;padding:10px;border:1px solid #877f92;border-radius:6px;background:#101b2d;color:white;font-size:16px}.rank-input button{margin:0}#rankStatus{font-size:12px;line-height:1.5;margin:7px 0}.ranking summary{cursor:pointer;padding:8px 0}.ranking ol{max-height:160px;overflow:auto;list-style:none;padding:0}.ranking li{display:flex;justify-content:space-between;gap:10px;border-bottom:1px solid #ffffff20;padding:7px 0}.ranking li span{overflow-wrap:anywhere}.ranking li strong{white-space:nowrap}.ranking .secondary{min-height:38px}

.cinema.rage-cutscene{background:transparent;justify-content:flex-end}.cinema.rage-cutscene video,.cinema.rage-cutscene #movieStatus{display:none}.cinema.rage-cutscene .movie-tools{justify-content:flex-end;background:transparent}.cinema.rage-cutscene #movieSkip{background:#121522cc}

@media(max-width:360px){.controls{padding-left:10px;padding-right:10px;gap:8px}}

/* Larger touch targets; stick can extend above the controls into the arena. */
.controls{--palm-width:112px;--palm-height:62px}
.controls #jump,.controls #dodge,.controls #attack{width:var(--palm-width);height:var(--palm-height);flex-shrink:0}
.controls .attack-controls{grid-template-columns:auto var(--palm-width)}
.controls .stick{transform:scale(1.25);transform-origin:left bottom;z-index:2;flex-shrink:0}
@media(max-width:640px){.controls{--palm-width:76px;--palm-height:58px}.controls .attack-controls{grid-template-columns:76px 76px}.controls .stick{transform:scale(1.3)}}
@media(max-width:360px){.controls .stick{transform:scale(1.15)}}
@media(max-height:520px) and (min-width:641px){.controls{--palm-height:55px}}
@media(orientation:landscape) and (max-height:600px){.game-shell:is(:fullscreen,.expanded) .controls{--palm-width:76px;--palm-height:55px}.game-shell:is(:fullscreen,.expanded) .stick{transform:scale(1.4)}}

.scene-caption{display:none}

#backTitle,#nextSecret{width:180px;min-height:42px;padding:10px 26px;font-size:14px;box-sizing:border-box}

.game-shell{position:relative}.layout-help,.layout-reset{display:none}
@media(pointer:coarse){.layout-editable .layout-help{display:block;font-size:12px;margin:8px 0;color:#ddd}.layout-editable .layout-reset{display:inline-block;margin:0;padding:6px 12px;font-size:12px}.control.custom-position{position:absolute;z-index:25;margin:0}.control.layout-dragging{outline:3px solid #f2cd8f;filter:brightness(1.3);transform:none}.layout-editable .control{opacity:1;cursor:grab}}

#extremeStart{min-width:240px;border-color:#ba7586;color:#ffdce5;background:#391f3080;margin-top:10px} .overlay{align-items:safe center}
@media(max-height:600px){#extremeStart{padding:7px 20px;margin-top:7px}.start-screen .quick-help{margin:6px 0}}

.character-cards{grid-template-columns:repeat(3,minmax(0,1fr))}.character-screen{max-height:100%;overflow-y:auto}.character-card strong{font-size:15px}

/* Touch landscape: 115% of the existing stick, including expanded view. */
@media (pointer:coarse) and (orientation:landscape){.controls .stick{scale:1.15}}

.hud.sky-hud,.hud.sky-hud .boss-hud{background:transparent;box-shadow:none;backdrop-filter:none}

/* Keep landscape selection actions visible without scrolling. */
@media (orientation:landscape) and (max-height:650px){
 #startScreen .story,#startScreen .start-foot,#startScreen .quick-help,
 #characterDescription,.character-card span{display:none}
 #courseScreen,#characterScreen{width:min(680px,94%);padding:6px;overflow:visible;max-height:none}
 #courseScreen .chapter,#characterScreen .chapter{display:none}
 #courseScreen h2,#characterScreen h2{font-size:20px;margin:0 0 6px}
 #courseScreen{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 #courseScreen h2,#course-back{grid-column:1/-1}
 #courseScreen button{min-width:0;width:100%;margin:0;padding:8px 12px;min-height:40px}
 .character-cards{display:flex;justify-content:center;gap:8px}
 .character-card{flex:1;max-width:210px;min-width:0;padding:4px 8px;min-height:44px;justify-content:center}
 .character-card img{height:clamp(36px,12svh,64px)}
 .character-card strong{font-size:14px;margin-top:2px}
 #characterScreen #backCharacters,#characterScreen #confirmCharacter{display:inline-block;min-width:0;margin:8px 3px 0;padding:8px 14px;min-height:40px;font-size:13px}
}

/* One blue-silver illustrated finish shared by every menu. */
:root{--night-button:url('assets/ui/night-buttons.png')}
.overlay:has(#startScreen:not(.hidden)){
 background:linear-gradient(90deg,rgba(3,8,17,.67),rgba(3,8,17,.52) 50%,rgba(3,8,17,.67)),url('assets/ui/title-ensemble.jpg') center 42%/cover no-repeat;
}
.start-screen h1{color:#fff9ed;text-shadow:0 3px 6px #000,0 0 24px #000}
.start-screen .chapter,.start-screen .subtitle{color:#d4dfed;text-shadow:0 2px 5px #000}
.start-screen .story{color:#e1e7ef;text-shadow:0 2px 4px #000}
.screen .primary,.screen .secondary,#extremeStart{
 color:#edf4ff;border:0;border-radius:0;background-color:#080f1c;
 background-image:var(--night-button);background-size:213.333% 495.484%;background-position:4.29% 9.79%;
 clip-path:polygon(6% 0,94% 0,100% 24%,100% 76%,94% 100%,6% 100%,0 76%,0 24%);
 box-shadow:none;text-shadow:0 2px 4px #000;letter-spacing:.06em;transition:filter .15s;
}
.screen .primary:hover,.screen .secondary:hover,.character-card:hover{filter:brightness(1.2)}
.screen .primary:focus-visible,.screen .secondary:focus-visible{outline:none;filter:brightness(1.45)}
.screen button:disabled{filter:grayscale(.5);opacity:.55}
.character-card{position:relative;isolation:isolate;overflow:hidden;border:1px solid #617890;border-radius:3px;background:linear-gradient(135deg,#25374d,#080f1deF 45%,#182638);box-shadow:inset 0 0 0 3px #080e19;color:#eaf2fd}
.character-card::before{content:'';position:absolute;inset:0;z-index:-1;background:var(--night-button) 4.29% 9.79%/213.333% 495.484%;opacity:.65;pointer-events:none}
.character-card[aria-pressed="true"]{border-color:#c1dcff;background:#253c58;box-shadow:inset 0 0 0 2px #93b4d9,0 0 14px #8eb8eb30}
.character-card strong{color:#f1f6ff;text-shadow:0 2px 4px #000}.character-card span{color:#bdcfe5}
