/* Shared material palette; narrative lighting is confined to the background. */
#adventure{--ship-wood:#8c5230;--ship-highlight:#d98f4e;--ship-edge:#2b1408;--ship-paper:#f4cfa4;--ship-brass:#d9ab62}
#adventure .adventure-scene{border-color:var(--ship-wood);box-shadow:0 0 0 3px var(--ship-highlight),0 0 0 6px var(--ship-edge)}
#adventure .adventure-tools button,#adventure .interaction-label{background:var(--ship-wood);color:var(--ship-paper);border-color:var(--ship-edge);box-shadow:inset 0 2px var(--ship-highlight),2px 3px var(--ship-edge)}
#adventure .adventure-talk{background:var(--ship-paper);border-color:var(--ship-wood)}
.room-voyage::before,.room-plaza::before{content:'';position:absolute;inset:0;pointer-events:none;background:#e7ad6d;opacity:.055}
.room-plaza::before{background:#ffe0a1;opacity:.025}
.voyage-sky,.voyage-runes,.voyage-torches{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.voyage-drift{animation:starfield-scroll 12s steps(12,end) infinite}
@keyframes starfield-scroll{from{transform:translateX(0)}to{transform:translateX(-12px)}}
.voyage-runes i{position:absolute;width:4px;height:4px;border:1px solid #e4ba69;box-shadow:4px 0 #d98f4e,-4px 0 #d98f4e;animation:rune-glint 2.4s steps(3,end) infinite}
@keyframes rune-glint{0%,100%{opacity:.15}50%{opacity:.7}}
.voyage-torches i{position:absolute;width:24px;height:32px;transform:translate(-50%,-50%);background:rgba(255,180,60,.2);clip-path:polygon(25% 0,75% 0,75% 12%,100% 12%,100% 88%,75% 88%,75% 100%,25% 100%,25% 88%,0 88%,0 12%,25% 12%);animation:torch-flicker .8s steps(2,end) infinite}
@keyframes torch-flicker{0%,100%{opacity:.8}50%{opacity:1}}
.room-voyage .voyage-door::before{content:'';position:absolute;inset:-48% -8% -2%;border:3px solid #ffd84d;clip-path:polygon(18% 0,82% 0,82% 6%,94% 6%,94% 16%,100% 16%,100% 100%,0 100%,0 16%,6% 16%,6% 6%,18% 6%);box-shadow:inset 0 0 0 2px #8c5230,0 0 0 2px #d98f4e;opacity:0;pointer-events:none}
.room-voyage .voyage-door:is(:hover,:focus-visible,.near)::before{opacity:1;animation:door-gold .8s steps(2) infinite}
@keyframes door-gold{50%{border-color:#d9ab62}}
#adventure .room-voyage .voyage-door .interaction-label{bottom:150%;max-width:220px;white-space:normal;width:max-content;text-align:center;pointer-events:none}
.room-voyage .voyage-door:is(:hover,:focus-visible,.near) .interaction-label{animation:door-bubble .18s steps(3,end) both}
@keyframes door-bubble{from{translate:0 6px}to{translate:0 0}}
.room-voyage #traveller:not(.walking) #travelCat{animation:qat-idle-pixel .8s steps(2,end) infinite}
@keyframes qat-idle-pixel{50%{translate:0 -2px}}
.pixel-scene-wipe{position:fixed;inset:0;width:100vw;height:100vh;z-index:10000;image-rendering:pixelated;pointer-events:auto}
body.reduced :is(.voyage-drift,.voyage-runes i,.voyage-torches i,.voyage-door::before,.voyage-door .interaction-label,#travelCat){animation:none!important}
@media(prefers-reduced-motion:reduce){.voyage-drift,.voyage-runes i,.voyage-torches i,.voyage-door::before,.voyage-door .interaction-label,#travelCat{animation:none!important}}
@media(max-width:600px){#adventure .room-voyage .voyage-door .interaction-label{max-width:110px;font-size:12px;padding:4px}.room-voyage .voyage-door .interaction-label kbd{display:inline-block}}

/* Corner glints follow the brass jambs, rather than drawing a collision rectangle. */
.room-voyage .voyage-door::before{inset:-35% 0 22%;border:0;clip-path:none;box-shadow:none;background:linear-gradient(#ffd84d,#ffd84d) left top/12px 3px no-repeat,linear-gradient(#ffd84d,#ffd84d) left top/3px 12px no-repeat,linear-gradient(#ffd84d,#ffd84d) right top/12px 3px no-repeat,linear-gradient(#ffd84d,#ffd84d) right top/3px 12px no-repeat,linear-gradient(#ffd84d,#ffd84d) left bottom/12px 3px no-repeat,linear-gradient(#ffd84d,#ffd84d) left bottom/3px 12px no-repeat,linear-gradient(#ffd84d,#ffd84d) right bottom/12px 3px no-repeat,linear-gradient(#ffd84d,#ffd84d) right bottom/3px 12px no-repeat}
@keyframes door-gold{50%{opacity:.65}}

/* Reusable feedback across room thresholds, with no collision rectangles. */
#sharedAtmosphere,.shared-room-atmosphere,.room-window-sparks{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.room-window-sparks i{position:absolute;width:2px;height:2px;background:#d9d5b7;opacity:.5;animation:starfield-scroll 12s steps(12,end) infinite}
.room-window-sparks{clip-path:polygon(15% 0,85% 0,85% 10%,15% 10%)}
.scene-door:not(.voyage-door)::after{content:'';position:absolute;inset:12%;pointer-events:none;opacity:0;background:linear-gradient(#ffd84d,#ffd84d) left top/8px 2px no-repeat,linear-gradient(#ffd84d,#ffd84d) left top/2px 8px no-repeat,linear-gradient(#ffd84d,#ffd84d) right bottom/8px 2px no-repeat,linear-gradient(#ffd84d,#ffd84d) right bottom/2px 8px no-repeat}
.scene-door:is(:hover,:focus-visible,.near)::after{opacity:1;animation:door-gold .8s steps(2) infinite}
#adventure .scene-door:not(.room-exit):not(.tech-portal) .interaction-label{bottom:100%;white-space:normal;width:max-content;max-width:200px;text-align:center}
.scene-door:is(:hover,:focus-visible,.near) .interaction-label{animation:door-bubble .18s steps(3,end) both}
#traveller:not(.walking) #travelCat{animation:qat-idle-pixel .8s steps(2,end) infinite}
.resident.guide-walking canvas{animation:qat-idle-pixel .3s steps(2,end) infinite}
.room-guide{position:relative;display:flex;gap:16px;margin:16px 0;padding:16px;background:#f4cfa4;border:4px solid #8c5230;box-shadow:0 0 0 2px #d98f4e;color:#4a2511;font:16px/1.7 'Fusion Pixel',monospace}
.room-guide[hidden]{display:none}.room-guide canvas{width:48px;height:72px;flex-shrink:0;image-rendering:pixelated;background:#3d2314;border:3px solid #d98f4e}.room-guide strong{color:#7a401c}.room-guide p{margin:8px 0;font-size:16px;color:#4a2511}.room-guide button{padding:8px 12px;min-height:44px;margin-top:6px}.room-guide .guide-next{background:#6a993e;color:#fff4cd}
body.reduced :is(.room-window-sparks i,.scene-door::after,.scene-door .interaction-label,.guide-walking canvas){animation:none!important}
@media(prefers-reduced-motion:reduce){.room-window-sparks i,.scene-door::after,.scene-door .interaction-label,.guide-walking canvas{animation:none!important}}
@media(max-width:600px){.room-guide{gap:10px;padding:12px}.room-guide canvas{width:32px;height:48px}#adventure .scene-door:not(.room-exit):not(.tech-portal) .interaction-label{max-width:130px}}

.room-guide{position:fixed;right:20px;bottom:16px;width:min(620px,calc(100vw - 40px));max-height:36vh;overflow:auto;z-index:30;box-sizing:border-box;margin:0;box-shadow:0 0 0 2px #d98f4e,4px 4px #2b1408}

#adventure .room-guide{width:min(520px,calc(100vw - 40px))}#adventure .room-guide .guide-next{background:#6a993e!important;color:#fff4cd!important;border:2px solid #381a08;box-shadow:inset 0 3px #99c568,0 3px #35562b;text-shadow:none}#adventure .room-guide .guide-next:hover{background:#79a84d!important}

/* Dialogue belongs to the world: parchment speech above the NPC, not a viewport window. */
:is(#adventure .adventure-scene, .scene-wrap) > .room-guide{position:absolute;left:2%;top:4%;right:auto;bottom:auto;width:36%;max-height:84%;padding:14px;display:block;overflow:auto;z-index:12;border:3px solid #8c5230;box-shadow:3px 3px 0 #2b1408,0 0 0 2px #d98f4e}
:is(#adventure .adventure-scene, .scene-wrap) > .room-guide[hidden]{display:none}
.guide-speech-copy>strong::before{content:'▸ ';color:#8c5230}
.guide-speech-copy>strong{font-size:18px}.guide-speech-copy>p{line-height:1.7}
.guide-speech-actions{display:flex;flex-wrap:wrap;gap:8px}
#adventure .room-guide button{font-size:14px;line-height:1.4;padding:6px 9px}
.guide-sketch{margin:10px 0;padding:8px;background:#282332;border:3px solid #775132;box-shadow:inset 2px 2px #191521}
.guide-sketch svg{width:100%;height:80px;display:block;image-rendering:pixelated}
.guide-sketch figcaption{font:14px/1.6 'Fusion Pixel',monospace;color:#ffe0a1;text-align:center}.guide-sketch small{display:block;font-size:12px;color:#b8adc5}
.sketch-heat{animation:guide-cool 2.4s steps(4,end) infinite}
@keyframes guide-cool{0%,20%{transform:translateY(8px);opacity:1}80%,100%{transform:translateY(-12px);opacity:0}}
.sketch-atom{animation:guide-atom 1.6s steps(2,end) infinite}.sketch-ion{animation:guide-ion 1.2s steps(2,end) infinite}
@keyframes guide-atom{50%{fill:#79e4dd}}@keyframes guide-ion{50%{transform:translateX(2px)}}
.sketch-record{animation:guide-record 2.4s steps(3,end) infinite}@keyframes guide-record{0%{opacity:.3;transform:translateY(4px)}50%,100%{opacity:1;transform:translateY(0)}}
.sketch-signal{animation:guide-signal 2s steps(8,end) infinite}@keyframes guide-signal{to{transform:translateX(184px)}}
.sketch-paused .guide-sketch *{animation-play-state:paused!important}
.scene-guide-active .resident-bubble,.scene-guide-active .interaction-label{visibility:hidden!important}
body.reduced .guide-sketch *{animation:none!important}@media(prefers-reduced-motion:reduce){.guide-sketch *{animation:none!important}}
@media(max-width:700px){:is(#adventure .adventure-scene, .scene-wrap) > .room-guide{left:3%;top:4%;width:94%;max-height:90%;padding:10px}.guide-speech-copy>strong{font-size:16px}.guide-speech-copy>p{font-size:14px;margin:5px 0}.guide-sketch svg{height:52px}.guide-sketch{margin:6px 0}.guide-speech-actions{gap:6px}}

@media(max-width:700px){.guide-speech-actions{position:sticky;bottom:0;background:#f4cfa4;padding:4px 0;flex-wrap:nowrap}#adventure .room-guide button{font-size:12px;padding:5px;white-space:nowrap}.guide-sketch small{font-size:12px}}

.guide-target:after{content:'▼';position:absolute;top:-18px;left:50%;color:#ffd84d;font:24px 'Fusion Pixel',monospace;text-shadow:2px 2px #382517;pointer-events:none;animation:pixel-bob 1.2s steps(2) infinite}.scene-guide-active .guide-target .interaction-label{visibility:visible!important}


.scene-wrap > .room-guide button{font-size:14px;line-height:1.4;padding:6px 9px}.scene-wrap > .room-guide .guide-next{background:#6a993e;color:#fff4cd}.scene-wrap > .room-guide .guide-speech-copy{min-width:0;overflow-wrap:anywhere}@media(max-width:700px){.scene-wrap > .room-guide button{font-size:12px;padding:5px;white-space:normal}.scene-wrap > .room-guide .guide-speech-actions{flex-wrap:wrap}}
