/* World 1 V3 · compact quest tracker + timber store panel (Level 1-1). */
#quest-tracker{position:absolute;z-index:34;top:64px;right:12px;width:min(250px,46vw);box-sizing:border-box;padding:6px 9px;background:#fdf3dcf0;color:#2b2118;border:3px solid #5b3a1e;border-radius:6px;box-shadow:0 3px 0 #0003;font:13px/1.3 system-ui,sans-serif}
#quest-tracker[hidden],#store-panel[hidden],#quest-tracker [hidden]{display:none!important}
#quest-tracker .qt-head{margin:0;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#8a5a2b}
#quest-tracker #qt-text{margin:1px 0 2px;font-weight:800}
#quest-tracker #qt-inv{margin:0 0 2px;font-weight:700;color:#1d6b4f}
#quest-tracker .qt-row{display:flex;gap:6px;align-items:center}
#quest-tracker #qt-hint{min-width:30px;min-height:30px;border:2px solid #5b3a1e;border-radius:50%;background:#fff8e8;font-weight:900}
#quest-tracker .link-btn{background:none;border:0;padding:4px 0;color:#5b3a1e;text-decoration:underline;font-weight:700;min-height:30px}
#quest-tracker #qt-hint-text,#quest-tracker #qt-math-text{margin:3px 0 0;font-size:12px;color:#5b3a1e}
#store-panel{position:absolute;z-index:35;top:64px;left:12px;width:min(270px,calc(100% - 24px));box-sizing:border-box;padding:8px 10px;background:#fdf3dc;color:#2b2118;border:3px solid #5b3a1e;border-radius:6px;box-shadow:0 3px 0 #0003;font:14px/1.3 system-ui,sans-serif}
#store-panel p{margin:0 0 5px}
#store-panel .sp-head{font-weight:800}
#store-panel .sp-receipt{font:12px ui-monospace,monospace;background:#fff;border:1px dashed #8a5a2b;padding:3px 6px}
#store-panel .sp-row{display:flex;align-items:center;gap:8px;margin:0 0 5px}
#store-panel .sp-row button{min-width:40px;min-height:40px;border:2px solid #5b3a1e;border-radius:4px;background:#fff8e8;font:900 18px system-ui}
#store-panel output{min-width:30px;text-align:center;font:900 22px ui-monospace,monospace}
#store-panel .sp-total{font-weight:800}
#store-panel .sp-buy{width:100%;min-height:42px;border:2px solid #5b3a1e;border-radius:4px;background:#f2b21c;font-weight:900}
#store-panel #sp-msg{margin:5px 0 0;font-weight:700;min-height:1.2em}
#store-panel #sp-msg.bad{color:#a4321a}#store-panel #sp-msg.good{color:#1d6b4f}
@media (max-height:500px){#quest-tracker{top:58px;padding:4px 7px;font-size:12px}#store-panel{top:44px;padding:5px 8px;font-size:12px}#store-panel .sp-row button{min-width:34px;min-height:34px}#store-panel .sp-buy{min-height:34px}}
/* Fasa F: portrait → top right, under the pause button (clear of the prompt and touch buttons). */
@media (max-aspect-ratio:1/1){#quest-tracker{top:64px;bottom:auto;right:8px}}
/* Short screens: the tracker never grows into the touch buttons; long hints scroll. */
@media (max-height:500px){#quest-tracker{max-height:calc(100% - 168px);overflow-y:auto} /* ends above the right-hand touch buttons */
 /* 1-2 / 1-3 bottom prompt moves left (above the arrows), clear of the tracker on the right */
 .twin-active #world-prompt,.inverse-active #world-prompt{left:12px!important;transform:none!important;max-width:calc(100% - 46vw - 36px)}
 #quest-tracker{font-size:11.5px;line-height:1.25;width:min(320px,46vw)}#quest-tracker.hint-open #qt-inv{display:none}
 /* the 44px touch '?' sits in the top-right corner instead of its own row */
 #quest-tracker.has-hint-btn{min-height:58px}#quest-tracker.has-hint-btn #qt-hint{position:absolute;top:4px;right:5px}#quest-tracker.has-hint-btn #qt-text,#quest-tracker.has-hint-btn #qt-inv{padding-right:46px}#quest-tracker.has-hint-btn .qt-row:not(:has(#qt-math:not([hidden]))){display:contents}#quest-tracker .qt-head{font-size:9px}#quest-tracker #qt-hint{min-width:26px;min-height:26px}#quest-tracker .link-btn{min-height:26px;padding:2px 0}#quest-tracker #qt-hint-text,#quest-tracker #qt-math-text{font-size:11px}}
/* A speech bubble with nowhere else to go (narrow portrait) briefly takes the tracker's place. */
body.bubble-over-tracker #quest-tracker{visibility:hidden}
/* Phone layout (V3 fix): while buying, the store is one compact bar under the
   HUD chips; the tracker and the world prompt step aside (same info). */
body.store-open #quest-tracker,body.store-open #world-prompt{display:none!important}
@media (max-height:500px),(max-aspect-ratio:1/1){
  #store-panel{display:grid;grid-template-columns:auto 1fr auto;gap:3px 10px;align-items:center;padding:5px 10px;font-size:13px}
  #store-panel[hidden]{display:none!important}
  #store-panel .sp-head{display:none}
  #store-panel .sp-receipt{grid-column:1/-1;margin:0}
  #store-panel .sp-row{margin:0;gap:6px}#store-panel .sp-row span{display:none}
  #store-panel .sp-row button{min-width:40px;min-height:40px}
  #store-panel output{font-size:20px;min-width:24px}
  #store-panel .sp-total{margin:0;font-size:13px;line-height:1.25}
  #store-panel .sp-buy{width:auto;min-width:76px;min-height:40px;padding:0 14px}
  #store-panel #sp-msg{grid-column:1/-1;margin:0;min-height:0}
  #store-panel #sp-msg:empty{display:none}
}
@media (max-height:500px) and (min-aspect-ratio:1/1){#store-panel{top:46px;left:50%;transform:translateX(-50%);width:min(540px,calc(100% - 210px))}}
@media (max-aspect-ratio:1/1){#store-panel{top:62px;left:8px;right:8px;width:auto}}
