:root{--ink:#3c4338;--muted:#7a7468;--paper:#e7e0d0;--line:#3c4338;--green:#4e6356;--orange:#9a5344;--yellow:#c4a36a}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:"Microsoft JhengHei","PingFang TC",sans-serif}button{font:inherit;cursor:pointer}button:focus-visible{outline:3px solid var(--orange);outline-offset:4px}.app{max-width:1450px;margin:auto;padding:27px 40px 18px}.masthead,.brand,.header-right,.dashboard,.panel-heading,.control-bar,.side-heading,footer{display:flex;align-items:center}.masthead{justify-content:space-between;margin-bottom:24px}.brand{gap:13px}.brand-mark{display:grid;place-items:center;background:var(--orange);color:#fff7e4;width:52px;height:58px;border-radius:8px;font-size:34px;font-weight:900;transform:rotate(-4deg)}.eyebrow{font:10px monospace;letter-spacing:2px;color:var(--muted);margin-bottom:4px}h1{font-size:28px;margin:0;letter-spacing:2px}h1 span{color:var(--orange)}.header-right{gap:12px}.solo{font-size:12px;color:var(--muted);margin-right:8px}.icon-button{border:1px solid var(--line);border-radius:8px;background:transparent;padding:9px 12px;font-size:12px;color:var(--ink)}kbd{font-family:inherit;font-size:11px;border:1px solid #d8dacc;border-bottom-width:2px;background:#faf9f2;padding:3px 5px;border-radius:4px;color:#596251}.dashboard{background:#e8ebdf;border:1px solid #d9dfd0;border-radius:13px;padding:16px 24px;gap:34px;margin-bottom:20px;min-height:88px}.shift{display:flex;align-items:center;gap:14px;min-width:140px}.live-dot,.tiny-dot{background:#79956b;border-radius:50%;width:9px;height:9px;display:inline-block}.live-dot{box-shadow:0 0 0 5px #d7e1cc}.dashboard small{display:block;font-size:11px;color:#71806c;margin-bottom:5px;letter-spacing:1px}.dashboard strong{font-size:26px;font-variant-numeric:tabular-nums;letter-spacing:1px}.metric{border-left:1px solid #ccd4c2;padding-left:30px;min-width:110px}.currency,.unit{font-size:14px;margin:0 5px;color:#7b8972}.shift-note{margin-left:auto;text-align:right}.shift-note span{font:10px monospace;letter-spacing:1px;color:#87917f}.shift-note p{margin:7px 0 0;font-size:12px}.play-layout{display:grid;grid-template-columns:minmax(0,1fr) 282px;gap:22px}.kitchen-panel{background:#fcfbf7;border:1px solid var(--line);border-radius:13px;overflow:hidden;align-self:start;box-shadow:0 4px 18px #293d3805}.panel-heading{justify-content:space-between;font-size:12px;padding:15px 20px;color:#727c6c}.tiny-dot{width:6px;height:6px;margin-right:7px}.canvas-wrap{position:relative;background:#263f39;line-height:0}canvas{width:100%;height:auto;display:block}.control-bar{gap:18px;justify-content:center;flex-wrap:wrap;padding:18px 10px;font-size:11px;color:#7d8377}.control-bar span{white-space:nowrap}.control-bar kbd{margin-right:3px}aside{display:flex;flex-direction:column;gap:18px}.orders-panel,.recipe-panel{background:#fcfbf7;border:1px solid var(--line);padding:20px;border-radius:13px}.side-heading{justify-content:space-between}.side-heading h2{margin:0;font-size:16px}.side-heading>span{font-size:11px;color:var(--muted)}.section-subtitle{font-size:11px;color:var(--muted);margin:8px 0 19px}.order{border:1px solid #e5dfcf;border-radius:8px;padding:13px;margin-top:11px;background:#fffdf8}.order-head{display:flex;justify-content:space-between;font-size:10px;color:#8d897a}.order-head b{color:var(--orange);font-weight:500}.order h3{font-size:16px;margin:10px 0 6px}.order p{font-size:10px;margin:0 0 12px;color:#8a8d80}.order-bottom{display:flex;justify-content:space-between;font-size:10px;color:#7d8775}.progress-track{height:4px;background:#ecece3;border-radius:4px;margin:8px 0 0;overflow:hidden}.progress-track i{height:100%;display:block;background:#85a27b;transition:width .15s}.order.urgent{border-color:#d88161}.order.urgent .progress-track i{background:#d65c36}.empty-orders{padding:30px 6px;text-align:center;color:#99a08f;font-size:12px;line-height:1.8;border:1px dashed #dde1d3;border-radius:8px}.small-action{border:0;background:#e9eee1;border-radius:6px;color:var(--green);width:100%;padding:11px;font-size:11px;margin-top:14px}.recipe{display:flex;gap:11px;align-items:center;padding:18px 0;border-bottom:1px solid #eeeade}.dish-icon{width:37px;height:37px;display:grid;place-items:center;border-radius:50%;font-size:26px}.green{background:#e4eddb;color:#5b8358}.yellow{background:#f6e9c5;color:#c5943e}.recipe strong{font-size:12px}.recipe em{font-size:10px;color:#95917f;font-style:normal;margin-left:5px}.recipe p{font-size:10px;color:#969486;margin:7px 0 0}.chef-note{padding:16px 0 0}.chef-note strong{font-size:11px;color:#8e835e}.chef-note p{font-size:11px;color:#96917e;line-height:1.9;margin:7px 0 0}footer{justify-content:space-between;font-size:10px;color:#a1a294;margin-top:20px;letter-spacing:1px}#toast{position:absolute;top:14px;left:50%;transform:translateX(-50%);line-height:1.5;max-width:90%;width:max-content;border-radius:8px;background:#fcf7e9f2;color:#4b5544;padding:11px 18px;font-size:13px;pointer-events:none;opacity:0;transition:opacity .2s;box-shadow:0 3px 14px #0002}#toast.show{opacity:1}#interaction{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);line-height:1.6;font-size:12px;color:#fff9e8;background:#1e322dec;padding:8px 15px;border-radius:7px;pointer-events:none;white-space:nowrap;max-width:96%}#interaction:empty{display:none}.overlay{position:fixed;inset:0;background:#172e28b8;backdrop-filter:blur(7px);display:grid;place-items:center;z-index:10;padding:20px;overflow:auto}.modal{max-width:570px;width:100%;background:#f8f5ec;border:1px solid #fdfbf3;border-radius:19px;padding:35px;text-align:center;box-shadow:0 30px 100px #102b2966}.modal-kicker{font-size:11px;letter-spacing:4px;color:#a38a5a}.modal-symbol{margin:23px auto 17px;width:74px;height:74px;background:var(--orange);color:#fff3ce;border-radius:16px;font-size:49px;font-weight:bold;transform:rotate(-5deg);line-height:74px}.modal h2{font-size:23px;line-height:1.6;margin:14px 0}.intro{font-size:13px;color:#848775;line-height:1.9}.welcome-steps{display:flex;gap:12px;border-top:1px solid #e4e4d6;border-bottom:1px solid #e4e4d6;padding:20px 0;margin:25px 0}.welcome-steps>div{flex:1}.welcome-steps b{display:block;font:12px monospace;color:#bb9a65;margin-bottom:9px}.welcome-steps strong{display:block;font-size:13px}.welcome-steps span{font-size:10px;line-height:1.8;display:block;color:#93927f;margin-top:7px}.primary{width:100%;background:var(--green);border:0;color:#fff9ea;border-radius:9px;padding:16px 20px;font-size:14px;font-weight:bold}.primary:hover{background:#356d57}.primary span{float:right}.secondary{width:100%;background:transparent;color:#888c79;border:1px solid #d6dacd;margin-top:12px;border-radius:8px;padding:12px;font-size:12px}.modal-foot{font-size:10px;color:#9b9c89;line-height:1.9;margin:17px 0 0}.hidden{display:none!important}.stars{font-size:39px;letter-spacing:8px;color:#d99f40;margin-top:18px}#result-stats{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:22px 0}#result-stats div{background:#edeedf;border-radius:8px;padding:14px}#result-stats span{display:block;font-size:11px;color:#838b74}#result-stats strong{display:block;font-size:23px;margin-top:5px}#best-record{font-size:11px;color:#8b917d;margin:15px 0 22px}@media(min-width:1500px){.app{padding-top:40px}}@media(max-width:1000px){.app{padding:18px}.play-layout{grid-template-columns:minmax(0,1fr) 240px;gap:14px}.dashboard{gap:15px;padding:15px}.metric{padding-left:16px;min-width:85px}.shift-note{display:none}.solo{display:none}.orders-panel,.recipe-panel{padding:15px}.control-bar{gap:9px}.header-right{gap:5px}}@media(max-width:720px){.play-layout{grid-template-columns:1fr}aside{display:grid;grid-template-columns:1fr 1fr;gap:10px}.app{padding:12px}.brand-mark{width:38px;height:43px;font-size:28px}h1{font-size:20px}.eyebrow{font-size:8px}.dashboard{gap:12px;padding:12px}.dashboard strong{font-size:20px}.shift{min-width:95px}.metric{min-width:0;padding-left:12px}.dashboard small{font-size:9px}.header-right kbd{display:none}.icon-button{padding:8px}.modal{padding:25px}.modal h2{font-size:20px}footer{font-size:9px;letter-spacing:0}}
@media(min-width:1001px) and (max-height:850px){.app{padding:16px 28px 10px;max-width:calc((100dvh - 285px)*1.6 + 360px)}.masthead{margin-bottom:14px}.brand-mark{height:48px}.dashboard{margin-bottom:14px;min-height:72px;padding:10px 18px;gap:20px}.metric{padding-left:20px;min-width:85px}.shift{min-width:120px}.panel-heading{padding:11px 16px}.control-bar{padding:12px 8px;gap:10px}.orders-panel,.recipe-panel{padding:14px}.recipe{padding:12px 0}.chef-note{padding-top:10px}footer{margin-top:10px}.shift-note{display:none}}
/* Version 0.2: level selection, independent wok status, and four-dish menu. */
button:disabled { cursor: default; opacity: .5; }
canvas:focus { outline: none; }
canvas:focus-visible { outline: 2px solid #eebd58; outline-offset: -3px; }
.level-modal { max-width: 760px; max-height: calc(100dvh - 36px); overflow-y: auto; padding: 25px 30px; }
.level-modal h2 { font-size: 22px; margin: 10px 0; }
.level-modal .intro { margin: 6px 0 20px; }
.level-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: left; }
.level-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border: 1px solid #dcddcf; border-radius: 11px; padding: 16px 13px; background: #eeeee2; color: #68735e; text-align: left; transition: background .15s, border-color .15s; }
.level-card:hover { background: #e7eada; }
.level-card.selected { background: #e2ead8; border: 2px solid #65815c; padding: 15px 12px; }
.level-card .night-number { font: 10px monospace; letter-spacing: 2px; color: #a0804f; }
.level-card strong { font-size: 16px; color: #304d3d; }
.level-card > span:not(.night-number):not(.level-stars) { font-size: 11px; }
.level-card small { font-size: 10px; color: #8b917b; }
.level-stars { font-size: 21px; letter-spacing: 3px; color: #bb8b3b; }
.level-brief { display: flex; flex-direction: column; gap: 8px; padding: 16px 8px 0; min-height: 69px; }
.level-brief strong { font-size: 12px; line-height: 1.8; font-weight: 500; }
.level-brief span { font-size: 10px; color: #968664; }
.level-modal .welcome-steps { margin: 13px 0; padding: 12px 0; }
.level-modal .welcome-steps b { margin-bottom: 5px; }
.level-modal .modal-foot { margin-top: 12px; }
.text-button { display: block; margin: 17px auto 0; border: 0; background: transparent; font-size: 12px; color: #7b826b; text-decoration: underline; text-underline-offset: 4px; }
.wok-status { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #e6e8dc; background: #eeefe4; min-height: 44px; }
.wok-chip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: #e3e7d7; border-radius: 5px; padding: 6px 8px; color: #6f7d62; font-size: 10px; }
.wok-chip b { font-size: 10px; white-space: nowrap; }
.wok-chip span { line-height: 1.6; }
.wok-chip.cooking { background: #f2e5c8; color: #8a703c; }
.wok-chip.ready { background: #eec69f; color: #764525; }
.wok-chip.burned { background: #d6c6b8; color: #6b4e3f; }
.wok-chip.measure { background: #e5f3ea; color: #245744; }
.wok-chip.measure.over { background: #f6ddd4; color: #8a3e2c; }
.wok-chip.measure span { white-space: normal; }
.recipe > div { flex: 1; }
.recipe p { line-height: 1.8; }
.recipe small { display: block; margin-top: 5px; font-size: 9px; color: #959889; }
.dish-icon { flex-shrink: 0; }
.brown { background: #eddece; color: #a16c50; }
.amber { background: #f0dfbd; color: #ba8a47; }
aside { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #c6ceba transparent; padding-right: 3px; }
.orders-panel,.recipe-panel { flex-shrink: 0; }
.modal:not(.level-modal) { max-height: calc(100dvh - 36px); overflow-y: auto; }
@media (min-width: 1001px) and (max-height: 850px) {
  .app { max-width: calc((100dvh - 337px)*1.6 + 360px); min-width: 910px; }
  .solo { display: none; }
  aside { max-height: calc(100dvh - 210px); }
  .wok-status { padding: 7px 9px; }
  .wok-chip { display: block; }
  .wok-chip b { margin-right: 6px; }
  .control-bar { font-size: 10px; gap: 6px; }
  .order { padding: 10px; }
  .order h3 { margin: 8px 0 5px; }
}
@media (min-width: 1001px) and (min-height: 851px) { aside { max-height: calc(100dvh - 265px); } }
@media (max-width: 720px) {
  .level-list { grid-template-columns: 1fr; gap: 8px; }
  .level-card { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
  .level-modal { padding: 20px; }
  .wok-status { flex-wrap: wrap; }
  .wok-chip { min-width: 160px; }
  .recipe-panel { min-width: 0; }
}
/* Warm enamel, receipt paper and original dish illustrations. */
.dish-art { width: 64px; height: 52px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 3px 2px #475b3810); }
.recipe { gap: 8px; }
.canvas-wrap { background: #233c40; }
.kitchen-panel { border-color: #c7cdb9; box-shadow: 0 5px 0 #dfe2d2, 0 12px 32px #334d3809; }
.panel-heading { background: #f6f2e4; border-bottom: 1px solid #e1dfca; }
.order { border-radius: 5px 5px 9px 9px; border-top: 3px solid #cfa46c; background: linear-gradient(90deg, #fbf7e9, #fffdf5); }
.order.urgent { border-top-color: #c26c45; }
.orders-panel { background: #f9f6ec; }
.side-heading h2 { letter-spacing: 1px; }
.recipe-panel { background: #f3f1e6; }
.brand-mark { border: 2px solid #ac5439; box-shadow: inset 0 0 0 3px #eb987355; }
#toast { top: 70px; border: 1px solid #dfc99f; background: #fff4dbf2; }
#interaction { bottom: 48px; background: #294b3bf2; border: 1px solid #9eb18c; }
@media (max-width: 1000px) { .dish-art { width: 52px; height: 44px; } }

.origin-open { display: block; margin: 0 auto 10px; }
.origin-modal { width: min(680px, 94vw); max-height: 92vh; overflow-y: auto; }
.origin-scene { display: flex; align-items: center; gap: 20px; text-align: left; padding: 22px; margin: 18px 0; border-radius: 12px; background: #29433e; color: #fff0cb; border-top: 8px solid #c68b64; }
.origin-scene strong { font-size: 24px; letter-spacing: 4px; }
.origin-scene p { margin: 8px 0 0; font-size: 14px; color: #e3dcc4; }
.origin-lantern { background: #b9563c; border: 2px solid #e5b87d; border-radius: 40%; padding: 16px 10px; font-size: 28px; }
.origin-steam { margin-left: auto; font-size: 42px; }
.origin-dialogue { display: flex; gap: 18px; text-align: left; padding: 22px; border: 3px double #8c9b83; border-radius: 10px; background: #fff9e9; min-height: 160px; }
.origin-portrait { display: grid; place-items: center; flex: 0 0 58px; height: 68px; border-radius: 12px; background: #dbe2cc; color: #345348; font-size: 28px; border: 2px solid #9eac90; }
.origin-lines strong { color: #995535; font-size: 16px; }
.origin-lines p { font-size: 18px; line-height: 1.85; margin: 10px 0 0; }
.origin-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.origin-controls button { width: auto; margin: 0; padding: 12px 20px; }
.origin-controls span { color: #687965; font-size: 13px; }
.origin-controls button:disabled { opacity: .4; cursor: default; }
@media (max-width: 520px) { .origin-dialogue { padding: 14px; gap: 10px; } .origin-portrait { flex-basis: 38px; height: 48px; font-size: 22px; } .origin-lines p { font-size: 16px; } .origin-steam { display: none; } }

/* Original chibi portraits, kept proportional beside dialogue. */
.origin-portrait { flex: 0 0 112px; height: auto; align-self: flex-start; overflow: hidden; background: #e8e7cb; }
.origin-portrait img { display: block; width: 100%; height: auto; }
.origin-lines { min-width: 0; }
@media (max-width: 520px) { .origin-portrait { flex-basis: 72px; height: auto; } }

.course-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.course-tabs button { padding:10px 14px; border:1px solid #bdcbb6; background:#f4f0e3; border-radius:8px; color:#365847; }
.course-tabs button.selected { background:#295747; color:#fff9ea; }
#start:disabled { opacity:.5; cursor:default; }

/* Career mode: weekly choices, stat meters and chef cards. */
.welcome-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 10px; }
.welcome-links .origin-open { margin: 0; }
.career-modal { width: min(720px, 94vw); max-width: 720px; max-height: calc(100dvh - 36px); overflow-y: auto; text-align: left; }
.career-modal > .modal-kicker, .career-modal > h2, .career-week { text-align: center; }
.career-week { margin: -6px 0 14px; color: #a0804f; font-size: 13px; letter-spacing: 2px; }
.career-status { padding: 12px 14px; border-radius: 10px; background: #eeefe4; }
.stat-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 18px; }
.stat-row { display: grid; grid-template-columns: 36px 1fr 28px; align-items: center; gap: 8px; font-size: 12px; color: #4c6152; }
.stat-row b { text-align: right; font-size: 12px; }
.meter { height: 8px; border-radius: 4px; background: #d8dccb; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, #d9a54f, #d65c36); border-radius: 4px; }
.career-message { min-height: 1.6em; margin: 12px 0 6px; color: #7b5a33; font-size: 13px; line-height: 1.7; }
.career-actions, .career-choices, .career-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.career-option { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 13px 14px; border: 1px solid #d3d8c6; border-radius: 10px; background: #f4f0e3; color: #4c6152; text-align: left; }
.career-option:hover { background: #e7eada; }
.career-option.selected { background: #e2ead8; border: 2px solid #65815c; padding: 12px 13px; }
.career-option strong { font-size: 15px; color: #304d3d; }
.career-option span { font-size: 12px; line-height: 1.6; }
.career-option small, .career-warn { color: #b0532f; font-size: 11px; }
.career-warn { display: block; margin: 10px 0 6px; }
.career-note, .career-empty, .career-intro p, .career-exam p { font-size: 13px; line-height: 1.8; color: #5f6c5b; }
.career-heading, .career-exam h3 { font-size: 15px; color: #304d3d; margin: 20px 0 10px; }
.career-exam small, .chef-card small { display: block; margin: 10px 0 14px; font-size: 11px; color: #968664; line-height: 1.6; }
.career-scene { margin: 6px 0 12px; }
.career-scene strong { font-size: 18px; letter-spacing: 2px; }
.career-choices { margin-top: 14px; }
.career-result { text-align: center; }
.career-result .stars { font-size: 26px; letter-spacing: 4px; color: #bb8b3b; }
.career-result p { font-size: 13px; color: #5f6c5b; margin: 4px 0 12px; }
.chef-cards { display: grid; gap: 10px; }
.chef-card { padding: 14px 16px 2px; border-radius: 12px; background: #fff9e9; border: 3px double #c9ae7c; }
.chef-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.chef-card-head strong { font-size: 17px; color: #995535; }
.chef-card-head span { font-size: 12px; padding: 2px 10px; border-radius: 10px; background: #295747; color: #fff9ea; }
.career-name { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; font-size: 12px; color: #5f6c5b; }
.career-name input { font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #bdcbb6; border-radius: 8px; background: #fffdf5; color: var(--ink); }
.career-card-actions { margin-top: 14px; }
.career-card-actions:empty { display: none; }
.career-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 22px; }
.career-links .text-button { margin: 17px 0 0; }
.career-modal .modal-foot { text-align: center; }
.chef-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 8px 0; }
.chef-picker-label { font-size: 11px; letter-spacing: 2px; color: #a0804f; }
.chef-picker button { display: flex; flex-direction: column; align-items: flex-start; padding: 7px 12px; border: 1px solid #bdcbb6; border-radius: 8px; background: #f4f0e3; color: #365847; font-size: 13px; }
.chef-picker button small { font-size: 10px; color: #968664; }
.chef-picker button.selected { background: #295747; color: #fff9ea; }
.chef-picker button.selected small { color: #e8d9ae; }
.copy-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin: -8px 0 16px; }
.copy-row .small-action { width: auto; margin: 0; padding: 9px 16px; }
#copy-status { font-size: 11px; color: #65815c; }
.copy-fallback { display: block; width: 100%; margin: 0 0 16px; padding: 10px; font: 11px/1.7 monospace; color: var(--ink); background: #fffdf5; border: 1px solid #d6dacd; border-radius: 8px; resize: vertical; }
.chef-picker p { flex-basis: 100%; margin: 2px 0 0; font-size: 11px; color: #968664; }
@media (max-width: 520px) { .career-modal { padding: 18px 16px; } .stat-bars, .career-actions, .career-choices, .career-slots { grid-template-columns: 1fr; } }

/* On-screen controls. Same E / hold-F channel as the keyboard. */
html, body { overscroll-behavior: none; }
body.touch-active { touch-action: manipulation; }
.canvas-wrap, #game, #touch-controls, #touch-controls button { touch-action: none; -webkit-user-select: none; user-select: none; }
body.playing .kitchen-panel { touch-action: none; }
#toast, #interaction { z-index: 5; }
#touch-controls[hidden] { display: none !important; }
#touch-controls {
  display: none;
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  padding: 28px 10px 10px;
  pointer-events: none;
  background: linear-gradient(180deg, #1e322d00, #1e322de0 36%);
}
body.touch-active #touch-controls { display: flex; }
#touch-controls button {
  pointer-events: auto;
  margin: 0;
  padding: 0;
  border: 2px solid #e5b87d;
  background: #f6f1e4e6;
  color: #295747;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 0 #1a2e28;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
#touch-controls button.held {
  background: #eebd58;
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1a2e28;
}
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 5px;
}
#touch-up { grid-column: 2; grid-row: 1; }
#touch-left { grid-column: 1; grid-row: 2; }
#touch-right { grid-column: 3; grid-row: 2; }
#touch-down { grid-column: 2; grid-row: 3; }
.dpad button { width: 52px; height: 52px; border-radius: 12px; font-size: 18px; }
.dpad-hub {
  grid-column: 2; grid-row: 2;
  display: grid; place-items: center;
  color: #fff3d2;
  font-weight: 900;
  font-size: 18px;
  pointer-events: none;
  opacity: .85;
}
.action-pad { display: flex; align-items: flex-end; gap: 10px; }
#touch-e, #touch-f {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 50%; gap: 2px;
}
#touch-e { width: 72px; height: 72px; background: #295747e6; color: #fff9ea; border-color: #9eb18c; font-size: 26px; }
#touch-f { width: 88px; height: 88px; background: #d65c36e8; color: #fff7e4; border-color: #f0c27a; font-size: 30px; }
#touch-e small, #touch-f small { font-size: 11px; font-weight: 700; letter-spacing: 1px; }
#touch-f.held { background: #eebd58; color: #6a341f; }
body.touch-active .keys-hint { display: none; }
body:not(.touch-active) .touch-hint { display: none; }
body.touch-active .touch-hint { color: #6d7464; }
body.touch-active .icon-button, body.touch-active .small-action { min-height: 44px; }
@media (max-width: 820px) {
  #interaction { white-space: normal; text-align: center; }
  body.touch-active #interaction { max-width: min(46%, 280px); bottom: 16px; }
}
@media (max-width: 820px) and (orientation: portrait), (max-width: 560px) {
  body.touch-active #touch-controls {
    position: fixed;
    z-index: 6;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    background: #243f39f5;
    border-top: 3px solid #c68b64;
    box-shadow: 0 -10px 28px #10241fcc;
  }
  body.touch-active .app { padding-bottom: calc(220px + env(safe-area-inset-bottom)); }
  body.touch-active #open-early:not(.hidden) {
    position: fixed;
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(200px + env(safe-area-inset-bottom));
    z-index: 7;
    margin: 0;
  }
  body.touch-active .control-bar { display: none; }
  body.touch-active #interaction { max-width: 92%; bottom: 10px; }
  body.touch-active .masthead { margin-bottom: 10px; }
  body.touch-active .dashboard { margin-bottom: 10px; padding: 10px 12px; gap: 10px; min-height: 0; }
}
@media (max-width: 380px) {
  .dpad { grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 46px); gap: 4px; }
  .dpad button { width: 46px; height: 46px; }
  #touch-e { width: 64px; height: 64px; font-size: 22px; }
  #touch-f { width: 76px; height: 76px; font-size: 26px; }
  .action-pad { gap: 8px; }
  body.touch-active #touch-controls { padding-left: 8px; padding-right: 8px; }
}

/* v0.15 watercolor sheet. Double ink mat, paper grain, sage washes — same language as the kitchen. */
body{
  background-color:#efe4d2;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .36  0 0 0 0 .32  0 0 0 0 .26  0 0 0 .14 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(ellipse at 0% 0%, #f7f1e4 0%, transparent 46%),
    radial-gradient(ellipse at 100% 80%, #d5e4d6aa 0%, transparent 42%),
    radial-gradient(ellipse at 70% 0%, #f3e0c8aa 0%, transparent 36%);
}
h1::after,.level-modal h2::after{
  content:"";
  display:block;
  width:128px;
  height:14px;
  margin:6px auto 0;
  background:center/contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 14'><path d='M8 8c18-6 28 4 40-1 10-4 16 3 28 0 14-4 22 5 36-1' fill='none' stroke='%238d6840' stroke-width='1'/><path d='M58 8c-6-7-2-9 2-11 3 4 8 2 10-2-2 6 2 8 0 12-4-2-8 1-12 1z' fill='%237f9a86'/></svg>");
}
h1 span{color:#9a5344}
.brand-mark{
  background:#f4ecd8;
  color:#9a5344;
  border:2px solid #3c4338;
  border-radius:12px 16px 9px 14px;
  box-shadow:3px 3px 0 #3c433822, inset 0 0 0 3px #c4a36a66;
}
.eyebrow,.shift-note span,.modal-kicker{color:#7a7468}
.icon-button,.secondary,.text-button,.small-action{
  background:#f4ecd8;
  color:#3c4338;
  border:1.5px solid #3c4338;
  border-radius:10px 12px 8px 13px;
  box-shadow:2px 2px 0 #3c433814;
}
.small-action{background:#e7eee4}
kbd{background:#f4ecd8;border-color:#3c4338;color:#3c4338}
.dashboard{
  background:#f3ead8;
  border:1.5px solid #3c4338;
  border-radius:16px 12px 18px 14px;
  box-shadow:3px 4px 0 #3c433812;
}
.dashboard small,.metric{color:#6a6458}
.metric{border-left-color:#cfc6b4}
.live-dot,.tiny-dot{background:#6e8a74}
.live-dot{box-shadow:0 0 0 5px #d5e0d4}
.kitchen-panel,.orders-panel,.recipe-panel{
  background:#f7f1e4;
  border:2px solid #3c4338;
  border-radius:18px 14px 16px 20px;
  box-shadow:4px 5px 0 #3c433814;
}
.canvas-wrap{background:#e4dcc8}
.panel-heading{background:#efe6d4;border-bottom:1.5px solid #3c4338;color:#5c564c}
.control-bar{color:#6a6458}
.order{
  background:#fbf6ea;
  border:1.5px solid #3c4338;
  border-top:4px solid #c4a36a;
  border-radius:3px 3px 12px 10px;
}
.order.urgent{border-color:#9a5344;border-top-color:#9a5344}
.order-head b,.stars,.level-stars,.career-result .stars{color:#a68455}
.empty-orders{border:1.5px dashed #3c4338;color:#7a7468;background:#f4ecd866}
.progress-track{background:#e4dcc8}
.progress-track i{background:#6e8a74}
.order.urgent .progress-track i{background:#9a5344}
.recipe{border-bottom-color:#e0d6c4}
.dish-icon.green{background:#e3eee0;color:#4e6356}
.dish-icon.yellow{background:#f3e6cc;color:#8a6a3a}
.brown{background:#eadcc8;color:#8a5a42}
.amber{background:#f0e4cc;color:#8a6a3a}
.chef-note strong{color:#6d5b40}
.modal{
  background:#f7f1e4;
  border:2px solid #3c4338;
  border-radius:18px 22px 16px 20px;
  box-shadow:6px 8px 0 #3c433818;
}
.modal-symbol{
  background:#f4ecd8;
  color:#9a5344;
  border:2px solid #3c4338;
  box-shadow:inset 0 0 0 3px #c4a36a55;
}
.primary,.course-tabs button.selected,.chef-picker button.selected,.chef-card-head span{
  background:#4e6356;
  color:#f7f1e4;
  border:2px solid #2f3a34;
  border-radius:12px 10px 14px 11px;
  box-shadow:2px 3px 0 #2f3a3422;
}
.primary:hover{background:#3f5348}
.course-tabs button,.level-card,.career-option,.chef-picker button,.career-name input,#copy-fallback{
  background:#f4ecd8;
  color:#3c4338;
  border:1.5px solid #3c4338;
  border-radius:12px 14px 10px 13px;
}
.level-card:hover,.career-option:hover{background:#efe6d4}
.level-card.selected,.career-option.selected{
  background:#e4eee4;
  border:2px solid #4e6356;
}
.level-card strong,.career-option strong,.career-heading,.career-exam h3{color:#3c4338}
.level-card .night-number,.career-week,.chef-picker-label,.level-brief span{color:#8a6a3a}
.welcome-steps{border-color:#d9d0bc}
.welcome-steps b{color:#a68455}
#result-stats div,.career-status,.wok-status{background:#efe6d4}
.wok-status{border-bottom:1.5px solid #3c4338}
.wok-chip{background:#e7eee4;color:#3c4338;border:1px solid #3c433855;border-radius:8px}
.wok-chip.cooking{background:#f3e6cc;color:#6d5336}
.wok-chip.ready{background:#f0d7c0;color:#6d3f30}
.wok-chip.burned{background:#e4d5c8;color:#5c463c}
.wok-chip.measure{background:#e3efe6;color:#2c4a3c}
.wok-chip.measure.over{background:#f3ddd4;color:#7a3e30}
.meter{background:#ddd4c4}
.meter i{background:linear-gradient(90deg,#c4a36a,#9a5344)}
.chef-card{background:#fbf6ea;border:3px double #3c4338}
.chef-card-head strong,.origin-lines strong{color:#8d4638}
.origin-scene{
  background:#efe6d4;
  color:#3c4338;
  border:2px solid #3c4338;
  border-top:8px solid #9a5344;
}
.origin-scene p{color:#5c564c}
.origin-lantern{background:#a85a48;border-color:#c4a36a;color:#f7f1e4}
.origin-dialogue{background:#fbf6ea;border:3px double #3c4338}
.origin-portrait{background:#efe6d4;border-color:#3c4338;color:#4e6356}
#toast{background:#fbf6eaf2;border:1.5px solid #3c4338;color:#3c4338}
#interaction{background:#3c4338ee;border:1.5px solid #c4a36a;color:#f7f1e4}
.overlay{background:#3c4338b0}
canvas:focus-visible,button:focus-visible{outline-color:#a68455}
#touch-controls{background:linear-gradient(180deg,#3c433800,#3c4338d0 40%)}
#touch-controls button{
  border:2px solid #3c4338;
  background:#f4ecd8ee;
  color:#3c4338;
  box-shadow:2px 3px 0 #2a312c;
}
#touch-e{background:#4e6356ee;color:#f7f1e4;border-color:#2f3a34}
#touch-f{background:#9a5344ee;color:#f7f1e4;border-color:#6d3a30}
#touch-controls button.held,#touch-f.held{background:#e7d3a4;color:#3c4338}
.dpad-hub{color:#f4ecd8}
body.touch-active #touch-controls{border-top-color:#c4a36a;background:#3c4338f2}
footer{color:#7a7468}
.dish-art{filter:drop-shadow(1px 2px 0 #3c433822)}
.text-button,.welcome-links .origin-open,.career-links .text-button{
  background:transparent;
  border:0;
  box-shadow:none;
  color:#4e6356;
  text-decoration:underline;
  text-underline-offset:4px;
}
/* Mounted watercolor sheet: inner rule, wash corners, ticket orders. */
.brand-mark{
  width:54px;height:54px;border-radius:50%;
  background:
    radial-gradient(circle at 40% 35%, #fffaf2, #f4e6d0 70%);
  box-shadow:inset 0 0 0 2px #c4a15a, inset 0 0 0 5px #f7f1e4, inset 0 0 0 6.5px #3a4238;
  transform:none;
}
.kitchen-panel,.orders-panel,.recipe-panel,.modal,.dashboard{
  background:
    radial-gradient(ellipse at 0 0, #e7f0e6 0%, transparent 42%),
    radial-gradient(ellipse at 100% 100%, #f6e6d0 0%, transparent 46%),
    #f7f1e4;
  border:1.5px solid #3a4238;
  box-shadow:
    inset 0 0 0 5px #f7f1e4,
    inset 0 0 0 6px #3a423855,
    3px 4px 0 #3a423814;
}
.modal{box-shadow:inset 0 0 0 6px #f7f1e4, inset 0 0 0 7px #3a423866, 0 24px 60px #3a423840}
.order{
  position:relative;
  background:#fbf6ea;
  border:1px solid #3a4238;
  border-left:4px solid #8fa898;
  border-top:1px solid #3a4238;
  border-radius:2px 10px 10px 2px;
  box-shadow:2px 3px 0 #3a423812;
}
.order::before{
  content:"";
  display:block;
  height:7px;
  margin:-13px -13px 10px;
  background:radial-gradient(circle at 6px -2px, transparent 3px, #c4a15a 3.5px) left top / 12px 7px repeat-x;
}
.order.urgent{border-color:#a85c48;border-left-color:#a85c48;border-top-color:#a85c48}
.level-card,.career-option{
  background:
    linear-gradient(#fbf6ea, #fbf6ea) padding-box,
    linear-gradient(180deg, #c4a15a, #3a4238) border-box;
  border:1.5px solid transparent;
  box-shadow:inset 0 10px 0 #f3e6cc;
}
.primary{
  background:linear-gradient(180deg, #7f9a86, #4e6356);
  box-shadow:inset 0 1px 0 #e7f0e4, 2px 3px 0 #2f3a3422;
}
.panel-heading{
  background:linear-gradient(180deg, #f7f1e4, #efe4d2);
  letter-spacing:1px;
}
.canvas-wrap{background:#f3e6cc}
.dish-art{filter:none}

/* Readable controls and labels, including the phone layout. */
.panel-heading,.control-bar,.dashboard small,.order-head,.order p,.order-bottom,.recipe strong,.recipe p,.recipe small,.chef-note strong,.chef-note p,.section-subtitle,.small-action,.intro,.secondary,.modal-foot,footer { font-size:14px; }
#interaction,#toast,.order h3,.recipe strong { font-size:16px; }
@media (max-width:720px) {
  .canvas-wrap { overflow-x:auto; }
  .canvas-wrap,#game { touch-action:pan-x; }
  #game { width:780px; max-width:none; }
  body.touch-active #interaction { position:sticky; left:0; bottom:0; transform:none; margin:0; max-width:100%; width:100%; padding:10px; }
  .panel-heading { font-size:14px; }
  aside { grid-template-columns:1fr; }
}
@media (max-width:720px) { body.playing .kitchen-panel { touch-action:auto; } }
@media (max-width:720px) {
  .canvas-wrap,#game { touch-action:pan-x pan-y pinch-zoom; }
  .kitchen-panel::before { content:'左右滑動查看廚房 · 上下滑動調整視野'; display:block; padding:8px 12px; font-size:14px; color:#405544; background:#f3ead8; }
}
#supply-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
#supply-options button { margin:0; min-height:52px; font-size:17px; background:#e9eddf; color:#314e3b; }
#supply-options button:disabled { opacity:.45; cursor:default; }
#supply-picker .modal { max-height:90dvh; overflow:auto; }
#supply-note { font-size:16px; }
#supply-options button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:112px; }
#supply-options .supply-icon { font-size:38px; line-height:1.2; font-family:'Segoe UI Emoji','Apple Color Emoji',sans-serif; }
#supply-options button:focus { outline:3px solid #a64c31; outline-offset:2px; background:#fff0ce; box-shadow:0 0 0 5px #a64c311a; }
.supply-help { font-size:14px; line-height:1.6; color:#52634d; }
.quantity-row{display:flex;justify-content:center;gap:14px;margin:20px 0}.quantity-row button{width:52px;height:52px;font-size:26px}.quantity-row input{width:90px;text-align:center;font-size:24px}

/* Home dinner: dish picker and step close-ups */
#dish-options { display:grid; gap:10px; margin:14px 0; }
#dish-options button { display:flex; flex-direction:column; align-items:flex-start; gap:4px; padding:12px 16px; text-align:left; }
#dish-options button.selected { outline:3px solid #a64c31; outline-offset:2px; background:#fff0ce; }
#dish-options small { color:#52634d; font-size:13px; }
#dish-options .short { color:#8a3e2c; }
.closeup-modal { max-width:640px; text-align:center; }
#closeup-stage { margin:22px 0 14px; }
.cu-track { position:relative; height:74px; border:2px solid #3c4338; border-radius:10px; background:#fbf6ea; overflow:hidden; }
.cu-track i { position:absolute; top:0; bottom:0; display:block; }
.cu-zone { background:#9fbf9a; }
.cu-fill { left:0; background:#c4a36a99; border-right:3px solid #9a5344; }
.cu-guide { width:0; border-left:3px dashed #4e6356; margin-left:-1.5px; }
.cu-cut { width:4px; margin-left:-2px; background:#9a5344; }
.cu-knife { width:6px; margin-left:-3px; background:#3c4338; box-shadow:0 0 0 3px #f7f1e4; }
.cu-score { font-size:34px; font-weight:700; color:#4e6356; margin:6px 0 0; }
#closeup-action { min-height:64px; width:100%; font-size:20px; touch-action:manipulation; }
.order .warmth { display:block; height:6px; margin-top:6px; border-radius:3px; background:#e3e7d7; overflow:hidden; }
.order .warmth b { display:block; height:100%; background:#c98a5b; }

/* v0.18.1 phone play: the kitchen view follows the chef (no sideways scrolling)
   and the on-screen buttons float over the kitchen on a see-through backing. */
body.camera-follow .kitchen-panel::before { content:none; display:none; }
body.camera-follow .canvas-wrap {
  overflow:hidden;
  height:clamp(300px, calc(100dvh - 230px), 606px);
  touch-action:pan-y;
}
body.camera-follow #game { width:780px; max-width:none; touch-action:pan-y; will-change:transform; }
body.camera-follow.playing .canvas-wrap, body.camera-follow.playing #game { touch-action:none; }
body.camera-follow.touch-active #interaction {
  position:absolute; left:8px; right:8px; width:auto; max-width:none; transform:none; margin:0;
  bottom:calc(var(--controls-overlap, 0px) + 8px);
  border-radius:8px; padding:8px 12px;
}
@media (max-width: 820px) and (orientation: portrait), (max-width: 560px) {
  body.touch-active #touch-controls {
    padding:3px 8px calc(3px + env(safe-area-inset-bottom));
    background:transparent;
    border-top:0;
    box-shadow:none;
  }
  body.touch-active .dpad {
    grid-template-columns:repeat(3, 46px); grid-template-rows:repeat(3, 46px); gap:4px;
    padding:3px; border-radius:16px;
    background:rgba(36,54,44,0.35);
  }
  body.touch-active .dpad button { width:46px; height:46px; }
  body.touch-active #touch-controls button { background:rgba(247,241,228,0.72); box-shadow:0 2px 0 rgba(26,46,40,0.45); }
  body.touch-active #touch-controls button.held { background:rgba(231,211,164,0.92); }
  body.touch-active #touch-e { width:66px; height:66px; background:rgba(78,99,86,0.78); }
  body.touch-active #touch-f { width:80px; height:80px; background:rgba(154,83,68,0.78); }
  body.touch-active #touch-e.held, body.touch-active #touch-f.held { background:rgba(231,211,164,0.92); color:#3c4338; }
  body.touch-active .action-pad { padding:3px; border-radius:48px; background:rgba(36,54,44,0.35); }
  body.touch-active .app { padding-bottom:calc(170px + env(safe-area-inset-bottom)); }
  body.touch-active #open-early:not(.hidden) { bottom:calc(166px + env(safe-area-inset-bottom)); }
}
