@font-face{font-family:Fredoka;src:url("./fonts/fredoka-latin-400-normal.woff2") format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:Fredoka;src:url("./fonts/fredoka-latin-600-normal.woff2") format("woff2");font-weight:600;font-display:swap}
:root{color-scheme:dark;--night:#09121e;--pine:#005436;--trunk:#613713;--podzol:#423913;--fox:#ba5422;--cream:#f4e6cc}
*{box-sizing:border-box}
body{margin:0;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;min-height:100vh;min-height:100dvh;display:grid;place-items:center;color:var(--cream);font-family:Fredoka,system-ui,sans-serif;background:radial-gradient(ellipse at 50% 42%,#203d35,var(--night) 70%)}
.game{--sky-0:#304c3e;--sky-1:#192e29;--sky-2:#09121e;width:100%;height:100vh;height:100dvh;position:relative;isolation:isolate;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:radial-gradient(ellipse at 50% 47%,var(--sky-0) 0%,var(--sky-1) 45%,var(--sky-2) 83%)}
.shop-header{padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 4px max(12px,env(safe-area-inset-left));z-index:1;background:linear-gradient(180deg,#09121e 0%,#09121e00 100%)}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.place{margin:0 0 6px;color:#bbd5ba;font-size:.79rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
.place span,.preview span{color:#e58b62;padding-inline:.2em}
h1{margin:0;font-size:clamp(1.68rem,6.8vw,2.4rem);font-weight:600;line-height:1.08;text-wrap:balance;text-shadow:0 3px var(--trunk)}
.view{position:relative;min-height:0;display:grid;place-items:center}
canvas{display:block;position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:grab;-webkit-user-select:none;user-select:none}
canvas:active{cursor:grabbing}
canvas:focus-visible{outline:2px solid #e58b62;outline-offset:-4px}
#loading{position:relative;margin:0 20px;text-align:center;pointer-events:none}
.shop-footer{position:relative;z-index:1;text-align:center;padding:12px max(16px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));background:linear-gradient(0deg,#09121e 55%,#09121e00)}
.preview{color:#eed6ac;font-weight:600;margin:0 0 5px}
.mouse{display:none}
.shop-status{display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:40px;max-width:460px;margin:0 auto;padding:6px 12px;border:1px solid #c9935c40;border-radius:12px;background:#09121edc;font-size:.9rem}
#shop-clock{min-width:0;display:grid;line-height:1.15}
#shop-clock b,#shop-clock small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#shop-clock b{font-weight:600}
#shop-clock small{font-size:.78rem;color:#e9d6b6}
.purse{display:flex;gap:10px;align-items:center;flex:none;position:relative}
#hearts{color:#e58b62;letter-spacing:1px;font-size:.85rem}
#diamonds{color:#ffcc92;font-weight:600}
.purse .gain{position:absolute;right:30px;top:100%;white-space:nowrap;font-size:.85rem;color:#ffd9a8;text-shadow:0 1px 2px #000a;pointer-events:none;animation:gain-drift 1.3s ease-out forwards}
@keyframes gain-drift{0%{opacity:0;transform:translateY(-4px)}15%{opacity:1}70%{opacity:1}100%{opacity:0;transform:translateY(14px)}}
@media (prefers-reduced-motion:reduce){.purse .gain{animation:gain-fade 1.3s linear forwards}}
@keyframes gain-fade{0%,70%{opacity:1}100%{opacity:0}}
#settings-open{min-height:32px;min-width:32px;padding:4px;border:0;background:none;color:#e8cfa6;display:grid;place-items:center;margin-right:-6px}
#settings-open svg{width:20px;height:20px}
.settings{display:grid;gap:10px}
.setting{display:grid;grid-template-columns:4.5em 1fr 3em;align-items:center;gap:10px;color:#2d1e14;font-weight:600}
.setting small{text-align:right;color:#634a36;font-weight:500}
.setting input[type=range]{width:100%;min-height:44px;accent-color:#d9773b}
.settings-note{margin-top:14px;font-size:13px}
.settings-head{margin:18px 0 2px;font-size:1rem;color:#2d1e14}
.setting.toggle{grid-template-columns:4.5em auto 1fr}
.setting.toggle input{width:24px;height:24px;min-height:44px;accent-color:#d9773b}
.setting.toggle small{text-align:left}
.about-card{display:flex;gap:12px;align-items:center;margin-bottom:6px;color:#2d1e14}
.about-card img{border-radius:14px;background:#fff0c9}
.about-card b{display:block;font-size:1.1rem}
.about-card small{color:#634a36}
.whats-new{margin:6px 0 14px;padding-left:1.2em;color:#2d1e14;line-height:1.4}
.whats-new li+li{margin-top:4px}
#update-bar{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);z-index:2;display:flex;align-items:center;gap:8px;width:max-content;max-width:94%;padding:6px 6px 6px 14px;border-radius:14px;background:#09121ef0;border:1px solid #c9935c66;color:#f4e6cc;font-size:14px}
#update-bar button{min-height:36px;border-radius:10px;border:0;background:#d9773b;color:#fff;font-weight:600}
#update-bar [data-update=later]{background:none;color:#e8cfa6;min-width:36px}
#sheet-content .wide.secondary+.wide.secondary{margin-top:8px}
.shop-footer{padding-top:6px}
#shop-news.toast{position:absolute;top:8px;left:50%;transform:translate(-50%,-6px);width:max-content;max-width:92%;margin:0;padding:7px 14px;border-radius:12px;background:#09121eed;border:1px solid #c9935c55;color:#f4e6cc;font-size:14px;line-height:1.25;text-align:center;pointer-events:none;opacity:0;transition:opacity .3s,transform .3s;z-index:1}
#shop-news.toast.show{opacity:1;transform:translate(-50%,0)}
@media (prefers-reduced-motion:reduce){#shop-news.toast{transition:none}}
button,select{font:inherit;color:inherit;border:1px solid #bb8d5a75;background:#241e19;border-radius:9px;min-height:44px}
button{padding:6px 10px;cursor:pointer;touch-action:manipulation}
button:disabled{opacity:.54;cursor:default}
/* Panel buttons and menus with no style of their own read cream on brown, never dark on dark. */
:where(#sheet-content) button{background:#75482c;color:#fff5e1}
:where(#sheet-content) select{min-height:40px;padding:0 8px;border-color:#d49e63;background:#fff7dd;color:#2d1e14}
#phase-action.not-ready{opacity:.62}
button:focus-visible,select:focus-visible{outline:2px solid #f3b37e;outline-offset:2px}
.primary{background:#005436;border-color:#609278;color:#fff4dc;font-weight:600;white-space:nowrap}
#shop-tools.dock{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px;margin:0 auto;max-width:460px;padding:4px;border-radius:16px;background:#241e19e6;border:1px solid #bb8d5a55}
#shop-tools.dock button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:56px;padding:4px 2px;border:0;border-radius:12px;background:transparent;color:#f4e6cc;font-size:13px;font-weight:600}
#shop-tools.dock button[hidden]{display:none}
#shop-tools.dock svg{width:24px;height:24px}
#shop-tools.dock button[aria-current]{background:#f1d9ae;color:#2d1e14}
.badge{position:absolute;top:4px;right:calc(50% - 22px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#ba5422;color:#fff4dc;font-size:11px;line-height:18px;font-weight:600}
.badge[hidden]{display:none}
.service-actions{position:absolute;bottom:100%;left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));pointer-events:none}
.service-actions button{pointer-events:auto}
#phase-action{display:block;width:100%;max-width:460px;min-height:52px;margin:0 auto 8px;font-size:1.05rem}
#phase-action[hidden]{display:none}
#floor-done{position:absolute;right:12px;top:12px;min-width:88px;background:#005436;color:#fff4dc;border-color:#609278;font-weight:600;z-index:1}
/* Tabs stay put: they stick to the top while a long page scrolls, and the panel keeps one height from tab to tab. */
.sheet-switch{position:sticky;top:-12px;z-index:3;display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:3px;padding:3px;margin:-4px 0 10px;border-radius:12px;background:#d9b98a;box-shadow:0 -10px 0 #f1d9ae}
.sheet-frame:has(.sheet-switch){height:min(58dvh,560px)}
.sheet-switch button{min-height:40px;border:0;border-radius:9px;background:transparent;color:#2d1e14;font-weight:600}
.sheet-switch button[aria-pressed=true]{background:#fff0c9;box-shadow:0 1px 3px #61371355}
.sheet-switch button.fresh{position:relative}
.sheet-switch button.fresh::after{content:"";position:absolute;top:6px;right:8px;width:8px;height:8px;border-radius:50%;background:#e2672f}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.decorate-actions{margin:0 0 12px}
#shop-sheet{width:min(100% - 16px,460px);max-height:min(58dvh,560px);padding:0;margin:auto auto max(8px,env(safe-area-inset-bottom));border:1px solid #d49e63;border-radius:18px;background:#f1d9ae;color:#2d1e14;box-shadow:0 20px 70px #000a;overflow:hidden}
#shop-sheet::backdrop{background:#09121e55}
.sheet-frame{display:grid;grid-template-rows:auto auto minmax(0,1fr);max-height:min(58dvh,560px)}
.sheet-frame>header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 14px;background:#613713;color:#fff1d7}
.sheet-frame h2{margin:0;font-weight:600;font-size:1.35rem}
#sheet-close{min-width:44px;padding:0;font-size:1.5rem;background:#3b251b}
.sheet-frame h2{flex:1}
#sheet-tip{min-width:36px;min-height:36px;padding:0;border-radius:50%;font-size:1.05rem;font-weight:700;background:#ffffff26;color:#fff1d7}
/* One-time tips from Chestnut: a small card over everything, cleared with Got it. */
#tip-card{width:min(100% - 32px,360px);margin:auto;padding:14px;border:2px solid #d49e63;border-radius:18px;background:#fff8ea;color:#2d1e14;
  box-shadow:0 14px 40px #000a;display:none;grid-template-columns:48px 1fr;gap:10px 12px;animation:tip-in .22s ease-out}
#tip-card[open]{display:grid}
#tip-card::backdrop{background:#09121e66}
.tip-fox{width:48px;height:48px;border-radius:12px;background:#f1d9ae;image-rendering:pixelated}
#tip-card h2{margin:2px 0 4px;font-size:1.15rem;font-weight:600}
#tip-card p{margin:0;font-size:15px;line-height:1.4;color:#4a3526}
.tip-actions{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-end;gap:12px}
#tip-dots{display:flex;gap:5px;margin-right:auto}
#tip-dots i{width:7px;height:7px;border-radius:50%;background:#d9c4a6}
#tip-dots i.on{background:#b8642f}
#tip-ok{min-width:110px}
@keyframes tip-in{from{opacity:0;transform:translateY(10px) scale(.97)}}
@media (prefers-reduced-motion:reduce){#tip-card{animation:none}}
#sheet-content{grid-row:3;overflow:auto;overscroll-behavior:contain;padding:12px 14px 18px;scrollbar-width:thin}
.sheet-help{margin:0 0 12px;color:#543e2b;line-height:1.35}
.goods{padding:0;margin:0;list-style:none;display:grid;gap:5px}
.goods li{display:flex;align-items:center;gap:8px;padding:6px 8px;background:#fff0c9;border-radius:9px}
.goods-info{flex:1}
.goods-info small,.step-row small{display:block;color:#634a36;font-size:13px}
.goods button,.display-card button,.wide:not(.primary){background:#75482c;color:#fff5e1;min-width:44px}
.swatch{width:17px;height:17px;flex:none;background:var(--item);border:2px solid #54382765;border-radius:4px;box-shadow:inset 0 2px #fff4}
.wide{width:100%;margin-top:10px}
.display-card{background:#fff0c9;border:1px solid #b3875999;border-radius:12px;padding:9px 10px;margin-bottom:8px}
.display-card header,.display-card label,.step-row{display:flex;align-items:center;gap:7px;justify-content:space-between}
.display-card label,.step-row{margin-top:6px}
.display-card select{max-width:76%;padding-inline:6px;background:#fff7dd;color:#2d1e14}
.step-row span{flex:1}
.step-row b{min-width:28px;text-align:center}
.step-row button{min-width:44px;padding:0;font-size:1.35rem;font-weight:600;line-height:1}
.tally{margin:0 0 12px;display:grid;grid-template-columns:repeat(2,1fr);gap:6px}
.tally div{padding:7px 8px;background:#fff0c9;border-radius:8px}
.tally dt{font-size:.83rem}
.tally dd{margin:0;font-size:1.12rem;color:#005436;font-weight:600}
.ledger-lines li>div{flex:1;min-width:0}
.ledger-lines li>div small{display:block;color:#634a36}
.ledger-lines b{margin-left:auto;white-space:nowrap;font-size:1.05rem}
.ledger-lines b.gain-line{color:#2f6b2a}
.ledger-lines b.loss{color:#a2402c}
.ledger-lines b.none{color:#9a8470}
@media(max-width:350px){#shop-sheet{width:calc(100% - 8px)}#sheet-content{padding-inline:8px}}
@media (hover:hover) and (pointer:fine){.touch{display:none}.mouse{display:inline}}
@media (min-width:600px),(orientation:landscape){
  .game{width:min(calc(100vw - 24px),calc((100vh - 32px)*9/16));width:min(calc(100vw - 24px),calc((100dvh - 32px)*9/16));height:auto;aspect-ratio:9/16;border-radius:18px;border:1px solid #b090655d;box-shadow:0 22px 80px #0008}
}
@media (orientation:landscape) and (max-height:500px){
  .shop-header{padding-top:4px;padding-bottom:2px}
  .shop-footer{padding:4px}
  #shop-tools.dock button{min-height:46px}
  .preview{display:none}
}

#floor-hint{position:absolute;bottom:4px;left:50%;transform:translateX(-50%);width:max-content;max-width:94%;margin:0;padding:6px 12px;border-radius:10px;background:#09121eed;color:#fff1d8;pointer-events:none;text-align:center;font-size:14px}


.shopper-bubble{position:absolute;display:flex;align-items:center;gap:5px;transform:translate(-50%,-100%);pointer-events:none;background:#fff2d8;color:#423913;border-radius:10px 10px 10px 2px;padding:4px 8px;font-size:14px;line-height:1.2;white-space:nowrap;box-shadow:0 2px 5px #09121e55}

.book-tabs{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:8px}
.book-tabs button{min-height:40px;padding:4px 14px;border-radius:999px;border:1px solid #d49e63;background:#e6c89a;color:#2d1e14;font-weight:600}
.book-tabs button[aria-pressed=true]{background:#005436;border-color:#005436;color:#f4e6cc}



#panel-note{grid-row:2;margin:0;padding:10px 14px 2px;color:#2d1e14;font-weight:600;line-height:1.35}#panel-note:empty{display:none}


#till-action{position:absolute;transform:translate(-50%,-100%);min-height:44px;background:#315941;color:#fff2d8;border:2px solid #e7be82;z-index:1}
#bargain:not([hidden]){display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-bottom:8px}
#bargain button{min-height:44px;padding-inline:14px}
#bargain .wrap-label{flex-basis:100%;text-align:center;font-size:.85rem;color:#f1d9ae}
/* The packing counter: a bottom sheet with the parcel on a wooden counter. */
#pack{width:min(100% - 16px,460px);padding:0;margin:auto auto max(8px,env(safe-area-inset-bottom));border:1px solid #d49e63;border-radius:18px;background:#f1d9ae;color:#2d1e14;box-shadow:0 20px 70px #000a;overflow:hidden}
#pack::backdrop{background:#09121e33}
.pack-frame>header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 14px;background:#613713;color:#fff1d7}
.pack-frame h2{margin:0;font-weight:600;font-size:1.1rem;line-height:1.2}
#pack-close{min-height:40px;padding:0 12px;background:#3b251b;font-size:.9rem;white-space:nowrap}
#pack-body{display:grid;justify-items:center;gap:10px;padding:0 14px 16px}
.counter-top{width:calc(100% + 28px);display:grid;place-items:center;padding:16px 0 0;background:linear-gradient(transparent 0 calc(100% - 26px),#b07a4a calc(100% - 26px) calc(100% - 22px),#9a6a3e calc(100% - 22px))}
.parcel{position:relative;width:180px;height:118px;margin:22px 0 16px;touch-action:none}
.parcel i,.parcel button{position:absolute;display:block;padding:0;min-height:0;border:0}
.box-back{left:6px;right:6px;top:10px;height:24px;background:#8f6038;border-radius:4px 4px 0 0}
.box-inside{position:absolute;left:10px;right:10px;top:0;height:36px;display:flex;justify-content:center;align-items:flex-end;gap:0;z-index:1}
.box-inside .icon,.box-inside .swatch{width:32px;height:32px;margin:0 -3px}
.box-inside .dropped{animation:drop-in .28s ease-out}
@keyframes drop-in{from{transform:translateY(-34px) scale(1.2);opacity:.4}}
.box-front{left:0;right:0;top:28px;bottom:0;z-index:2;border-radius:3px 3px 6px 6px;background:#c99862;box-shadow:inset 0 3px 0 #dcae7a,0 6px 0 #6e4526,0 10px 18px #0004}
.flap{z-index:3;top:-8px;width:90px;height:36px;background:#d4a571!important;border:1px solid #9c6c40!important;border-radius:3px;transition:transform .3s ease;cursor:pointer}
.flap.left{left:0;transform-origin:0 100%;transform:rotate(-24deg)}
.flap.right{right:0;transform-origin:100% 100%;transform:rotate(24deg)}
.shut-0 .flap.left,.shut-1 .flap.right{transform:translateY(29px) scaleY(.2);cursor:default}
.shut .box-back,.shut .box-inside{visibility:hidden}
.ready-flaps .flap:not(:disabled){animation:flap-glow 1.1s ease-in-out infinite}
.ready-flaps .flap.right:not(:disabled){animation-delay:.25s}
@keyframes flap-glow{50%{filter:brightness(1.12);box-shadow:0 0 0 3px #fff6}}
.parcel.over .box-front{box-shadow:inset 0 3px 0 #dcae7a,0 6px 0 #6e4526,0 0 0 4px #ffe6a8,0 10px 18px #0004}
.ribbon-v,.ribbon-h{z-index:4;background:var(--ribbon);box-shadow:inset 0 0 0 1px #0002;transition:transform .45s ease}
.ribbon-v{left:calc(50% - 7px);top:26px;bottom:0;width:14px;transform:scaleY(0);transform-origin:50% 0}
.ribbon-h{top:66px;left:0;right:0;height:14px;transform:scaleX(0);transform-origin:0 50%;transition-delay:.2s}
.ribboned .ribbon-v{transform:none}.ribboned .ribbon-h{transform:none}
.knot{z-index:5;left:calc(50% - 22px);top:51px;width:44px;height:44px;border-radius:50%;background:transparent!important;opacity:0;pointer-events:none}
.ready-knot .knot{opacity:1;pointer-events:auto;cursor:pointer;box-shadow:0 0 0 3px #fff;animation:knot-pulse 1.1s ease-in-out infinite}
@keyframes knot-pulse{50%{box-shadow:0 0 0 7px #fff8}}
.bow{z-index:5;left:calc(50% - 9px);top:64px;width:18px;height:18px;border-radius:5px;background:var(--ribbon);filter:brightness(.9);box-shadow:0 0 0 2px #0002;transform:scale(0);transition:transform .3s cubic-bezier(.3,1.6,.5,1)}
.bow::before,.bow::after{content:'';position:absolute;top:-10px;width:22px;height:16px;border:5px solid var(--ribbon);border-radius:50% 50% 50% 50%/60% 60% 40% 40%;box-shadow:0 0 0 1px #0003,inset 0 0 0 1px #0003}
.bow::before{right:12px;transform:rotate(-20deg)}.bow::after{left:12px;transform:rotate(20deg)}
.tied .bow{transform:none}
.drag-ghost{position:fixed;left:0;top:0;z-index:10;pointer-events:none;filter:drop-shadow(0 6px 6px #0005)}
.drag-ghost .icon,.drag-ghost .swatch{width:52px;height:52px}
.pack-goods button.lifted{opacity:.4}
.pack-alert{display:grid;justify-items:center;gap:6px;padding:10px 12px;background:#fff7dd;border:1px solid #d49e63;border-radius:12px;box-shadow:0 6px 16px #0002;animation:alert-pop .22s ease-out}
.pack-alert small{color:#543e2b}
@keyframes alert-pop{from{transform:scale(.9);opacity:0}}
.pack-controls{display:grid;justify-items:center;align-content:center;width:100%;min-height:124px}
@media (prefers-reduced-motion:reduce){.parcel *,.pack-alert{animation:none!important;transition:none!important}}
.pack-hint{margin:0;font-weight:600;text-align:center;line-height:1.35}
.pack-goods{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;width:100%}
.pack-goods button{touch-action:none;display:grid;justify-items:center;gap:2px;width:78px;min-height:78px;padding:6px 4px;background:#fff0c9;color:#2d1e14;border:1px solid #d49e63;border-radius:10px}
.pack-goods button small{font-size:11px;line-height:1.15;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pack-goods button.in{opacity:.3}
.pack-goods .icon,.pack-goods .swatch{width:36px;height:36px}
.pack-ribbons{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.pack-ribbons button{min-height:44px;padding-inline:14px;background:#75482c;color:#fff5e1;display:inline-flex;align-items:center;gap:6px}
.pack-ribbons button i{width:14px;height:14px;border-radius:50%;background:var(--ribbon);box-shadow:0 0 0 2px #fff6}
.pack-step{min-height:48px;min-width:200px}
#pack-offer #bargain:not([hidden]){margin:0;padding:10px 12px;background:#fff0c9;border-bottom:1px solid #d49e63}
#pack-offer #bargain .wrap-label{color:#2d1e14;font-weight:600}
#pack-offer #bargain button{background:#75482c;color:#fff5e1}
.pack-helper{margin:0;font-size:.85rem;color:#543e2b;text-align:center}



.confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.confirm-actions button{min-height:48px;font-weight:600}
.confirm-actions .secondary,.wide.secondary{background:#fff0c9;color:#2d1e14;border:2px solid #d49e63}
#coach{position:absolute;left:50%;top:14px;transform:translateX(-50%);width:min(92%,340px);z-index:2;padding:12px 14px;border:2px solid #d49e63;border-radius:16px;background:#f1d9ae;color:#2d1e14;box-shadow:0 10px 30px #0008}
#coach h2{margin:0 0 6px;font-size:1.1rem}
#coach ul{margin:0 0 10px;padding-left:1.1em;line-height:1.35;font-size:15px}
#coach button{width:100%}
.shopper-bubble[hidden]{display:none}
.face{display:inline-block;flex:none;width:18px;height:18px;border-radius:50%;background:#ffd08a;box-shadow:inset 0 0 0 1.5px #613713;position:relative}
.face::before{content:'';position:absolute;left:5px;top:6px;width:2.5px;height:2.5px;border-radius:50%;background:#423913;box-shadow:5.5px 0 #423913}
.face::after{content:'';position:absolute;left:4.5px;width:9px;box-sizing:border-box;border:1.5px solid #423913}
.face.bargain::after{top:9px;height:4.5px;border-top:0;border-radius:0 0 6px 6px}
.face.fair::after{top:11px;height:0;border-width:1.5px 0 0}
.face.pricey::after{top:10.5px;height:4px;border-bottom:0;border-radius:6px 6px 0 0}
.empty-badge{position:absolute;transform:translate(-50%,-100%);pointer-events:none;width:18px;height:18px;border-radius:50%;background:#ba5422;box-shadow:0 1px 3px #09121e44,inset 0 0 0 1.5px #fff8ec88}
.empty-badge::before,.empty-badge::after{content:'';position:absolute;left:4px;right:4px;height:2px;border-radius:1px;background:#fff8ec}
.empty-badge::before{top:6px}.empty-badge::after{top:10.5px;opacity:.6}
.empty-badge[hidden]{display:none}
.patience{display:inline-block;width:14px;height:14px;flex:none;border-radius:50%;background:conic-gradient(#3f8a5b calc(var(--p,1)*360deg),#e3cfa8 0)}
.patience.low{background:conic-gradient(#c4532d calc(var(--p,1)*360deg),#e3cfa8 0)}
#till-action{box-shadow:0 0 0 3px #f1d9ae,0 0 0 6px color-mix(in srgb,#3f8a5b calc(var(--p,1)*100%),#c4532d)}
#till-action.low{animation:nudge 1s ease-in-out infinite}
@keyframes nudge{50%{transform:translate(-50%,-100%) scale(1.06)}}
@media (prefers-reduced-motion:reduce){#till-action.low{animation:none}}
.outlet-card{display:flex;align-items:center;gap:8px;padding:6px}
.outlet-open{flex:1;display:grid;justify-items:start;gap:2px;text-align:left;background:transparent!important;color:#2d1e14!important;border:0;padding:4px 6px}
.outlet-open small{color:#634a36;font-size:13px}
.slot-strip{display:flex;gap:4px;margin-top:3px}
.slot-strip i{display:grid;place-items:center;width:24px;height:24px;border-radius:6px;background:var(--item);color:#fff8e6;font-style:normal;font-size:12px;font-weight:600;text-shadow:0 1px 1px #0007;box-shadow:inset 0 2px #fff4}
.slot-strip i img{width:20px;height:20px;grid-area:1/1}
.slot-strip i:has(img){background:#fff4dc;border:2px solid var(--item);color:#54382c;text-shadow:none}
.slot-strip i:has(img) b{grid-area:1/1;align-self:end;justify-self:end;font-size:10px;line-height:1;background:#fff8ec;border-radius:4px;padding:0 2px;margin:-3px -4px}
.slot-strip i.empty{background:#e3cfa8;border:1px dashed #b3875999;box-shadow:none}
.slot-row{display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));gap:6px;margin-bottom:10px}
.slot{position:relative;display:grid;justify-items:center;align-content:center;gap:2px;min-height:86px;padding:6px 3px 4px;border:2px solid #b3875999;border-radius:12px;background:#fff0c9;color:#2d1e14}
.slot.empty{border-style:dashed;background:#f6e3bd}
.slot.ready{border-color:#609278}
.slot.over,.slot.chosen{border-color:#005436;box-shadow:0 0 0 3px #00543633}
.slot.over{background:#e2f0de}
.slot .plus{font-size:1.6rem;color:#a07752}
/* Full names, up to two lines, so no good is ever cut to "Swee…" or shown as a bare "jam". */
.slot-name,.good-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;max-width:100%;overflow:hidden;text-align:center;line-height:1.15;font-size:13px;overflow-wrap:break-word}
.good-name{font-size:12px;-webkit-line-clamp:3;line-clamp:3}
.count{font-size:12px;line-height:1;padding:2px 5px;border-radius:8px;background:#2d1e14;color:#fff4dc}
.slot .tag{font-size:12px;font-weight:600;color:#423913;background:#f4e6cc;border-radius:999px;padding:1px 6px}
.slot .tag.bargain{background:#d9ecd2;color:#005436}
.slot .tag.premium{background:#f6dc9a;color:#613713}
.presets{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:6px 0}
.presets button{display:grid;gap:1px;padding:6px 4px;border-radius:12px;border:1px solid #d49e63;background:#f1d9ae;color:#2d1e14;font:inherit;line-height:1.1}
.presets button b{font-size:14px}
.presets button small{font-size:13px;opacity:.8}
.presets button[aria-pressed="true"]{background:#005436;border-color:#005436;color:#f4e6cc}
.good .season{position:absolute;top:4px;left:6px;font-style:normal;font-size:13px;color:#ba5422;line-height:1}
.swatch.big{width:28px;height:28px;border-radius:7px}
img.icon{width:28px;height:28px;flex:none;object-fit:contain;filter:drop-shadow(0 1px 1px #54382755);pointer-events:none;user-select:none}
img.icon.big{width:40px;height:40px}
.shopper-bubble img.icon{width:22px;height:22px;margin:-3px 0}
.slot.landed{animation:land .32s ease-out}
@keyframes land{0%{transform:scale(.9)}60%{transform:scale(1.07)}100%{transform:scale(1)}}
.slot-tools{padding:4px 8px 8px;margin-bottom:10px;border-radius:12px;background:#fff0c9}
.grid-title{display:flex;justify-content:space-between;align-items:baseline;margin:6px 0 8px;font-size:1rem}
.grid-title small{font-weight:400;color:#634a36;font-size:13px}
.goods-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-bottom:6px}
.good{position:relative;display:grid;justify-items:center;gap:2px;min-height:64px;padding:6px 2px 4px;border:1px solid #b3875999;border-radius:10px;background:#fff7dd;color:#2d1e14;touch-action:none;-webkit-user-select:none;user-select:none}
.good .count{position:absolute;top:3px;right:3px}
.good.out{opacity:.45}
.good.armed{border:2px solid #005436;background:#e2f0de}
.good.lifted{opacity:.35}
.drag-ghost{position:fixed;z-index:10;margin:0;pointer-events:none;transform:scale(1.1);box-shadow:0 10px 22px #2d1e1466;opacity:.95}
.drag-ghost.returning{transition:left .2s ease-in,top .2s ease-in,transform .2s;transform:scale(1)}
@media (max-width:330px){.goods-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (prefers-reduced-motion:reduce){.slot.landed{animation:none}.drag-ghost.returning{transition:none}}
/* Decorate: cozy meter and decor tray */
.cozy-card{background:#fff0c9;border:1px solid #e3be86;border-radius:12px;padding:10px 12px;margin-bottom:10px}
.cozy-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.cozy-head small{color:#634a36;font-size:13px}
.cozy-bar{height:10px;border-radius:999px;background:#e6c89a;margin:8px 0;overflow:hidden}
.cozy-bar i{display:block;height:100%;width:calc(var(--p) * 100%);background:#d9773b;border-radius:inherit}
.set-chips{display:flex;flex-wrap:wrap;gap:5px}
.set-chip{font-size:13px;padding:3px 9px;border-radius:999px;background:#e6c89a;color:#2d1e14}
.set-chip.done{background:#005436;color:#f4e6cc}
.decor-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.decor-card{display:flex;flex-direction:column;gap:3px;padding:8px;background:#fff0c9;border-radius:10px;border:2px solid transparent}
.decor-card.placed{border-color:#005436}
.decor-card.locked{opacity:.6}
.decor-card small{color:#634a36;font-size:12px}
.decor-card button{margin-top:auto;min-height:40px;background:#75482c;color:#fff5e1}
.decor-card button.primary{background:#005436}
.decor-swatch{height:34px;border-radius:7px;background:linear-gradient(135deg,var(--color) 60%,var(--accent) 60%)}
/* Market corkboard */
.corkboard{display:flex;flex-direction:column;gap:10px;padding:12px 10px 14px;border-radius:12px;border:6px solid #8a5a34;
  background:#c79a62 radial-gradient(circle at 20% 30%,#b5864f 1.5px,transparent 2px) 0 0/14px 14px,#c79a62;box-shadow:inset 0 2px 6px #0003}
/* Each row is a strict two-column grid; notes tilt a degree at most and never overlap. */
.board-band{align-self:flex-start;margin:2px 0 -2px;padding:3px 9px;border-radius:999px;background:#6b4220;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#fff3df}
.board-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 10px;align-items:start}
.note{position:relative;min-width:0;padding:14px 10px 10px;background:#fff8ec;border-radius:3px;box-shadow:0 3px 6px #3b2a1e40;display:flex;flex-direction:column;gap:5px;transform:rotate(-1deg)}
.board-row .note:nth-child(even){transform:rotate(1deg)}
.note.span2,.board-row .note.span2{grid-column:1/-1;transform:rotate(-.5deg)}
.board-row .note.span2:nth-child(even){transform:rotate(.5deg)}
.note.act{box-shadow:0 0 0 3px #e0a53a,0 3px 6px #3b2a1e40}
.board-done{display:flex;flex-wrap:wrap;gap:8px 10px;justify-content:center;padding-top:2px}
.board-done .stamp{margin:0;font-size:12px;padding:3px 8px;border-width:2px;background:#fff8ecd9;transform:rotate(-3deg)}
.board-done .stamp:nth-child(even){transform:rotate(2deg)}
.note p{margin:0;font-size:14px;line-height:1.3}
.note small{color:#634a36;font-size:12px;display:block}
.note button{min-height:40px;background:#75482c;color:#fff5e1;margin-top:auto}
.note button.primary{background:#005436}
.note .pin{position:absolute;top:-5px;left:50%;width:12px;height:12px;margin-left:-6px;border-radius:50%;background:#c64f3a;box-shadow:0 2px 2px #0004,inset -2px -2px 0 #0002}
.note.request{background:#fff0c9}
.note.harvest{background:#f3ead2}
.note.picnic{background:#eef4e2}
.note.around{background:#fbe3b8;border:2px dashed #d9773b;padding-top:16px}
.note.around .fest{font-size:20px;font-family:Georgia,serif;line-height:1.1}
.note.around .tomorrow{font-size:13px;color:#4a3526}
.note.around h4{margin:6px 0 0;font-size:14px}
.note.stall-parcel .crate{min-height:36px}
.note.stall-parcel .crate img.icon,.note.stall-parcel .crate i{width:24px;height:24px}
.note.harvest:not(.span2) .harvest-row{font-size:13px;flex-wrap:wrap}
.note.season-summer{background:#fff1b8}.note.season-autumn{background:#f6d2b4}.note.season-winter{background:#e4ecf2}
.note.request.ready{outline:2px dashed #609278;outline-offset:3px}
.note.request.over{background:#e2f0de}
.note-head{display:flex;align-items:center;gap:8px}
.face-portrait{width:48px;height:48px;flex:none;border-radius:6px;image-rendering:pixelated;background-image:var(--skin),var(--skin);
  background-size:384px 384px;background-position:-240px -48px,-48px -48px;box-shadow:0 0 0 2px #75482c}
.face-portrait.blank{display:grid;place-items:center;background:#e6c89a;color:#75482c;font-weight:700}
.wanted,.carry-row{display:flex;align-items:center;gap:8px}
.wanted span{flex:1}
.carry{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:999px;background:#e6c89a;touch-action:none;cursor:grab}
.carry-row button{margin-top:0;flex:1}
.crate{display:flex;flex-wrap:wrap;justify-content:center;gap:2px;padding:6px 4px 10px;min-height:44px;border-radius:3px;
  background:repeating-linear-gradient(0deg,#b07a46 0 9px,#8a5a34 9px 11px)}
.crate img.icon,.crate i{width:28px;height:28px}
.stamp{align-self:center;margin-top:auto;padding:3px 10px;border:3px solid #b5452f;border-radius:6px;color:#b5452f;font-weight:800;letter-spacing:.06em;
  text-transform:uppercase;transform:rotate(-8deg);opacity:.85}
.note .rebuild{list-style:none;margin:0;padding:0;display:grid;gap:5px}
.note .rebuild li{display:grid;grid-template-columns:1fr 1fr auto;align-items:center;gap:6px;font-size:13px}
.note .rebuild .cozy-bar{margin:0;height:8px}
.score-parts{list-style:none;margin:8px 0 4px;padding:0;display:grid;gap:5px}
.score-parts li{display:grid;grid-template-columns:7.5em 1fr 3.4em;align-items:center;gap:8px;font-size:13px}
.score-parts small{text-align:right;color:#634a36}
.score-parts .cozy-bar{margin:0;height:8px}
.score-card.perfect{background:#fdf3b8;border-color:#d8a93a;box-shadow:0 0 0 2px #f1d36f inset}
@media (prefers-reduced-motion:reduce){.note,.board-row .note:nth-child(even),.board-row .note.span2,.board-done .stamp{transform:none}}

/* Placing furniture: one bar of big buttons at the bottom, the hint above it */
#place-bar{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);display:flex;gap:8px;padding:6px;border-radius:14px;background:#fff4dcee;box-shadow:0 3px 10px #3b2a1e44;z-index:1}
#place-bar[hidden]{display:none}
#place-bar:not([hidden])~#floor-hint{bottom:84px}
#place-bar button{min-height:48px;min-width:76px;border-radius:10px;font-weight:700;background:#613713;color:#fff2de}
#place-bar #pack-selected{background:#e6c89a;color:#2d1e14}
#place-bar #place-selected{background:#005436;color:#fff4dc;min-width:96px}
#place-bar #place-selected:disabled{background:#9fb5a8;color:#f2efe6}

/* Walls tab: a little two-tone chip for each floor or wall finish */
.finish-swatch{width:34px;height:34px;flex:none;border-radius:8px;border:2px solid #54382765;background:linear-gradient(180deg,var(--a) 55%,var(--b) 55%)}
.goods li.in-use{outline:2px solid #005436;outline-offset:-2px}
.goods.expand small{white-space:normal}
.friends .friend{align-items:flex-start}
.friend-face{flex:none;width:34px;height:34px;border-radius:10px;background:linear-gradient(180deg,var(--fur) 0 58%,var(--belly) 58%);box-shadow:inset 0 -3px 0 var(--tip)}
.friend-hearts{color:#d0574f;letter-spacing:1px}
.friend-letter{margin:.3em 0 0;font-style:italic;font-size:.9em}
.friend-gift{color:#7a5a2a}
.friend.unread strong::after{content:' · new note';font-weight:400;font-size:.8em;color:#d0574f}
.journal-goals .goal{align-items:center}
.journal-goals .goal>div{flex:1;min-width:0}
.journal-goals .goal .cozy-bar{display:block;margin:4px 0 2px;height:7px}
.journal-goals .goal.done{background:#e3efd6}
.journal-goals .goal b{white-space:nowrap}
.journal-head{font-size:15px;margin:14px 0 6px}
.journal-goals .goal.ready{background:#fff1c9;box-shadow:inset 0 0 0 2px #e0a53a}
.journal-goals .claim{flex:none;min-height:44px;padding:0 14px;border-radius:12px;background:#0f5c3a;color:#fff5e1;font-weight:700;animation:claim-glow 1.6s ease-in-out infinite}
.journal-goals .bonus small{display:block}
.claim-all{width:100%;min-height:44px;margin:0 0 8px;border-radius:12px;background:#0f5c3a;color:#fff5e1;font-weight:700}
.journal-goals .claimed{color:#4d7a3a;font-size:.9rem}
@keyframes claim-glow{50%{box-shadow:0 0 0 4px #e0a53a66}}
@media (prefers-reduced-motion:reduce){.journal-goals .claim{animation:none}}
.collection{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:6px}
.collection li{display:grid;justify-items:center;gap:2px;padding:6px 4px;background:#fff0c9;border-radius:9px;font-size:13px}
.collection li.unsold{opacity:.45;filter:grayscale(1)}
.recipes .recipe{align-items:center}
.recipes .recipe>div{flex:1;min-width:0}
.recipes .recipe strong{display:block}
.needs{display:flex;flex-wrap:wrap;gap:4px 10px;margin-top:4px;font-size:13px}
.need{display:inline-flex;align-items:center;gap:3px}
.need .icon,.need .swatch{width:18px;height:18px}
.need i{font-style:normal;opacity:.7}
.need.short{color:#a3402f}
.recipes .recipe button{white-space:nowrap}

/* Sales float up and fade; a passing remark fades in place; extra askers shrink to their good. */
.shopper-bubble.pop{background:#3f8a5b;color:#fff8ec;font-weight:700;font-size:13px;padding:2px 7px;border-radius:999px;gap:4px;animation:pop-rise 1.8s ease-out forwards}
.shopper-bubble.pop .face{width:15px;height:15px;transform:scale(.85)}
.shopper-bubble.note{font-size:12px;padding:2px 7px;opacity:.92;animation:pop-fade 1.8s ease-in forwards}
.shopper-bubble.compact{font-size:0;gap:3px;padding:3px 5px}
@keyframes pop-rise{0%{opacity:0;transform:translate(-50%,-100%)}12%{opacity:1}70%{opacity:1}100%{opacity:0;transform:translate(-50%,-100%) translateY(-22px)}}
@keyframes pop-fade{0%,70%{opacity:.92}100%{opacity:0}}
@media (prefers-reduced-motion:reduce){.shopper-bubble.pop{animation:pop-fade 1.8s ease-in forwards}}
.morning{margin:0 0 12px;padding-left:18px;line-height:1.4}
.morning li{margin:3px 0}
.note.town .cozy-bar{margin:6px 0 2px;height:8px}
.town-gifts{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.town-gifts button{flex:1 1 auto;min-height:40px}

/* Harvest board: the season's weather as a row of little days, then what's plentiful and scarce. */
.wx-row{display:flex;gap:4px;margin:6px 0}
.wx{width:18px;height:18px;border-radius:5px;background:#e8d9b5;position:relative}
.wx.today{box-shadow:0 0 0 2px #7a4b2a}
.wx.sun::after{content:'';position:absolute;inset:4px;border-radius:50%;background:#e6a93a}
.wx.rain::after{content:'';position:absolute;left:4px;right:4px;top:3px;height:7px;border-radius:5px;background:#8ea4b5;box-shadow:-2px 8px 0 -2px #5f86a6,3px 8px 0 -2px #5f86a6}
.wx.wind::after{content:'';position:absolute;left:3px;right:3px;top:6px;height:2px;background:#8a9a8a;box-shadow:2px 4px 0 #8a9a8a}
.wx.snow::after{content:'';position:absolute;inset:5px;border-radius:50%;background:#fff;box-shadow:0 0 0 2px #b9cde0}
.harvest-row{display:flex;align-items:center;gap:4px;margin-top:4px;font-size:.85rem}
.harvest-row .icon{width:22px;height:22px}
.harvest-row span{margin-left:4px}
b.plenty{color:#3f7a3f;font-weight:600}
b.scarce{color:#a0522d;font-weight:600}

/* The dawn cart's note from Pip. */
.cart-note{margin:4px 0 10px;padding:8px 12px;background:#fff6e4;border-left:3px solid #c9773c;border-radius:4px;font-style:italic;color:#4a3526}
.cart-note small{display:block;font-style:normal;color:#7a5a40;margin-top:2px}
.set-chip.mess { background: #f3dfc4; color: #6b4426; }
.goods.locked li{opacity:.55}
.note.makers-met ul{list-style:none;margin:6px 0 0;padding:0;display:grid;gap:6px}
.note.makers-met li{display:flex;align-items:center;gap:8px}
.note.makers-met li span{display:flex;flex-direction:column}
.note.maker .note-head .icon{width:44px;height:44px}
.picnic-slots{list-style:none;margin:6px 0;padding:0;display:grid;gap:6px}
.picnic-slots li{display:grid;gap:4px}
.picnic-label{font-size:13px;font-weight:600}
.picnic-goods{display:flex;flex-wrap:wrap;gap:5px}
.picnic-goods button{position:relative;padding:3px;border-radius:10px;background:#fffaf0;border:2px solid transparent;min-width:44px;min-height:44px}
.picnic-goods button[aria-pressed="true"]{border-color:#005436;background:#e2f0de}
.picnic-goods button .icon{width:34px;height:34px}
.picnic-goods button b{position:absolute;right:2px;bottom:0;font-size:11px}
#title{position:fixed;inset:0;z-index:5;display:grid;place-items:center;padding:max(20px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));background:radial-gradient(ellipse at 50% 30%,#2c5143 0%,#14281f 48%,#09121e 100%);overflow:auto}
#title[hidden]{display:none}
#title{transition:opacity .25s ease}
#title.leaving{opacity:0;pointer-events:none}
@media (prefers-reduced-motion:reduce){#title{transition:none}}
.title-card{width:min(100%,380px);text-align:center}
.title-fox{display:block;margin:0 auto 6px;width:96px;height:96px;border-radius:28px;background:#f1d9ae;box-shadow:0 6px 0 #613713,0 10px 24px #0008}
.title-kicker{margin:14px 0 2px;color:#bbd5ba;font-size:.78rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase}
#title-name{margin:0;font-size:clamp(2rem,9vw,2.6rem);font-weight:600;line-height:1.05;text-shadow:0 3px var(--trunk)}
.title-line{margin:6px 0 18px;color:#eed6ac}
#title-slots{display:grid;gap:10px;text-align:left}
.shop-slot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 12px 12px 14px;border-radius:16px;background:#f1d9ae;color:#2d1e14;border:2px solid #d49e63}
.shop-slot.last{border-color:#d9773b;box-shadow:0 0 0 3px #d9773b44}
.shop-slot.empty{background:#f1d9aecc;border-style:dashed}
.shop-slot b{display:block;font-size:1.05rem}
.shop-slot small{display:block;color:#634a36;font-size:.85rem}
.shop-slot small.when{color:#8a6c52;font-size:.78rem}
.shop-slot.confirming{display:grid;gap:8px}
.shop-slot.confirming p{margin:0}
.shop-slot-actions{display:flex;gap:6px;flex:none}
.shop-slot-actions button{min-height:44px;min-width:44px;padding:6px 14px;border-radius:12px;border:2px solid #d49e63;background:#fff0c9;color:#2d1e14;font:inherit;font-weight:600}
.shop-slot-actions button.primary{background:#d9773b;border-color:#b85c26;color:#fff}
.shop-slot-actions button.quiet{border-color:transparent;background:none;color:#8a5a3a;font-weight:500;padding:6px 8px}
.shop-slot-actions button.danger{background:#b5492f;border-color:#8e3420;color:#fff}
.shop-slot.confirming .shop-slot-actions{justify-content:flex-end}
.title-foot{margin:18px 0 0;color:#8fa896;font-size:.8rem}

/* Crates at the door: a chip over the shop, a row in the panels that bring goods, and the card you pry open. */
.crate-mini{display:inline-block;flex:none;width:26px;height:20px;border-radius:3px;border:2px solid #8a5a34;
  background:repeating-linear-gradient(0deg,#c99a5e 0 6px,#a8763f 6px 8px)}
#crate-chip{position:absolute;left:max(12px,env(safe-area-inset-left));top:58px;z-index:1;display:flex;align-items:center;gap:8px;min-height:44px;padding:6px 12px 6px 8px;
  border:2px solid #e7be82;border-radius:14px;background:#fff4dcf2;color:#2d1e14;font-weight:600;box-shadow:0 4px 12px #0006}
#crate-chip[hidden]{display:none}
#crate-chip.arrive{animation:crate-drop .5s cubic-bezier(.3,1.6,.5,1)}
@keyframes crate-drop{from{transform:translateY(-40px);opacity:0}}
.crate-row{display:flex;align-items:center;gap:10px;width:100%;margin:0 0 12px;padding:8px 12px;border:2px dashed #a8763f;border-radius:12px;background:#fff0c9;color:#2d1e14;text-align:left}
.crate-row span{display:flex;flex-direction:column}
.crate-row small{color:#634a36;font-weight:400}
#crate-card{width:min(100% - 32px,360px);margin:auto;padding:16px;border:2px solid #d49e63;border-radius:18px;background:#fff8ea;color:#2d1e14;box-shadow:0 14px 40px #000a;text-align:center}
#crate-card::backdrop{background:#09121e77}
#crate-card h2{margin:0 0 8px;font-size:1.2rem;font-weight:600}
#crate-box{position:relative;display:block;width:170px;height:130px;margin:28px auto 6px;padding:0;border:0;background:none;min-height:0;cursor:pointer}
#crate-box .crate-body{position:absolute;left:10px;right:10px;bottom:0;height:86px;border:3px solid #7a4e2a;border-radius:6px;
  background:repeating-linear-gradient(0deg,#c99a5e 0 18px,#a8763f 18px 22px);box-shadow:inset 0 -6px 0 #0002,0 6px 10px #0003}
#crate-box .crate-body::after{content:"";position:absolute;inset:8px 18px;border:3px solid #8a5a3466;border-radius:3px;background:linear-gradient(45deg,transparent 47%,#8a5a3466 47% 53%,transparent 53%)}
#crate-box .crate-lid{position:absolute;left:4px;right:4px;bottom:84px;height:20px;z-index:2;border:3px solid #7a4e2a;border-radius:5px;background:#d4a768;transform-origin:10% 100%;transition:transform .45s cubic-bezier(.3,1.4,.5,1),opacity .45s}
#crate-box.wobble .crate-lid{animation:lid-wobble .26s ease-in-out}
#crate-box.open .crate-lid{transform:translate(-64px,18px) rotate(-28deg);opacity:0}
#crate-box:not(.open)::after{content:"";position:absolute;left:50%;top:-6px;width:12px;height:12px;margin-left:-6px;border-radius:50%;background:#e0a53a;animation:crate-hint 1.4s ease-in-out infinite}
@keyframes lid-wobble{25%{transform:rotate(-4deg)}75%{transform:rotate(3deg)}}
@keyframes crate-hint{50%{transform:translateY(-6px);opacity:.5}}
#crate-pop{position:absolute;left:50%;bottom:70px;width:0;height:0;z-index:1}
.crate-good{position:absolute;left:-16px;bottom:0;width:32px;height:32px;animation:crate-good .7s cubic-bezier(.2,.9,.4,1) forwards}
.crate-good img.icon,.crate-good .swatch{width:32px;height:32px}
@keyframes crate-good{0%{transform:translate(0,30px) scale(.4);opacity:0}40%{opacity:1}100%{transform:translate(var(--x),-58px) scale(1)}}
#crate-hint{margin:6px 0;min-height:1.3em;color:#543e2b}
#crate-goods{list-style:none;margin:6px 0 10px;padding:0;display:grid;gap:5px;text-align:left}
#crate-goods li{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:9px;background:#fff0c9}
#crate-goods li span{flex:1}
#crate-goods li .icon{width:28px;height:28px}
#crate-goods li b{min-width:2ch;text-align:right;font-variant-numeric:tabular-nums}
#crate-goods li.tick b{animation:count-tick .18s ease-out}
@keyframes count-tick{50%{transform:scale(1.35);color:#0f5c3a}}
.crate-actions{display:flex;gap:8px;justify-content:flex-end}
.crate-actions button{min-width:110px}
#crate-all,#carry-details{background:#fff0c9;color:#2d1e14;border:2px solid #d49e63}
@media (prefers-reduced-motion:reduce){#crate-chip.arrive,#crate-box *,#crate-box::after,.crate-good,#crate-goods li.tick b{animation:none!important;transition:none!important}.crate-good{transform:translate(var(--x),-58px)}}

/* Carrying a crate: a tray along the bottom of the shop view while Chestnut stocks a display. */
#carry-tray{position:absolute;left:8px;right:8px;bottom:8px;z-index:6;max-width:460px;margin:0 auto;padding:10px 10px 12px;border:2px solid #d49e63;border-radius:16px;background:#fff8ea;color:#2d1e14;box-shadow:0 10px 28px #0008;animation:carry-up .28s cubic-bezier(.3,1.3,.5,1)}
#carry-tray[hidden]{display:none}
#carry-tray header{display:flex;align-items:center;gap:8px;margin-bottom:8px}
#carry-tray h2{flex:1;min-width:0;margin:0;font-size:1.02rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#carry-tray header button{min-height:38px;padding:0 12px}
#carry-slots{display:grid;grid-template-columns:repeat(var(--cols,3),minmax(0,1fr));gap:6px;padding:6px;border-radius:10px;background:#c9955c;box-shadow:inset 0 -4px 0 #8a5a34}
.carry-slot{position:relative;display:grid;place-items:center;min-height:56px;padding:4px;border:2px solid #f2dcb4;border-radius:8px;background:#fff1d8;color:#5a3a20;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.carry-slot.empty{border-style:dashed;background:#f6e3c2;font-size:1.3rem;color:#a77b4e}
.carry-slot.full{border-color:#e0a53a;box-shadow:0 0 0 2px #e0a53a55}
.carry-slot .icon,.carry-slot .swatch{width:30px;height:30px}
.carry-slot b{font-size:.78rem;font-variant-numeric:tabular-nums}
.carry-slot.landed .icon,.carry-slot.landed .swatch{animation:carry-land .3s cubic-bezier(.3,1.6,.5,1)}
.carry-slot:active{transform:scale(.96)}
#carry-hint{min-height:1.1em;margin:6px 2px;font-size:.84rem;color:#6b4a2e}
#carry-goods{display:flex;gap:6px;overflow-x:auto;padding:2px 2px 4px;scroll-snap-type:x proximity}
#carry-goods button{flex:none;display:grid;justify-items:center;gap:2px;min-width:56px;min-height:56px;padding:5px 6px;border:2px solid #e8cfa6;border-radius:10px;background:#fffaf0;color:#3a2716;scroll-snap-align:start}
#carry-goods button[aria-pressed="true"]{border-color:#2f6f4f;background:#e6f2e9;box-shadow:0 0 0 2px #2f6f4f44}
#carry-goods .icon,#carry-goods .swatch{width:28px;height:28px}
#carry-goods b{font-size:.78rem;font-variant-numeric:tabular-nums}
.carry-empty{margin:4px 2px;font-size:.88rem;color:#6b4a2e}
@keyframes carry-up{from{transform:translateY(24px);opacity:0}}
@keyframes carry-land{0%{transform:translateY(-14px) scale(.6);opacity:.3}100%{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){#carry-tray,.carry-slot.landed .icon,.carry-slot.landed .swatch{animation:none}}
/* A shopper noticing goods Chestnut just set out. */
.shopper-bubble.cheer{font-size:13px;padding:3px 8px;background:#fff8ea;border:2px solid #e0a53a;animation:cheer-in .3s cubic-bezier(.3,1.6,.5,1)}
.shopper-bubble.cheer .icon{width:18px;height:18px}
@keyframes cheer-in{from{transform:translate(-50%,-80%) scale(.7);opacity:0}}
@media (prefers-reduced-motion:reduce){.shopper-bubble.cheer{animation:none}}

/* The new shop view (preview): the shop fills the whole window, with the bars laid over it. */
body.walk{display:block}
body.walk .game{width:100%;height:100vh;height:100dvh;aspect-ratio:auto;border-radius:0;border:0;box-shadow:none;grid-template-columns:minmax(0,1fr)}
body.walk .view{grid-row:1/4;grid-column:1}
body.walk .shop-header{grid-row:1;grid-column:1;align-self:start;background:none}
body.walk .shop-footer{grid-row:3;grid-column:1;align-self:end;background:linear-gradient(0deg,#09121eb0,#09121e00)}
body.walk canvas{cursor:crosshair}
body.walk #coach{display:none}
body.walk #floor-hint{bottom:auto;top:72%}
@media (min-width:900px){
  body.walk #shop-sheet{margin:auto max(16px,env(safe-area-inset-right)) auto auto;max-height:min(calc(100dvh - 32px),760px)}
}
#walk-prompt{position:absolute;left:50%;top:64%;transform:translateX(-50%);z-index:2;margin:0;padding:8px 16px 8px 10px;display:flex;align-items:center;gap:10px;border-radius:999px;background:#09121ee6;border:1px solid #e8be7666;color:#fff1d8;font-weight:600;pointer-events:none;white-space:nowrap}
#walk-prompt[hidden]{display:none}
#walk-prompt kbd,#walk-help kbd{display:inline-grid;place-items:center;min-width:1.7em;height:1.7em;padding:0 .35em;border-radius:6px;background:#f1d9ae;color:#2d1e14;font:600 .85rem Fredoka,system-ui,sans-serif;box-shadow:0 2px #9c7250}
#walk-help{position:absolute;left:max(16px,env(safe-area-inset-left));top:76px;z-index:2;margin:0;max-width:380px;padding:10px 12px;border-radius:12px;background:#09121ed0;color:#f4e6cc;font-size:.85rem;line-height:1.9;pointer-events:none;transition:opacity .8s}
#walk-help.faded{opacity:0}
@media (max-width:899px){#walk-help{display:none}}
/* Touch controls for the new shop view: a floating thumb stick, a Use button and a view switch. */
#walk-touch{display:none}
body.walk-touch #walk-touch{display:block}
#walk-touch .stick{position:absolute;z-index:2;width:120px;height:120px;margin:-60px 0 0 -60px;border-radius:50%;background:#09121e55;border:2px solid #f1d9ae88;pointer-events:none}
#walk-touch .stick[hidden]{display:none}
#walk-touch .stick i{position:absolute;left:50%;top:50%;width:52px;height:52px;margin:-26px 0 0 -26px;border-radius:50%;background:#f1d9ae;box-shadow:0 3px #9c7250}
#walk-touch .use{position:absolute;z-index:3;right:max(18px,env(safe-area-inset-right));bottom:calc(150px + env(safe-area-inset-bottom));min-width:96px;min-height:96px;max-width:180px;padding:10px 14px;border-radius:48px;border:2px solid #e8be76;background:#09121ee6;color:#fff1d8;font:600 1rem/1.2 Fredoka,system-ui,sans-serif;box-shadow:0 4px 14px #0006}
#walk-touch .use[hidden]{display:none}
#walk-touch .use::before{content:'Use';display:block;font-size:.75rem;letter-spacing:.06em;text-transform:uppercase;color:#e8be76;margin-bottom:2px}
#walk-touch .eye{position:absolute;z-index:3;right:max(18px,env(safe-area-inset-right));top:calc(72px + env(safe-area-inset-top));width:48px;height:48px;padding:0;display:grid;place-items:center;border-radius:50%;border:1px solid #e8be7666;background:#09121ed0;color:#f1d9ae}
#walk-touch .eye svg{width:26px;height:26px}
@media (max-height:500px){#walk-touch .use{bottom:calc(112px + env(safe-area-inset-bottom));min-width:84px;min-height:84px}#walk-touch .eye{top:calc(56px + env(safe-area-inset-top))}}
/* On a phone held sideways, the shop button and the dock share one row so the shop stays in view. */
@media (max-height:500px){
  body.walk .shop-footer{display:flex;justify-content:center;align-items:flex-end;gap:10px;padding-top:4px}
  body.walk .service-actions{position:static;flex:0 1 260px;width:260px;max-width:40vw;min-width:0}
  body.walk #phase-action{margin:0;min-height:44px}
  body.walk #shop-tools{flex:0 1 auto;margin:0}
  body.walk #walk-touch .use{bottom:calc(84px + env(safe-area-inset-bottom))}
}
/* The stick and Use button step aside while the carry tray or a sheet is open. */
body.walk-touch:has(#carry-tray:not([hidden])) #walk-touch,body.walk-touch:has(#shop-sheet[open]) #walk-touch,body.walk-touch:has(dialog[open]) #walk-touch{display:none}
.hud-time{min-width:0;display:grid}
#hud-goal[hidden],#notebook-open[hidden],#build-open[hidden],#build-tray[hidden],#notebook-tabs[hidden]{display:none}

/* The new shop view's HUD: the clock and the next goal in one corner, the purse, notebook and settings in the other.
   The bottom dock gives way to the notebook, and opening the shop moves to the sign on the door. */
body.walk .shop-status{max-width:none;margin:0;padding:calc(10px + env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left));border:0;background:none;align-items:flex-start;pointer-events:none}
body.walk .hud-time,body.walk .purse{pointer-events:auto;padding:7px 12px;border-radius:14px;background:#09121ed8;border:1px solid #c9935c44;box-shadow:0 4px 14px #0004}
body.walk .hud-time{max-width:min(340px,48vw);gap:4px}
body.walk #shop-clock b{font-size:1rem}
#hud-goal{display:flex;gap:7px;align-items:baseline;padding-top:5px;border-top:1px solid #f1d9ae26;font-size:.86rem;line-height:1.25;color:#fff1d8}
#hud-goal::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:#e8be76;box-shadow:0 0 0 3px #e8be7633;transform:translateY(-1px)}
body.walk .purse{gap:12px;padding-block:5px}
#notebook-open,#build-open,body.walk #settings-open{position:relative;min-height:40px;min-width:40px;padding:4px 6px;border:0;border-radius:10px;background:none;color:#e8cfa6;display:inline-flex;align-items:center;gap:6px;margin:0}
#notebook-open svg,#build-open svg,body.walk #settings-open svg{width:22px;height:22px}
#notebook-open kbd,#build-open kbd,#build-tray kbd{font:600 .7rem Fredoka,system-ui,sans-serif;padding:1px 5px;border-radius:5px;background:#f1d9ae;color:#2d1e14;box-shadow:0 2px #9c7250}
body.walk-touch #notebook-open kbd,body.walk-touch #build-open kbd,body.walk-touch #build-tray kbd{display:none}
#notebook-open:hover,#build-open:hover,body.walk #settings-open:hover{background:#ffffff14}
#notebook-open .badge{top:-2px;right:-4px}
body.walk #shop-tools{display:none}
body.walk .shop-footer{background:none;pointer-events:none}
body.walk .shop-footer>*{pointer-events:auto}
body.walk:not(.walk-touch) #phase-action.at-door{display:none}
body.walk-touch #phase-action.at-door{max-width:220px;margin-inline:auto}
/* News drifts in at the bottom left on a computer, and under the HUD on a phone, then fades. */
body.walk #shop-news.toast{top:auto;bottom:calc(22px + env(safe-area-inset-bottom));left:max(16px,env(safe-area-inset-left));transform:translateY(6px);max-width:min(420px,46vw);text-align:left}
body.walk #shop-news.toast.show{transform:none}
body.walk-touch #shop-news.toast{bottom:auto;top:calc(86px + env(safe-area-inset-top));left:50%;transform:translate(-50%,-6px);max-width:min(420px,70vw);text-align:center}
body.walk-touch #shop-news.toast.show{transform:translate(-50%,0)}
body.walk #walk-help{top:auto;bottom:calc(72px + env(safe-area-inset-bottom))}
/* The notebook: the shop's management in one book with a row of pages along the top. */
.sheet-frame:has(#notebook-tabs:not([hidden])){grid-template-rows:auto auto auto minmax(0,1fr)}
#notebook-tabs{display:flex;align-items:center;gap:4px;padding:8px 10px 0;background:#613713;overflow-x:auto;scrollbar-width:none}
#notebook-tabs::-webkit-scrollbar{display:none}
#notebook-tabs button{position:relative;flex:none;min-height:40px;padding:6px 14px;border:0;border-radius:12px 12px 0 0;background:#8a5530;color:#fff1d7;font-weight:600}
#notebook-tabs button[aria-current=page]{background:#f1d9ae;color:#2d1e14}
#notebook-tabs button.marked::after{content:"";position:absolute;top:6px;right:5px;width:8px;height:8px;border-radius:50%;background:#e2672f}
#notebook-tabs .paused{margin-left:auto;flex:none;padding:2px 10px;border-radius:999px;background:#ffffff26;color:#fff1d7;font-size:.8rem}
#shop-sheet.notebook #panel-note:empty{display:none}
body.walk #shop-sheet.notebook{width:min(100% - 16px,760px);margin:auto auto max(8px,env(safe-area-inset-bottom))}
body.walk #shop-sheet.notebook,body.walk #shop-sheet.notebook .sheet-frame{max-height:min(86dvh,760px);height:min(86dvh,760px)}
@media (min-width:900px){body.walk #shop-sheet.notebook{margin:auto}}
@media (max-height:500px){body.walk #shop-sheet.notebook,body.walk #shop-sheet.notebook .sheet-frame{max-height:calc(100dvh - 12px);height:calc(100dvh - 12px)}body.walk #shop-sheet.notebook{margin:6px auto}}
/* Screen settings and the controls list. */
.setting.choice{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;margin:0 0 10px}
.setting.choice>div{display:flex;gap:3px;padding:3px;border-radius:12px;background:#d9b98a}
.setting.choice button{min-height:38px;padding:4px 12px;border:0;border-radius:9px;background:transparent;color:#2d1e14;font-weight:600}
.setting.choice button[aria-pressed=true]{background:#fff0c9;box-shadow:0 1px 3px #61371355}
dl.controls{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;align-items:center;margin:0 0 8px}
dl.controls dt{display:flex;gap:3px}
dl.controls dd{margin:0}
dl.controls kbd{display:inline-grid;place-items:center;min-width:1.8em;height:1.8em;padding:0 .4em;border-radius:6px;background:#fff8ea;color:#2d1e14;font:600 .8rem Fredoka,system-ui,sans-serif;box-shadow:0 2px #9c7250}
/* Menu size: the HUD, prompts and menus grow or shrink together. */
body.walk.ui-small :is(.shop-header,.shop-footer,#shop-sheet,#walk-prompt,#carry-tray,#walk-touch .use,#shop-news){zoom:.88}
body.walk.ui-large :is(.shop-header,.shop-footer,#shop-sheet,#walk-prompt,#carry-tray,#walk-touch .use,#shop-news){zoom:1.18}
body.walk .shop-header{pointer-events:none}
/* Phones: the eye button and the news sit below the HUD. Held upright, the goal gets its own row under the clock and purse. */
body.walk #walk-touch .eye{top:calc(84px + env(safe-area-inset-top))}
@media (max-height:500px){body.walk #walk-touch .eye{top:calc(74px + env(safe-area-inset-top))}body.walk-touch #shop-news.toast{top:calc(108px + env(safe-area-inset-top))}}
@media (max-width:600px){
  body.walk .shop-status{flex-wrap:wrap;row-gap:6px}
  body.walk .hud-time{display:contents}
  body.walk #shop-clock{order:1;flex:1 1 0;min-width:0;padding:7px 12px;border-radius:14px;background:#09121ed8;border:1px solid #c9935c44}
  body.walk .purse{order:2;gap:6px;padding-inline:8px}
  body.walk #hud-goal{order:3;flex:1 1 100%;margin-right:60px;padding:6px 12px;border:1px solid #c9935c44;border-radius:12px;background:#09121ed8;pointer-events:auto}
  body.walk #hud-goal[hidden]{display:none}
  body.walk #walk-touch .eye{top:calc(70px + env(safe-area-inset-top))}
  body.walk-touch #shop-news.toast{top:calc(128px + env(safe-area-inset-top))}
}
@media (max-width:600px){
  body.walk #hearts{font-size:.72rem;letter-spacing:0}
  body.walk .purse{gap:2px}
  body.walk #notebook-open,body.walk #settings-open{min-width:40px;padding:4px}
  body.walk #shop-clock b{font-size:.92rem}
}

/* Menus step 4: stocking happens on the display itself. A card floats over the section Chestnut faces,
   and the goods she can set out sit in a hand bar along the bottom. */
#slot-card{position:absolute;left:0;top:0;z-index:3;min-width:150px;max-width:230px;padding:7px 9px 8px;border-radius:14px;background:#fff8eaf2;color:#2d1e14;border:2px solid #e8be76;box-shadow:0 6px 18px #0006;font-size:.86rem;pointer-events:none;will-change:transform}
#slot-card[hidden]{display:none}
#slot-card::after{content:'';position:absolute;left:50%;bottom:-8px;width:12px;height:12px;background:#fff8ea;border-right:2px solid #e8be76;border-bottom:2px solid #e8be76;transform:translateX(-50%) rotate(45deg)}
#slot-card button{pointer-events:auto}
.sc-head{display:flex;align-items:center;gap:6px;font-weight:600}
.sc-head b{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sc-head .icon,.sc-head .swatch{width:24px;height:24px}
.sc-head.empty{color:#7a5a3c}
.sc-count{font-variant-numeric:tabular-nums;color:#7a5a3c;font-size:.8rem}
.sc-price{display:grid;grid-template-columns:34px 1fr 34px;align-items:center;gap:6px;margin-top:6px;text-align:center}
.sc-price button{min-height:32px;padding:0;border:2px solid #e0b77c;border-radius:10px;background:#f6e3c2;color:#5a3a20;font:600 1.2rem/1 Fredoka,system-ui,sans-serif}
.sc-price button:active{transform:scale(.94)}
.sc-price span{display:grid;line-height:1.1}
.sc-price small{font-size:.72rem;color:#7a5a3c}
.sc-price.low small{color:#2f6f4f}.sc-price.high small{color:#8a3b1f}
.sc-touch{margin-top:6px}.sc-touch button{width:100%;min-height:34px;border:2px solid #e0b77c;border-radius:10px;background:#fff1d8;color:#5a3a20;font:600 .82rem Fredoka,system-ui,sans-serif}
#hand-bar,#pack-bar,#till-bar{position:absolute;left:50%;bottom:14px;z-index:3;transform:translateX(-50%);max-width:min(560px,calc(100% - 24px));padding:6px 8px 8px;border-radius:16px;background:#09121ecc;color:#fff1d8;box-shadow:0 6px 18px #0005;text-align:center}
#hand-bar[hidden],#pack-bar[hidden],#till-bar[hidden]{display:none}
.hand-title,.hand-empty{margin:0 4px 6px;font-size:.84rem}
.hand-empty{margin:4px 6px}
.hand-sub{margin:-4px 4px 6px;font-size:.74rem;opacity:.75}
.hand-keys{opacity:.8;margin-left:6px}
.hand-keys kbd{display:inline-grid;place-items:center;min-width:1.5em;height:1.5em;padding:0 .3em;border-radius:5px;background:#f1d9ae;color:#2d1e14;font:600 .74rem Fredoka,system-ui,sans-serif;box-shadow:0 2px #9c7250}
.hand-goods{display:flex;gap:6px;justify-content:center;overflow-x:auto;padding:2px}
.hand-goods button{flex:none;position:relative;display:grid;place-items:center;width:52px;height:52px;padding:0;border-radius:50%;border:2px solid #e8be7666;background:#fff8ea;color:#2d1e14}
.hand-goods button[aria-pressed="true"]{border-color:#ffd98a;box-shadow:0 0 0 3px #ffd98a88;transform:translateY(-3px)}
.hand-goods .icon,.hand-goods .swatch{width:32px;height:32px}
.hand-goods b{position:absolute;right:-2px;bottom:-2px;min-width:20px;padding:0 4px;border-radius:999px;background:#2f6f4f;color:#fff;font-size:.72rem}
body.walk-touch #hand-bar,body.walk-touch #pack-bar,body.walk-touch #till-bar{bottom:auto;top:auto;bottom:calc(14px + env(safe-area-inset-bottom));left:50%;max-width:calc(100% - 260px)}
body.walk-touch:has(#phase-action:not([hidden])) #hand-bar,body.walk-touch:has(#phase-action:not([hidden])) #pack-bar{bottom:84px}
@media (max-width:600px){body.walk-touch #hand-bar,body.walk-touch #pack-bar,body.walk-touch #till-bar{max-width:calc(100% - 24px);bottom:150px}}
body.walk:has(#hand-bar:not([hidden])) #shop-news,body.walk:has(#pack-bar:not([hidden])) #shop-news,body.walk:has(#till-bar:not([hidden])) #shop-news{opacity:0}
/* Packing at the counter: where you are in the five steps, then only the choice this step needs. */
.pack-steps{display:flex;gap:4px;justify-content:center;margin:0 0 8px;padding:0;list-style:none;font-size:.72rem}
.pack-steps li{padding:2px 8px;border-radius:999px;background:#ffffff14;color:#fff1d8aa}
.pack-steps li.done{color:#9fd3b2}
.pack-steps li.done::before{content:'✓ '}
.pack-steps li.now{background:#ffd98a;color:#2d1e14;font-weight:600}
#pack-bar .hand-goods button[disabled]{opacity:.35;transform:none;box-shadow:none}
.pack-swatches{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.pack-swatches button{display:flex;align-items:center;gap:6px;min-height:36px;padding:4px 10px;border:2px solid #e8be7666;border-radius:999px;background:#fff8ea;color:#2d1e14;font:600 .8rem Fredoka,system-ui,sans-serif}
.pack-swatches button i{width:16px;height:16px;border-radius:50%;background:var(--ribbon)}
.pack-swatches button.chosen{border-color:#ffd98a;box-shadow:0 0 0 3px #ffd98a88}
.pack-hand{min-height:44px;padding:6px 22px;border:0;border-radius:999px;background:#1f6b4c;color:#fff;font:600 1rem Fredoka,system-ui,sans-serif}
.pack-away{margin-left:10px;padding:2px 10px;border:1px solid #fff1d855;border-radius:999px;background:none;color:#fff1d8cc;font:500 .72rem Fredoka,system-ui,sans-serif}
body.walk-touch #pack-bar .hand-goods button{width:44px;height:44px}
@media (max-height:440px){#pack-bar .pack-steps{margin-bottom:4px}#pack-bar .hand-title{margin-bottom:4px}}
/* The counter view: who's at the till, what they're buying, how patient they are and the line behind. */
#till-bar{min-width:min(340px,calc(100% - 24px))}
.till-who{display:flex;align-items:baseline;justify-content:center;gap:12px;margin:0 6px 6px}
.till-who p{margin:0;font-size:.9rem}
.till-who .till-price{font-weight:700;color:#ffd98a}
.till-patience{height:6px;margin:0 10px 8px;border-radius:999px;background:#ffffff22;overflow:hidden}
.till-patience i{display:block;width:calc(var(--p,1)*100%);height:100%;border-radius:inherit;background:color-mix(in srgb,#6fcf97 calc(var(--p,1)*100%),#e2734c)}
.till-offer{margin-top:6px;padding-top:6px;border-top:1px solid #fff1d822}
.till-offer p{margin:0 0 6px;font-size:.8rem}
.till-offer button{min-height:36px;margin:0 3px;padding:4px 12px;border:2px solid #e8be7666;border-radius:999px;background:#fff8ea;color:#2d1e14;font:600 .8rem Fredoka,system-ui,sans-serif}
/* At the till the bar holds the one Ring up, so the floating and bottom buttons step aside. */
body.walk #till-action,body.at-counter #phase-action,body.at-counter #bargain{display:none!important}
/* The catalog on the counter: a side sheet, so the shop stays in view while you order. */
body.walk #shop-sheet.station{margin:auto 12px auto auto;width:min(420px,calc(100vw - 24px));max-height:min(84dvh,720px)}
body.walk #shop-sheet.station::backdrop{background:#0002}
@media (max-width:600px){body.walk #shop-sheet.station{margin:auto auto 0;width:100%;max-height:78dvh}}
/* A lighter notebook in the new shop view: a page held open at the side, with the shop still in view behind it,
   rather than a full-screen book. Bottom half on a phone held upright. */
body.walk #shop-sheet.notebook{width:min(440px,calc(100vw - 24px));height:auto;max-height:calc(100dvh - 24px);margin:12px max(12px,env(safe-area-inset-right)) 12px auto;border-radius:20px;background:#fbf1dc;box-shadow:0 12px 40px #0006}
body.walk #shop-sheet.notebook .sheet-frame{height:auto;max-height:calc(100dvh - 24px)}
body.walk #shop-sheet.notebook::backdrop{background:#09121e1f}
body.walk #shop-sheet.notebook #notebook-tabs{gap:6px;padding:8px 10px 6px;background:none;border-bottom:1px solid #e6cf9f}
body.walk #shop-sheet.notebook #notebook-tabs button{min-height:34px;padding:4px 12px;border-radius:999px;background:#f1dfba;color:#5a3a20;font-size:.86rem}
body.walk #shop-sheet.notebook #notebook-tabs button[aria-current=page]{background:#613713;color:#fff1d7}
body.walk #shop-sheet.notebook #notebook-tabs .paused{background:#f1dfba;color:#7a5a3c}
@media (min-width:900px){body.walk #shop-sheet.notebook{margin:12px max(12px,env(safe-area-inset-right)) 12px auto}}
@media (max-height:500px){
  body.walk #shop-sheet.notebook{width:min(440px,56vw);height:calc(100dvh - 12px);max-height:calc(100dvh - 12px);margin:6px max(6px,env(safe-area-inset-right)) 6px auto}
  body.walk #shop-sheet.notebook .sheet-frame{height:calc(100dvh - 12px);max-height:calc(100dvh - 12px)}
}
@media (max-width:600px) and (min-height:501px){
  body.walk #shop-sheet.notebook{width:calc(100% - 12px);max-width:none;height:66dvh;max-height:66dvh;margin:auto 6px max(6px,env(safe-area-inset-bottom))}
  body.walk #shop-sheet.notebook .sheet-frame{height:66dvh;max-height:66dvh}
}
body.walk #shop-sheet.notebook .sheet-frame>header{padding:6px 8px 0 16px;background:none;color:#5a3a20}
body.walk #shop-sheet.notebook .sheet-frame h2{font-size:1.05rem;letter-spacing:.02em;opacity:.85}
body.walk #shop-sheet.notebook #sheet-close{min-width:38px;min-height:38px;border-radius:50%;background:#f1dfba;color:#5a3a20;font-size:1.3rem}
body.walk #shop-sheet.notebook #sheet-tip{background:#f1dfba;color:#5a3a20}
/* Phones held sideways have little height, so the in-world bars slim down and leave the display in view. */
@media (max-height:440px){
  #hand-bar,#pack-bar,#till-bar{padding:4px 6px 6px}
  #till-bar .till-who{margin-bottom:2px}
  #hand-bar .hand-sub{display:none}
  #hand-bar .hand-goods button,#pack-bar .hand-goods button{width:42px;height:42px}
  #hand-bar .hand-goods .icon,#pack-bar .hand-goods .icon{width:26px;height:26px}
  .hand-title{margin-bottom:4px}
}

/* Build mode: the camera up over the shop, one tray of everything that goes in it along the bottom. */
body.building #build-open{background:#f1d9ae;color:#2d1e14}
body.building #walk-touch,body.building #walk-prompt,body.building #walk-help,body.building #hand-bar,body.building #slot-card,
body.building #till-bar,body.building #pack-bar,body.building #phase-action,body.building #till-action,body.building #crate-chip,
body.building #floor-done,body.building .shop-footer,body.building #shop-news{display:none!important}
body.building canvas{cursor:pointer}
#build-tray{position:absolute;left:0;right:0;bottom:0;z-index:4;padding:8px max(12px,env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom));background:linear-gradient(0deg,#fff4dc 0,#fff4dcf2 88%,#fff4dc00);color:#2d1e14;font-size:14px}
#build-tray header{display:flex;align-items:center;gap:8px}
#build-tray .tray-tabs{display:flex;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}
#build-tray .tray-tabs button{min-height:40px;padding:6px 14px;border:0;border-radius:999px;background:#ead2a8;color:#2d1e14;font-weight:700;white-space:nowrap}
#build-tray .tray-tabs button[aria-pressed=true]{background:#613713;color:#fff2de}
#build-tray [data-build-done]{min-height:40px;padding:6px 14px;border:0;border-radius:12px;background:#005436;color:#fff4dc;font-weight:700;display:inline-flex;gap:6px;align-items:center;white-space:nowrap}
#build-tray .tray-hint{margin:6px 2px;font-size:13px;color:#5b4330}
#build-tray .tray-body{display:flex;gap:10px;align-items:stretch;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;padding:2px 2px 6px}
#build-tray .tray-body>*{flex:0 0 auto}
#build-tray .cozy-card{flex:0 0 250px;margin:0;scroll-snap-align:start}
#build-tray .sheet-help,#build-tray .book-tabs,#build-tray .set-chips{display:none}
#build-tray h3{margin:0;align-self:center;writing-mode:vertical-rl;transform:rotate(180deg);font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#7a5a3c}
#build-tray .goods,#build-tray .decor-grid{display:flex;gap:8px}
#build-tray .goods:empty{display:none}
#build-tray .goods li,#build-tray .decor-grid li{flex:0 0 150px;min-height:96px;flex-direction:column;align-items:stretch;justify-content:space-between;gap:6px;padding:8px;border-radius:12px;background:#fff;box-shadow:0 2px 0 #e2c597;scroll-snap-align:start}
#build-tray .goods li strong,#build-tray .decor-grid li strong{font-size:14px;line-height:1.15}
#build-tray .goods li small,#build-tray .decor-grid li small{font-size:12px;color:#6b513a;display:block}
#build-tray .goods li button,#build-tray .decor-grid li button{min-height:40px;width:100%}
#build-tray .decor-swatch,#build-tray .finish-swatch{width:100%;height:28px;border-radius:8px}
#build-tray .decorate-actions{display:flex;flex-direction:column;gap:8px;margin:0;justify-content:center}
#build-tray .decorate-actions [data-arrange]{display:none}
#build-tray .decorate-actions button{min-height:44px;padding:6px 14px}
#build-tray .decorate-actions button:disabled{display:none}
#build-tray.placing{background:none;pointer-events:none}
#build-tray.placing header,#build-tray.placing .tray-hint{pointer-events:auto}
#build-tray.placing .tray-hint{display:none}
body.building #floor-hint{top:auto;bottom:calc(150px + env(safe-area-inset-bottom));height:auto}
body.building #place-bar{bottom:calc(76px + env(safe-area-inset-bottom));z-index:5}
@media (max-height:500px){
  #build-tray{padding-top:2px}
  #build-tray .tray-hint{display:none}
  #build-tray header{margin-bottom:6px}
  #build-tray .tray-tabs button,#build-tray [data-build-done]{min-height:36px;padding:4px 12px}
  #build-tray .goods li,#build-tray .decor-grid li{flex-basis:128px;min-height:0;padding:6px;gap:4px}
  #build-tray .goods li button,#build-tray .decor-grid li button{min-height:34px}
  #build-tray .goods li small,#build-tray .decor-grid li small{display:none}
  #build-tray .decor-swatch,#build-tray .finish-swatch{height:16px}
  #build-tray .cozy-card{display:none}
  body.building #floor-hint{bottom:calc(60px + env(safe-area-inset-bottom))}
  body.building #place-bar{bottom:calc(52px + env(safe-area-inset-bottom))}
}

body.walk #crate-chip{display:none!important}
