  :root{
    --ink:#2b1d12; --paper:#f8eed6; --paper2:#efe0bd; --teal:#177e70; --teal-d:#0f5a50;
    --gold:#c98f2d; --red:#b3402a; --night:#0d2136;
  }
  *{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
  html,body{margin:0;padding:0;}
  body{
    background:radial-gradient(1200px 700px at 50% -10%, #274b66 0%, var(--night) 60%) fixed, var(--night);
    color:#f3ead2; font-family:"Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    min-height:100vh; padding:10px 10px 34px;
  }
  #app{max-width:1080px; margin:0 auto;}
  header.top{display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:2px 2px 8px;}
  header.top h1{font-family:Georgia,"Times New Roman",serif; font-size:1.55rem; margin:0; letter-spacing:.4px; color:#ffe9b8;}
  header.top h1 em{color:#7fe3d0; font-style:normal;}
  header.top .sub{font-size:.95rem; color:#bcd6dd;}
  /* slim status strip */
  #strip{
    display:flex; align-items:center; gap:14px; flex-wrap:wrap;
    background:rgba(9,28,43,.78); border:1px solid rgba(127,227,208,.35); border-radius:12px;
    padding:7px 12px; font-size:1.02rem; margin-bottom:8px; min-height:48px;
  }
  #strip .cell{display:flex; align-items:center; gap:7px; white-space:nowrap;}
  #strip .lab{color:#9fc3cc; font-size:.82rem; text-transform:uppercase; letter-spacing:.6px;}
  #strip .togo{font-size:.8em; text-transform:uppercase; letter-spacing:.5px;} /* v4.57: the to-go words ride small-caps beside the big number, like the NEXT label beside the name */
  #strip b{color:#fff;}
  #faces{display:flex; gap:4px;}
  #faces .fc{width:26px;height:26px;border-radius:50%;border:2px solid rgba(255,255,255,.5); overflow:hidden; background:#e8c39a; flex:none;}
  #faces .fc svg{width:100%;height:100%;display:block;}
  #faces .fc.gone{filter:grayscale(1); opacity:.45;}
  .sbtn{
    margin-left:auto; background:#134a5e; color:#eaf6f6; border:1px solid rgba(127,227,208,.55);
    border-radius:10px; padding:9px 14px; font-size:1rem; font-weight:700; cursor:pointer; min-height:44px;
  }
  .sbtn:hover{background:#1a5f78;} .sbtn:disabled{opacity:.4; cursor:default;}
  /* stage */
  #stage{
    position:relative; border-radius:16px; overflow:hidden; border:1px solid rgba(255,233,184,.4);
    box-shadow:0 18px 44px rgba(0,0,0,.5); background:#87b5d6; aspect-ratio:16/9;
  }
  #scene{width:100%; height:100%; display:block;}
  #placeTag{
    position:absolute; left:14px; bottom:12px; background:rgba(10,30,44,.72); color:#ffe9b8;
    padding:6px 14px; border-radius:999px; font-size:1rem; font-weight:600; pointer-events:none;
  }
  /* story bar */
  #story{
    margin-top:10px; background:linear-gradient(180deg, var(--paper) 0%, var(--paper2) 100%);
    color:var(--ink); border-radius:14px; padding:14px 18px; min-height:86px;
    box-shadow:0 8px 22px rgba(0,0,0,.35); border:1px solid #d9c491;
    font-size:1.13rem; line-height:1.5;
  }
  /* short screens (e.g. 1366x768 laptops): shrink the scene so story + choices stay in reach */
  @media (max-height:840px){
    #stage{ aspect-ratio:auto; height:47vh; }
    button.choice{min-height:50px; padding:10px 14px; font-size:1.02rem;}
    button.choice .hint{font-size:.9rem;}
    #card .choices{gap:7px;}
    .evehdr{padding:6px 10px; margin-bottom:6px; max-height:104px; overflow-y:auto;}
  }
  /* narrow screens (phones): the place tag moves to the top so it never covers the wagon */
  @media (max-width:560px){
    #placeTag{ top:10px; bottom:auto; font-size:.85rem; padding:5px 10px; }
  }
  #story .who{display:flex; align-items:center; gap:10px; margin-bottom:4px;}
  #story .who .pf{width:44px;height:44px;border-radius:50%;overflow:hidden;border:2px solid var(--teal); background:#e8c39a; flex:none;}
  #story .who .pf svg{width:100%;height:100%;display:block;}
  #story .who .nm{font-weight:800; color:var(--teal-d); font-size:1.05rem;}
  #story .who .rl{color:#7a6748; font-size:.9rem;}
  #story p{margin:0; font-size:1.13rem; line-height:1.5;}
  #story p.jrnl{font-family:Georgia,serif; font-style:italic; color:#4c3a22;}
  /* choices / card */
  #card{margin-top:10px; display:flex; flex-direction:column; gap:10px;}
  .choices{display:flex; flex-direction:column; gap:10px;}
  button.choice{
    text-align:left; background:#fdf8ec; color:var(--ink); border:2px solid #cbb27a; border-radius:14px;
    padding:14px 16px; font-size:1.12rem; cursor:pointer; min-height:56px; line-height:1.35;
    box-shadow:0 4px 12px rgba(0,0,0,.25); transition:transform .06s ease, border-color .12s;
  }
  button.choice:hover{border-color:var(--teal); transform:translateY(-1px);}
  button.choice b{color:var(--teal-d);}
  button.choice .hint{display:block; font-size:.95rem; color:#77683f; margin-top:2px;}
  button.choice.primary{background:linear-gradient(180deg,#23a48f,#157a68); color:#fff; border-color:#0d5a4d;}
  button.choice.primary b{color:#ffe9b8;} button.choice.primary .hint{color:#d9f2ec;}
  button.choice:disabled{opacity:.45; cursor:default; transform:none;}
  .shoprow{
    display:flex; align-items:center; gap:12px; background:#fdf8ec; color:var(--ink);
    border:2px solid #cbb27a; border-radius:14px; padding:10px 14px;
  }
  .shoprow .ic{font-size:1.7rem; width:44px; text-align:center; flex:none;}
  .shoprow .tx{flex:1;} .shoprow .tx b{font-size:1.1rem;} .shoprow .tx span{display:block; color:#77683f; font-size:.95rem;}
  .shoprow .own{font-weight:800; color:var(--teal-d); min-width:86px; text-align:right;}
@media (max-width:560px){ .shoprow .tx{min-width:0;} .shoprow .own{min-width:0;} .shoprow .ic{width:36px;} }
  /* v4.30: the store answers a tap it can't honour (see SHOP_MSG) */
  .shopmsg{background:#f7e3b0; color:#6b4a12; border:2px solid #cbb27a; border-radius:12px; padding:8px 12px; font-weight:700; margin:8px 0 0;}
  /* v4.37: the per-item haggle — the trader's counter line + small buttons inside the row */
  .hagbtn{font:inherit; font-size:.85rem; font-weight:700; background:#fdf6dd; color:#6b4a12; border:1.5px solid #cbb27a; border-radius:8px; padding:2px 9px; cursor:pointer; margin-top:3px;}
  .hagline{display:block; color:#6b4a12; font-size:.92rem; margin-top:3px;}
  .haghow{font-size:.9rem; opacity:.85;}
  .shoprow .bb{display:flex; gap:8px;}
  .shoprow .bb button{
    width:52px; height:52px; border-radius:12px; border:2px solid var(--teal); background:#e7f5f1;
    font-size:1.5rem; font-weight:900; color:var(--teal-d); cursor:pointer;
  }
  .shoprow .bb button:disabled{opacity:.35; cursor:default;}
  .note{font-size:1rem; color:#ffe9b8; background:rgba(9,28,43,.65); border-radius:10px; padding:9px 13px;}
  /* v4.1: crosshair hunt, upgrades line, pace line */
  #scene.hunting{cursor:none; touch-action:none;}
  #crosshairG{pointer-events:none;}
  #crosshairG .ring{fill:none; stroke:#ffd75e; stroke-width:3.9;}
  #crosshairG .ring2{fill:none; stroke:rgba(20,16,8,.68); stroke-width:12.5;}
  #crosshairG .tick{stroke:#ffd75e; stroke-width:3.6; stroke-linecap:round;}
  #crosshairG .dot{fill:#ffd75e; stroke:rgba(20,16,8,.65); stroke-width:1.6;}
  /* v4.36: hunt animals wear their art in an inner group so a hit can
     flinch and a kill can FALL (animated) while the outer group keeps
     the frozen per-frame transform the hunt tick writes. */
  .huntIn{transform-box:fill-box; transform-origin:50% 96%;}
  #crosshairG.oor{opacity:.55;}
  #crosshairG.oor .ring, #crosshairG.oor .tick{stroke:#b9b2a4;}
  #crosshairG.oor .dot{fill:#b9b2a4;}
  .upgline{margin-top:8px; font-size:.95rem; color:#ffe9b8;}
  .paceline{margin-top:8px; font-size:.98rem; line-height:1.45; color:#d9ecff; background:rgba(9,28,43,.45); border-radius:8px; padding:7px 11px;}
  /* journal overlay */
  #journalWrap{
    position:fixed; inset:0; background:rgba(4,14,24,.78); display:none; z-index:60;
    align-items:flex-start; justify-content:center; overflow:auto; padding:22px 10px;
  }
  #journalWrap.open{display:flex;}
  #journal{
    background:linear-gradient(180deg,#fbf3da,#f1e3ba); color:var(--ink); max-width:760px; width:100%;
    border-radius:8px 16px 16px 8px; padding:26px 30px 30px; box-shadow:0 24px 60px rgba(0,0,0,.6);
    border-left:10px solid #a3762a;
  }
  #journal h2{font-family:Georgia,serif; margin:0 0 4px; color:#6d4c15;}
  #journal .jsub{color:#77683f; margin-bottom:16px; font-style:italic;}
  .jentry{border-bottom:1px dashed #c9ae72; padding:12px 0;}
  .jentry .jh{display:flex; gap:10px; align-items:baseline; color:#6d4c15; font-weight:700; font-size:.98rem; flex-wrap:wrap;}
  .jentry .jh .jm{color:#96762f; font-weight:600;}
  .jentry p{margin:5px 0 0; font-family:Georgia,serif; font-size:1.13rem; line-height:1.55;}
  .jentry .sketch{margin-top:8px;}
  .keeps{display:flex; gap:10px; flex-wrap:wrap; margin-top:6px;}
  .keep{background:#fff8e6; border:1.5px dashed #b98c3e; border-radius:10px; padding:6px 12px; font-size:.98rem;}
  .jclose{margin-top:18px; width:100%;}
  /* ending overlay card */
  .endcard{
    background:linear-gradient(180deg,var(--paper),var(--paper2)); color:var(--ink); border-radius:16px;
    padding:22px 24px; border:1px solid #d9c491; box-shadow:0 10px 26px rgba(0,0,0,.35);
  }
  .endcard h2{font-family:Georgia,serif; margin:0 0 8px; color:#6d4c15; font-size:1.6rem;}
  .endcard p{font-size:1.12rem; line-height:1.55;}
  .scoreline{display:flex; justify-content:space-between; border-bottom:1px dashed #c9ae72; padding:7px 0; font-size:1.08rem;}
  .scoreline b{color:var(--teal-d);}
  /* scene animations */
  @keyframes legSwing{0%,100%{transform:rotate(15deg)}50%{transform:rotate(-15deg)}}
  @keyframes legSwingB{0%,100%{transform:rotate(-15deg)}50%{transform:rotate(15deg)}}
  @keyframes bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-3.5px)}}
  @keyframes headBob{0%,100%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(2.6px) rotate(1.6deg)}}
  @keyframes tailSwish{0%,100%{transform:rotate(-7deg)}50%{transform:rotate(9deg)}}
  @keyframes earFlick{0%,88%,100%{transform:rotate(0deg)}92%{transform:rotate(-24deg)}96%{transform:rotate(10deg)}}
  @keyframes sway{0%,100%{transform:rotate(-1.1deg)}50%{transform:rotate(1.1deg)}}
  @keyframes wheelSpin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
  @keyframes drift{from{transform:translateX(-320px)}to{transform:translateX(1520px)}}
  @keyframes grassSway{0%,100%{transform:rotate(-2.5deg)}50%{transform:rotate(2.5deg)}}
  @keyframes rainFall{from{transform:translateY(-30px)}to{transform:translateY(46px)}}
  /* v4.43: weather grades ease in and out with the state, never snap */
  #stormShade, #snowVeil, #wetG{transition:opacity 1.4s ease;}
  #rainG, #snowG, #stormRainG, #heatG{transition:opacity 1.1s ease;}
  @keyframes snowFall{0%{transform:translate(0,-16px)}100%{transform:translate(-26px,690px)}}
  @keyframes flick{0%,100%{transform:scale(1) rotate(-1.5deg); opacity:.95}50%{transform:scale(1.13,1.22) rotate(1.5deg); opacity:1}}
  @keyframes flick2{0%,100%{transform:scale(1.06,.94) rotate(1.2deg)}50%{transform:scale(.94,1.14) rotate(-1.8deg)}}
  @keyframes firePulse{0%,100%{opacity:.13}50%{opacity:.22}}
  @keyframes firePulse2{0%,100%{opacity:.16}50%{opacity:.27}}
  @keyframes emberUp{0%{transform:translate(0,0) scale(1); opacity:0}12%{opacity:.95}100%{transform:translate(-14px,-86px) scale(.35); opacity:0}}
  @keyframes smokeUp{0%{transform:translateY(0) scale(.7); opacity:.55}100%{transform:translateY(-64px) scale(1.5); opacity:0}}
  @keyframes flagWave{0%,100%{transform:skewY(-2.5deg)}50%{transform:skewY(2.5deg)}}
  @keyframes bubbleUp{0%{transform:translateY(0); opacity:0}15%{opacity:.85}100%{transform:translateY(-26px); opacity:0}}
  @keyframes waterFlow{from{stroke-dashoffset:0}to{stroke-dashoffset:-64}}
  @keyframes sparkleTw{0%,100%{opacity:.15}50%{opacity:1}}
  @keyframes birdCross{0%{transform:translate(-180px,0)}100%{transform:translate(1420px,-36px)}}
  @keyframes birdBobY{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
  @keyframes wingFlap{0%,100%{transform:rotate(-26deg)}50%{transform:rotate(24deg)}}
  @keyframes wingFlapR{0%,100%{transform:rotate(26deg)}50%{transform:rotate(-24deg)}}
  @keyframes pcIn{from{opacity:0; transform:translateX(30px)}to{opacity:1; transform:translateX(0)}}
  @keyframes fadeIn{from{opacity:0}to{opacity:1}}
  .legA{animation:legSwing .62s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 0%;}
  .legB{animation:legSwingB .62s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 0%;}
  .legA2{animation:legSwing .62s ease-in-out infinite; animation-delay:-.31s; transform-box:fill-box; transform-origin:50% 0%;}
  .legB2{animation:legSwingB .62s ease-in-out infinite; animation-delay:-.31s; transform-box:fill-box; transform-origin:50% 0%;}
  .wheelspin{animation:wheelSpin 1.15s linear infinite; transform-box:fill-box; transform-origin:center;}
  .pausedAnim .legA, .pausedAnim .legB, .pausedAnim .legA2, .pausedAnim .legB2, .pausedAnim .wheelspin, .pausedAnim .bobEl, .pausedAnim .headBob{animation-play-state:paused !important;}
  .cloudA{animation:drift 150s linear infinite;} .cloudB{animation:drift 210s linear infinite;} .cloudC{animation:drift 115s linear infinite;}
  .swayEl{animation:sway 2.6s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 100%;}
  .tailEl{animation:tailSwish 1.9s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 0%;}
  .earEl{animation:earFlick 4.7s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 90%;}
  .bobEl{animation:bob 1.24s ease-in-out infinite;}
  .headBob{animation:headBob 1.24s ease-in-out infinite; transform-box:fill-box; transform-origin:20% 60%;}
  .grassEl{animation:grassSway 3.2s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 100%;}
  .flame{animation:flick .5s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 100%;}
  .flame2{animation:flick2 .38s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 100%;}
  .fireGlow1{animation:firePulse 1.7s ease-in-out infinite;}
  .fireGlow2{animation:firePulse2 1.15s ease-in-out infinite;}
  .ember{animation:emberUp 2.6s ease-out infinite;}
  .smokeP{animation:smokeUp 3.4s ease-out infinite;}
  .flagEl{animation:flagWave 1.6s ease-in-out infinite; transform-box:fill-box; transform-origin:0% 50%;}
  @keyframes signSway{0%,100%{transform:rotate(-1.7deg)}50%{transform:rotate(1.7deg)}}
  .signSway{animation:signSway 3.4s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 0%;}
  .bubEl{animation:bubbleUp 2.2s ease-in infinite;}
  .waterLine{stroke-dasharray:26 38; animation:waterFlow 1.1s linear infinite;}
  .waterLine2{stroke-dasharray:14 30; animation:waterFlow 2.3s linear infinite reverse;}
  .riverSheen{animation:riverDrift 9s ease-in-out infinite alternate;}
  @keyframes riverDrift{from{transform:translateX(-46px)}to{transform:translateX(46px)}}
  /* v4.51: the current made visible — light flecks and dark seams whose
     dashes slide downstream through the water column. setRiverState sets
     each one's duration from the depth tier (its data-d weight times the
     tier's flow factor): a walking river crawls, a channel river runs —
     the same law the waterLine dash speed has followed since v4.38. */
  .flowStreak{stroke-dasharray:56 88; animation:flowRun 5s linear infinite;}
  @keyframes flowRun{from{stroke-dashoffset:0}to{stroke-dashoffset:-144}}
  .flowSeam{stroke-dasharray:90 160; animation:seamRun 9s linear infinite;}
  @keyframes seamRun{from{stroke-dashoffset:0}to{stroke-dashoffset:-250}}
  /* v4.38: standing-wave caps bob on the channel; debris rides the current.
     Both are pure paint — SCENE.setRiverState decides how much of either
     the water shows, from the same depth the outcome math uses. */
  .waveCap{animation:waveBob 1.7s ease-in-out infinite;}
  @keyframes waveBob{0%,100%{transform:translateY(0)}50%{transform:translateY(2.2px)}}
  .debrisEl{animation:debrisDrift 30s linear infinite;}
  @keyframes debrisDrift{from{transform:translateX(0)}to{transform:translateX(-150px)}}
  .floatSheen{animation:floatDrift 11s ease-in-out infinite alternate;}
  @keyframes floatDrift{from{transform:translate(-26px,-6px)}to{transform:translate(26px,8px)}}
  .birdFly{animation:birdCross 46s linear infinite;}
  /* v4.14: far cloud layer (slowest drift) + distant V-formation flocks.
     flockCross crosses in the first ~32% of a 76s cycle, then holds
     off-screen — a flight passes every ~38s across the two flocks. */
  .cloudD{animation:drift 260s linear infinite;}
  @keyframes flockCross{0%{transform:translate(-360px,0)}32%{transform:translate(1480px,-46px)}100%{transform:translate(1480px,-46px)}}
  .flockFly{animation:flockCross 76s linear infinite;}
  .birdBob{animation:birdBobY 1.15s ease-in-out infinite;}
  .wingL{animation:wingFlap .58s ease-in-out infinite; transform-box:fill-box; transform-origin:100% 50%;}
  .wingR{animation:wingFlapR .58s ease-in-out infinite; transform-box:fill-box; transform-origin:0% 50%;}
  #postcardG{animation:pcIn .6s ease;}
  /* v4.46: an ending scene owns the stage — the travelling wagon and the
     camp-fire groups stand down so the drawn scene is the whole picture. */
  #scene.endingScene #wagonG, #scene.endingScene #fireG{display:none !important;}
  /* calm mode: honor the OS reduced-motion setting — freeze decorative motion
     (the travel parallax offsets are also gated in SCENE.update) */
  @media (prefers-reduced-motion: reduce){
    #scene *{animation-play-state:paused !important;}
    #postcardG{animation:none;}
  }
  @media (max-width:640px){
    header.top h1{font-size:1.25rem;}
    #story p{font-size:1.05rem;}
    #strip{font-size:.92rem; gap:9px;}
    button.choice{font-size:1.05rem;}
  }


  /* === v4.10: pause, popup menus, click-to-clear, hands-on cooking === */
  #otCtl{position:absolute; top:10px; right:10px; z-index:47; display:none; gap:8px;} /* above the popup (46): pause is ALWAYS reachable */
  body.popmode #otCtl, body.otMini #otCtl{display:flex;}
  .otBtn{
    width:48px; height:48px; border-radius:50%; border:2px solid rgba(255,233,184,.65);
    background:rgba(9,28,43,.72); color:#ffe9b8; font-size:1.25rem; font-weight:900; cursor:pointer;
    display:flex; align-items:center; justify-content:center; padding:0; touch-action:manipulation;
    user-select:none; -webkit-user-select:none; box-shadow:0 6px 16px rgba(0,0,0,.4);
  }
  .otBtn:active{background:rgba(23,122,104,.85);}
  .otBtn.wide{width:auto; border-radius:999px; padding:0 16px; font-size:1rem; gap:6px;}
  #pauseVeil{position:absolute; inset:0; z-index:8; display:none; align-items:center; justify-content:center;
    background:rgba(6,16,24,.42); pointer-events:none;}
  body.otPaused #pauseVeil{display:flex;}
  .pauseChip{background:rgba(9,28,43,.88); color:#ffe9b8; border:2px solid rgba(255,233,184,.7);
    border-radius:999px; padding:12px 26px; font-size:1.35rem; font-weight:900; letter-spacing:.4px;
    box-shadow:0 12px 30px rgba(0,0,0,.5);}
  body.otPaused #scene *{animation-play-state:paused !important;}
  /* v12: the river decision hold — while the crossing choice is on the
     card, the water's CSS motion (flow streaks, seams, sheen, caps)
     rests, the same way the pause veil rests it. */
  body.flowHold #scene *{animation-play-state:paused !important;}
  body.otPaused #menuPopBody, body.otPaused #card, body.otPaused #story{pointer-events:none;}
  body.popmode #boardBtn{display:none !important;}
  body.popmode #chipStack, body.otMini #chipStack{max-width:calc(100% - 216px);} /* 216px: the #otCtl cluster (pause disc + Trail panel pill) is ~196px wide at right:10px — the old 190px reserve let the last party chip slide under the pause button in the hunt view */
  #menuPop{position:fixed; z-index:46; display:none; flex-direction:column;
    background:rgba(7,20,30,.97); border:1.5px solid rgba(255,233,184,.5); border-radius:16px;
    box-shadow:0 18px 50px rgba(0,0,0,.6); transition:transform .26s ease, opacity .26s ease;}
  body.popmode #menuPop{display:flex;}
  #menuPop.closed{opacity:0; pointer-events:none; transform:translateY(18px);}
  #menuPopHead{display:flex; align-items:center; gap:8px; padding:6px 10px;
    border-bottom:1px solid rgba(255,233,184,.25); color:#ffe9b8; font-weight:800; font-size:1.02rem;}
  #menuPopHead .sp{flex:1;}
  .popBtn{min-height:44px; border-radius:999px; border:1.5px solid rgba(255,233,184,.55);
    background:rgba(255,248,230,.1); color:#ffe9b8; font-weight:800; cursor:pointer; padding:6px 14px; font-size:.95rem;}
  .popBtn:active{background:rgba(23,122,104,.6);}
  /* v4.10 gate fix (hard acceptance): inside the popup the CHOICES never
     scroll — the popup is a full-height flex column; the story text caps
     and scrolls internally, the evening header caps, and the caravan board
     (showBoard's markup untouched — CSS on its host only) takes whatever
     room is left below the choices and scrolls internally. */
  #menuPopBody{overflow:hidden; padding:6px; min-height:0; flex:1 1 auto; display:flex; flex-direction:column;}
  #menuPop #story{margin-top:0; flex:none; max-height:10vh; overflow-y:auto;}
  #menuPop #card{margin-top:6px; overflow:hidden; flex:1 1 auto; min-height:0; height:auto; max-height:none; display:flex; flex-direction:column; gap:8px;}
  #menuPop #card>*{flex:none; min-height:0;}
  #menuPop #card .evehdr{max-height:60px; overflow-y:auto;}
  #menuPop #card .choices{gap:8px;}
  #menuPop #card .board{flex:1 1 auto; min-height:0; overflow-y:auto;}
  /* v4.57: scene cards pin their choices — the family-review pattern
     (.famScroll: a bounded text region, actions pinned after it)
     applied to say()+choices() cards. The STORY becomes the bounded,
     flexible region (it shrinks and scrolls inside itself) and the
     card keeps its natural height, so on a long card the choice
     buttons can never be pushed past the sheet's fold by the text —
     the v4.56 sweep found stuck-wagon buttons below the fold at
     412x880. Scoped to scene-phase cards (popSync wears .phaseScene);
     hub cards keep their own well (.hubList), shop cards keep their
     rows layout, the family review keeps .famScroll, and camp/travel
     cards are untouched. */
  body.phaseScene #menuPop #card:has(> .choices:not(.hubList)):not(:has(> .shoprow)):not(:has(> .famScroll)){flex:0 0 auto;}
  body.phaseScene #menuPopBody:has(> #card > .choices:not(.hubList)):not(:has(> #card > .shoprow)):not(:has(> #card > .famScroll)) > #story{flex:0 1 auto; min-height:0;}
  #menuPop .board .roster{display:none;} /* the roster already lives on the stage chips in popmode */
  #menuPop button.choice{padding:7px 12px;}
  #menuPop button.choice .hint{display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:.9rem; line-height:1.28;}
  @media (min-width:1024px){
    #menuPop{right:14px; top:10px; bottom:10px; width:468px; max-height:none;}
    body.popmode #stage{grid-column:1 / -1;}
    body.cooking #menuPop{top:auto; max-height:300px;}
    /* the road's main verb stays reachable with the menu up: on desktop the
       pill floats over the board's lower corner — never over the choices */
    body.popmode #campBtn{z-index:48;}
  }
  @media (max-width:1023px){
    #menuPop{left:6px; right:6px; top:6px; bottom:6px; max-height:none;}
    #menuPop #story{max-height:12dvh;}
    #menuPop.closed{transform:translateY(calc(100% + 14px));}
    body.cooking #menuPop{top:auto; max-height:196px;}
  }
  @media (max-width:560px){
    body.popmode #stage{flex:1 1 auto; height:auto; min-height:0;}
    body.popmode #stage #chipStack{max-width:calc(100% - 190px);} /* two IDs: outranks the later traveling-strip cap so the chips never slide under the pause/menu buttons */
    .otBtn{width:44px; height:44px; font-size:1.1rem;}
    .otBtn.wide{padding:0 12px; font-size:.92rem;}
  }
  #menuPop .helpnote{display:none;} /* v4.10 declutter: the popup carries the moment, not the manual */
  /* v4.40: the fort hub — the primary actions ride a fixed row at the top
     of the card, the family's headline state sits under it as chips in the
     strip's own language, and the rest of the fort's business scrolls in
     its own well below. Nothing is removed; the scroll is for the
     secondary material only. */
  .hubAct{display:flex; gap:8px;}
  .hubAct .choice{flex:1 1 0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center;}
  #menuPop .hubAct .choice{padding:8px 6px; min-height:56px;}
  .hubAct .choice b{font-size:1rem; line-height:1.15;}
  .hubAct .choice .hint{display:block; margin-top:2px; font-size:.82rem; line-height:1.2;}
  #menuPop .hubAct .choice .hint{display:block; -webkit-line-clamp:unset; -webkit-box-orient:unset; overflow:visible;}
  .hubState{display:flex; flex-wrap:wrap; gap:5px; align-items:center;}
  .hubState .hchip{display:inline-flex; align-items:center; gap:5px; background:rgba(255,248,230,.1); border:1px solid rgba(255,233,184,.35); color:#ffe9b8; border-radius:999px; padding:2px 9px 2px 3px; font-size:.85rem; font-weight:700; white-space:nowrap;}
  .hubState .hchip .fc{width:22px; height:22px; border-radius:50%; overflow:hidden; flex:none; background:#e8c39a;}
  .hubState .hchip .fc svg{width:100%; height:100%; display:block;}
  .hubState .hchip i{font-style:normal; font-weight:600; color:#9fc3cc;}
  .hubState .hchip.gone{opacity:.45;}
  .hubState .hchip.wag{padding-left:9px;}
  .hubList{display:flex; flex-direction:column; gap:8px;}
  /* v4.41: the Henderson note card — secondary-well furniture, never a
     choice: a madder-red ruled card pinned at the top of the well. */
  .hubNote{flex:none; background:linear-gradient(180deg,#fdf6dd,#f7ecc9); color:#43331f; border:1px solid #c9a86a; border-left:4px solid #b3402a; border-radius:8px; padding:8px 11px; font-size:.92rem; line-height:1.35;}
  .hubNote b{color:#7a2d1c;}
  #menuPop #card .hubList{flex:1 1 auto; min-height:0; overflow-y:auto; padding-right:2px;}
  .hubList .choice{flex:none;}
  #menuPop .hubList .choice .hint{display:block; -webkit-line-clamp:unset; -webkit-box-orient:unset; overflow:visible;}
  @media (min-width:1024px){
    /* two abreast on wide sheets. Flex wrap, not grid: as grid items the
       buttons' rows sized to the clamped hint and the un-clamped text
       spilled past the borders; flex lines size to the tallest content. */
    #menuPop #card .hubList{flex-direction:row; flex-wrap:wrap; align-content:flex-start;}
    #menuPop #card .hubList .choice{flex:1 1 45%;}
    #menuPop #card .hubList .hubNote{flex:1 1 100%;}
  }
  @keyframes heatShim{0%,100%{transform:translateY(0); opacity:.32}50%{transform:translateY(-3.5px); opacity:.12}}
  .heatShim{animation:heatShim 2.3s ease-in-out infinite;}
  @keyframes cookBubble{0%,100%{transform:translateY(0); opacity:.85}50%{transform:translateY(-2.4px); opacity:.4}}
  .cookBubble{animation:cookBubble 1.1s ease-in-out infinite;}
  .cookIng{cursor:grab;}
  .cookIng.added{opacity:.28; pointer-events:none;}
  @keyframes spoonStir{0%,100%{transform:rotate(-13deg)}50%{transform:rotate(15deg)}}
  .stirring #cookSpoon{animation:spoonStir .55s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 88%;}

  /* === v4.1: painted plates, party chips, drive HUD, plaques, evenings === */
  #plateImg{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center 38%; z-index:0; pointer-events:none; filter:sepia(.13) saturate(1.06) brightness(1.01);
    -webkit-mask-image:linear-gradient(180deg,#000 58%,transparent 96%); mask-image:linear-gradient(180deg,#000 58%,transparent 96%);
    animation:plateDrift 70s ease-in-out infinite alternate;}
  #plateImg.crop3{height:106%;}
  #plateImg.cropBottom{height:106%; object-position:center top;}
  #plateImg.crop3{height:103.5%; object-position:center top;}
  @keyframes plateDrift{from{transform:scale(1.07) translateX(-1.2%)}to{transform:scale(1.07) translateX(1.2%)}}
  #plateImg.still{animation:none; transform:scale(1.07);}
  #scene{position:relative; z-index:1;}
  #placeTag{z-index:6;}
  #chipStack{position:absolute; top:10px; left:10px; z-index:5; display:flex; flex-direction:column; gap:6px; max-width:84%; pointer-events:none;}
  #partyChips{display:flex; gap:6px; flex-wrap:wrap;}
  .pchip{display:flex; align-items:center; gap:6px; background:rgba(10,26,38,.78); border:1px solid rgba(255,233,184,.45); border-radius:999px; padding:3px 9px 3px 3px; color:#ffe9b8;}
  .pchip .pf{width:30px; height:30px; border-radius:50%; overflow:hidden; flex:none; background:#e8c39a;}
  .pchip .pn{font-size:.86rem; font-weight:700; line-height:1;}
  .pchip .pbar{width:64px; height:8px; border-radius:99px; background:rgba(255,255,255,.22); overflow:hidden;}
  .pchip .pbar i{display:block; height:100%; border-radius:99px; transition:width .6s ease, background .6s ease;}
  .pchip.gone{opacity:.45; filter:grayscale(1);}
  .pchip.pulse{animation:chipPulse 1s ease-in-out 3;}
  @keyframes chipPulse{0%,100%{box-shadow:0 0 0 0 rgba(255,90,60,0)}50%{box-shadow:0 0 0 6px rgba(255,90,60,.55)}}
  #chipCallout{align-self:flex-start; background:rgba(80,16,8,.88); color:#ffd9a8; font-weight:800; padding:6px 14px; border-radius:999px; font-size:1rem; pointer-events:none; animation:fadeIn .3s ease;}
  @keyframes flashPop{0%{opacity:.95; transform:scale(.4)}100%{opacity:0; transform:scale(1.6)}}
  .flashAnim{animation:flashPop .28s ease-out forwards; transform-box:fill-box; transform-origin:center;}
  @keyframes puffRise{0%{opacity:.5}100%{opacity:0}}
  .puffAnim{animation:puffRise 1.6s ease-out forwards;}
  @keyframes rockW{from{transform:rotate(-.6deg)}to{transform:rotate(.6deg)}}
  .rocky .bobEl{animation:rockW .45s ease-in-out infinite alternate; transform-box:fill-box; transform-origin:50% 90%;}
  #teamChips{display:flex; gap:5px; flex-wrap:wrap;}
  #teamChips .pchip{padding:2px 8px 2px 6px; font-size:.78rem;}
  #teamChips .pbar{width:44px; height:6px;}
  #teamChips .pchip .pn{font-size:.78rem;}
  @media (max-width:560px){ #teamChips .pbar{width:28px;} }
  @media (max-width:560px){
    #chipStack{top:46px; left:8px; max-width:96%; gap:4px;}
    #partyChips{gap:4px;}
    .pchip{padding:2px 5px 2px 2px;} .pchip .pf{width:22px; height:22px;} .pchip .pn{display:none;} .pchip .pbar{width:36px; height:6px;}
    #chipCallout{font-size:.88rem;}
  }
  .drivenote{margin-top:8px; background:rgba(16,42,58,.12); border:1.5px dashed #7a9a8a; border-radius:10px; padding:8px 12px; font-size:1.02rem; line-height:1.45;}
  .huntpulse{animation:campPulse 1.4s ease-in-out infinite; border-color:#ffd75e !important;}
  .plaque{margin:0 0 10px; background:linear-gradient(180deg,#f7ead0,#efe0bc); border:1.5px solid #a9823e; border-radius:10px; padding:10px 14px; color:#4a3418; font-size:1.04rem; line-height:1.5; box-shadow:inset 0 0 0 3px rgba(169,130,62,.18);}
  .plaque b{color:#6a4a12;}
  .evehdr{margin:0 0 8px; background:rgba(30,58,44,.14); border:1.5px solid #5d7a5a; border-radius:10px; padding:8px 12px; font-size:1.03rem; line-height:1.5;}
  .starTwinkle{animation:twinkle 2.6s ease-in-out infinite;}
  @keyframes twinkle{0%,100%{opacity:.35}50%{opacity:1}}
  @media (prefers-reduced-motion: reduce){ #plateImg{animation:none;} .starTwinkle{animation:none;} .pchip.pulse{animation:none;} .riverSheen{animation:none;} .floatSheen{animation:none;} .waterLine2{animation:none;} .waveCap{animation:none;} .debrisEl{animation:none;} .flowStreak{animation:none;} .flowSeam{animation:none;} }

  /* === v3 additions: camp button, catch line, cast bar, town stroll === */
  #campBtn{
    position:absolute; right:14px; bottom:12px; z-index:5;
    background:linear-gradient(180deg,#23a48f,#157a68); color:#fff; border:2px solid #ffe9b8;
    border-radius:999px; padding:12px 20px; font-size:1.12rem; font-weight:800; cursor:pointer;
    box-shadow:0 8px 22px rgba(0,0,0,.45); animation:campPulse 2.2s ease-in-out infinite; min-height:52px;
  }
  #campBtn:hover{filter:brightness(1.12);}
  /* Round-2 F2: Make Camp disabled while a trail decision is open — the
     game's own disabled dimming (choice buttons use opacity:.45), with
     the invitation pulse stilled so it plainly reads as unavailable. */
  #campBtn:disabled{opacity:.45; cursor:default; animation:none; filter:grayscale(.3);}
  #campBtn:disabled:hover{filter:grayscale(.3);}
  @keyframes campPulse{0%,100%{box-shadow:0 8px 22px rgba(0,0,0,.45), 0 0 0 0 rgba(255,233,184,.55)}50%{box-shadow:0 8px 22px rgba(0,0,0,.45), 0 0 0 11px rgba(255,233,184,0)}}
  @media (prefers-reduced-motion: reduce){ #campBtn{animation:none;} .strollEl{animation:none;} }
  .catchline{margin:10px 0 0; background:#fff3cf; border:1.5px dashed #b98c3e; border-radius:10px; padding:9px 13px; font-size:1.06rem; line-height:1.45;}
  .castbar{position:relative; height:28px; border-radius:999px; background:linear-gradient(90deg,#2f6a92,#7ec3de 50%,#2f6a92); border:2px solid #cbb27a; overflow:hidden;}
  .castbar .sweet{position:absolute; left:38%; width:24%; top:0; bottom:0; background:rgba(255,232,150,.55); border-left:2px dashed #fff3b0; border-right:2px dashed #fff3b0;}
  .castbar .mark{position:absolute; top:0; bottom:0; width:7px; margin-left:-3.5px; background:#fff; border-radius:4px; box-shadow:0 0 8px #fff;}
  .downed *{animation-play-state:paused !important;}
  .strollEl{animation:stroll 9s ease-in-out infinite;}
  @keyframes stroll{0%,100%{transform:translateX(0)}50%{transform:translateX(54px)}}
  @keyframes dustPop{0%{transform:scale(.4); opacity:.85}100%{transform:scale(1.9) translateY(-9px); opacity:0}}
  .dustPop{animation:dustPop .7s ease-out forwards; transform-box:fill-box; transform-origin:center;}
  .swayGrass{animation:grassSway 3.4s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 100%;}

/* === v4.3 P0: pointer steering chrome + phone travel fit (Sean, live phone play) === */
.steerBtn{
  position:absolute; bottom:12px; z-index:6; width:72px; height:72px; border-radius:50%;
  background:rgba(9,28,43,.55); color:#ffe9b8; border:2px solid rgba(255,233,184,.65);
  font-size:1.7rem; font-weight:900; cursor:pointer; display:none;
  touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
  align-items:center; justify-content:center; padding:0;
}
#steerL{left:12px;} #steerR{right:12px;}
body.traveling .steerBtn{display:flex;}
.steerBtn:active{background:rgba(23,122,104,.78);}
body.traveling #campBtn{right:96px;}
@media (min-width:561px){ body.traveling #placeTag{left:96px;} }
body.traveling #scene{touch-action:none;}
/* === v4.27: surface tag — inside the scene, never input === */
#surfTag{
  position:absolute; left:50%; top:104px; transform:translateX(-50%); z-index:6;
  pointer-events:none; background:rgba(9,28,43,.78); color:#ffe9b8;
  border:1.5px solid rgba(255,233,184,.5); border-radius:999px; padding:6px 14px;
  font-size:.92rem; font-weight:700; opacity:0; transition:opacity .3s ease; white-space:nowrap;
}
#surfTag.show{opacity:1;}
body:not(.traveling) #surfTag{display:none;}
@media (max-width:560px){
  #surfTag{top:156px; left:10px; transform:none; font-size:.85rem;}
}
/* with the desktop panel dock open, the surface tag shifts
   left of the dock instead of sliding under it (same :has pattern the
   Make Camp dock uses) */
@media (min-width:1024px){
  body.popmode:has(#menuPop:not(.closed)) #surfTag{ left:12px; transform:none; }
}
#boardBtn{
  position:absolute; top:10px; right:10px; z-index:6; background:rgba(9,28,43,.8); color:#ffe9b8;
  border:1.5px solid rgba(255,233,184,.55); border-radius:999px; padding:8px 14px;
  font-size:.95rem; font-weight:800; cursor:pointer; min-height:44px;
}
/* v4.24: the stats button carries a painted insignia — an emigrant before
   his covered wagon — so a new player can tell what it is at a glance */
#boardBtn .bbadge{width:34px; height:34px; border-radius:50%; object-fit:cover;
  border:1.5px solid rgba(255,233,184,.85); vertical-align:-11px; margin-right:8px;}
.quietLink{
  display:block; margin:12px auto 2px; background:none; border:none; color:#9fc3cc;
  font-size:1rem; font-weight:700; cursor:pointer; text-decoration:underline; min-height:44px; padding:6px 10px;
}
.sizeBtn{
  flex:1; min-height:58px; font-size:1.35rem; font-weight:900; border-radius:12px;
  border:2px solid #cbb27a; background:#fdf8ec; color:var(--ink); cursor:pointer;
}
.sizeBtn.on{background:var(--teal); border-color:var(--teal-d); color:#fff;}
/* phone: EVERY main-flow screen fits the visible viewport — the page never
   scrolls; long middles (letter, creator cards, store list) scroll inside
   their own bounded panels, and primary buttons stay on screen. */
@media (max-width:560px){
  html body{padding:6px 6px 0; overflow:hidden;}
  #app{height:calc(100vh - 6px); height:calc(100dvh - 6px); display:flex; flex-direction:column;}
  header.top{flex-wrap:nowrap; margin:0 2px 4px; align-items:center;}
  header.top h1{font-size:1.02rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  header.top .sub{display:none;}
  #strip{flex-wrap:nowrap; overflow-x:auto; min-height:0; padding:4px 8px; font-size:.8rem; gap:8px; margin-bottom:6px; scrollbar-width:none;}
  #strip::-webkit-scrollbar{display:none;}
  #strip .cell{gap:4px;}
  #strip .lab{display:none;}
  #strip #faces{display:none;}
  #strip .sbtn{min-height:36px; padding:5px 10px; font-size:.85rem;}
  #stage{flex:none; height:23dvh; aspect-ratio:auto;}
  /* mini-games that live IN the stage get its height back (progressive: :has) */
  #stage:has(#floatGame){height:54dvh;}
  #stage:has(#huntG){height:54dvh;}
  #story{flex:none; max-height:19dvh; overflow-y:auto; min-height:0; padding:8px 12px; font-size:1rem; margin-top:6px;}
  #card{flex:1 1 auto; min-height:0; overflow-y:auto; margin-top:6px; padding-bottom:8px;}
  /* the creator's way forward is pinned to the card's bottom edge — always visible */
  #card .choices.creActions{
    position:sticky; bottom:0; z-index:3; background:rgba(9,24,38,.96);
    border-top:1px solid rgba(255,233,184,.35); padding:8px 2px 2px; margin-top:2px;
  }
  body.traveling #stage{flex:1 1 auto; min-height:0; height:auto;}
  body.traveling #boardBtn{display:block !important;}
  /* fixed heights while traveling: the scene must not breathe as notes arrive —
     a resizing stage breaks the finger-to-wagon mapping mid-drag */
  body.traveling #story{height:13dvh; max-height:13dvh;}
  body.traveling #card{flex:none; height:35dvh; max-height:35dvh;}
  body.traveling #card button.choice{padding:9px 12px; min-height:48px; font-size:1rem;}
  body.traveling #card button.choice .hint{display:none;}
  /* Round-2 F3: while a trail decision waits on the player (body.deciding,
     synced every frame to DRIVE.deciding), the open choices' cost/risk
     lines show — a decision is the one moment the price must be on the
     card's face, the way the river choices carry theirs. */
  body.traveling.deciding #card button.choice .hint{display:block;}
  body.traveling #card .drivenote{font-size:.92rem; padding:6px 10px;}
  /* health chips: ONE slim row (portrait + mini bar), tap to expand */
  body.traveling #chipStack{
    flex-direction:row; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; pointer-events:auto;
    max-width:calc(100% - 118px); scrollbar-width:none; cursor:pointer; align-items:flex-start;
  }
  body.traveling #chipStack::-webkit-scrollbar{display:none;}
  body.traveling #partyChips, body.traveling #teamChips{flex-wrap:nowrap; flex:none;}
  body.traveling #chipStack.expanded{
    flex-direction:column; flex-wrap:wrap; overflow-y:auto; overflow-x:hidden; max-height:66%;
    background:rgba(6,18,28,.93); border:1px solid rgba(255,233,184,.4); border-radius:12px; padding:6px;
  }
  body.traveling #chipStack.expanded #partyChips, body.traveling #chipStack.expanded #teamChips{flex-wrap:wrap;}
  body.traveling #chipStack.expanded .pchip .pn{display:inline;}
  body.traveling #chipStack.expanded .pchip .pbar{width:56px; height:8px;}
  /* the caravan board leaves the stack: a bottom sheet behind the Caravan button */
  body.traveling .board{
    position:fixed; left:6px; right:6px; bottom:6px; z-index:45; max-height:64dvh; overflow-y:auto;
    transform:translateY(calc(100% + 14px)); transition:transform .28s ease;
    box-shadow:0 -12px 34px rgba(0,0,0,.55);
    /* v4.24 gate fix: fully opaque — at the base .92 the trail log's bright
       text ghosted through the sheet and fought the gauges for the eye */
    background:rgb(9,28,43);
  }
  body.traveling.boardOpen .board{transform:none;}
}

/* v3 physics: wheels, gait, and body sway are driven from ground distance */
#wagonG .legA, #wagonG .legB, #wagonG .legA2, #wagonG .legB2, #wagonG .wheelspin, #wagonG .bobEl, #wagonG .headBob{animation:none !important;}
/* === WIDE NO-SCROLL LAYOUT (Sean, 2026-10-31): wider game, everything on one screen === */
@media (min-width:1024px){
  body{padding:10px 14px 12px;}
  #app{max-width:1560px; width:100%; height:calc(100vh - 22px); display:grid;
    grid-template-columns:minmax(0,1.62fr) minmax(350px,1fr);
    grid-template-rows:auto auto auto minmax(0,1fr);
    column-gap:16px;}
  header.top{grid-column:1 / -1; grid-row:1;}
  #strip{grid-column:1 / -1; grid-row:2;}
  #stage{grid-column:1; grid-row:3 / 5; aspect-ratio:auto; height:100%; min-height:0;}
  #story{grid-column:2; grid-row:3; margin-top:0; max-height:31vh; overflow-y:auto;}
  #card{grid-column:2; grid-row:4; margin-top:10px; overflow-y:auto; min-height:0; padding-right:2px;}
}
@media (max-width:560px){
  body{padding-bottom:10px;}
}

/* v4.5.1 (Sean, live phone play 2026-11-01): on a phone the Make Camp pill
   sat mid-scene ON the wagon — right:96px + its width centers it at this
   size. While traveling on a phone it becomes a compact pill docked above
   the steer-button row, over the meadow, never on the trail band. */
@media (max-width:560px){
  body.traveling #campBtn{
    right:auto; bottom:104px; left:50%; transform:translateX(-50%);
    padding:8px 14px; font-size:.95rem; min-height:42px;
  }
}

/* === v4 additions: health bars, caravan board, creator, float game === */
#faces .fwrap{display:inline-flex; flex-direction:column; align-items:center; gap:2px;}
#faces .hbar{width:26px; height:5px; border-radius:3px; background:rgba(255,255,255,.22); overflow:hidden;}
#faces .hbar i{display:block; height:100%; border-radius:3px;}
.hbar i.ok{background:#69c24a;} .hbar i.mid{background:#e8b93c;} .hbar i.low{background:#d95f43;}
.board{background:rgba(9,28,43,.92); border:1px solid rgba(127,227,208,.35); border-radius:12px; padding:8px 10px; flex:none;}
.board .btitle{color:#9fc3cc; font-size:.82rem; text-transform:uppercase; letter-spacing:.6px; margin-bottom:6px;}
.board .gauges{display:flex; flex-wrap:wrap; gap:8px;}
button.gauge{
  flex:1 1 150px; text-align:left; background:rgba(255,248,230,.08); color:#f3ead2; border:1.5px solid rgba(255,233,184,.35);
  border-radius:10px; padding:8px 11px; font-size:1rem; cursor:pointer; min-height:52px; line-height:1.3;
}
button.gauge:hover{border-color:#7fe3d0;}
button.gauge b{color:#fff;}
button.gauge .gw{display:block; font-size:.9rem;}
.gw.ok{color:#9fe08a;} .gw.low{color:#ffd873;} .gw.crit{color:#ff9a86;}
.board .roster{margin-top:9px; display:flex; flex-direction:column; gap:5px;}
.rrow{display:flex; align-items:center; gap:8px; font-size:.98rem; color:#f3ead2;}
.rrow .pf{width:26px; height:26px; border-radius:50%; overflow:hidden; border:1.5px solid rgba(255,255,255,.5); flex:none; background:#e8c39a;}
.rrow .pf svg{width:100%; height:100%; display:block;}
.rrow .rn{min-width:86px; font-weight:700;}
.rrow .rbar{flex:1; height:10px; border-radius:5px; background:rgba(255,255,255,.18); overflow:hidden;}
.rrow .rbar i{display:block; height:100%;}
.rrow .rword{min-width:64px; text-align:right; font-weight:700;}
.rrow.gone{opacity:.45; filter:grayscale(1);}
/* v4.19: the board speaks in words — gauge boxes hold a main (fix-it) button,
   a small figures toggle, and a hidden exact-figures line */
.gauge{flex:1 1 150px; display:flex; flex-wrap:wrap; align-items:flex-start; gap:4px 8px;
  background:rgba(255,248,230,.08); border:1.5px solid rgba(255,233,184,.35);
  border-radius:10px; padding:8px 11px; min-height:52px;}
.gauge .gmain{flex:1 1 60%; background:none; border:0; color:#f3ead2; text-align:left;
  font-size:1rem; line-height:1.3; cursor:pointer; padding:0; font-family:inherit;}
.gauge .gmain b{color:#fff;}
.gauge .gmain .gw{display:inline;}
.gauge .gfig{flex:none; background:rgba(255,233,184,.14); border:1px solid rgba(255,233,184,.45);
  color:#ffe9b8; border-radius:999px; font-size:.78rem; padding:3px 10px; cursor:pointer; min-height:28px;}
.gauge .gfigs{flex:1 1 100%; font-size:.93rem; color:#ffe9b8;
  border-top:1px dashed rgba(255,233,184,.3); padding-top:5px;}
button.rrow{width:100%; background:none; border:0; font:inherit; cursor:pointer;
  text-align:left; flex-wrap:wrap; padding:2px 0;}
.rrow .rfigs{flex:1 1 100%; font-size:.9rem; color:#ffe9b8; padding-left:34px;}
/* v4.27 P7: the board reads as ONE flat list — full-width rows, the row
   itself opens the figures, and a plainly labeled Tend button does the
   fixing. The travel quick actions (Pace, Rations) are the same kind of
   row, in the same list, under one heading. */
.board .gauges{flex-direction:column; flex-wrap:nowrap; gap:6px;}
.board .gauge{flex:1 1 auto; width:100%; align-items:center;}
.board .gauge .gmain{min-height:44px; display:flex; align-items:center; gap:6px;}
.board .gauge .gtend{flex:none; min-height:44px; padding:8px 13px; border-radius:9px;
  background:rgba(127,227,208,.16); border:1.5px solid rgba(127,227,208,.5);
  color:#d8f3ec; font-weight:800; font-size:.92rem; cursor:pointer; font-family:inherit;}
.tendhead{color:#9fc3cc; font-size:.82rem; text-transform:uppercase; letter-spacing:.6px; margin:8px 0 6px;}
.tendlist{display:flex; flex-direction:column; gap:6px;}
.trow{display:flex; flex-direction:column; align-items:flex-start; gap:1px; width:100%;
  min-height:48px; padding:8px 12px; border-radius:10px; text-align:left; cursor:pointer;
  background:rgba(255,248,230,.08); border:1.5px solid rgba(255,233,184,.35); color:#f3ead2; font-family:inherit;}
.trow:hover{border-color:#7fe3d0;}
.trow .tlab{font-size:1rem; line-height:1.3;}
.trow .tlab b{color:#fff;}
.trow .tsub{font-size:.82rem; opacity:.85; line-height:1.35;}

/* creator */
.ccard{background:#fdf8ec; color:var(--ink); border:2px solid #cbb27a; border-radius:14px; padding:12px 14px;}
.chead{display:flex; gap:12px; align-items:center; margin-bottom:8px;}
.chead .pf{width:64px; height:64px; border-radius:50%; overflow:hidden; border:2px solid var(--teal); background:#e8c39a; flex:none;}
.chead .pf svg{width:100%; height:100%; display:block;}
.chead .cwho b{font-size:1.12rem; display:block;}
.chead .cwho span{color:#77683f; font-size:.95rem;}
.cfield{display:flex; align-items:center; gap:10px; margin:7px 0; font-weight:700; font-size:1rem; color:var(--ink); flex-wrap:wrap;}
.cfield input[type=text], .cfield select{
  font-size:1.05rem; padding:9px 11px; border-radius:9px; border:2px solid #cbb27a; background:#fffdf4; color:var(--ink); min-height:46px;
}
.cfield input[type=text]{flex:1; min-width:130px;}
.cfield.cwide{background:#fdf8ec; border:2px solid #cbb27a; border-radius:14px; padding:10px 14px;}
.cfield.ccheck input{width:26px; height:26px;}
.cfield.rolef{background:#fdf8ec; border:2px solid #cbb27a; border-radius:14px; padding:8px 12px;}
.swrow{display:inline-flex; gap:7px; flex-wrap:wrap;}
.sw{width:34px; height:34px; border-radius:50%; border:2.5px solid rgba(43,29,18,.35); cursor:pointer; padding:0;}
.sw.on{border-color:var(--teal); box-shadow:0 0 0 2.5px #7fe3d0;}
/* float game overlay */
#floatGame{position:absolute; inset:0; z-index:8; background:#2f6a92; display:flex; flex-direction:column;}
/* v4.57: the pause disc + Trail panel pill (#otCtl, top-right of the
   stage) floated over the crossing header's tail — "steer her acro…"
   hid under them (v4.56 first-timer pass). The header now keeps a
   right-hand safe zone the width of that cluster, so the title and
   the Bumps/Across stat wrap inside ground the controls never touch.
   The controls themselves are unchanged. */
#floatGame .fhead{background:rgba(9,28,43,.85); color:#ffe9b8; padding:8px 14px; padding-right:206px; font-size:1.05rem; font-weight:700; display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap;}
#floatGame svg{flex:1; width:100%; min-height:0;}
#floatGame .fbtns{display:flex; gap:10px; padding:10px; background:rgba(9,28,43,.85);}
#floatGame .fbtns button{
  flex:1; min-height:58px; font-size:1.25rem; font-weight:800; border-radius:12px; border:2px solid #ffe9b8;
  background:#134a5e; color:#eaf6f6; cursor:pointer; touch-action:none; user-select:none; -webkit-user-select:none;
}
#floatGame .fbtns button:active{background:#1a5f78;}
/* v4.57: the wind layer drifts — a slow horizontal breathing of the
   gust group; syncWind sets the pace from the wind's strength and
   flips the group for a headwind. Reduced motion stills it. */
#windDrift{animation:windDrift 22s linear infinite alternate;}
@keyframes windDrift{from{transform:translateX(-54px)}to{transform:translateX(54px)}}
@media (prefers-reduced-motion: reduce){ #windDrift{animation:none;} }
/* === v4 animation layer (owner: "lots of animations") — transform/opacity only === */
@keyframes campSway{0%,100%{transform:rotate(-.8deg) translateY(0)}50%{transform:rotate(.9deg) translateY(-1.1px)}}
.campSway{animation:campSway 3.8s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 100%;}
.campSway.d1{animation-delay:-1.3s;} .campSway.d2{animation-delay:-2.5s;} .campSway.d3{animation-delay:-.7s; animation-duration:4.4s;}
@keyframes oarRowL{0%,100%{transform:rotate(0deg)}50%{transform:rotate(-9deg)}}
@keyframes oarRowR{0%,100%{transform:rotate(0deg)}50%{transform:rotate(9deg)}}
.floatOarL{animation:oarRowL 1.7s ease-in-out infinite; transform-box:fill-box; transform-origin:88% 10%;}
.floatOarR{animation:oarRowR 1.7s ease-in-out infinite; animation-delay:-.85s; transform-box:fill-box; transform-origin:12% 10%;}
@keyframes rustleIn{0%{transform:translateX(0)}20%{transform:translateX(2.5px)}45%{transform:translateX(-2px)}70%{transform:translateX(1.2px)}100%{transform:translateX(0)}}
.rustleIn{animation:rustleIn .55s ease-out;}
@keyframes gwPulse{0%,100%{opacity:1}50%{opacity:.55}}
.gw.crit{animation:gwPulse 1.5s ease-in-out infinite;}
#faces .hbar i{transition:width .7s ease;}
.rrow .rbar i{transition:width .7s ease;}
@keyframes shimmerRise{0%{transform:translateY(6px); opacity:.04}50%{opacity:.12}100%{transform:translateY(-10px); opacity:.04}}
.heatWave{animation:shimmerRise 2.8s ease-in-out infinite;}
.ccard .pf svg{animation:fadeIn .35s ease;}
@media (prefers-reduced-motion: reduce){
  #floatGame *, .rustleIn, .gw.crit, .heatWave{animation:none !important;}
  #rainG *, #snowG *, #stormRainG *{animation:none !important;}
  #faces .hbar i, .rrow .rbar i{transition:none;}
}
  /* v4.11 roam / stalk / condition */
  #roamPrompt{position:absolute; z-index:46; transform:translate(-50%,-100%); background:linear-gradient(180deg,#f7ead0,#ecd9ae); color:#3a2c14; border:2px solid #8a6a34; border-radius:999px; padding:7px 14px; font:700 14px/1.2 Georgia,serif; cursor:pointer; box-shadow:0 4px 14px rgba(0,0,0,.45); white-space:nowrap;}
  #roamPrompt:hover{filter:brightness(1.06);}
  #roamPrompt .rpKey{opacity:.6; font-weight:400; font-size:12px;}
  @keyframes roamDotPulse{0%,100%{opacity:.3}50%{opacity:.8}}
  .roamDot{animation:roamDotPulse 1.8s ease-in-out infinite;}
  @keyframes oxBreathK{0%,100%{transform:scale(1,1)}50%{transform:scale(1.05,1.13)}}
  .oxBreath{animation:oxBreathK 2.6s ease-in-out infinite; transform-box:fill-box; transform-origin:50% 50%;}
  .pausedAnim .oxBreath, .pausedAnim .roamDot{animation-play-state:paused !important;}
  #roamHint{position:absolute; left:50%; bottom:8px; transform:translateX(-50%); z-index:44; background:rgba(20,14,6,.8); color:#f3e6c8; border:1px solid rgba(240,220,170,.4); border-radius:999px; padding:5px 12px; font:600 12.5px/1.3 Georgia,serif; pointer-events:none; white-space:nowrap; max-width:92%;}
  /* === v4.13 mobile declutter — phone presentation pass, layout only.
     D-numbers refer to manifest-v413.md. === */
  /* D8: while the side panel is OPEN, its own header already carries Pause and
     Close — the floating scene pair must never sit on top of the panel's text.
     (Outside popmode the panel is display:none, so this can only fire while
     the panel is genuinely open over the scene.) */
  body.popmode:has(#menuPop:not(.closed)) #otCtl{display:none !important;}
  /* D8 polish: the panel's capped story box fades at its bottom edge, so a
     scrolled-past line reads as a deliberate fade, not a sliced line. */
  #menuPop #story{-webkit-mask-image:linear-gradient(180deg,#000 80%,transparent 98%); mask-image:linear-gradient(180deg,#000 80%,transparent 98%);}
  /* D1 insurance: the Caravan board button never shares the top-right row
     with the floating pair in minigame states. */
  body.otMini #boardBtn{top:100px;}
  #otCtl{gap:10px;}
  #muteBtn{min-width:52px; text-align:center;}
  /* the status strip never flex-shrinks: in the fixed-height app column its
     wrapped second row otherwise spills under the stage and is covered. */
  #strip{flex:none;}
  @media (max-width:1023px){
    /* D8: on phones the panel is a true full-screen sheet — no see-through
       edges, and a fully solid background so the scene can't bleed through
       and muddy the text. */
    #menuPop{left:0; right:0; top:0; bottom:0; border-radius:0; background:#07141e;}
    /* D8: more of the story visible before it scrolls internally. */
    #menuPop #story{max-height:20dvh;}
    /* D8: choice hints get a third line instead of truncating mid-word. */
    #menuPop #card button.choice .hint{-webkit-line-clamp:3;}
    /* D8: in panels without the caravan board (scene/river/fort cards) there
       is room for the fourth line the longest hints need. */
    #menuPop #card:not(:has(.board)) button.choice .hint{-webkit-line-clamp:4;}
    #menuPop .drivenote{font-size:.92rem;}
    /* D8: the board's smallest print steps up a size inside the panel. */
    #menuPop .board .gauge .gs, #menuPop .board .pbar .pl{font-size:.8rem;}
  }
  @media (max-width:560px){
    /* D2: the status strip wraps to two rows — the Journal button is always
       on-screen instead of cut off at the right edge. */
    #strip{flex-wrap:wrap; overflow:visible; gap:5px 10px; padding:7px 10px;}
    #strip .cell{white-space:nowrap;}
    /* (v4.57's strip room for the "mi to go" label lives in the v4.30
       B2 travel-strip block below — the regime that actually wins the
       cascade on a phone drive.) */
    /* D1/D7: the place tag never runs under the floating buttons — slightly
       smaller type everywhere, and a hard cap that clears the button row
       only in the states where that row exists (popmode / minigames). */
    #placeTag{max-width:92%; font-size:.74rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
    body.popmode #placeTag, body.otMini #placeTag{max-width:calc(100% - 166px);}
    /* D1: on phones the Caravan board button (shown while traveling) moves
       out of the top-right row entirely — below the chips, clear of the
       floating pause/Menu pair it used to hide behind. */
    body.traveling #boardBtn{top:100px;}
    /* D3: chips get their own full-width row below the button row — every
       party chip visible at once, no hidden horizontal scroll. */
    #chipStack{top:58px;}
    body.popmode #stage #chipStack, body.otMini #stage #chipStack, body.traveling #stage #chipStack{max-width:calc(100% - 16px);}
    body.traveling .pchip{padding:3px 6px;}
    body.traveling .pchip .pf{width:20px; height:20px;}
    body.traveling .pchip .bar{width:30px;}
    /* D4: Make Camp docks bottom-center BETWEEN the steering buttons —
       clear of the wagon above it and of both steer buttons beside it. */
    body.traveling #campBtn{left:50%; right:auto; top:auto; bottom:14px; transform:translateX(-50%); z-index:7;}
    /* D6: near-foreground shapes soften on the small screen so the clipped
       frame-edge forms read as soft foreground, not stray lumps. */
    #fgG{opacity:.5;}
    /* the roam hint wraps to two lines instead of clipping mid-word. */
    #roamHint, body.traveling #roamHint{white-space:normal; left:8px; right:8px; transform:none; max-width:none; line-height:1.35;}
  }

  /* v4.16: the flavor strip — chances, banter, callouts under the drive note */
  .flavornote{margin-top:8px; background:rgba(90,64,20,.10); border:1.5px solid #b08d3f; border-radius:10px; padding:8px 12px; font-size:1rem; line-height:1.45;}
  .flavornote.banter{background:rgba(16,42,58,.10); border:1.5px dashed #7a9a8a;}
  .flavornote.callout{background:rgba(150,60,20,.12); border:1.5px solid #b35a2a;}
  .flavornote.done{background:rgba(60,110,50,.12); border:1.5px solid #6a9a5a;}
  .flavornote .frow{display:flex; gap:8px; margin-top:8px; flex-wrap:wrap;}
  .flavornote .fbtn{flex:1 1 150px; min-height:44px; padding:8px 10px; border-radius:9px; border:1.5px solid #8a6a2a; background:#f4e3b2; color:#2c2010; font-size:.98rem; font-weight:600; cursor:pointer;}
  .flavornote .fbtn.alt{background:#e8e2d2; border-color:#7a7a6a;}
  .flavornote .fbtn:active{transform:scale(.98);}
  #menuPop .flavornote{font-size:.92rem;}
  .chanceBob{animation:chanceBob 3.1s ease-in-out infinite;}
  @keyframes chanceBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-2.5px)}}
  @media (prefers-reduced-motion: reduce){ .chanceBob{animation:none;} }

  /* v4.17: discovery collections — guide notes in the flavor strip, locked journal entries */
  .flavornote.guide{background:rgba(46,96,44,.13); border:1.5px solid #5d8a4a;}
  #menuPop .flavornote.guide{font-size:.92rem;}
  .jentry.lock{opacity:.68;}
  .jentry .jmeta{margin-top:4px; font-size:.86em; color:#7a5b21; font-style:italic;}

  /* v4.18: recipe book — the meal-time note in the story block */
  .recipeNote{margin-top:9px; padding:8px 11px; border-radius:9px; background:rgba(46,96,44,.13); border:1.5px solid #5d8a4a; font-size:.93em; line-height:1.45;}

  /* === v4.22: the travel panel on phone — while the wagon ROLLS the panel
     is a compact bottom strip and the road stays on screen; the full sheet
     is for reading, and while it is up the wagon is honestly stopped (the
     sim freezes — see popSync / mainLoop). No hit lands unseen again. === */
  #popExpandBtn{display:none;}
  #popStopBar{display:none; flex:none; align-items:center; gap:8px; margin:0 0 6px;
    padding:7px 10px; border-radius:10px; background:rgba(255,233,184,.14);
    border:1.5px solid rgba(255,233,184,.5); color:#ffe9b8; font-weight:800; font-size:.92rem; line-height:1.3;}
  body.popExpanded #popStopBar{display:flex;}
  @media (max-width:1023px){
    body.popStrip{--stripH:min(318px, 40dvh);}
    body.popStrip #popExpandBtn, body.popExpanded #popExpandBtn{display:block;}
    /* strip state: bottom-anchored and capped — and the app column gives up
       exactly the strip's height, so the scene and its road are never under it */
    body.popStrip #menuPop{top:auto; bottom:0; left:0; right:0; height:var(--stripH); border-radius:16px 16px 0 0;}
    body.popStrip #menuPop #story{max-height:52px;}
    body.popStrip #menuPop #card{display:block; overflow-y:auto; overflow-x:hidden;}
    body.popStrip #menuPop #card>*{margin-top:8px;}
    body.popStrip #menuPop #card>*:first-child{margin-top:0;}
    body.popStrip #menuPop #card .board{overflow:visible; flex:none;}
    body.popStrip #menuPop button.choice{padding:6px 10px;}
    body.popStrip #menuPop button.choice .hint{-webkit-line-clamp:1;}
    body.popStrip #menuPop .drivenote{font-size:.9rem;}
    /* expanded (reading) state: the familiar full sheet, wagon stopped */
    body.popExpanded #menuPop{left:0; right:0; top:0; bottom:0; height:auto; max-height:none; border-radius:0; background:#07141e;}
  }
  @media (max-width:560px){
    body.popStrip #app{height:calc(100vh - 6px - var(--stripH)); height:calc(100dvh - 6px - var(--stripH));}
  }
  @media (min-width:561px) and (max-width:1023px){
    body.popStrip #app{padding-bottom:var(--stripH);}
  }

  /* v4.24 (Sean, live phone play): Make Camp leaves the trail band for
     good. While traveling it docks at the scene's right edge, vertically
     centered over the hills — the wagon train rolls along the bottom band
     and can never pass under it. Full-size pill, pulse and all: still the
     plainest button on the screen. Placed last so it outranks the older
     traveling docks (right:96px, the v4.5.1 shelf, D4 bottom-center). */
  body.traveling #campBtn{left:auto; right:12px; top:50%; bottom:auto; transform:translateY(-50%); z-index:7;}
  /* …except the sanctioned desktop pop-mode float: with the menu panel
     actually up at desktop widths the pill stays over the board's lower
     corner, where the road's main verb has always stayed reachable. The
     :has keys on the panel being OPEN — once it's closed the dock above
     rules again, even though popmode itself stays on. */
  @media (min-width:1024px){
    body.popmode:has(#menuPop:not(.closed)) #campBtn{left:auto; right:14px; top:auto; bottom:12px; transform:none; z-index:48;}
  }

  /* === v4.25 D1: the cooking dock, sized to its contents === */
  /* At every width the dock's card runs tight: the head and body padding
     give back a few pixels and the choices sit closer, so the stage's own
     button (Give up on supper / Pull it off the fire) stays inside the
     dock instead of rendering below its fold. The story window is capped
     and scrolls — the instruction rides in the card's note line as well. */
  body.cooking #menuPopHead{padding-top:3px; padding-bottom:3px;}
  body.cooking #menuPopBody{padding:3px 6px;}
  body.cooking #menuPop #card .choices{margin-top:2px !important;}
  body.cooking #menuPop #story{max-height:68px; min-height:0;} /* min-height: the base #story floor (86px) otherwise defeats the cap on desktop */
  body.cooking #menuPop #card .note{max-height:62px; overflow:hidden;}
  @media (max-width:1023px){
    /* The old 196px dock could not hold its own card: head (57px) + story
       ate it whole, and the prep note, the Give-up button, the stir bar
       and the serve button all rendered below its fold, clipped away.
       The dock takes the desktop measure (300px), the story window inside
       it is capped and scrolls, and the app column gives up the dock's
       height — the popStrip pattern — so the scene, the pot and the
       ingredients sit entirely ABOVE the dock instead of underneath it. */
    body.cooking #menuPop{top:auto; max-height:300px;}
    body.cooking #menuPop #story{max-height:56px;}
  }
  @media (max-width:560px){
    body.cooking #app{height:calc(100vh - 6px - 306px); height:calc(100dvh - 6px - 306px);}
  }
  @media (min-width:561px) and (max-width:1023px){
    body.cooking #app{padding-bottom:306px;}
  }

  /* === v4.25: phone chip fit (D5) + the strip's Day label === */
  @media (max-width:560px){
    /* D5: the party chips shrink to fit the phone whole — five (or six)
       members across inside the stack's width, no last chip hanging off
       the right edge in town, on the trail, or in camp. Placed last so it
       outranks the older ≤560 chip sizing and the traveling-chip rules.
       Names stay hidden at this size, as before; desktop is untouched. */
    #partyChips{gap:3px;}
    .pchip{padding:2px 5px 2px 2px; gap:4px;}
    .pchip .pf{width:20px; height:20px;}
    .pchip .pbar{width:26px; height:6px;}
    body.traveling .pchip{padding:2px 5px 2px 2px;}
    body.traveling .pchip .pf{width:20px; height:20px;}
    body.traveling .pchip .pbar{width:26px;}
    /* Sean's find: the ≤560 strip hides every .lab, leaving a bare
       "0 April 12" that reads as a stray digit. The Day label stays. */
    #strip .lab.daylab{display:inline;}
  }

  /* === v4.26 (first-time-player audit D3/D4/D6/D7): honest text windows === */
  /* D3: on the title screen the story box is allowed to fit its text —
     the opening story must never end mid-sentence behind an invisible
     scroll. (46dvh fits the whole intro at phone and desktop heights;
     the D6 cue below backstops any cap that still overflows.) */
  body.atTitle #story{max-height:46dvh;}
  /* D6: the "▾ more" cue — a real, tappable chip pinned by JS to the
     bottom edge of any capped text window that still has text below
     the fold (see syncMoreCues). It replaces the old invisible scroll:
     a faint fade was the only hint, and text read as broken. */
  .moreCue{position:fixed; z-index:47; transform:translate(-50%,-50%);
    padding:4px 14px 5px; border-radius:999px; border:1.5px solid #a3762a;
    background:#ffe9b8; color:#4c3a22; font:inherit; font-size:.85rem; font-weight:800;
    letter-spacing:.2px; cursor:pointer; box-shadow:0 6px 16px rgba(0,0,0,.45);}
  .moreCue:active{background:#f5d98f;}
  /* v4.57: the cue DOCKS below its window, in a gap the window itself
     reserves while its cue is live (syncMoreCues toggles .cueDock) —
     it used to float over the window's bottom edge and sit on the
     last line of live text (the camp narration's tail, the Evening
     header's middle). The start-flow pop-ups read clean the same
     way: the chip never covers words. */
  #story.cueDock, #driveStory.cueDock, #card .evehdr.cueDock, #menuPop #card .note.cueDock{margin-bottom:30px;}
  /* D4: the creator's cards scroll in their OWN region and the
     way-forward bar sits below it in the flow — its space is reserved,
     so it can never float over a card again (the old sticky bar struck
     through the Father heading and covered Build rows mid-scroll). */
  #card:has(> .creScroll){overflow-y:hidden;}
  .creScroll{flex:1 1 auto; min-height:0; overflow-y:auto; display:flex;
    flex-direction:column; gap:10px; padding:2px 2px 4px;}
  /* the two reserved bars keep their full height — as flex items in the
     bounded card column they would otherwise shrink and let the scroll
     region paint over the top button's hint */
  #card > #creDefault{flex:none;}
  #card .choices.creActions{position:static; flex:none; background:rgb(9,24,38);
    box-shadow:0 -8px 18px rgba(0,0,0,.35);}
  /* ================= v4.54 — the start screen is a MENU of pop-ups ====
     Sean, live playtest Nov 5: the creator stacked every decision on one
     cramped scrolling screen — "you can't choose how many are traveling
     because everything's so clustered up and cluttered... break it into
     pop-up menus." v4.54 made it a menu of pop-ups; Sean's second
     correction the same night (v4.55): "Still way too clutter — make
     them sequential pop-ups." So there is no menu: the start screen
     carries almost nothing, and the setup runs as a SEQUENCE of pop-ups,
     one decision at a time, each with Back + Next. Each pop-up is a
     full-screen panel (the journal overlay's pattern) and gets the whole
     screen's room: nothing stacked behind it, nothing competing. The
     journal keeps z-index 60, above these panels, exactly as before. */
  /* v4.55: no start menu at all — the SEQUENCE's pop-ups are the start
     (Sean's second correction: the menu was "still way too clutter").
     The family chips stay OFF the scene while the start flow is up
     (body.atStart, added in creatorScene, removed in departStart):
     chips belong to the trail. */
  body.atStart #chipStack{display:none;}
  .popNav{display:flex; gap:10px; margin-top:14px;}
  .popNav .choice{flex:1 1 0;}
  .popNav .popBack{flex:0 1 38%;}
  .popLine{color:#5d4a26; font-size:1rem; line-height:1.45; margin:2px 0 6px;}
  #startPop{position:fixed; inset:0; z-index:55; display:none;
    background:rgba(4,14,24,.82); align-items:flex-start; justify-content:center;
    overflow:hidden; padding:16px 10px;}
  #startPop.open{display:flex;}
  .popPanel{background:linear-gradient(180deg,#fbf3da,#f1e3ba); color:var(--ink);
    width:100%; max-width:680px; max-height:calc(100dvh - 32px); overflow-y:auto;
    border-radius:16px; border:2px solid #cbb27a; box-shadow:0 24px 60px rgba(0,0,0,.6);
    padding:18px 18px 20px;}
  .popHead{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px;}
  .popHead h2{font-family:Georgia,serif; font-size:1.35rem; margin:0; color:#6d4c15;}
  .popClose{flex:none; width:52px; height:52px; border-radius:12px; border:2px solid #cbb27a;
    background:#fdf8ec; color:var(--ink); font-size:1.25rem; font-weight:900; cursor:pointer;}
  .popBtns{display:flex; flex-direction:column; gap:10px;}
  .popBtns button.choice, .popPanel button.choice{width:100%;}
  .popNote{color:#5d4a26; font-size:1rem; line-height:1.45; background:#fff8e6;
    border:1.5px dashed #b98c3e; border-radius:10px; padding:9px 12px; margin-top:10px;}
  .popNote:first-of-type{margin-top:0;}
  .sizeGrid{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:2px 0 12px;}
  .sizeGrid .sizeBtn{min-height:78px; font-size:1.75rem;}
  @media (min-width:900px){ .sizeGrid{grid-template-columns:repeat(6,1fr);} .sizeGrid .sizeBtn{min-height:74px;} }
  .popDone{margin-top:14px; width:100%;}
  .prow{display:flex; align-items:center; gap:12px; width:100%; text-align:left;
    background:#fdf8ec; color:var(--ink); border:2px solid #cbb27a; border-radius:14px;
    padding:10px 14px; cursor:pointer; min-height:70px; font:inherit;
    box-shadow:0 4px 12px rgba(0,0,0,.18);}
  .prow:hover{border-color:var(--teal);}
  .prow .pf{width:52px; height:52px; border-radius:50%; overflow:hidden;
    border:2px solid var(--teal); background:#e8c39a; flex:none;}
  .prow .pf svg{width:100%; height:100%; display:block;}
  .prow .ptx{flex:1; min-width:0;}
  .prow .ptx b{font-size:1.15rem; display:block;}
  .prow .pr{display:block; color:#77683f; font-size:.92rem;}
  .prow .pgo{color:var(--teal-d); font-weight:800; flex:none;}
  @media (max-width:560px){
    #startPop{padding:8px 6px;}
    .popPanel{max-height:calc(100dvh - 16px); padding:14px 12px 16px;}
    .popHead h2{font-size:1.2rem;}
  }
  /* familyScene (the ready-made path's review step) gets the game's own
     D4 pattern: the introductions scroll in their own bounded region and
     the two way-forward buttons stay on screen below it, in the flow. */
  #card:has(> .famScroll){overflow-y:hidden;}
  .famScroll{flex:1 1 auto; min-height:0; overflow-y:auto; display:flex;
    flex-direction:column; gap:10px; padding:2px 2px 4px;}
  /* v4.54 (desktop start fit): while the start flow is up (body.atStart,
     removed in departStart), the stage lends height to the stack and the
     menu/family buttons pair up in two columns, so no start step needs
     the page to scroll at 1366x768 or 1440x950 either. The letter and
     the introductions scroll inside their own capped windows (the D6
     more-cue system covers the story cap). */
  @media (min-width:900px){
    body.atStart #stage{height:42vh; aspect-ratio:auto;}
    body.atStart #story{max-height:30dvh; overflow-y:auto;}
    body.atStart .famScroll{max-height:28dvh;}
    body.atStart .famChoices{display:grid; grid-template-columns:1fr 1fr; align-items:stretch;}
  }
  @media (min-width:900px) and (max-height:840px){
    body.atStart #stage{height:34vh;}
    body.atStart #story{max-height:24dvh;}
    body.atStart .famScroll{max-height:24dvh;}
  }
  /* v4.54 (phone start fit): on the start screens the scene and the
     narration lend height to the card, so the letter and the family
     review fit the phone screen with no scrolling. (v4.55: the start
     card itself is nearly empty behind the pop-up sequence.) The trail
     restores the full stage and story the moment it sets out. */
  @media (max-width:560px){
    body.atStart #stage{height:19dvh;}
    body.atStart #story{max-height:15dvh;}
  }
  /* ================= v4.29 — drive feel + declutter =================
     Sean, live playtest Nov 3: "the steering sucks", "It's so
     cluttered", and his rein-pressure throttle. The scene owns the
     screen now; everything else is a guest. */
  /* --- header: one slim row at every width; on the phone in travel
     the header folds away entirely and the strip carries title +
     Day/date + next + food/$ + Journal + sound in ONE row --- */
  header.top{flex-wrap:nowrap; align-items:center;}
  header.top h1{font-size:1.28rem; white-space:nowrap;}
  header.top .sub{white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  @media (max-width:900px){ header.top .sub{display:none;} }
  .stripTitle{display:none; font-weight:800; color:#ffd75e;}
  @media (max-width:560px){
    body.traveling header.top{display:none;}
    body.traveling #strip .stripTitle{display:inline;}
    /* the folded header must stay ONE row: the strip scrolls
       sideways (its long-standing phone pattern), never wraps */
    body.traveling #strip{flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none;}
    body.traveling #strip::-webkit-scrollbar{display:none;}
    body.traveling #strip .cell{white-space:nowrap;}
  }
  /* --- the floating family chip row is OFF the scene (pop phases:
     travel/camp/scene). Health lives in the strip faces, the panel
     gauges and the Family & Wagon board — whose roster returns now
     that the chips no longer cover for it. The fading/failing
     callout remounts on the stage itself. --- */
  body.popmode #chipStack{display:none;}
  #menuPop .board .roster{display:flex;}
  #stage > #chipCallout{position:absolute; top:8px; left:10px; z-index:6; max-width:72%; align-self:auto;}
  /* --- scene-edge pills: Family & Wagon (top right) and Make Camp
     (mid right edge) — small, and Make Camp can never meet the wagon:
     the wagon's road lives in the middle of the scene, never at the
     right edge, at any depth the wagon can travel --- */
  #boardBtn{padding:5px 10px; font-size:.85rem; gap:6px;}
  #boardBtn .bbadge{width:22px; height:22px;}
  body.traveling #campBtn{right:10px; left:auto; top:50%; bottom:auto; transform:translateY(-50%); padding:8px 12px; font-size:.95rem; min-height:44px; border-radius:999px;}
  /* --- steer discs: smaller, ghosted at rest, solid in the hand --- */
  .steerBtn{width:54px; height:54px; font-size:1.25rem; opacity:.55; transition:opacity .15s ease;}
  .steerBtn:active, .steerBtn.held{opacity:1;}
  /* --- the rein rail: the throttle. Left edge of the scene, clear
     of the steer disc below it and the place tag above it. Fill =
     pressure (rises as you haul back); thumb rides the pressure. --- */
  #reinRail{display:none; position:absolute; left:10px; top:50%; transform:translateY(-50%); width:38px; height:38%; min-height:128px; z-index:7; border-radius:20px; background:rgba(24,18,10,.52); border:2px solid rgba(240,220,170,.55); touch-action:none; cursor:pointer; overflow:hidden;}
  body.traveling #reinRail{display:block;}
  #reinRail .rrFill{position:absolute; left:0; right:0; bottom:0; height:48%; background:linear-gradient(180deg,#a9763f,#7c4f26); opacity:.85; pointer-events:none;}
  #reinRail .rrThumb{position:absolute; left:50%; top:52%; transform:translate(-50%,-50%); width:32px; height:32px; border-radius:50%; background:#3a2a16; border:2px solid #e8cf9e; display:flex; align-items:center; justify-content:center; font-size:1rem; pointer-events:none; box-shadow:0 2px 6px rgba(0,0,0,.5); z-index:2;}
  #reinRail .rrTop, #reinRail .rrBot{position:absolute; left:0; right:0; text-align:center; font-size:.55rem; color:#f0dcb4; pointer-events:none; z-index:3;}
  #reinRail .rrTop{top:3px;} #reinRail .rrBot{bottom:3px;}
  #reinRail .rrLab{position:absolute; left:50%; bottom:15px; transform:translateX(-50%); writing-mode:vertical-rl; font-size:.5rem; letter-spacing:.18em; color:rgba(240,220,180,.9); pointer-events:none; z-index:1;}
  #reinRail.flash{animation:rrFlash 1.6s ease;}
  @keyframes rrFlash{0%,100%{box-shadow:none;} 25%,60%{box-shadow:0 0 0 4px rgba(255,215,110,.9), 0 0 18px rgba(255,215,110,.7);}}
  /* --- ONE panel card: story + drive note + flavor line in a
     single box; the standalone #story hides while merged --- */
  .drivebox{background:linear-gradient(180deg,#f7ecd2,#efdfba); color:var(--ink); border:2.5px solid #8a6a44; border-radius:12px; padding:10px 14px; box-shadow:0 2px 0 rgba(0,0,0,.25);}
  .drivebox .dbstory{font-size:1.02rem; line-height:1.45;}
  .drivebox .dbstory p{margin:0 0 7px;}
  .drivebox .dbstory p:last-child{margin-bottom:0;}
  #menuPop .drivebox .dbstory{max-height:10vh; overflow-y:auto;}
  body.popStrip #menuPop .drivebox .dbstory{max-height:52px; overflow:hidden;}
  body.popExpanded #menuPop .drivebox .dbstory{max-height:36dvh; overflow-y:auto;}
  .drivebox .drivenote{background:rgba(101,67,33,.07); border:none; border-top:1.5px dashed #a98d5f; border-radius:0; margin-top:8px; padding:8px 2px 0; color:inherit; box-shadow:none;}
  .drivebox .flavornote{background:transparent; border:none; border-top:1.5px dashed #a98d5f; border-radius:0; margin-top:6px; padding:7px 2px 0; box-shadow:none;}
  body.travelMerge #menuPop #story{display:none;}
  /* ================= v4.30 B2 — the phone travel strip =================
     The v4.29 one-row strip side-scrolled: the next stop's name ran off
     the right edge and food / $ sat a scroll away. In travel on a phone
     the strip now WRAPS instead — nothing is ever off-screen. The game
     title (it lives on the title screen) and the calendar date give up
     their room; Day, next stop + miles, food and $ always show. */
  @media (max-width:560px){
    body.traveling #strip{flex-wrap:wrap; overflow-x:visible; gap:5px; padding:7px 8px;}
    body.traveling #strip .stripTitle{display:none;}
    body.traveling #strip .dstr{display:none;}
    body.traveling #strip .cell{white-space:nowrap; gap:3px; font-size:.94em;}
    body.traveling #strip .togo{letter-spacing:0;}
    /* v4.57: the trims above buy back the room the "mi to go" label
       (fix 4) takes — on the widest cell (Kansas River Crossing, two
       digits, late-season snow cell aboard) the money cell was pushed
       to a third row and the header grew ~24px, which the brief
       forbids. Gaps and padding only; no words change. */
  }
  /* ================= v4.31 Nit A — the place pill on phones =================
     One line never fit: "Big Blue River Crossing · September 30, 1852"
     needed ~276px where ~232 were clear, so the date ellipsized — and in
     the closed-panel state the pause button sat on the pill's right end
     and hid the year outright. On phones the pill now stacks: place on
     the first line, the full date on a second, smaller line. While
     traveling its width is capped to clear the pause cluster. Desktop
     keeps the single inline line, separator and all (setPlace markup). */
  @media (max-width:560px){
    #placeTag{line-height:1.3; overflow:visible; text-overflow:clip;}
    #placeTag .plSep{display:none;}
    #placeTag .plName{display:block;}
    #placeTag .plDate{display:block; font-size:.84em; font-weight:600; opacity:.85;}
    body.traveling #placeTag{max-width:calc(100% - 196px);}
  }

  /* ================= v4.58 — OVERHAUL PASS 1 (2026-11-10) =================
     D3: on desktop the trail panel (#menuPop, fixed, 468px wide at the
     right) overlays the stage's right edge. Measured at 1440x950: the
     right steer button sat entirely inside the panel's footprint —
     mouse/touch players could not steer right with the panel open, the
     strip's party faces were cut at the panel edge, and the Journal
     button vanished behind it. With the panel open, pull the right
     steer button and the strip's content clear of the panel, and keep
     the camp walk-hint (#roamHint, nowrap, z 44 < panel 46) from
     sliding underneath it. */
  @media (min-width:1024px){
    body.popmode #steerR{right:496px;}
    body.popmode #strip{padding-right:496px;}
    body.popmode #roamHint{max-width:calc(100% - 510px);}
  }
  /* D4: the title card gains a short "how this plays" briefing under
     the Start button — it fills the dead space under the card (worst
     on phones, where half the screen sat empty) and tells a brand-new
     player the game's verbs before the first click. */
  body.atTitle #card::after{
    content:"🚦 Steer with the ◀ ▶ buttons, A / D keys, or drag on the trail\A🪢 The reins are your throttle — ease off to fly, haul back to go gentle\A🍞 Keep food, water and the wagon tended — at 0% she stops dead until repaired\A🏁 1,850 miles · 16 stops · your first river is the Kansas, 102 miles out";
    display:block; white-space:pre-line; margin-top:14px;
    background:linear-gradient(180deg,#f7ecd2,#efdfba); color:#4c3a22;
    border:2px solid #8a6a44; border-radius:12px; padding:12px 16px;
    font-size:1rem; line-height:1.8; box-shadow:0 2px 0 rgba(0,0,0,.25);
  }
  /* === declutter pass (Sean: "the screen is so cluttered") ===
     1) While driving, the party chips leave the scene — family state
        lives in the Family & Wagon panel, whose roster shows there now.
     2) The two pills on the art (Family & Wagon, Make Camp) go small,
        dark and semi-transparent, stacked in the scene's top-right
        corner — no more big bright buttons floating mid-scene. The
        !important box/position props outrank the older per-breakpoint
        dock rules for these two buttons while traveling.
     3) The board gains a quiet date/day/money line (off the strip).
     4) Store rows tighten into one compact row; Haggle becomes a
        small text-style button riding the price line. */
  body.traveling #chipStack{display:none;}
  body.traveling #menuPop .board .roster{display:flex;}
  body.traveling #boardBtn, body.traveling #campBtn{
    left:auto !important; right:10px !important; transform:none !important;
    background:rgba(6,18,28,.66) !important; border:1.5px solid rgba(255,233,184,.38) !important;
    box-shadow:none !important; animation:none !important;
    color:#ffe9b8; border-radius:999px; padding:6px 11px !important;
    font-size:.85rem !important; min-height:38px; z-index:7;
  }
  body.traveling #boardBtn{ top:10px !important; bottom:auto !important; }
  body.traveling #campBtn{ top:54px !important; bottom:auto !important; }
  body.traveling #boardBtn .bbadge{ width:22px; height:22px; vertical-align:-6px; margin-right:6px; }
  @media (min-width:1024px){
    /* with the desktop panel dock open, the pills sit at the visible
       scene's top-right, left of the dock — the steerR pattern */
    body.popmode:has(#menuPop:not(.closed)) #boardBtn,
    body.popmode:has(#menuPop:not(.closed)) #campBtn{ right:482px !important; }
  }
  .board .bquiet{font-size:.88rem; color:#9fc3cc; margin:-2px 0 8px;}
  .shoprow{padding:7px 10px; gap:9px; border-radius:12px;}
  .shoprow .ic{font-size:1.35rem; width:34px;}
  .shoprow .tx .sdesc{display:block; color:#77683f; font-size:.84rem; line-height:1.25; margin-top:1px;}
  .shoprow .tx .sunit{display:inline; color:#77683f; font-size:.9rem;}
  .shoprow .tx .hagwrap{display:inline;}
  .shoprow .own{min-width:0; font-size:.95rem;}
  .shoprow .bb button{width:46px; height:46px; font-size:1.3rem; border-radius:10px;}
  .hagbtn{background:none; border:none; color:#157a68; text-decoration:underline;
    font-size:.88rem; font-weight:700; padding:2px 4px; margin:0 0 0 4px; cursor:pointer;}
  a.s2w-backlink{display:inline-block;color:#ffe9b8;text-decoration:none;font-size:16px;font-weight:bold;margin:6px 2px 2px;}

/* ================= v13 — LIVE-SCENE TITLE MENU (2026-11-29) =================
   Sean's approved illusion (Jungle v83 / Carmen v13 pattern): the title
   menu sits OVER the game's live first scene. showTitle() already renders
   the real Independence scene into #scene (Missouri biome, wagon + oxen,
   parallax far/mid layers drifting under mainLoop — SCENE.traveling is on
   in title phase), so this is presentation only: at title the stage grows
   to fill the screen behind the menu, and the story card + choices ride
   over its lower half as near-opaque paper panels (the game's own paper,
   a breath of the scene ghosting through). Every other phase is
   untouched — body.atTitle comes off the moment a journey starts. */
body.atTitle #story{position:relative; z-index:5;
  background:linear-gradient(180deg, rgba(248,238,214,.94), rgba(239,224,189,.94));
  box-shadow:0 12px 28px rgba(0,0,0,.5);}
body.atTitle #card{position:relative; z-index:5;}
body.atTitle #card button.choice:not(.primary){background:rgba(253,248,236,.97);
  box-shadow:0 8px 20px rgba(0,0,0,.4);}
body.atTitle #card::after{
  background:linear-gradient(180deg, rgba(247,236,210,.95), rgba(239,223,186,.95));
  box-shadow:0 8px 20px rgba(0,0,0,.4);}
/* phone: the stage becomes the tall backdrop; story + card pull up over it */
@media (max-width:560px){
  body.atTitle #stage{height:56dvh;}
  body.atTitle #story{margin-top:-26dvh;}
}
/* tablet / small window: same pull-up in the plain stacked layout */
@media (min-width:561px) and (max-width:1023px){
  body.atTitle #stage{aspect-ratio:auto; height:62vh;}
  body.atTitle #story{margin:-150px 20px 0;}
  body.atTitle #card{margin-left:20px; margin-right:20px;}
}
/* desktop wide grid: the stage spans BOTH columns behind the menu column */
@media (min-width:1024px){
  body.atTitle #stage{grid-column:1 / -1;}
  body.atTitle #story{margin:20px 20px 0 0;}
  body.atTitle #card{margin:10px 20px 20px 0;}
}
