/* ===== v96: the rules every screen follows (js/36t-ui.js explains them) ===== */
/* 2. words stay whole; a word longer than its line still breaks instead of running out of the box */
html,body{word-break:keep-all;overflow-wrap:anywhere;line-break:strict}
button,.btn,.rb,.pill,h1,h2,h3,#nav .t1,.poBubble,.tile .n,.plHead b,.lvRow b{text-wrap:balance}
#dlg .tx,.memoStory,p,.hint{text-wrap:pretty}
/* 3. a button is its words, centred, on at most two lines (the fitter makes them smaller before a third) */
.btn{line-height:1.2;text-align:center;min-width:0;max-width:100%}
.btn .pxe,.btn img,.btn svg{flex:none}
#bAct,#bAlt{line-height:1.15;text-align:center;padding:0 7px;box-sizing:border-box}
#bActTx,#bAltTx{display:block;max-width:100%}
/* 4. a bar of buttons: equal shares of the row; two rows when the words do not fit in one */
.poBtns,[data-bar]{display:grid;grid-template-columns:repeat(var(--bar-n,4),minmax(0,1fr));gap:8px;justify-content:stretch;align-items:stretch}
.poBtns{left:0;right:0;padding:0 12px;zoom:var(--ui);width:auto;max-width:calc(560px);margin:0 auto}
.poBtns .btn,[data-bar] .btn{flex-direction:column;gap:3px;padding:8px 6px;min-height:64px;font-size:16px;width:100%}
.poBtns .btn .pxe{width:24px;height:24px}
.uiBar2{grid-template-columns:repeat(var(--bar-n,2),minmax(0,1fr))}
.uiBar2 .btn{flex-direction:row;min-height:50px;gap:6px}
#dlg .choices{display:grid;grid-template-columns:repeat(var(--bar-n,2),minmax(0,1fr));gap:8px}
#dlg .choices .btn{width:100%;min-height:44px;padding:6px 10px;font-size:15px}
#dlg .choices.uiBar2{grid-template-columns:repeat(var(--bar-n,2),minmax(0,1fr))}
/* 5. one peanut counter: a screen that has its own does not get the floating one on top of it */
body:has(#wallet:not([hidden])) .poNut{display:none}
.poBubble{zoom:var(--ui);width:min(420px,calc((100vw - 28px)/var(--ui)));box-sizing:border-box}
/* no empty room inside a box: once the choices are up, the talk box is only as tall as its words and its buttons */
#dlg:has(.choices:not([hidden])) .tx{min-height:0}
#dlg:has(.choices:not([hidden])) .bar:not(:has(button:not([hidden]))){display:none}
#dlg .choices{margin-top:10px}
/* 1. one size: the screens that were drawn at their own size now follow --ui like everything else.
      (A screen that is a drawing surface or a game — pond, meteor, word blocks, the sewing studio — keeps its own
      fitting, because it measures its canvas itself.) */
#voteSheet,#phoneUI,#cafeShop,#starMap,#petShop,#songMaker,#flowerShop{zoom:var(--ui)}
.vtPanel{width:min(480px,100%)}
.csPanel{width:min(520px,100%);max-height:min(720px,100%)}
/* no empty room inside a box: a card is as tall as what is in it (up to the screen), not always full height */
#flowerShop .fsCard{height:auto;max-height:calc(100% - 4px)}
/* 7. (v99) the ✕ that closes a window: last in its top bar, at the right edge and the top, 44 px everywhere (js/36t-ui.js rule 7, xCheck) */
button.x,button.vtX,button.stX,button.scX,#dcX,[data-winx]{order:99;margin-left:auto;align-self:flex-start;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;display:grid;place-items:center;font-size:18px;line-height:1}
.shHead>button.x,.vtHead>.vtX,.csHead>.vtX,.lgHead>.vtX,.psHead>.vtX,.phHead>.vtX{margin-right:-6px;margin-top:-4px}
/* (v100) at home: the materials under the peanut chip (js/36h-home.js homeMatsSync) */
#nutHud{display:grid;justify-items:start}
#homeMats{display:grid;grid-template-columns:repeat(var(--mc,4),auto);gap:2px 8px;margin-top:6px;padding:5px 9px;border-radius:14px;background:#fff8ec;width:max-content}
#homeMats[hidden]{display:none}
.hmM{display:flex;align-items:center;gap:2px;font:14px var(--disp);color:#7a4a2a;min-width:38px}.hmM .pxe{width:18px;height:18px}
/* 10. (v107) the top-left corner is one column (js/38b-hud-dock.js): no piece in it gets a top of its own here — the column measures
       them. A piece the column folds away to stay within its budget (the materials card first) has .dockFold */
.dockFold{display:none!important}
#bedLeft.atR{left:auto;right:10px;transform:none}
/* (v100) one big button in the corner: the action when there is one, otherwise jump — in the same place */
#acts:not(.noAct) #bJump{display:none}
#acts.noAct #bAct{display:none}
#acts.noAct #bJump{width:88px;height:88px;font-size:16px}
/* (v100) the row of colours under the turn slider (js/36m-phone.js colorRow) */
.colS{display:flex;justify-content:center;gap:4px;margin:2px 0 4px}.colS[hidden]{display:none}
.colS button{position:relative;width:34px;height:34px;min-width:34px;border-radius:50%;border:2px solid var(--cocoa);padding:0;cursor:pointer;touch-action:manipulation}
.colS button::before{content:'';position:absolute;inset:-5px}   /* a fingertip-sized target around each dot */
.colS button.orig{background:conic-gradient(#c98b52 0 25%,#f3e2c4 0 50%,#c98b52 0 75%,#f3e2c4 0)}
.colS button.on{outline:3px solid #fff;box-shadow:0 0 0 5px var(--cocoa)}
/* (v100) the night screen when play time is over (js/36u-bedtime.js) and the grown-up's choices */
#bedLock{position:fixed;inset:0;z-index:55;display:grid;place-items:center;padding:16px;background:radial-gradient(120% 90% at 50% 20%,#3a3f7a 0%,#1f2350 55%,#12142e 100%);touch-action:none}
#bedLock[hidden]{display:none}
#bedLock:not([hidden]){animation:bedIn 1.6s ease-out}@keyframes bedIn{from{opacity:0}to{opacity:1}}   /* v101: falling asleep, not a slammed door */
#bedLeft{position:fixed;left:50%;top:calc(8px + env(safe-area-inset-top,0px));transform:translateX(-50%);z-index:4;pointer-events:none;padding:2px 10px;border-radius:999px;background:rgba(40,26,20,.16);color:#fffaf0;font:13px var(--disp);text-shadow:0 1px 2px rgba(0,0,0,.4);opacity:.6;white-space:nowrap}   /* v101: the minutes left — faint, under everything */
#bedLeft[hidden]{display:none}#bedLeft .pxe{width:14px;height:14px;vertical-align:-2px}body.photo #bedLeft,body.cineAll #bedLeft{display:none}
#bedShield{position:fixed;inset:0;z-index:7;background:transparent;touch-action:none}#bedShield[hidden]{display:none}   /* v101: the walk to bed — taps do nothing (above the side buttons, under notices) */
body.bedWalk #side,body.bedWalk #acts,body.bedWalk #pills,body.bedWalk .prompt,body.bedWalk #nav,body.bedWalk #placeUI,body.bedWalk #busy,body.bedWalk #joy,body.bedWalk #nutHud,body.bedWalk #wallet{opacity:0;pointer-events:none;transition:opacity .4s}
#bedLock .bedSky i{position:absolute;width:4px;height:4px;border-radius:50%;background:#fff6c8;box-shadow:0 0 8px #fff6c8;animation:bedTw 2.4s ease-in-out infinite}
#bedLock .bedSky i:nth-child(1){left:12%;top:14%}#bedLock .bedSky i:nth-child(2){left:78%;top:10%;animation-delay:.6s}#bedLock .bedSky i:nth-child(3){left:30%;top:28%;animation-delay:1.2s}
#bedLock .bedSky i:nth-child(4){left:88%;top:34%;animation-delay:.3s}#bedLock .bedSky i:nth-child(5){left:8%;top:62%;animation-delay:1.6s}#bedLock .bedSky i:nth-child(6){left:66%;top:78%;animation-delay:.9s}#bedLock .bedSky i:nth-child(7){left:44%;top:8%;animation-delay:2s}
@keyframes bedTw{50%{opacity:.25;transform:scale(.6)}}
#bedLock .bedCard{position:relative;width:min(380px,100%);box-sizing:border-box;padding:20px 18px 18px;text-align:center;display:grid;gap:10px;justify-items:center;zoom:var(--ui)}
#bedLock .bedMoon .pxe{width:64px;height:64px}#bedLock h2{margin:0;font:24px var(--disp)}#bedLock .bedTxt{margin:0;font:17px/1.5 var(--disp)}#bedLock .bedTxt .pxe{width:22px;height:22px;vertical-align:-4px}
#bedLock .bedNote{margin:0;font-size:13px;color:var(--soft)}
.bedPick{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}.bedPick .btn{min-width:64px}
#bedHello{margin:10px auto 0;max-width:420px;padding:12px 14px;text-align:left;display:grid;gap:6px;font-size:14px}#bedHello p{margin:0;line-height:1.5}#bedHello .btn{justify-self:end}
