:root{--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
html,body{overscroll-behavior:none;-webkit-text-size-adjust:100%}
body{height:100dvh;-webkit-user-select:none;user-select:none}
#game,#move-stick,#touch-actions button{touch-action:none}
#hud{transform:none!important;transition:opacity .25s,visibility .25s}
button{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#touch-controls,.touch-help,#rotate-guide{display:none}
#receipt-close{display:block;margin:9px auto 0;padding:7px 10px;background:transparent;color:#7c816b;font-size:10px}
#receipt{pointer-events:auto}
#receipt-button.has-order{box-shadow:inset 0 -3px #c5a765}
.control-settings{display:flex;gap:14px;flex-wrap:wrap;padding:10px 0 18px;font-size:11px;color:#62705d}
.control-settings label{display:flex;align-items:center;gap:8px}
.control-settings select{padding:8px 10px;border:1px solid #c5cdbb;border-radius:3px;background:#fffdf4;color:#3c5547;font:inherit}
.control-settings input{accent-color:#3c5547;width:17px;height:17px}
.paused #hud button,.paused #move-stick{pointer-events:none}
.paused #hud{opacity:.35}
.pointer-locked #game{cursor:none}
#rotate-guide{position:fixed;inset:0;z-index:40;background:#f7f3e8f7;padding:36px 24px;align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:20px;transition:opacity .25s}
#rotate-guide>span svg{width:48px;height:48px;color:#5d7660}
#rotate-guide h2{font:400 27px LocalSerif,serif;letter-spacing:3px;margin:0}
#rotate-guide p{font-size:13px;line-height:2.2;color:#66785f;margin:0}
#rotate-guide small{font-size:10px;color:#8a947f;line-height:1.7}
body.touch-controls #width-guide{display:none}
body.portrait-touch #rotate-guide{display:flex}
body.touch-controls #reticle{display:block;width:12px;height:12px;pointer-events:none}
body.touch-controls #reticle i:first-child{width:12px;top:6px}
body.touch-controls #reticle i:last-child{height:12px;left:6px}
body.touch-controls .desktop-help,body.touch-controls #auto-lock-row,body.touch-controls .settings-note{display:none}
body.touch-controls .touch-help{display:grid}
body.touch-controls .mini-brand{display:none}
body.touch-controls header{left:calc(140px + var(--safe-left));right:calc(12px + var(--safe-right));top:calc(9px + var(--safe-top));height:44px;justify-content:flex-end}
body.touch-controls .header-actions{gap:5px}
body.touch-controls .icon-button{width:44px;height:44px;background:#f7f3e7e8;border:1px solid #ffffff77}
body.touch-controls .status-button{height:44px;padding:8px 12px;font-size:11px}
body.touch-controls #help-button{display:none}
body.touch-controls #phone{left:calc(12px + var(--safe-left));top:calc(9px + var(--safe-top));bottom:auto;width:117px;height:44px;padding:0;transform:none;background:#faf6e9eb;border:1px solid #ffffff7a;border-radius:4px;box-shadow:0 2px 7px #182a2025}
body.touch-controls .phone-screen{border:0;background:transparent;overflow:visible}
body.touch-controls .phone-top,body.touch-controls .phone-speaker,body.touch-controls .phone-home,body.touch-controls .phone-forest,body.touch-controls .phone-feedback{display:none}
body.touch-controls .phone-money{margin:0;padding:5px 9px;background:transparent;box-shadow:none}
body.touch-controls .phone-money small{font-size:8px;letter-spacing:.5px}
body.touch-controls .phone-money strong{font-size:18px}
body.touch-controls .phone-bottom{left:auto;right:5px;top:3px;bottom:auto;width:43px;text-align:right;font-size:7px;background:none}
body.touch-controls #view-controls{top:calc(61px + var(--safe-top));right:calc(12px + var(--safe-right));gap:4px;opacity:1}
body.touch-controls #view-controls button{min-width:48px;min-height:44px;padding:7px;font-size:10px;background:#f7f3e5db;border:1px solid #ffffff52}
body.touch-controls #lock-button{display:none}
body.touch-controls #interaction{bottom:calc(75px + var(--safe-bottom));left:50%;gap:6px;width:calc(100% - 340px - var(--safe-left) - var(--safe-right));max-width:420px;text-align:center;pointer-events:none}
body.touch-controls #interact-button{pointer-events:none;font-size:11px;padding:8px 10px;gap:5px;flex-wrap:wrap;justify-content:center;min-height:34px;line-height:1.4}
body.touch-controls #interact-button kbd,body.touch-controls #return-tip{display:none}
body.touch-controls #target-detail{font-size:9px;white-space:nowrap}
body.touch-controls #holding{font-size:10px;line-height:1.4}
body.touch-controls #tools{bottom:calc(13px + var(--safe-bottom));left:50%;right:auto;transform:translateX(-50%);gap:5px}
body.touch-controls #tools button{width:54px;height:49px;padding:7px 5px;gap:3px;background:#f9f6e8e8}
body.touch-controls #tools button.selected{background:#3c5648ed}
body.touch-controls #tools kbd{display:none}
body.touch-controls #tools svg{height:21px;width:21px}
body.touch-controls #tools button>span:last-child{font-size:10px}
body.touch-controls #touch-controls{display:block;position:absolute;inset:0;pointer-events:none}
#move-stick{position:absolute;pointer-events:auto;left:calc(22px + var(--safe-left));bottom:calc(23px + var(--safe-bottom));width:112px;height:112px;border-radius:50%;border:1px solid #fffceb70;background:#fff8e11a;box-shadow:inset 0 0 24px #dce8ce10;transition:background .18s,border-color .18s}
.stick-ring{position:absolute;inset:16px;border:1px solid #fffce540;border-radius:50%}
#stick-knob{position:absolute;top:36px;left:36px;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#faf7e6ce;color:#526c55;border:1px solid #fffde6;box-shadow:0 2px 9px #243b2633;transition:transform .14s ease,background .18s}
#stick-knob svg{width:19px;height:19px}
#move-stick.pressed{background:#fff8e12f;border-color:#fffcebba}
#move-stick.pressed #stick-knob{transition:background .18s;background:#fffced}
#move-stick small{position:absolute;bottom:-18px;left:0;width:100%;text-align:center;font-size:9px;color:#fffcecce;text-shadow:0 1px 3px #15351b}
#touch-actions{position:absolute;right:calc(18px + var(--safe-right));bottom:calc(18px + var(--safe-bottom));width:170px;height:124px}
#touch-actions button{position:absolute;pointer-events:auto;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;color:#405b45;background:#f9f6e5d9;border:1px solid #fffcedab;box-shadow:0 3px 10px #1d36252a;font-size:10px;transition:transform .16s,background .16s,box-shadow .16s}
#touch-action{right:0;bottom:0;width:80px;height:80px;border-radius:50%}
#touch-action svg{width:24px;height:24px}
#touch-actions #touch-action.has-target{background:#fdf8e8f5;box-shadow:0 0 0 3px #fff7db24,0 3px 10px #1d36252a}
#touch-actions #touch-action.pressed{transform:scale(.93);background:#dde8d0}
#touch-return{left:4px;bottom:5px;width:58px;height:58px;border-radius:50%}
#touch-alt{right:4px;top:0;width:86px;height:36px;border-radius:20px;flex-direction:row!important;font-size:9px!important}
#touch-alt svg{width:15px;height:15px}
body.touch-controls .receipt{left:calc(148px + var(--safe-left));top:calc(61px + var(--safe-top));width:174px;padding:12px 14px 8px;transform:none;z-index:4}
body.touch-controls .receipt-number{margin:4px 0 7px}
body.touch-controls .receipt h2{font-size:15px;margin-bottom:8px}
body.touch-controls .perforation{margin-bottom:9px}
body.touch-controls #recipe-items{gap:7px 4px}
body.touch-controls .receipt-bottom{margin-top:9px;padding-top:7px}
body.touch-controls #receipt-close{min-height:36px;width:100%;margin-top:2px;font-size:11px}
body.touch-controls .modal{width:min(620px,calc(100vw - 30px - var(--safe-left) - var(--safe-right)));max-height:calc(100dvh - 20px - var(--safe-top) - var(--safe-bottom));padding:22px 28px;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch}
body.touch-controls .modal-backdrop{padding:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left)}
body.touch-controls .settings label{min-height:36px}
body.touch-controls .settings input{height:28px;min-width:80px}
body.touch-controls .control-settings select{min-height:40px}
@media(max-height:500px){
 body.touch-controls .start-card{left:calc(6vw + var(--safe-left));width:340px}
 body.touch-controls .start-card h1{font-size:40px;letter-spacing:7px;margin:13px 0 9px;line-height:1.15}
 body.touch-controls .start-card .eyebrow{font-size:8px;letter-spacing:1.5px}
 body.touch-controls .start-card .intro{font-size:11px;line-height:1.6;letter-spacing:1px;margin:8px 0}
 body.touch-controls .start-rule{margin:10px 0}
 body.touch-controls .start-desc{font-size:10px;margin:8px 0}
 body.touch-controls .start-card .primary{min-height:44px;padding:11px 16px;margin-top:12px;font-size:12px;min-width:215px}
 body.touch-controls .start-card .quiet{padding:8px 0;font-size:11px}
 body.touch-controls .start-note{margin:8px 0;font-size:9px}
 body.touch-controls .help-grid{gap:10px}
 body.touch-controls .modal h2{margin-top:10px}
}
@media(max-width:700px) and (orientation:landscape){
 body.touch-controls #sound-button{display:none}
 body.touch-controls #view-controls button{min-width:44px;font-size:9px;padding:6px}
 body.touch-controls #interaction{width:calc(100% - 310px - var(--safe-left) - var(--safe-right));bottom:calc(70px + var(--safe-bottom))}
 body.touch-controls #tools button{width:47px}
 #move-stick{width:100px;height:100px;left:calc(15px + var(--safe-left));bottom:calc(22px + var(--safe-bottom))}
 #stick-knob{top:30px;left:30px}
 #touch-actions{right:calc(12px + var(--safe-right));width:154px}
 #touch-action{width:74px;height:74px}
 #touch-return{left:0;width:54px;height:54px}
 body.touch-controls .receipt{left:calc(130px + var(--safe-left));width:168px}
}
@media(prefers-reduced-motion:reduce){
 *,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}
}

/* Landscape entry is available before starting, including the portrait overlay. */
#landscape-button{gap:14px;min-height:52px;justify-content:center;min-width:232px}
#landscape-status{max-width:320px;font-size:12px!important;line-height:1.8!important}
button[aria-busy="true"]{opacity:.6;cursor:wait}

/* Quiet feedback stays below the existing action controls, with no popup card. */
#action-status{position:absolute;top:calc(100% + 5px);left:50%;transform:translateX(-50%);width:360px;max-width:90vw;font-size:10px;line-height:1.5;text-align:center;color:#fff9dc;text-shadow:0 1px 3px #17281c,0 0 5px #17281c;opacity:0;pointer-events:none;transition:opacity .18s}
#action-status.visible{opacity:1}
body.touch-controls #action-status{top:calc(100% + 3px);width:100%;max-height:30px;overflow:hidden;font-size:9px}
/* Reference: stars over the customer, small floating base/tip, total on the phone. */
#sale{gap:0;pointer-events:none;white-space:nowrap;transition:visibility .15s;will-change:transform}
#sale .stars{position:absolute;bottom:55px;gap:5px}
#sale .stars svg{width:17px;height:17px}
#sale strong{font:600 14px Arial,sans-serif;color:#fffbe8;text-shadow:0 1px 4px #17291d}
body.touch-controls #sale .stars{bottom:42px;gap:3px}
body.touch-controls #sale .stars svg{width:13px;height:13px}
body.touch-controls #sale strong{font-size:11px}

/* Keep the counter clear; settings live in the pause sheet. */
.playing .mini-brand,#help-button,#sound-button{display:none}
header{justify-content:flex-end}
#interact-button{padding:7px 11px;background:#f9f7eddf;box-shadow:none;font-size:11px}
#target-detail:empty{display:none}
#view-controls{opacity:.62}
#view-controls:focus-within,#view-controls:hover{opacity:1}
#phone{width:164px;height:224px;pointer-events:auto;transition:box-shadow .2s}
#phone-toggle{position:absolute;inset:0;z-index:3;width:100%;height:100%;background:transparent!important;border-radius:7px;transform:none}
#phone-toggle:hover{box-shadow:inset 0 0 0 1px #e2d8ab}
#phone-toggle:active{box-shadow:inset 0 0 0 2px #d6c482}
.phone-money strong{font-size:19px}
.phone-money small{font-size:8px}
.phone-feedback{padding:10px 9px;bottom:20px;left:5px;right:5px;min-height:0;background:#fbf9ed;opacity:0;visibility:hidden;transform:translateY(5px);transition:opacity .2s,transform .2s,visibility .2s;pointer-events:none}
#phone.review-open .phone-feedback{opacity:1;visibility:visible;transform:translateY(0)}
.phone-feedback strong{font:20px Georgia,serif;margin:6px 0;color:#345d45}
.phone-feedback #phone-message{font-size:11px;line-height:1.65;color:#475947;overflow-wrap:anywhere}
.phone-review-meta{display:flex;justify-content:space-between;align-items:center;gap:5px}
.phone-review-meta small{font-size:8px;color:#8b8f7a}
#phone-stars{display:flex;color:#b89242;gap:1px}
#phone-stars i,#sale .stars i{display:flex;font-style:normal}
#phone-stars svg{width:10px;height:10px;fill:currentColor;stroke-width:.5}
.unfilled{opacity:.24}
.phone-bottom{height:19px;line-height:19px;font-size:8px}
.phone-forest{height:94px;margin-top:8px}
body.touch-controls #phone{width:129px;height:44px}
body.touch-controls #phone .phone-bottom{font-size:0;width:8px;height:8px;top:8px;right:8px;border:1px solid #9ca98c;border-radius:50%;background:#6f8666}
body.touch-controls #phone .phone-bottom b{display:none}
body.touch-controls #phone .phone-feedback{display:block;top:49px;bottom:auto;left:0;right:auto;width:190px;padding:10px 11px;border:1px solid #fffdf4;border-radius:5px;box-shadow:0 3px 14px #1c362520}
body.touch-controls #phone .phone-feedback strong{font-size:19px;margin:6px 0}
body.touch-controls #phone .phone-feedback #phone-message{font-size:11px;line-height:1.6;display:block}
body.touch-controls #phone .phone-review-meta small{font-size:9px}
body.touch-controls #phone-stars svg{width:11px;height:11px}
body.touch-controls #target-detail{white-space:normal}
.quality-help{line-height:1.8!important}
@media(max-height:650px){body:not(.touch-controls) #phone{transform:scale(.85)}}
@media(prefers-reduced-motion:reduce){.phone-feedback{transition:none;transform:none}}
