/* Readable physical type and spacing; no page transform or browser zoom. */
:root{--ui-size:1.15;--read:calc(clamp(14px,.86vw,21px)*var(--ui-size));--number:calc(clamp(23px,1.4vw,34px)*var(--ui-size))}
#hud{gap:clamp(8px,1vw,26px);padding:10px 14px;align-items:center}
#hud small,#hud .wallet small{font-size:calc(var(--read)*.8)}
#hud .stage-badge{min-width:210px;max-width:290px;flex:0 1 290px}
#hud .stage-badge strong{font-size:var(--read);line-height:1.45;display:block}
#reputation-label{display:block;font-size:var(--read);color:#3e705d;margin-top:4px;font-weight:700}
#hud .stage-badge #reputation-label{color:#fff0c6}
#hud .hud-revenue{min-width:230px;max-width:none}
#hud .hud-revenue strong,#hud .hud-time strong,#hud .wallet strong,#hud .hud-satisfaction strong{font-size:var(--number)}
#hud .hud-revenue #goal-target{font-size:calc(var(--read)*.85)}
#hud .hud-time{min-width:112px}#hud .hud-satisfaction{min-width:112px}
#day-note{top:154px;left:24px;width:250px;padding:14px 16px}
#day-note h2{font-size:var(--read);margin:7px 0}
#day-note .eyebrow{font-size:calc(var(--read)*.65)}
#day-note p{font-size:calc(var(--read)*.78);line-height:1.65;margin:5px 0 8px}
#condition-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#direct-goal,#vip-goal,#loss-goal,#clean-goal{font-size:calc(var(--read)*.87);line-height:1.7}
#order-dock,.battle #order-dock{left:24px;top:410px;width:250px;max-height:calc(100vh - 650px);overflow:auto;scrollbar-width:thin;border-radius:14px;background:#f8efdd}
.dock-heading{font-size:var(--read);position:sticky;top:0;z-index:1}.dock-heading span{font-size:calc(var(--read)*.7)}
.ticket-card{padding:8px;border-bottom:1px solid #c9c6ad}.ticket-card header{font-size:calc(var(--read)*.78);color:#3b5a4b;display:flex;align-items:center;gap:6px;margin-bottom:5px}.ticket-card header>span{margin-left:auto;font-weight:bold}.ticket-card.urgent{border-left:4px solid #b7533d}
.order-button{font-size:var(--read);padding:9px 8px;border-radius:7px!important;min-height:55px;line-height:1.35}
.order-button:disabled{opacity:1;color:#514f60}.order-button img{width:32px;height:32px;flex:0 0 32px}.order-button small,.order-button:disabled small{font-size:calc(var(--read)*.83);color:inherit;margin-top:3px;font-weight:700}
.order-button.state-COOKING{background:#f7dfaf;color:#815328}.order-button.state-READY{background:#dcebcf;color:#396142}.order-button.state-SERVING{background:#d4e9e1;color:#376b60}.order-button.state-PLAYER_LOCKED,.order-button.state-PLAYER_ASSIGNED{background:#deedf8;color:#2f638b}.order-button.state-STAFF_ASSIGNED{background:#e6e0eb;color:#625573}
.order-more{font-size:var(--read);padding:12px;width:100%}
#order-list .order-button{min-height:62px;padding:9px 8px;gap:8px}#order-list .order-button .order-name{font-size:var(--read)}#order-list .order-button small{font-size:calc(var(--read)*.83);line-height:1.35;margin-top:4px}#order-list .order-button img{width:32px;height:32px}
#play-controls{gap:20px;bottom:20px}
.typing-station{width:820px;max-width:60%;padding:12px 18px}
#order-input{font-size:calc(clamp(27px,1.65vw,40px)*var(--ui-size));padding:9px 0;min-height:56px}
#order-input::placeholder{font-size:calc(var(--read)*.95)}
.typing-heading,.typing-heading .quiet,.input-wrap button{font-size:calc(var(--read)*.84)}
#typing-feedback,#typing-candidate,#typing-verdict{font-size:var(--read)}
.typing-help{font-size:calc(var(--read)*.7);line-height:1.6;flex-wrap:wrap}
#command-queue{height:34px}#command-queue small{font-size:calc(var(--read)*.75)}
.command-token{height:30px;width:30px;flex-basis:30px}.command-token img{width:27px;height:27px}
.management-button{font-size:var(--read);padding:17px 20px}.management-button small{font-size:calc(var(--read)*.72)}
#staff-status{font-size:calc(var(--read)*.85);max-width:240px;width:240px}#staff-status small{font-size:calc(var(--read)*.7)}
#game #combo strong,#game.battle #combo strong{font-size:calc(var(--number)*1.3)}#game #combo small,#game #combo>span{font-size:calc(var(--read)*.75)}
#game #last-order strong,#game #last-order span,#game #fever strong,#game #rush-notice{font-size:var(--read)}
#game #rush-notice{top:144px}#game #rush-notice span{font-size:calc(var(--read)*.8)}
#toast{font-size:var(--read);bottom:250px;max-width:65%;text-align:center}
dialog{width:620px;padding:30px;max-height:90vh}dialog h2{font-size:calc(var(--number)*1.1)}dialog .dialog-desc,.dialog-note{font-size:calc(var(--read)*.9)}
dialog .primary,dialog .quiet,.setting-row,.setting-row select{font-size:var(--read)}
#briefing-objectives,.briefing-menus span{font-size:var(--read)}
#upgrade-dialog{width:880px}#upgrade-list h3,#shop-tabs button,.upgrade-info strong,.buy-button{font-size:var(--read)}
.upgrade-info small,.upgrade-row select{font-size:calc(var(--read)*.83)}.upgrade-info em{font-size:calc(var(--read)*.7)}.upgrade-row{padding:17px 0;min-height:110px}.menu-wallet{font-size:var(--read)}
#clear-stats small{font-size:calc(var(--read)*.8)}#clear-stats strong{font-size:var(--number)}#result-unlock{font-size:var(--read);line-height:1.65}
#map-dialog{width:950px}.stage-tile{min-height:120px}.stage-tile>span,.stage-tile>strong{font-size:var(--read)}.stage-tile>small{font-size:calc(var(--read)*.76)}
#battle-race strong{font-size:var(--number)}#battle-race small,#rival-live p,#rival-operations{font-size:calc(var(--read)*.75)}#rival-live{top:158px}#rival-live h2{font-size:var(--number)}
#vip-dialog{border:5px solid #af8a4d;text-align:center;background:#fcf0d7;width:700px}
#vip-words{display:flex;gap:14px;justify-content:center;margin:25px 0}#vip-words span{padding:14px 22px;border:2px solid #c7b898;border-radius:12px;font-size:var(--number);opacity:.65}#vip-words .current{background:#3d6b58;color:#fff6e3;border-color:#3d6b58;opacity:1}#vip-words .done{background:#e2ebce;opacity:1;text-decoration:line-through}
#vip-time{display:block;font-size:calc(var(--number)*1.35);color:#915530;margin-bottom:18px;font-variant-numeric:tabular-nums}#vip-dialog label{display:block;font-size:var(--read)}#vip-input{width:100%;padding:14px;border:2px solid #75927a;border-radius:12px;background:#fffaf0;color:#345342;font-size:calc(var(--number)*1.2);text-align:center}#vip-feedback{font-size:var(--read);min-height:28px;color:#42644c}
@media(min-width:2300px){#day-note,#order-dock,.battle #order-dock{width:310px}#day-note{top:175px}#order-dock,.battle #order-dock{top:500px;max-height:calc(100vh - 800px)}.typing-station{width:1050px}#hud .stage-badge{max-width:350px;flex-basis:350px}#play-controls{bottom:32px}}
@media(max-width:1400px){#hud .stage-badge{min-width:155px;max-width:210px;flex-basis:190px}#hud .hud-revenue{min-width:190px}#hud .hud-satisfaction{display:none}#day-note{width:200px;top:144px}#order-dock,.battle #order-dock{width:200px;top:390px;max-height:calc(100vh - 610px)}#staff-status{display:none}.typing-station{max-width:75%}.management-button small{display:none}#game #rush-notice{top:140px}}
@media(max-height:850px){#day-note{top:132px}#condition-description,#staff-note,#loss-goal{display:none}#order-dock,.battle #order-dock{top:275px;max-height:calc(100vh - 500px)}.typing-station{padding:8px 12px}.typing-help{display:none}#play-controls{bottom:12px}#order-input{min-height:44px}.stage-grid{grid-template-columns:repeat(4,1fr)}}

#toast{left:auto;right:24px;top:180px;bottom:auto;transform:none;max-width:330px}

/* Final HUD: retain type size; spend less screen area on containers. */
#hud,.battle #hud{gap:clamp(10px,1vw,22px);padding:0 2px;background:none;box-shadow:none;border:0;align-items:center}
#hud>*{padding:8px 12px}
#hud .stage-badge{flex:0 0 clamp(210px,16vw,290px);min-width:0;max-width:290px;border-radius:9px 20px 20px 9px}
#hud .stage-badge strong{line-height:1.3}
#hud small{margin-bottom:3px;color:#53664e}
#hud .stage-badge small{color:#e4e8ce}
#hud .stage-badge #reputation-label{margin-top:2px;line-height:1.3}
#hud .hud-revenue{flex:0 0 clamp(320px,32vw,520px);width:clamp(320px,32vw,520px);min-width:0;max-width:520px;margin-inline:auto;padding:10px 16px;border-radius:16px}
#hud .hud-revenue strong{display:block;line-height:1.2;white-space:nowrap}
#hud .hud-revenue #goal-target{color:#5d694e;font-weight:500}
#hud .hud-revenue .progress-track{height:5px;margin-top:8px}
#hud .hud-time,#hud .hud-satisfaction{flex:0 0 auto;min-width:112px;text-align:center}
#hud .hud-satisfaction{background:#f8eedbe8;text-shadow:none;border-radius:16px}
#hud .wallet{flex:0 0 auto;white-space:nowrap;padding:9px 12px}
#hud #pause-button{flex:0 0 44px;width:44px;height:44px;padding:10px}
#battle-race{flex:0 1 620px;margin-inline:auto}
#day-note,.battle #day-note{top:130px;width:250px;padding:12px 14px;background:#faf0dcf5;color:#344f43;border-left:3px solid var(--theme-accent);border-radius:0 14px 14px 0}
#day-note .eyebrow,.battle #day-note .eyebrow{display:block;font-size:calc(var(--read)*.76);letter-spacing:.08em;color:#53634e}
#day-note h2,.battle #day-note h2{font-size:var(--read);line-height:1.3;margin:4px 0 5px;color:#304e40}
#day-note #condition-description{font-size:calc(var(--read)*.85);line-height:1.45;color:#4e6049;margin:0 0 9px;display:block;overflow:visible}
#day-note .mission-list{border-top:1px solid #c6c4a7;border-bottom:1px solid #c6c4a7;padding:5px 0}
#day-note .mission-row{display:grid;grid-template-columns:1fr auto 16px;gap:5px;align-items:center;min-height:31px;line-height:1.3;color:#465a46;border-radius:5px;padding:4px 0;font-size:calc(var(--read)*.86)}
#day-note .mission-row strong{font-size:calc(var(--read)*1.08);color:#2d493c;white-space:nowrap;font-variant-numeric:tabular-nums}
#day-note .mission-status{width:16px;height:16px;border:1px solid #a3a58b;border-radius:50%;display:grid;place-items:center}
#day-note .mission-status svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.5;visibility:hidden}
#day-note .mission-row.met{background:#deead3;animation:mission-done .7s ease-out}
#day-note .mission-row.met .mission-status{background:#466c4e;color:#fff4dc;border-color:#466c4e}
#day-note .mission-row.met svg{visibility:visible}
#day-note .mission-row.warning{background:#f3ddc5;color:#8c472e}
#day-note .mission-row.warning strong{color:#8c472e}
#day-note .mission-row.warning .mission-status{background:#a95b36;border-color:#a95b36}
#day-note #staff-note,.battle #day-note #staff-note{display:block;border:0;padding:0;margin:8px 0 0;font-size:calc(var(--read)*.85);line-height:1.3;color:#53634e}
#order-dock,.battle #order-dock{height:auto;min-height:0}
#order-dock .dock-heading{padding:9px 12px}
#order-dock.is-empty .dock-heading{border-radius:14px 14px 0 0;padding:7px 12px}
#order-dock.is-empty .dock-heading span{display:none}
#order-dock.is-empty #order-list{min-height:0;height:auto}
#order-dock #order-list .empty{margin:0;padding:9px 12px;font-size:calc(var(--read)*.85);color:#4e6049;line-height:1.4}
@keyframes mission-done{from{box-shadow:inset 0 0 0 2px #72926a;background:#bfd6ad}to{box-shadow:inset 0 0 0 0 transparent;background:#deead3}}
@media(min-width:2300px){#day-note,.battle #day-note{top:150px;width:310px}}
@media(max-width:1400px){#hud,.battle #hud{gap:9px}#hud .stage-badge{flex-basis:190px}#hud .hud-revenue{flex-basis:320px;width:320px}#hud .hud-satisfaction{display:none}#day-note,.battle #day-note{width:230px}#order-dock,.battle #order-dock{width:230px}}
@media(max-width:1100px){#hud .stage-badge{flex-basis:175px}#hud .hud-revenue{flex:0 1 320px;min-width:245px}#hud .hud-time{min-width:92px}#hud .wallet{padding:8px}#hud .wallet img{display:none}}
@media(max-height:850px){#day-note,.battle #day-note{top:122px;padding:8px 12px}#day-note #condition-description{display:none}#day-note .mission-row{min-height:26px;padding:2px 0}#day-note #staff-note{margin-top:5px}}
@media(prefers-reduced-motion:reduce){#day-note .mission-row.met{animation:none}}
:root[data-reduce-motion="true"] #day-note .mission-row.met{animation:none}
#day-note,.battle #day-note{padding:10px 14px}
#day-note .mission-list{padding:3px 0}
#day-note .mission-row{min-height:30px;padding:2px 0}
#day-note #condition-description{word-break:keep-all}

/* VIP content may be a sentence or four ingredients; preserve readable type. */
#vip-words{flex-wrap:wrap;gap:10px;min-height:70px;align-items:center}
#vip-words span{padding:10px 14px;max-width:100%;overflow-wrap:anywhere}
#vip-pattern{display:block;color:#86602c;font-size:var(--read)}
#vip-input:disabled{opacity:.65}

/* Fixed reading surfaces. Queue updates and customer movement never resize the word station. */
#game{--queue-width:260px;--typing-height:280px}
#order-dock,.battle #order-dock{width:var(--queue-width);overflow:hidden;border:1px solid #a8b597;display:flex;flex-direction:column;box-shadow:0 3px 14px #334c3620}
#order-dock .dock-heading{flex:none;position:relative;font-size:17px;padding:9px 12px!important}
#order-dock .dock-heading span{display:block!important;font-size:12px}
#order-count{float:right;font-size:14px;color:#fff4d6}
#order-list{overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;min-height:0;scrollbar-width:thin}
#order-list .ticket-card{padding:6px 8px;border:0;border-bottom:1px solid #c9c6ad;border-left:3px solid transparent}
#order-list .ticket-card header{font-size:12px;margin-bottom:3px;min-height:20px;white-space:nowrap}
#order-list .ticket-card header strong{font-weight:600;overflow:hidden;text-overflow:ellipsis}
#order-list .ticket-card.selected{border-left-color:#48789b;background:#e4eee7}
#order-list .ticket-card.processing{box-shadow:inset 0 0 0 1px #a0bccc}
#order-list .ticket-card.urgent header{color:#a04d38}
#order-list .ticket-card.delivered{background:#e1edda}
#order-list .order-button{display:flex;gap:7px;padding:5px 4px;min-height:45px;border:0;border-radius:5px;line-height:1.2;width:100%}
#order-list .order-button img{width:27px;height:27px;flex:0 0 27px}
#order-list .order-name{min-width:0;flex:1}
#order-list .order-name strong{display:block;font-size:calc(clamp(14px,.85vw,18px)*var(--ui-size));font-weight:700;overflow-wrap:anywhere}
#order-list .order-button small{font-size:12px;margin-top:2px;font-weight:500}
#order-list .item-count{font-size:14px;flex:none;font-variant-numeric:tabular-nums;color:#486443;min-width:27px;text-align:right}
#order-list .state-COMPLETED{background:#e1edda;color:#476845}
#play-controls{height:var(--typing-height);left:24px;right:24px;bottom:18px;display:block;pointer-events:none}
#play-controls>*{pointer-events:auto}
#play-controls .typing-station{position:absolute;left:50%;bottom:0;transform:translateX(-50%);width:min(880px,calc(100vw - 2*var(--queue-width) - 88px));max-width:none;height:100%;margin:0;padding:10px 14px;display:grid;grid-template-rows:22px 28px minmax(70px,1fr) 60px 24px 18px;gap:2px}
#play-controls .typing-heading{margin:0;white-space:nowrap;min-width:0;font-size:13px}
#target-label{overflow:hidden;text-overflow:ellipsis}
#play-controls #command-queue{height:28px;min-height:0;margin:0;overflow:hidden}
#current-word{display:flex;align-items:center;gap:10px;min-width:0;overflow:hidden;border-radius:8px;background:#f5f1df;padding:4px 8px}
#current-word>img{width:40px;height:40px;object-fit:contain;flex:0 0 40px}
#current-word #typing-letters{justify-content:flex-start;align-content:center;align-items:center;flex-wrap:wrap;gap:2px;min-height:0;margin:0;padding:0;flex:1;animation:none!important}
#current-word .typing-letter{font-size:calc(clamp(27px,1.55vw,33px)*var(--ui-size));font-weight:800;min-width:0;width:auto;padding:0 1px;height:40px;line-height:1.15;color:#466443;flex:none}
#current-word .typing-letter.done{color:#235a38;background:#c9dfba;border-bottom:3px solid #37653f}
#current-word .typing-letter.partial{color:#98642c;background:#f1dfba}
#current-word .typing-letter.incorrect{color:#a64736;border-bottom-color:#a64736}
#current-word .typing-letter.remaining{color:#55684e;border-bottom-color:#bbc5a9}
#current-word[data-long="true"] .typing-letter{font-size:calc(var(--read)*1.3);height:32px}
#current-word #typing-letters.no-target{font-size:18px;color:#78866b}
#play-controls .input-wrap{height:60px;padding:2px 8px}
#play-controls #order-input{min-height:0;height:100%;padding:2px 0}
#play-controls #typing-feedback{height:24px;min-height:0;margin:0;white-space:nowrap;overflow:hidden;font-size:14px}
#play-controls #typing-candidate,#play-controls #typing-verdict{font-size:14px;overflow:hidden;text-overflow:ellipsis}
#play-controls .typing-help,.crowded #play-controls .typing-help{display:flex;flex-wrap:nowrap;white-space:nowrap;overflow:hidden;margin:0;font-size:11px;line-height:18px}
#play-controls .typing-help>span{overflow:hidden;text-overflow:ellipsis}
#upgrade-button{position:absolute;left:0;bottom:0}
#staff-status{position:absolute;right:0;bottom:0}
@media(min-width:2300px){#game{--queue-width:300px;--typing-height:300px}#play-controls .typing-station{width:min(1040px,calc(100vw - 2*var(--queue-width) - 88px))}}
@media(max-width:1400px){#game{--queue-width:230px;--typing-height:260px}#play-controls .typing-station{padding:8px 10px;grid-template-rows:20px 26px minmax(66px,1fr) 54px 22px 16px}#play-controls .input-wrap{height:54px}#current-word>img{width:30px;height:30px;flex-basis:30px}#current-word .typing-letter{font-size:28px;height:34px}#current-word[data-long="true"] .typing-letter{font-size:22px;height:27px}#play-controls .typing-help{font-size:10px}#play-controls #typing-candidate,#play-controls #typing-verdict{font-size:12px}}
@media(max-width:1000px){#game{--queue-width:205px}#play-controls{left:14px;right:14px}#current-word .typing-letter{font-size:26px}#play-controls .typing-help>span:last-child{display:none}}

#current-word #typing-letters{height:100%;align-content:flex-start;padding-top:5px}
#current-word>img{align-self:flex-start;margin-top:5px}
.typing-tick #current-word .typing-letter{animation:none!important}

#game #fever{bottom:calc(var(--typing-height) + 36px);top:auto}
#game #toast{top:auto;bottom:calc(var(--typing-height) + 40px);height:auto}
/* Small transient penalties by the wallet; table badges carry the cleaning action. */
#penalty-toasts{position:absolute;right:24px;top:108px;z-index:6;display:flex;flex-direction:column;gap:5px;pointer-events:none;max-width:calc(100% - 48px)}
.penalty-toast{display:flex;align-items:center;gap:7px;padding:8px 11px;background:#fff4df;color:#526d51;border:1px solid #bcaa80;border-radius:9px;box-shadow:0 3px 8px #314f3820;font-size:13px;white-space:nowrap;transition:opacity .18s,transform .18s}
.penalty-toast img{width:19px;height:19px}.penalty-toast strong{color:#a4533c;font-size:14px}.penalty-toast.leaving{opacity:0;transform:translateY(-4px)}
#game:not(.playing) #penalty-toasts{display:none}
/* The typing controls retain the total dirty-table count. */
#cleaning-indicator{display:flex;align-items:center;gap:5px;white-space:nowrap;flex-shrink:0;border:1px solid #9b783b;border-radius:9px;background:#ffebae;color:#3c583e;padding:4px 8px;font-size:15px;cursor:pointer}
#cleaning-indicator[hidden]{display:none}#cleaning-indicator img{width:22px;height:22px}#cleaning-indicator:disabled{opacity:.65;cursor:default}
.typing-heading{gap:8px}.typing-heading #target-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.ticket-card.queued{opacity:.72}
