/* Original 2D artwork owns the screen; existing controls keep their handlers. */
.station-panel.station-notice-board>.encounter-content{width:min(760px,calc(100% - 24px));max-height:56%;background:#a44d3c;border:0;border-radius:12px;padding:14px;color:#fff5dc}
.station-notice-board .encounter-content>header{background:#a44d3c;top:-14px;padding:0 0 12px;color:#fff5dc}
.station-notice-board .encounter-content .station-postcards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.station-notice-board .encounter-content .station-postcard{position:relative;margin:0;padding:22px 14px 12px;background:#fff7df;color:#574932;border-radius:2px;box-shadow:0 5px 10px #542e2633;display:flex;flex-direction:column;align-items:start}
.station-notice-board .station-postcard:before{content:'';position:absolute;top:7px;left:50%;width:7px;height:7px;border-radius:50%;background:#ad6643}
.station-notice-board .encounter-content .station-tile-icon{display:block;width:38px;height:38px}
.station-notice-board .station-tile-icon svg{width:100%;height:100%}
.station-notice-board .encounter-content .station-postcard button{margin-top:auto;font-size:13px;padding:8px 12px;background:#eee6cb;color:#574932}
.station-notice-board .encounter-content header button{font-size:13px;padding:8px 12px;flex-shrink:0}
@media(max-width:500px){.station-panel.station-notice-board>.encounter-content{max-height:58%;padding:12px}.station-notice-board .encounter-content .station-postcards{grid-template-columns:1fr;gap:12px}.station-notice-board .encounter-content .station-postcard{padding:18px 14px 10px}.station-notice-board .encounter-content .station-tile-icon{position:absolute;right:14px;top:14px}.station-notice-board .station-postcard h3{padding-right:44px}.station-notice-board .station-postcard p{padding-right:40px}}
.illustrated-encounter{position:fixed!important;inset:0!important;transform:none!important;width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;padding:0!important;border:0!important;border-radius:0!important;overflow:clip!important;background:#dce5d3!important;box-sizing:border-box!important;display:block!important}
.illustrated-encounter[hidden]{display:none!important}.illustrated-encounter>.encounter-background{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-height:none!important;object-fit:cover!important;border-radius:0!important;margin:0!important}
.illustrated-encounter>.encounter-content{position:absolute;bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(680px,calc(100% - 32px));box-sizing:border-box;padding:16px 20px;border:1px solid #fff4d7;border-radius:24px;background:#fff8e9ef;color:#4e624e;box-shadow:0 6px 25px #3f4c3230;max-height:46%;overflow-y:auto;overscroll-behavior:contain}
.encounter-content>header,.encounter-content>.sheet-head,.encounter-content>.life-head{position:sticky;top:-16px;background:#fff8e9f5;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:6px 0;margin:0}
.encounter-content h2,.encounter-content h3{font-size:18px;margin:4px 0}.encounter-content p{font-size:14px;line-height:1.65;margin:8px 0}.encounter-content button{min-height:44px}.encounter-content #sheetOptions{display:flex;flex-wrap:wrap;gap:8px}.encounter-content #sheetOptions>button{flex:0 1 auto;min-width:0;width:auto;font-size:13px;padding:8px 14px}.encounter-retry{position:absolute;top:20px;left:50%;transform:translateX(-50%);min-height:44px}.encounter-retry[hidden]{display:none!important}
.encounter-content .newcomer-steps{margin:6px 0!important;gap:5px}.encounter-content .newcomer-step svg{width:26px;height:26px}.encounter-content .newcomer-step{padding:5px;font-size:11px}.encounter-content .discovery-object{width:30px;height:30px}.encounter-content .discovery-choice{width:auto!important;min-height:44px!important;font-size:13px!important;padding:8px!important;margin:4px!important}.encounter-content .npc-chat-card{position:static;display:block;width:100%;height:auto;max-height:none;margin:0;padding:0;background:transparent;border:0;box-shadow:none}.encounter-content .npc-chat-log{max-height:150px;overflow:auto}.encounter-content .npc-chat-header{padding:0}.encounter-content .npc-chat-composer{margin-top:8px}.encounter-content textarea{min-height:64px;max-height:120px}
@media(max-width:500px){.illustrated-encounter>.encounter-content{padding:12px 14px;max-height:44%;border-radius:20px}.encounter-content h2,.encounter-content h3{font-size:16px}.encounter-content>header,.encounter-content>.sheet-head,.encounter-content>.life-head{top:-12px}}
.encounter-content .station-postcards{display:block;max-height:none;overflow:visible;padding:0;margin:0}.encounter-content .station-postcard{display:block;min-height:0;padding:0;margin:8px 0;background:transparent;border:0;box-shadow:none}.encounter-content .station-tile-icon{display:none}.encounter-content .station-postcard p{margin:8px 0}.encounter-content .station-postcard h3{font-size:15px}.encounter-content .station-postcard button{margin:4px 0}
.encounter-content .npc-chat-header{position:sticky;top:-16px;z-index:3;background:#fff8e9;padding:4px 0}.encounter-content .npc-chat-kicker,.encounter-content .npc-chat-role{display:none}.encounter-content .npc-chat-close{flex:0 0 44px}.encounter-content .npc-chat-composer textarea{min-height:64px;height:64px}.encounter-content .npc-chat-log{max-height:110px}
@media(max-width:500px){.encounter-content .npc-chat-header{top:-12px}}
.encounter-content .npc-chat-card{overflow:visible;border-radius:0}.encounter-content .npc-chat-header h2{font-size:16px}
.encounter-content *{box-sizing:border-box}.encounter-content .npc-chat-composer{min-width:0}.encounter-content textarea{max-width:100%}
/* Story dialogue keeps the character visible. Route details are opt-in. */
.island-story-dialogue.illustrated-encounter>.encounter-content{width:min(560px,calc(100% - 32px));padding:12px 18px;border-radius:22px;max-height:min(230px,38dvh);overflow:auto;background:#fffaf0ed;box-shadow:0 6px 24px #263b3822}
.island-story-dialogue .story-speech{position:relative;padding-right:38px}.island-story-dialogue .story-speech small{font-size:12px;color:#687d69}.island-story-dialogue .story-speech p{font-size:16px;line-height:1.6;margin:5px 0 8px;min-height:26px}.island-story-dialogue .story-listen-next{position:absolute;right:-10px;bottom:0;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:#687d69;font-size:25px}
.island-story-dialogue .story-choices{display:flex;align-items:center;justify-content:safe center;gap:8px;overflow-x:auto;overflow-y:hidden;max-width:100%;padding:2px;scroll-snap-type:x proximity;scrollbar-width:thin}
#game .island-story-dialogue .story-choices .discovery-choice,.island-story-dialogue .story-choices .discovery-choice{display:flex;align-items:center;justify-content:center;flex:0 0 auto;gap:6px;max-width:100%;min-height:44px!important;margin:0!important;padding:6px 12px!important;border-radius:24px;white-space:nowrap;scroll-snap-align:center;font-size:13px!important;border:1px solid #ccd8bf;background:#eef3e5;color:#4d6658}
.island-story-dialogue .story-choices .discovery-object{display:inline-flex;width:28px;height:28px;flex:0 0 28px}.island-story-dialogue .story-choices .discovery-object svg{width:100%;height:100%}
.island-story-dialogue .story-toolbar{position:absolute;top:max(14px,env(safe-area-inset-top));left:16px;right:16px;display:flex;align-items:flex-start;justify-content:space-between;pointer-events:none;z-index:3}.story-toolbar>*{pointer-events:auto}
.island-story-dialogue .story-back,.island-story-dialogue .story-route-hint>summary{display:grid;place-items:center;width:44px;height:44px;box-sizing:border-box;padding:4px;list-style:none;border:1px solid #fff5dfbb;border-radius:50%;background:#fffaf0c9;color:#526a5b;cursor:pointer;font-size:24px;box-shadow:0 3px 12px #253e2920}.story-route-hint>summary::-webkit-details-marker{display:none}.story-route-hint>summary svg{width:34px;height:34px}
.story-hint-body{box-sizing:border-box;margin-top:8px;padding:16px;width:min(320px,calc(100vw - 32px));max-height:65dvh;overflow:auto;border-radius:18px;background:#fffaf0f5;color:#506650;font-size:13px;box-shadow:0 8px 28px #24372920}.story-hint-body li{padding:5px 0}.story-hint-body li[aria-current]{font-weight:bold}.story-hint-body .is-done{color:#7d9272}.story-hint-body button{display:block;min-height:44px;margin-top:8px;width:100%;font:inherit;border-radius:18px;padding:8px}
@media(max-width:500px){.island-story-dialogue.illustrated-encounter>.encounter-content{width:calc(100% - 24px);padding:10px 14px;bottom:max(12px,env(safe-area-inset-bottom));max-height:35dvh}.island-story-dialogue .story-speech p{font-size:15px}#game .island-story-dialogue .story-choices .discovery-choice,.island-story-dialogue .story-choices .discovery-choice{padding:6px 9px!important}.island-story-dialogue .story-choices .discovery-object{width:24px;height:24px;flex-basis:24px}}

.island-story-dialogue .story-choices[hidden],.island-story-dialogue .story-continue-cue[hidden]{display:none!important}
.island-story-dialogue .story-speech{padding:0;margin:0;min-height:74px;background:transparent;box-shadow:none;border-radius:0}
.island-story-dialogue .story-route-hint{margin:0!important;padding:0!important;border:0!important;background:transparent}
.island-story-dialogue .story-speech[role=button]{cursor:pointer;touch-action:manipulation}
.island-story-dialogue .story-speech[role=button]:focus-visible{outline:2px solid #8a9e77;outline-offset:5px;border-radius:8px}
.story-continue-cue{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-height:28px;font-size:12px;color:#54684e;margin-top:6px}
.story-continue-cue::after{content:'';display:block;width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);animation:story-cue-drift 1.8s ease-in-out infinite}
@keyframes story-cue-drift{0%,100%{transform:translateY(-2px) rotate(45deg);opacity:.6}50%{transform:translateY(2px) rotate(45deg);opacity:1}}
@media(prefers-reduced-motion:reduce){.story-continue-cue::after{animation:none}}
/* A portrait belongs to the traveler being addressed, not to the tourism clerk. */
.station-traveler-portrait{position:relative;display:block;aspect-ratio:1;width:100%;overflow:hidden;pointer-events:none}
.station-traveler-portrait>img{position:absolute;width:300%;height:200%;max-width:none;object-fit:fill}
.station-traveler-stage{position:absolute;left:50%;bottom:28%;transform:translateX(-50%);width:min(380px,62vh,70vw)}
.encounter-content .station-traveler-picker{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.station-traveler-picker>button{display:grid;justify-items:center;min-width:0;padding:0 0 8px!important;border:0!important;background:transparent!important;font-size:13px;color:#4e624e}
.station-traveler-picker>button:hover{background:#e8ecd8!important}
.station-traveler-picker>button:focus-visible{outline:2px solid #536a52;outline-offset:2px}
@media(max-width:500px){.encounter-content .station-traveler-picker{grid-template-columns:repeat(3,minmax(0,1fr));gap:2px 8px}.station-traveler-stage{bottom:30%;width:min(320px,70vw)}.station-traveler-picker .station-traveler-portrait{max-width:78px}}
.station-panel.illustrated-encounter .encounter-content:has(.station-traveler-picker){max-height:42%}
.station-panel.illustrated-encounter:has(.station-traveler-stage) .encounter-content{max-height:36%;padding:10px 18px}
.station-panel.illustrated-encounter:has(.station-traveler-stage) .encounter-content header{top:-10px;padding:0;background:transparent}
.station-panel.illustrated-encounter:has(.station-traveler-stage) .station-postcards>button{display:inline-block;margin:4px 0;padding:8px 12px;font-size:12px}
.station-panel.illustrated-encounter:has(.station-traveler-stage) .station-postcard{margin:4px 0}
@media(max-width:500px){.station-panel.illustrated-encounter:has(.station-traveler-stage) .encounter-content{max-height:34%}}

/* r169: scenery remains visible; secondary choices are deliberate. */
#game .illustrated-encounter>.encounter-content{left:auto;right:18px;transform:none;bottom:max(16px,env(safe-area-inset-bottom));width:min(420px,calc(100% - 36px));padding:10px 14px;max-height:30dvh;border-radius:16px;background:#fffaf0f2;box-shadow:0 3px 16px #233e2920}
#game .encounter-content>header,#game .encounter-content>.sheet-head,#game .encounter-content>.life-head{position:relative;top:auto;background:transparent;padding:0;min-height:44px}
#game .encounter-content h2{font-size:16px;line-height:1.4;margin:0}
#game .encounter-content #sheetNote{font-size:13px;margin:2px 0 8px}
#game .encounter-content #sheetOptions{gap:6px}
#game .encounter-content #sheetOptions>button{flex:1 1 auto;min-height:44px;padding:7px 10px}
#game .encounter-content .island-menu-more{flex:0 0 100%;border:0;margin:0;background:transparent;padding:0}
#game .encounter-content .island-menu-more>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-size:13px;color:#435e4e}
#game .encounter-content .island-menu-extra{display:flex;flex-wrap:wrap;gap:6px;padding:0 0 8px}
#game .encounter-content .island-menu-extra button{min-height:44px;font-size:13px;padding:8px 10px}
.encounter-toggle{position:absolute;right:max(14px,env(safe-area-inset-right));top:max(14px,env(safe-area-inset-top));max-width:calc(50% - max(14px,env(safe-area-inset-right)) - 8px);min-height:44px;z-index:5;font:inherit;font-size:13px;color:#354f40;background:#fffaf0eb;border:1px solid #e4e8d8;border-radius:22px;padding:8px 14px;cursor:pointer}
#game .illustrated-encounter[data-controls-collapsed=true]>.encounter-content{display:none!important}
#game .encounter-content button:focus-visible,.encounter-toggle:focus-visible{outline:2px solid #3e6551;outline-offset:3px}
@media(max-width:600px){#game .illustrated-encounter>.encounter-content{right:10px;width:calc(100% - 20px);max-height:32dvh;padding:8px 12px}}
@media(max-height:500px){#game .illustrated-encounter>.encounter-content{width:min(360px,52%);max-height:48dvh}.encounter-toggle{font-size:12px}}
/* Return and scenery controls occupy opposite sides of one safe-area baseline. */
#game .encounter-return{position:absolute;left:max(14px,env(safe-area-inset-left));right:auto;top:max(14px,env(safe-area-inset-top));max-width:calc(50% - max(14px,env(safe-area-inset-left)) - 8px);z-index:7;min-height:44px;padding:10px 14px;border:1px solid #a9b8aa70;border-radius:24px;background:#f7f4e5e8;color:#3e564b;font:inherit;font-size:13px;cursor:pointer}

/* Keep the gardener in the conversation, above the controls on narrow screens. */
.illustrated-encounter>.encounter-character{position:absolute;z-index:1;left:28%;bottom:0;transform:translateX(-50%);width:min(52vw,600px);height:92%;object-fit:contain;object-position:center bottom;pointer-events:none}
.illustrated-encounter[data-character-art=loading]>.encounter-character,.illustrated-encounter[data-character-art=error]>.encounter-character{visibility:hidden}
.illustrated-encounter[data-art-period=night]>.encounter-character{filter:brightness(.72) saturate(.85)}
@media(orientation:portrait),(max-width:600px){.illustrated-encounter>.encounter-character{left:50%;width:92%;height:min(72dvh,calc(100dvh - var(--encounter-card-height,220px) + 20px));bottom:max(0px,calc(var(--encounter-card-height,220px) - 44px))}.illustrated-encounter[data-controls-collapsed=true]>.encounter-character{bottom:0;height:88dvh}}
@media(orientation:landscape) and (max-height:500px){.illustrated-encounter>.encounter-character{left:23%;width:43%;height:94%;bottom:0}}
.illustrated-encounter[data-encounter-character]>.encounter-content{z-index:2}

/* The picture wrapper and its image must share the same viewport. */
#game .illustrated-encounter>picture.encounter-background>.encounter-responsive-image{display:block;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;margin:0!important;border-radius:0!important}
