/* Native game HUD: overlays leave the painted world in control. */
body.game-shell{height:100dvh;min-width:0;overflow:hidden;background:#080f19}
body.game-shell .ambient,body.game-shell .masthead,body.game-shell .chapter-bar,body.game-shell .sidebar,body.game-shell footer,body.game-shell .bottom-hints,body.game-shell .move-caption,body.game-shell .pause-badge{display:none!important}
body.game-shell main,body.game-shell .workspace,body.game-shell .game-column{position:fixed;inset:0;width:100%;height:100%;max-width:none;min-height:0;margin:0;padding:0;display:block;background:transparent;pointer-events:none}
body.game-shell .canvas-wrap,body.castle-page.game-shell .canvas-wrap{position:fixed;inset:0;width:100%;height:100%;min-height:0;aspect-ratio:auto;border:0;border-radius:0;box-shadow:none;background:#080f19;pointer-events:auto}
body.game-shell #gameCanvas{width:100%;height:100%;object-fit:contain;pointer-events:auto}
body.game-shell .scene-vignette{position:absolute;inset:0;box-shadow:inset 0 0 100px #050a1250;background:linear-gradient(#07101b88,transparent 19%,transparent 80%,#07101b66)}
body.game-shell .scene-heading,body.castle-page.game-shell .scene-heading{position:fixed;top:24px;left:28px;z-index:3;max-width:270px;text-shadow:0 2px 8px #000,0 0 18px #000;pointer-events:none}
body.game-shell .scene-heading>span{font-size:8px;letter-spacing:2px;color:#d6bd83}
body.game-shell .scene-heading h2,body.castle-page.game-shell .scene-heading h2{font-size:25px;line-height:1;margin:5px 0;color:#f4eddd}
body.game-shell .scene-heading p{font-size:10px;color:#d4d2c9;transition:opacity .6s}
body.game-shell.hud-settled .scene-heading p{opacity:0}
.hud-root{position:fixed;inset:0;z-index:10;pointer-events:none;color:#eee9db}
.hud-root button,.hud-root a,.hud-root input{pointer-events:auto}
.hud-topline{position:absolute;top:20px;right:24px;display:flex;align-items:center;gap:7px}
.hud-status .stage-meta{display:flex;min-height:34px;margin:0;padding:5px 12px;gap:12px;color:#d2d7dc;font-size:10px;background:linear-gradient(90deg,#0c1723b0,#101b28e8);border-left:1px solid #d6b87666;border-right:1px solid #d6b87633;white-space:nowrap}
.hud-status .stage-meta>div{display:flex;align-items:center}.hud-status .stage-stats{gap:11px}.hud-status #clock{font-size:16px;color:#f1e5c9}.hud-status .ability-tag{display:inline;color:#a6d6d4;font-size:9px}
.hud-small-button,.hud-timeline-toggle{border:1px solid #c9ad6a77;background:linear-gradient(180deg,#192535ed,#0c1624ed);color:#e6ddc8;border-radius:3px;padding:8px 10px;font-size:10px;line-height:1.2;box-shadow:0 3px 15px #0006;white-space:nowrap}
.hud-small-button:hover,.hud-timeline-toggle:hover{border-color:#f0d69a;color:#fff1cd;background:#263044}
.hud-root kbd{color:#dbc18a;border-color:#c2a86a66;background:#060e18a8;box-shadow:none;font-size:9px;height:19px;min-width:20px;margin-right:4px}
.hud-quest{position:absolute;top:92px;left:28px;max-width:min(340px,35vw);padding-left:10px;border-left:1px solid #d0b77a99;text-shadow:0 2px 7px #000,0 0 16px #000;color:#eee7d6;font-family:var(--serif);font-size:17px;line-height:1.1}
.hud-quest-label{display:block;margin-bottom:4px;color:#c7b17d;font:700 8px var(--font);letter-spacing:1.6px}
.hud-timeline{position:absolute;bottom:24px;left:24px;width:320px;max-width:calc(100vw - 48px);padding:8px 10px 5px;border:1px solid #b99e625e;border-radius:4px;background:linear-gradient(110deg,#101c2bea,#0a1420dd);box-shadow:0 8px 30px #0007;transition:width .25s ease}
.hud-timeline-toggle{display:block;margin:0 0 4px;padding:3px 0;border:0;background:none;box-shadow:none;text-transform:none;color:#e2d0a5;font-size:10px;letter-spacing:.2px}
.hud-timeline-toggle:hover{background:none}.hud-timeline .time-panel,body.castle-page .hud-timeline .time-panel{margin:0;padding:0;border:0;background:none;box-shadow:none}
.hud-timeline .time-panel-top{gap:8px;line-height:1.2}.hud-timeline .panel-label{font-size:8px;color:#aab8c9;letter-spacing:1px}.hud-timeline #timelineHint{display:none}
.hud-timeline #timelineCanvas,body.castle-page .hud-timeline #timelineCanvas{display:block;width:100%;height:48px;margin:2px 0 0}
body.hud-timeline-open .hud-timeline{width:min(700px,calc(100vw - 48px))}body.hud-timeline-open .hud-timeline #timelineCanvas,body.castle-page.hud-timeline-open .hud-timeline #timelineCanvas{height:105px}
.hud-actionbar{position:absolute;bottom:22px;left:50%;transform:translateX(-50%);display:flex;align-items:end;gap:9px;pointer-events:none}
.hud-actionbar .spellbar{display:flex;gap:5px;margin:0;padding:0;overflow:visible;border:0;background:none}
.hud-actionbar .spell{position:relative;flex:none;display:flex;flex-direction:column;justify-content:flex-end;gap:0;width:76px;height:68px;min-height:0;padding:5px 3px 8px;border:1px solid #bda16a88;border-radius:4px;background:linear-gradient(155deg,#243044f2,#0b1523f5);box-shadow:0 5px 18px #0009,inset 0 0 0 2px #ffffff06;color:#d6dbe0;text-align:center}
.hud-actionbar .spell:hover:not(:disabled){border-color:#f0d79c;background:linear-gradient(155deg,#3b4250,#111d2b)}
.hud-actionbar .spell.active{border-color:#e3c67d;color:#ffedc3;box-shadow:0 0 16px #e6bd6750,inset 0 0 0 1px #d9bd7866}
.hud-actionbar .spell kbd{display:flex;position:absolute;left:4px;top:4px;width:auto;height:16px;min-width:16px;margin:0;font-size:8px}
.hud-actionbar .spell span{display:block}.hud-actionbar .spell b{display:block;font-size:9px;font-weight:600;line-height:1.1}.hud-actionbar .spell small{display:none}
.hud-actionbar .spell::before{display:block;position:absolute;top:7px;left:0;right:0;font-family:Georgia,serif;font-size:23px;line-height:1;color:#e2c889;text-shadow:0 0 12px #d4a95088}
.hud-actionbar .spell[data-spell="inspect"]::before{content:'✧'}.hud-actionbar .spell[data-spell="lumos"]::before{content:'✦'}.hud-actionbar .spell[data-spell="leviosa"]::before{content:'⌁'}.hud-actionbar .potion-slot::before{content:'◇';color:#acd8c3}
.hud-actionbar #rewindButton{position:relative;display:flex;flex-direction:column;justify-content:center;gap:1px;width:82px;height:82px;padding:6px;border:1px solid #e1c887;border-radius:50%;background:radial-gradient(circle,#34404a,#101b29 66%);color:#f0deb0;box-shadow:0 0 0 4px #101b29df,0 0 0 5px #b99f6366,0 5px 24px #000a;font-family:var(--serif);font-size:13px;line-height:1.1;text-align:center}
.hud-actionbar #rewindButton kbd{margin:0;font:10px var(--font);color:#f1dfad;border:0;background:none}
.hud-tutorial-actions{display:flex;align-items:end;gap:6px}.hud-tutorial-actions button{min-height:52px;padding:9px 13px;border:1px solid #bda16a88;border-radius:4px;background:#101c2aeb;color:#ebddbd}
.hud-key-hints{position:absolute;bottom:5px;left:50%;transform:translateX(-50%);color:#c3c6c7;font-size:9px;white-space:nowrap;text-shadow:0 1px 6px #000,0 0 8px #000}
.hud-speaker{position:absolute;right:24px;bottom:136px;width:min(390px,calc(100vw - 48px));opacity:0;visibility:hidden;transform:translateX(35px);transition:opacity .3s,transform .3s,visibility .3s;pointer-events:none}
.hud-speaker.is-speaking{opacity:1;visibility:visible;transform:translateX(0)}
.hud-modal-open .hud-speaker,body.hud-modal-open .hud-speaker{opacity:0;visibility:hidden;pointer-events:none}
.hud-speaker .narrator-card,body.castle-page .hud-speaker .narrator-card{position:relative;display:grid;grid-template-columns:82px 1fr;column-gap:13px;align-items:center;min-height:104px;margin:0;padding:12px 27px 12px 12px;text-align:left;border:1px solid #b89c6255;border-radius:4px;background:linear-gradient(100deg,#101a28f5,#101927e8);box-shadow:0 8px 30px #0008}
.hud-speaker .narrator-portrait,body.castle-page .hud-speaker .narrator-portrait{grid-row:1 / span 2;width:82px;height:82px;margin:0;animation:none}
.hud-speaker .narrator-name{align-self:end;font:600 9px var(--font);letter-spacing:1px;text-transform:uppercase;color:#c7af78}
.hud-speaker .narrator-role,.hud-speaker .quote-dots{display:none}
.hud-speaker .narrator-card blockquote,body.castle-page .hud-speaker .narrator-card blockquote{align-self:start;min-height:0;margin:5px 0 0;font:italic 19px/1.15 var(--serif);color:#f1e8d5}
#hudSpeakerClose{position:absolute;right:7px;top:4px;z-index:1;padding:2px 5px;border:0;background:none;color:#bfae8a;font-size:19px}
.hud-room-banner{position:absolute;top:15%;left:50%;transform:translate(-50%,-8px);opacity:0;transition:opacity .4s,transform .4s;color:#f4e7c7;text-align:center;font:28px var(--serif);letter-spacing:.5px;text-shadow:0 2px 10px #000,0 0 25px #000;pointer-events:none}.hud-room-banner.visible{opacity:1;transform:translate(-50%,0)}
body.game-shell .interaction-prompt{position:fixed;right:24px;bottom:128px;max-width:240px;padding:7px 10px;border:1px solid #d7bb7e99;border-radius:3px;background:#101c2beb;color:#f2dfb3;box-shadow:0 5px 20px #0008;font-size:11px}
body.game-shell .target-caption{position:fixed;bottom:116px;left:50%;max-width:min(400px,70vw);padding:5px 12px;border:0;border-bottom:1px solid #d7bb7e88;background:#0b1725c9;color:#eee6d2;font-size:11px}
body.game-shell .toast{bottom:auto;top:105px;padding:9px 16px;border-radius:3px;background:#111d2bf2}
body.game-shell .game-dialog{max-height:calc(100dvh - 30px);width:min(540px,calc(100vw - 30px));padding:25px 30px;border:1px solid #c4a96e99;border-radius:3px;background:radial-gradient(ellipse at top,#253044,#101a28 70%);box-shadow:0 0 0 4px #101925,0 0 0 5px #ad925455,0 25px 100px #000d}
body.game-shell .game-dialog::backdrop{background:#030911bd;backdrop-filter:blur(4px)}
body.game-shell .game-dialog h2{font-size:34px;margin:12px 0}.game-dialog .dialog-beard{display:none}.game-dialog.failure-dialog blockquote{font-size:19px;margin:12px 0}
body.game-shell .brew-dialog{width:min(650px,calc(100vw - 30px))}
.hud-menu,.hud-journal,.hud-map{text-align:left}.hud-menu h2,.hud-journal h2,.hud-map h2{text-align:center}
#hudMenuChapters,#hudMenuActions,#hudMenuSettings{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:15px 0;padding-top:13px;border-top:1px solid #b99e6244}
#hudMenuChapters .chapter{padding:7px 9px;border:1px solid #9a855454;border-radius:3px;background:#0b1522;color:#d7c7a0;font-size:11px}
#hudMenuChapters .chapter.active{border-color:#d6bd83;color:#f3ddac}#hudMenuChapters .chapter.active:after{display:none}
#hudMenuSettings .icon-button{width:38px;height:38px}#hudResumeButton{width:100%}
.hud-journal .objective-card{padding:10px 0;border:0;background:none}.hud-map .room-map{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.hud-map-floor{color:#d0b77e;font-size:10px;letter-spacing:1px;text-transform:uppercase}.hud-map .room-node{min-width:0;padding:10px;border-radius:3px}.hud-map .discovery{margin:14px 0}
.rewind-dialog{scrollbar-width:thin;scrollbar-color:#9c8558 #101a28}.rewind-dialog .time-turner{width:48px;height:48px;margin-bottom:10px}.rewind-dialog .time-turner>span{font-size:24px}.rewind-dialog .rewind-clock{margin:12px 0;gap:24px}.rewind-dialog .rewind-clock b{font-size:22px}.rewind-dialog input[type=range]{margin:9px 0}.rewind-dialog .rewind-reason{min-height:0;margin:10px 0}.rewind-dialog .subtle{margin:9px 0 0;line-height:1.5}
.rewind-availability{margin:10px 0;text-align:left;color:#c5d1d7;font-size:10px}.rewind-availability-status{margin:5px 0;color:#d8cfba;line-height:1.4}#rewindAvailabilityBar{display:flex;width:100%;height:12px;gap:1px;overflow:hidden;border:1px solid #7f8b8b66;background:#101822}.rewind-slot{flex:1;min-width:0;background:#263447}.rewind-slot.is-safe{background:#83bdb3}.rewind-slot.is-blocked{background:#ad6c62}.rewind-assist-button{margin-top:6px;padding:5px 8px;border:1px solid #c3a76c77;border-radius:3px;background:#1a2938;color:#e6d4ac;font-size:10px}
@media(max-width:1050px){.hud-status #recordingLabel,.hud-status .live-dot{display:none}.hud-status .stage-meta{padding:5px 8px}.hud-quest{top:82px}.hud-timeline{width:260px}.hud-actionbar .spell{width:68px}.hud-key-hints{display:none}}
@media(max-width:700px){body.game-shell .scene-heading,body.castle-page.game-shell .scene-heading{top:12px;left:14px;max-width:160px}body.game-shell .scene-heading h2,body.castle-page.game-shell .scene-heading h2{font-size:20px}.hud-topline{top:10px;right:10px;gap:4px}.hud-status .stage-meta{min-height:29px;font-size:9px}.hud-status #clock{font-size:13px}.hud-status .ability-tag{display:none}.hud-small-button{padding:7px 6px;font-size:9px}.hud-small-button kbd{display:none}.hud-quest{top:63px;left:14px;max-width:240px;font-size:15px}.hud-timeline{left:10px;bottom:76px;width:220px;max-width:calc(100vw - 20px)}.hud-timeline #timelineCanvas,body.castle-page .hud-timeline #timelineCanvas{height:35px}.hud-actionbar{bottom:10px;gap:5px}.hud-actionbar .spellbar{gap:3px}.hud-actionbar .spell{width:54px;height:54px;padding-bottom:5px}.hud-actionbar .spell b{font-size:8px}.hud-actionbar .spell::before{font-size:19px}.hud-actionbar #rewindButton{width:63px;height:63px;font-size:11px}.hud-speaker{right:10px;bottom:145px;width:min(360px,calc(100vw - 20px))}.hud-speaker .narrator-card,body.castle-page .hud-speaker .narrator-card{grid-template-columns:60px 1fr;min-height:80px;padding:8px 25px 8px 8px}.hud-speaker .narrator-portrait,body.castle-page .hud-speaker .narrator-portrait{width:60px;height:60px}.hud-speaker .narrator-card blockquote,body.castle-page .hud-speaker .narrator-card blockquote{font-size:17px}.hud-room-banner{top:20%;font-size:23px}body.game-shell .interaction-prompt{right:10px;bottom:85px}body.game-shell .target-caption{bottom:78px}body.game-shell .game-dialog{padding:22px 20px}.hud-map .room-map{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){.hud-status #actorCount{display:none}.hud-quest{max-width:180px}.hud-topline{gap:3px}.hud-small-button{font-size:8px;padding:7px 5px}.hud-actionbar .spell{width:49px}.hud-actionbar #rewindButton{width:58px;height:58px}}
@media(prefers-reduced-motion:reduce){.hud-timeline,.hud-speaker,.hud-room-banner,body.game-shell .scene-heading p{transition:none}.hud-speaker .narrator-portrait{animation:none!important}}
@media(prefers-contrast:more){.hud-small-button,.hud-timeline,.hud-actionbar .spell,.hud-speaker .narrator-card{border-color:#f4d68f}.hud-quest,.hud-key-hints{color:#fff;text-shadow:0 1px 3px #000,0 0 8px #000}}
.hud-actionbar .spell::before{content:none!important}.hud-slot-icon{position:absolute;top:12px;left:calc(50% - 11px);width:22px;height:22px;filter:invert(87%) sepia(27%) saturate(627%) hue-rotate(350deg) brightness(92%)}.hud-potion-icon{position:absolute;top:7px;left:calc(50% - 16px);width:32px;height:34px;object-fit:contain}.hud-icon{width:15px;height:15px;vertical-align:middle;margin-right:6px;filter:invert(87%) sepia(27%) saturate(627%) hue-rotate(350deg) brightness(92%)}.hud-rewind-mark .hud-icon{width:25px;height:25px;margin:0 0 2px}.hud-actionbar #rewindButton:disabled{opacity:.5}.rewind-slot.is-selected{box-shadow:inset 0 0 0 1px #fff6d3}.rewind-assist-button[hidden]{display:none!important}body.hud-failure-open .hud-speaker.is-speaking{position:fixed;right:24px;bottom:136px;opacity:1;visibility:visible}body.game-shell #failureQuote{display:none}.hud-world-paused .hud-status:before{content:'ВРЕМЯ ОСТАНОВЛЕНО';position:absolute;right:0;top:44px;color:#efdba9;font-size:9px;letter-spacing:1px}.hud-modal-open .hud-room-banner{opacity:0}
#hudSpeakerClose{pointer-events:auto}body.hud-timeline-open .hud-timeline{bottom:125px}
@media(max-width:1050px) and (min-width:701px){.hud-timeline{bottom:125px}}@media(max-width:700px){body:not(.hud-timeline-open) .hud-timeline .time-panel{display:none}body:not(.hud-timeline-open) .hud-timeline{width:auto;max-width:190px;padding:7px 10px}.hud-timeline-toggle{margin:0}.hud-slot-icon{top:9px;left:calc(50% - 9px);width:18px;height:18px}.hud-potion-icon{top:5px;left:calc(50% - 12px);width:24px;height:27px}.hud-topline .hud-icon{display:none}.hud-timeline-open .hud-timeline{bottom:160px}.hud-quest{max-width:200px}.hud-failure-open .hud-speaker.is-speaking{right:10px;bottom:10px}}
