:root{--ink:#302f27;--paper:#f7f3e7;--muted:#777366;--line:#cbc3ae;--accent:#787447;--rust:#9a5035;--olive:#536345}
*{box-sizing:border-box}[hidden]{display:none!important}
body{margin:0;color:var(--ink);background:#dedfd1;background-image:radial-gradient(#b6b8a7 .65px,transparent .65px);background-size:4px 4px;font-family:Georgia,'Times New Roman',serif}
button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.4}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #b77e43;outline-offset:3px}
.desktop-bar{height:32px;padding:0 22px;border-bottom:2px solid var(--ink);background:var(--paper);display:flex;justify-content:space-between;align-items:center;font:11px ui-monospace,Consolas,monospace}.desktop-bar em{font-style:normal;color:var(--muted);margin-left:9px}.desktop-bar nav{display:flex;gap:18px;align-items:center}.desktop-bar button{border:0;background:none;font:inherit}.desktop-bar a{color:var(--muted);font-size:10px;text-decoration:none}
main{max-width:880px;margin:auto;padding:12px 18px 8px}.window{border:2px solid var(--ink);background:var(--paper);box-shadow:5px 5px #302f2730}.titlebar{height:32px;padding:0 10px;display:flex;align-items:center;gap:10px;border-bottom:2px solid;background:repeating-linear-gradient(0deg,transparent,transparent 3px,#302f2726 3px,#302f2726 4px)}h1{font-size:18px;font-weight:normal;margin:0;padding:0 9px;background:var(--paper)}.window-icon{background:var(--paper);border:1px solid;width:17px;text-align:center;font-size:12px}.edition{font:8px ui-monospace,monospace;letter-spacing:2px;background:var(--paper);padding:2px 6px}#day{margin-left:auto;font:9px ui-monospace,monospace;background:var(--paper);padding:3px}
.scene-wrap{position:relative;border-bottom:1px solid var(--ink);background:#ece8d7}canvas{display:block;width:100%;height:110px;object-fit:cover;object-position:50% 75%;image-rendering:pixelated}.scene-label,.weather{position:absolute;top:10px;font:8px ui-monospace,monospace;letter-spacing:1px}.scene-label{left:18px}.weather{right:18px}#chapter-name{position:absolute;left:18px;bottom:12px;font-size:16px;color:#514f3e;background:#ece8d7c9;padding:3px 7px}
.route{padding:10px 18px;border-bottom:1px solid var(--line)}.route-labels,.route-caption{display:flex;justify-content:space-between;align-items:center;font:9px ui-monospace,monospace}.route-labels>strong{font-size:12px;font-weight:normal}.route-track{position:relative;height:6px;background:#ddd8c5;border:1px solid #a29d89;margin:13px 0 16px}#route-progress{position:absolute;left:13.043%;height:100%;background:var(--accent)}#route-camel{position:absolute;top:-6px;transform:translateX(-50%);font-size:14px;z-index:2}#route-riders{position:absolute;top:6px;transform:translateX(-50%);font-size:12px;color:var(--rust);z-index:3}.haven-marker{position:absolute;top:-7px;font-size:16px;transform:translateX(-50%);background:var(--paper);line-height:17px}.haven-marker.passed{color:var(--olive);background:transparent}.outpost-marker{position:absolute;top:-3px;height:11px;border-left:1px solid var(--ink)}.route-caption{font-size:8px;color:var(--muted)}.route-caption b{color:var(--rust)}#pursuers{font-weight:normal;color:var(--ink)}#pursuers.danger{color:var(--rust);font-weight:bold}
h2{font-size:16px;font-weight:normal;margin:0 0 13px}.last-action{padding:10px 18px;background:#eeeade;border-bottom:1px solid var(--line);min-height:67px}.last-action h2,.kicker,#special-label{font:8px ui-monospace,monospace;letter-spacing:1.3px;color:var(--muted);margin:0 0 5px}#last-result{font-size:14px;line-height:1.3;margin:0}#last-result.danger{color:var(--rust)}#last-changes{font:9px/1.4 ui-monospace,monospace;color:var(--muted);margin:5px 0 0}
.dashboard{display:grid;grid-template-columns:27% 73%;padding:14px 0;min-height:271px}.supplies{padding:0 18px;border-right:1px solid var(--line)}.stat{margin-bottom:13px}.stat-label{display:flex;justify-content:space-between;gap:4px;font:10px ui-monospace,monospace;margin-bottom:5px}.meter{height:7px;background:#ded8c8}.meter>div{height:100%;background:var(--accent);transition:width .3s}.low .meter>div{background:var(--rust)}.low .stat-label{color:var(--rust)}.pocket{border-top:1px dashed var(--line);margin-top:10px;padding-top:8px;font:9px ui-monospace,monospace}.pocket b{font-size:15px;font-weight:normal;margin-left:5px}#keepsakes{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px}.keepsake{font:8px ui-monospace,monospace;border:1px solid var(--line);padding:3px 5px;background:#ece9da}
.command{padding:0 18px;min-width:0}.now-copy{min-height:74px}.kicker{color:var(--rust)}.command h2{font-size:21px;margin:0 0 5px}#description{font-size:12px;line-height:1.45;color:var(--muted);margin:0 0 12px}.main-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.main-actions button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:82px;padding:9px 4px;border:1px solid var(--ink);background:#eeeade;box-shadow:2px 2px #302f2720}.main-actions button:first-child{background:var(--ink);color:var(--paper)}.main-actions svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.main-actions strong{font:12px ui-monospace,monospace}.main-actions small{font:8px ui-monospace,monospace;opacity:.8}kbd{font:8px ui-monospace,monospace;opacity:.5;font-weight:normal}.main-actions kbd{position:absolute;right:5px;top:4px}.main-actions button:hover:not(:disabled),.actions button:hover:not(:disabled){transform:translateY(-1px);box-shadow:3px 3px #302f2735}.main-actions button:active:not(:disabled),.actions button:active:not(:disabled){transform:translate(1px,1px);box-shadow:none}
.cost-disclosure{margin:7px 0 9px}#cost-toggle{background:none;border:0;padding:1px 0;font:9px ui-monospace,monospace;color:var(--muted);text-decoration:underline;text-underline-offset:3px}#move-costs{font:10px/1.65 ui-monospace,monospace;white-space:pre-line;margin:8px 0;background:#eeeade;padding:9px}#special-section{border-top:1px solid var(--line);padding-top:9px}#special-label{letter-spacing:.5px}.actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}.actions button{text-align:left;min-height:43px;padding:7px 9px;border:1px solid var(--line);background:transparent}.actions button strong{display:flex;justify-content:space-between;gap:6px;font:11px ui-monospace,monospace}.actions button small{display:block;font:9px/1.4 ui-monospace,monospace;margin-top:3px;color:var(--muted)}
.window-footer{border-top:1px solid var(--line);padding:9px 18px;display:flex;align-items:center;justify-content:space-between;gap:10px;font:8px ui-monospace,monospace;color:var(--muted)}.window-footer button{background:none;border:0;font:10px ui-monospace,monospace;white-space:nowrap}.credit{font:7px/1.6 ui-monospace,monospace;text-align:center;color:#747665;margin:9px 0 0;letter-spacing:.7px}.credit span{letter-spacing:0}
dialog{max-width:520px;max-height:85vh;overflow:auto;background:var(--paper);color:var(--ink);border:2px solid;padding:26px;box-shadow:5px 5px #302f2740;font-size:13px;line-height:1.5}dialog::backdrop{background:#302f2780}dialog h2{font-size:25px}dialog ul{padding-left:18px}dialog li{margin:8px 0}dialog button{padding:10px 18px;background:var(--ink);color:var(--paper);border:0}dialog summary{cursor:pointer}.muted{color:var(--muted);font-size:11px}.dialog-actions{display:flex;gap:10px;flex-wrap:wrap}.dialog-actions button:first-child{background:transparent;color:var(--ink);border:1px solid var(--line)}
@media(min-width:641px) and (max-height:760px){main{padding-top:9px;padding-bottom:0}canvas{height:75px}.route{padding-top:8px;padding-bottom:8px}.last-action{padding-top:8px;padding-bottom:8px;min-height:61px}.dashboard{padding:10px 0}.now-copy{min-height:60px}.main-actions button{min-height:70px;padding:6px 4px}.cost-disclosure{margin:5px 0 6px}.command h2{font-size:20px}.credit{margin-top:4px}}
@media(max-width:640px){main{padding:10px}.desktop-bar{padding:0 12px}.desktop-bar em,.desktop-bar a{display:none}.edition{font-size:7px;letter-spacing:1px}.titlebar{gap:4px}h1{font-size:16px}.dashboard{grid-template-columns:1fr;padding:11px 0}.supplies{border-right:0;border-bottom:1px solid var(--line);padding:0 14px 10px}.supplies h2{display:none}#stats{display:flex;gap:13px}.stat{flex:1;min-width:0;margin-bottom:5px}.stat-label{font-size:9px}.pocket{padding-top:5px;margin-top:5px}#keepsakes{margin-top:5px}.command{padding:12px 14px 0}.now-copy{min-height:77px}.command h2{font-size:20px}.main-actions{gap:5px}.main-actions button{min-height:78px}.main-actions small{font-size:7px}.actions button small{font-size:8px}.route{padding:10px 14px}.last-action{padding:10px 14px}.window-footer{padding:8px 14px}.credit{letter-spacing:0}.credit span{display:none}canvas{height:85px}#chapter-name{font-size:14px}.route-caption{font-size:7px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
#food-advice{font:9px/1.5 ui-monospace,monospace;color:var(--rust);border-left:2px solid var(--line);padding-left:7px;margin:8px 0}
.main-actions button:disabled{opacity:.65}.main-actions button:disabled small{opacity:1}
.actions button.risk{border-color:var(--rust)}.actions button.risk .service-cost{color:var(--rust)}.service-cost{font-weight:bold!important}
@media(min-width:641px) and (max-height:760px){.window:has(.service-cost) canvas{height:70px}#special-section:has(.service-cost){padding-top:7px}.actions:has(.service-cost){gap:4px}.actions button:has(.service-cost){padding:5px 9px}.actions button:has(.service-cost) small{margin-top:2px;line-height:1.25}}
@media(max-width:640px){.main-actions strong{font-size:10px}#food-advice{font-size:8px}}
.emoji-scene{height:84px;display:flex;align-items:center;justify-content:center;gap:36px;font:34px 'Segoe UI Emoji','Apple Color Emoji',sans-serif;padding:10px 0 15px}
.emoji-scene span:nth-child(2){font-size:43px}.scene-label,.weather{top:7px}#chapter-name{bottom:5px;font-size:13px}
.action-emoji{font:23px 'Segoe UI Emoji','Apple Color Emoji',sans-serif;line-height:1.1}
.route-track{margin-top:22px;margin-bottom:22px}#route-camel{top:-23px;font-size:20px}#route-riders{top:6px;font-size:17px}.haven-marker{font-size:13px;top:-6px}
.preview-trail{position:absolute;pointer-events:none;height:4px;z-index:1;opacity:.35}.preview-trail.you{top:-7px;background:var(--olive)}.preview-trail.riders{top:9px;background:var(--rust)}
#preview-label{font:9px/1.4 ui-monospace,monospace;color:var(--muted);margin:7px 0 0;min-height:13px}.main-actions button.previewing:not(:disabled){outline:2px solid var(--olive);outline-offset:2px}.main-actions button:focus-visible{outline:3px solid #b77e43;outline-offset:3px}
.window-footer>div{display:flex;gap:10px}.window-footer #records{font-size:9px;color:var(--muted);text-decoration:underline;text-underline-offset:3px}
#playtests{width:600px;max-width:calc(100vw - 24px)}#record-list{margin:12px 0;max-height:36vh;overflow:auto}#record-list details{border-top:1px solid var(--line);padding:8px 0}#record-list ol{padding-left:22px;font-size:12px}#record-list li{margin:8px 0}.recording-switch{display:flex;align-items:center;gap:7px}#playtests .dialog-actions button{font-size:11px;padding:8px 12px}
@media(min-width:641px) and (max-height:760px){.emoji-scene{height:59px;font-size:25px;gap:24px}.emoji-scene span:nth-child(2){font-size:33px}#chapter-name{font-size:11px}.route{padding-top:6px;padding-bottom:6px}}
@media(max-width:640px){.emoji-scene{height:77px;gap:25px}.scene-label,.weather{font-size:6px;letter-spacing:.4px}#preview-label{font-size:8px}.window-footer{flex-wrap:wrap;gap:7px}.window-footer>div{margin-left:auto}}
#record-export{margin-top:14px;font-size:12px}#record-json{display:block;width:100%;height:120px;margin:7px 0;font:10px/1.4 ui-monospace,monospace;background:var(--paper);color:var(--ink);border:1px solid var(--line)}#download-records{color:var(--ink)}
.meter{position:relative}.forecast-fill{position:absolute;top:0;height:100%;pointer-events:none;background:repeating-linear-gradient(120deg,#9a5035bb,#9a5035bb 2px,#f7f3e7cc 2px,#f7f3e7cc 4px)}.forecast-fill.gain{background:repeating-linear-gradient(120deg,#536345bb,#536345bb 2px,#f7f3e7cc 2px,#f7f3e7cc 4px)}.forecast-marker{position:absolute;top:-2px;height:11px;border-left:2px solid var(--ink);pointer-events:none}.stat-forecast{font:8px ui-monospace,monospace;white-space:nowrap}.stat-forecast.cost{color:var(--rust)}.stat-forecast.gain{color:var(--olive)}
.forecast-penalty{position:absolute;top:0;height:100%;background:#d12828;pointer-events:none}.forecast-penalty+.forecast-penalty{box-shadow:inset 1px 0 var(--paper)}
#forecast-note{font:8px/1.4 ui-monospace,monospace;color:var(--rust);margin:3px 0 0}.actions button.previewing:not(:disabled){outline:2px solid var(--olive);outline-offset:1px}.actions button:focus-visible{outline:3px solid #b77e43;outline-offset:3px}
#route-courier{position:absolute;top:-28px;transform:translateX(-50%);font-size:17px;z-index:4;color:#6b5190}#courier-caption{color:#6b5190;font-weight:normal}.route-caption:has(#courier-caption:not([hidden])){justify-content:space-between;gap:12px}#preview-courier{position:absolute;top:-16px;height:3px;background:#6b5190;opacity:.55;pointer-events:none;z-index:1}#route-camel{top:-31px;background:transparent;border-radius:0}
@media(max-width:640px){.stat-label>span:last-child{text-align:right}.stat-forecast{display:block;font-size:7px}}
@media(min-width:641px){.actions.haven-actions{grid-template-columns:repeat(3,minmax(0,1fr))}}
.actions.event-wide{grid-template-columns:1fr}
/* Reserve the ordinary play regions so gifts, warnings and previews don't move buttons. */
#forecast-note{height:24px;overflow:auto}#forecast-note[hidden]{display:block!important;visibility:hidden}
#preview-label{height:26px;overflow:auto}
#preview-label.arrival{color:var(--olive);font-weight:bold}
.last-action{height:91px;overflow:auto}#last-result{font-size:13px}
#last-changes{min-height:13px}
.now-copy{height:78px;overflow:auto}
#food-advice{height:42px;overflow:auto}#food-advice[hidden]{display:block!important;visibility:hidden}
#keepsakes{height:47px;overflow:auto;align-content:flex-start}
.stat-label{position:relative;padding-bottom:13px}.stat-forecast{position:absolute;right:0;bottom:0}
.stat-forecast[hidden]{display:block!important;visibility:hidden}
.stat-forecast.empty{color:var(--rust);font-weight:bold}.will-empty .meter{outline:1px solid var(--rust);outline-offset:2px}
.dashboard{min-height:329px}.stat{margin-bottom:9px}
#special-section{min-height:83px}#special-section[hidden]{display:block!important;visibility:hidden}
@media(min-width:641px){.actions{grid-template-columns:repeat(3,minmax(0,1fr))}.actions:has(button:nth-child(4)){grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:641px) and (max-height:760px){
  .emoji-scene{height:45px}.route-track{margin-top:20px;margin-bottom:20px}
  .last-action{height:70px}.dashboard{min-height:278px;padding:8px 0}.now-copy{height:73px}
  .supplies h2{display:none}#food-advice{margin:5px 0}
  #preview-label{height:14px}#forecast-note{height:23px}.stat{margin-bottom:7px}
  .pocket{margin-top:5px;padding-top:5px}#keepsakes{height:42px;margin-top:5px}
}
@media(max-width:640px){
  .last-action{height:121px}.now-copy{height:94px}#preview-label{height:34px}#forecast-note{height:35px}
  #food-advice{height:26px}#keepsakes{height:44px}#special-section{min-height:142px}
}
#preview-label{font:11px/1.4 ui-monospace,monospace;height:34px;padding:6px 8px;background:#ebe6d3;border-left:3px solid var(--line);color:var(--ink);overflow:auto}
#preview-label.arrival{background:#e0e8d3;border-color:var(--olive);font-weight:bold}
#preview-label.fatal{background:#f2ddd1;border-color:var(--rust);color:var(--rust);font-weight:bold}
.route-caption{justify-content:flex-end}.haven-marker.target{outline:3px solid var(--olive);outline-offset:3px;background:transparent}
.main-actions button.fatal small{color:#b94829;font-weight:bold;opacity:1}.main-actions button:first-child.fatal small{color:#ffd09e}
.main-actions button.arrives small{font-weight:bold;opacity:1}
@media(min-width:641px) and (max-height:760px){#preview-label{height:29px;padding:4px 7px}.route-caption{margin-top:-5px}.route-track{margin-bottom:17px}.emoji-scene{height:40px}}
@media(max-width:640px){#preview-label{font-size:10px;height:44px}}
#route-progress{left:0}.route-track{margin-left:9px;margin-right:9px}
.haven-marker{background:transparent}.haven-marker.passed{background:transparent}
@media(min-width:641px){.actions.trader-actions{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Quiet layout: the scene and map carry the state, with one sentence for the story. */
main{padding-top:12px}
.scene-wrap{min-height:64px}
.scene-tools{position:absolute;right:12px;top:8px;z-index:5;display:flex;align-items:center;gap:10px;font:9px ui-monospace,monospace}
#day{margin:0;background:#ece8d7c9}
#help{width:24px;height:24px;border:1px solid var(--line);border-radius:50%;background:var(--paper);font:14px Georgia,serif}
#chapter-name{left:14px;bottom:4px;background:#ece8d7a8}
.route-labels>span{font-size:16px;line-height:1}
.route{padding-bottom:5px}
.route-track{margin-bottom:17px}
.story{padding:11px 18px;background:#eeeade;border-bottom:1px solid var(--line)}
#story-text{margin:0;font-size:15px;line-height:1.35;min-height:20px}
#story-text.danger{color:var(--rust)}
.dashboard{min-height:0;padding:13px 0}
.stat-label{padding-bottom:0}
.pocket{margin-top:14px}
#keepsakes{height:auto;min-height:0;margin-top:9px;overflow:visible}
.keepsake{font-size:15px;line-height:1;padding:3px 5px}
.command{display:flex;flex-direction:column;justify-content:flex-start}
.main-actions button{min-height:82px;gap:5px}
#special-section{min-height:0;margin-top:12px;padding-top:8px}
#special-section[hidden]{display:none!important}
.actions button{min-height:42px;display:flex;align-items:center}
.actions button strong{width:100%;align-items:center}
.window-footer{padding-top:8px;padding-bottom:8px}
@media(min-width:641px) and (max-height:760px){.emoji-scene{height:52px}.dashboard{min-height:0;padding:10px 0}.main-actions button{min-height:72px}.scene-wrap{min-height:52px}}
@media(max-width:640px){.story{padding:10px 14px}#story-text{font-size:14px}.dashboard{min-height:0}.command{padding-top:12px}.main-actions button{min-height:76px}.scene-tools{right:8px;top:5px}}
.story{height:90px;overflow:auto}
#special-section{height:119px;margin:0;padding:10px 18px;border-top:0;border-bottom:1px solid var(--line);overflow:auto}
#special-section[hidden]{display:block!important;visibility:hidden}
.actions{grid-template-columns:repeat(2,minmax(0,1fr))}
.actions button{min-height:38px}
.dashboard{height:160px;min-height:0;padding:12px 0}
#keepsakes{max-height:43px;overflow:auto}
.keepsake{font:9px/1.25 ui-monospace,monospace;padding:3px 5px}
.window-footer{justify-content:flex-end}
@media(min-width:641px) and (max-height:760px){.dashboard{height:146px;min-height:0}.story{height:82px}#special-section{height:109px}}
@media(max-width:640px){.story{height:100px}#special-section{height:123px;padding:9px 14px}.dashboard{height:193px;min-height:0}.supplies{padding-bottom:6px}.command{padding-top:8px}}
#special-section{height:58px;padding:9px 18px;overflow-x:auto;overflow-y:hidden}
.actions{display:flex;flex-wrap:nowrap;gap:6px;min-width:max-content}
.actions button{min-height:37px;padding:5px 9px;flex:1 0 auto;white-space:nowrap}
.actions button strong{font-size:10px;gap:12px;white-space:nowrap}
.dashboard{height:215px}
#keepsakes{max-height:94px;align-content:flex-start}
.supplies{display:flex;flex-direction:column;min-height:0}
#stats,.pocket{flex-shrink:0}
#keepsakes{flex:1 1 auto;min-height:0;overflow:auto}
@media(min-width:641px) and (max-height:760px){#special-section{height:54px}.dashboard{height:201px}}
@media(max-width:640px){#special-section{height:56px;padding:8px 14px}.dashboard{height:260px}#keepsakes{max-height:92px}}
#route-riders{width:33px;height:22px;object-fit:contain;top:3px;filter:drop-shadow(0 1px 1px #492b2655)}
.scene-khorkhoi img{display:block;width:54px;height:42px;object-fit:contain}
#route-event{position:absolute;top:-6px;transform:translateX(-50%);z-index:6;font-size:17px;line-height:1}

/* Stable space for the icons above situation-specific choices. */
#special-section{height:78px;padding:8px 18px}
.actions button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:54px;padding:5px 9px}
.actions button .specific-emoji{font-size:19px;line-height:22px}
.actions button strong{display:flex;align-items:center;gap:9px}
@media(min-width:641px) and (max-height:760px){#special-section{height:74px}}
@media(max-width:640px){#special-section{height:78px;padding:8px 14px}}

.actions button{position:relative}
.actions button strong{width:auto;justify-content:center}
.actions button kbd{position:absolute;right:5px;top:4px}


.actions button.fatal:not(:disabled){color:var(--rust);border-color:var(--rust)}

/* Small analog clock, light before noon and dark after noon. */
#clock-face{display:inline-block;position:relative;width:28px;height:28px;border:1px solid currentColor;border-radius:50%;flex-shrink:0}
#clock-face:after{content:'';position:absolute;width:4px;height:4px;background:currentColor;border-radius:50%;left:calc(50% - 2px);top:calc(50% - 2px)}
#clock-face i{position:absolute;left:calc(50% - 1px);bottom:50%;width:2px;background:currentColor;transform-origin:50% 100%;border-radius:2px}
#clock-hour{height:7px}#clock-minute{height:10px}
.scene-tools{align-items:center;gap:7px}
#coins{display:inline-flex;flex-wrap:wrap;gap:1px;font-size:15px;line-height:19px;max-height:42px;overflow:auto;vertical-align:middle}

/* Keep coin icons compact so possessions retain their own space. */
.pocket{margin-top:4px;padding-top:4px}
.pocket>span{display:flex;align-items:flex-start;gap:5px}
.pocket b#coins{flex:1;min-width:0;margin-left:0;font-size:12px;line-height:16px;max-height:32px}
#keepsakes{margin-top:6px;min-height:40px}

/* A plain floor beneath the emoji scene and a sky above it. */
.scene-wrap{background:linear-gradient(var(--sky-top,#96c5de),var(--sky-bottom,#f2deb3));overflow:hidden}
.scene-wrap::before{content:'';position:absolute;inset:72% 0 0;background:var(--ground,#ceb784)}
.emoji-scene{position:relative;z-index:1}
#chapter-name{z-index:2;background:transparent;color:var(--ink);text-shadow:0 1px 2px #eee8d8}
#chapter-name,.scene-tools{color:var(--scene-text,var(--ink))}#chapter-name{text-shadow:none}
#day{background:transparent}#help{color:var(--ink)}

#route-finish.target{outline:3px solid var(--olive);outline-offset:3px}

#clock-deadline{position:absolute;inset:0;pointer-events:none}
#clock-deadline:after{content:'';position:absolute;left:calc(50% - 1.5px);top:1px;width:3px;height:3px;background:#d47b32;border-radius:50%;box-shadow:0 0 0 1px #332f22}

#clock-preview{position:absolute;inset:0;pointer-events:none;border-radius:50%;background:conic-gradient(from var(--clock-preview-start),#71974c55 var(--clock-preview-angle),transparent 0)}
#clock-preview[hidden]{display:none}
#clock-face #clock-preview-hour{height:7px;background:#709647;width:2px;opacity:.65}
#clock-face #clock-preview-minute{height:10px;background:#709647;width:1px;opacity:.65}

#route-fork{position:absolute;top:calc(50% - 26px);width:60px;height:52px;z-index:7;pointer-events:none}
#route-fork[hidden]{display:none}
#route-fork svg{width:60px;height:52px;overflow:visible}
#route-fork path{fill:none;stroke:var(--olive);stroke-width:1.5;stroke-dasharray:3 3;opacity:.55}
#route-fork path.selected{stroke-width:3;stroke-dasharray:none;opacity:1}
.fork-landmark{position:absolute;top:0;font-size:18px;line-height:22px;pointer-events:auto;transform:translateX(-50%)}
.fork-landmark.left{left:42px;top:-3px}.fork-landmark.right{left:42px;top:33px}

#story-text.split{white-space:pre-line;font-size:14px;line-height:1.4}
.route-track{margin-top:28px;margin-bottom:32px}

/* Contextual choices stay inside the compact window as the catalog grows. */
.actions{min-width:0}.actions button{flex:1 1 0;min-width:0;padding:5px 4px;white-space:normal}.actions button strong{font-size:9px;min-width:0;white-space:normal}.actions button strong span{min-width:0;white-space:normal;text-align:center;overflow-wrap:break-word}

/* Solid SVG silhouettes and a compact, layered scene. */
.trek-icon{display:block;width:26px;height:23px;object-fit:contain;pointer-events:none}
.action-emoji .trek-icon{width:34px;height:30px;margin:auto}
.specific-emoji .trek-icon{width:24px;height:22px}
#route-camel .trek-icon{width:30px;height:23px}
#route-camel{top:-29px;line-height:0}
#route-courier .trek-icon{width:30px;height:25px}
#route-riders{width:34px;height:24px;top:8px;filter:none}
.haven-marker{background:transparent;line-height:0;top:-9px}
.haven-marker .trek-icon{width:18px;height:19px}
.fork-landmark .trek-icon{width:22px;height:22px}
#route-event .trek-icon{width:19px;height:19px}
.route-labels .trek-icon{width:21px;height:20px}
#coins .trek-icon{width:15px;height:15px;flex:none}
#coins .coin-token{position:relative;display:block;width:15px;height:15px;flex:none}
#coins .forecast-spent .trek-icon{opacity:.28}
#coins .forecast-spent::after{content:"";position:absolute;left:1px;right:1px;top:7px;height:2px;background:var(--rust);transform:rotate(-40deg)}
#coins .forecast-gained::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(120deg,#536345ee,#536345ee 2px,#f7f3e7dd 2px,#f7f3e7dd 4px);mask:url("assets/icons/coin.svg") center/contain no-repeat}
#coins .forecast-possible::after{opacity:.55}
.emoji-scene{display:block;height:150px;padding:0;overflow:hidden}
.emoji-scene>svg{display:block;width:100%;height:100%;}
.scene-wrap:before{display:none}
#chapter-name{left:14px;bottom:4px;font-size:12px}
@media(min-width:641px) and (max-height:760px){.emoji-scene{height:125px}}
@media(max-width:640px){.emoji-scene{height:140px}#chapter-name{font-size:11px}}
@media(max-width:640px) and (max-height:760px){.emoji-scene{height:115px}}
@media(min-width:641px) and (max-height:650px){.emoji-scene{height:100px}}
#clock-preview{inset:-8px;background:none;border-radius:0}
#clock-preview svg{display:block;width:100%;height:100%;overflow:visible}
.overflow-cap{position:absolute;right:-3px;top:-2px;width:4px;height:11px;background:#bd483a;z-index:3}
.overflow-cap[hidden]{display:none}

.inline-icon{width:1em;height:1em;vertical-align:-.15em}

#route-riders.target{outline:3px solid var(--rust);outline-offset:3px}

/* Keep contextual choices readable and easy to tap on narrow screens. */
@media(max-width:480px){#special-section{height:132px;overflow-y:auto;overflow-x:hidden}.actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:none;overflow:visible}.actions button{min-height:44px;padding:6px}.actions button strong{font-size:10px}#help{width:40px;height:40px}.scene-tools{gap:7px}dialog{max-width:calc(100vw - 24px);padding:18px}.main-actions kbd{display:none}.pocket,#keepsakes{font-size:10px}.keepsake{font-size:9px}}

/* Equipment-rich encounters retain readable buttons in a scrollable row. */
@media(min-width:641px){.actions:has(button:nth-child(7)){display:flex;min-width:max-content}.actions:has(button:nth-child(7)) button{flex:0 0 108px;min-width:108px;max-width:108px}}

/* Readability without changing the game's compact, fixed panel layout. */
#story-text,#story-text.split{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:17px;line-height:1.45}
.story{height:96px}
.stat-label{font-size:12px}.main-actions strong{font-size:14px}
.actions button strong{font-size:12px;line-height:1.25}.actions button{min-height:62px}
#special-section{height:104px}
.keepsake{font-size:11px;line-height:1.3}.pocket{font-size:11px}
.window-footer button{font-size:12px}.window-footer>div{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#chapter-name{font-size:14px}dialog{font-size:15px}.muted{font-size:13px}
.actions.route-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));min-width:0;gap:6px}
.actions.route-options button{min-width:0;max-width:none;min-height:62px;padding:4px}
.actions.route-options .specific-emoji .trek-icon{height:18px;width:23px}
@media(max-width:640px){#story-text,#story-text.split{font-size:16px}#special-section{height:132px;overflow-y:auto}.actions button strong{font-size:12px}.keepsake{font-size:11px}.window-footer{padding-left:14px;padding-right:14px}}

@media(min-width:481px) and (max-width:640px){.emoji-scene{height:120px}.dashboard{height:220px}#special-section{height:110px}}
@media(min-width:641px) and (max-height:760px){.emoji-scene{height:110px}.dashboard{height:185px}.story{height:90px}#special-section{height:96px}.actions.route-options button{min-height:62px}}

@media(min-width:641px) and (max-height:650px){.emoji-scene{height:90px}.dashboard{height:175px}.story{height:84px}}

@media(max-width:480px){.stat-label{flex-direction:column;gap:2px}.stat-label span:last-child{align-self:flex-end;white-space:nowrap}}

.actions button.has-price{padding-bottom:17px}
.action-price{position:absolute;bottom:4px;right:5px;display:flex;gap:1px;align-items:center;pointer-events:none}
.action-price .trek-icon{width:9px;height:9px}

/* Desktop haven services are one row, including optional sales and shelter. */
@media(min-width:481px),(hover:hover) and (pointer:fine){
 .actions.haven-actions:not(.route-options){display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);min-width:0;max-width:100%;gap:6px}
 .actions.haven-actions:not(.route-options) button{flex:none;min-width:0;max-width:none;width:auto;min-height:58px;padding-left:3px;padding-right:3px}
 .actions.haven-actions:not(.route-options) button strong{font-size:11px;line-height:1.2}
}
