/* Reference-led scene-first game. No game/save schema changes. */
html:has(body.immersive){background:#18332c;overflow:hidden}
body.immersive{margin:0;overflow:hidden;background:radial-gradient(ellipse at 50% 20%,#52665a,#253f35 50%,#10271f);color:#50371f;font-family:Trebuchet MS,Arial,sans-serif}
.immersive [hidden]{display:none!important}
.immersive .app-shell{position:relative;width:min(100vw,620px);height:100dvh;max-height:1100px;min-height:480px;margin:auto;padding:0;border:5px solid #b08850;border-radius:30px;box-shadow:0 0 0 2px #edc695,inset 0 0 0 3px #254a3c,0 15px 80px #0008;overflow:hidden;background:#294c42}
.immersive .game-layout,.immersive .play-column{position:absolute;inset:0;display:block;width:100%;height:100%;margin:0;padding:0}
.immersive .play-column{isolation:isolate}
.immersive .scene-wrap{position:absolute;inset:0;width:100%;height:100%!important;min-height:0!important;margin:0;border:0;border-radius:24px;background:#294c42;box-shadow:none;overflow:hidden;z-index:0}
.immersive #scene{display:block;width:100%;height:100%;border-radius:24px}
.immersive .scene-wrap:after{content:'';position:absolute;inset:0;box-shadow:inset 0 0 35px #182f2940;pointer-events:none;border-radius:24px}
.immersive .topbar{position:absolute;z-index:9;right:13px;top:72px;height:auto;padding:0;margin:0;border:0;width:auto}
.immersive .brand,.immersive .save-state,.immersive .stage-name,.immersive .cafe-heading .eyebrow,.immersive #next-level,.immersive .orders-header,.immersive .bottom-note,.immersive .page-footer{display:none}
.immersive .top-actions{display:flex;gap:6px}
.immersive .top-actions button{border:1px solid #a77c44;background:linear-gradient(#fff1d9,#e6c598);color:#4b321c;box-shadow:inset 0 2px 0 #fff7e6,0 2px 5px #18281e50;min-width:40px;height:40px;padding:0 10px;border-radius:12px;font-size:13px;font-weight:700}
.immersive .cafe-heading{position:absolute;top:72px;left:14px;z-index:5;pointer-events:none;display:block;padding:0;margin:0;max-width:calc(100% - 205px)}
.immersive .cafe-heading h1{font-family:inherit;font-size:17px;line-height:1.2;font-weight:700;color:#fff1d1;text-shadow:0 2px 3px #183a2e;margin:9px 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.immersive .money-pill{pointer-events:auto;position:fixed;top:15px;right:max(20px,calc((100vw - 620px)/2 + 20px));height:43px;min-width:113px;display:flex;gap:9px;align-items:center;justify-content:center;margin:0;padding:4px 14px 4px 8px;border:2px solid #ab7841;border-radius:24px;background:linear-gradient(#fff6e4,#efd2a8);color:#3f2a18;font-size:24px;font-weight:800;box-shadow:inset 0 2px 0 #fff,0 3px 5px #172b2370}
.immersive .coin{width:29px;height:29px;border:2px solid #e69f20;border-radius:50%;background:radial-gradient(circle at 35% 25%,#ffe795,#f4b936 65%,#bd7515);box-shadow:inset 0 0 0 2px #ffe6a1;color:#9d5e09;display:grid;place-items:center;font-size:23px;font-weight:700}
.immersive .level-line{position:absolute;z-index:6;top:13px;left:14px;width:206px;height:47px;padding:7px 12px 7px 42px;border:2px solid #b38753;border-radius:17px;background:linear-gradient(#fff5e3,#ecd1a7);color:#49311d;box-shadow:inset 0 2px 0 #fff9ec,0 3px 4px #152f2460;margin:0;display:grid;grid-template-columns:1fr;gap:5px;align-content:center}
.immersive .hud-star{position:absolute;left:-13px;top:-12px;font-size:64px;line-height:1;color:#ffc849;text-shadow:-2px -1px #fff0a5,2px 2px #a46617,0 4px 3px #88531d80;filter:drop-shadow(0 1px 1px #5e3c17)}
.immersive .level-badge{font-size:14px;font-weight:800;line-height:1;color:#49311d}
.immersive .level-track{width:100%;height:9px;background:#d8b889;border:1px solid #b89561;border-radius:9px;box-shadow:inset 0 1px 2px #6c482c40}
.immersive #level-fill{height:100%;border-radius:8px;background:linear-gradient(#88b39a,#2a6757);box-shadow:inset 0 1px 0 #c0dbb3}
.immersive .story-card{position:absolute;z-index:5;top:123px;left:14px;width:calc(100% - 94px);margin:0;padding:7px 12px;border:1px solid #c5a06b;border-radius:13px;gap:9px;background:linear-gradient(110deg,#fff0d6f5,#e7c99bed);box-shadow:inset 0 1px 0 #fff6e3,0 2px 6px #23382c4d;color:#674324;min-height:49px}
.immersive .story-card:before{font-size:25px;color:#bf8c30}.immersive .story-card small{display:none}.immersive .story-card strong{font-size:12px;font-weight:800}.immersive .story-card em{font-size:10px;line-height:1.3;color:#775737;margin-top:3px}.immersive .story-card>b{font-size:10px;color:#826244}
.immersive .scene-note{top:auto;left:15px;bottom:249px;max-width:65%;font-size:9px;background:#2e5242d9;color:#ffedca;border:1px solid #c5a06a70;padding:5px 8px;pointer-events:none}
.immersive .camera-controls{top:122px;right:12px;display:grid;grid-template-columns:27px 27px;gap:4px;z-index:5}.immersive .camera-controls button{border-radius:9px;height:29px;width:27px;font-size:20px;background:linear-gradient(#fff1d5,#e3c28d);color:#533b22}.immersive .camera-controls #overview-btn{grid-column:1/3;width:58px;height:26px;font-size:9px;padding:0}
.immersive .scene-toolbar{left:9px;right:9px;bottom:9px;z-index:8;gap:5px;padding:5px;border:2px solid #ac8050;border-radius:20px;background:linear-gradient(#fff2d8,#e9c898);box-shadow:0 4px 7px #11251d70,inset 0 0 0 2px #ffe9c0}
.immersive .scene-toolbar button{min-height:64px;padding:6px 2px 7px;border:1px solid #b68a51;border-radius:13px;background:linear-gradient(#fff3d8,#edc99b);box-shadow:inset 0 2px 0 #fff9e9,0 2px 0 #a47b4770;font-size:13px;color:#55361e;font-weight:800;gap:2px}.immersive .scene-toolbar button svg{width:28px;height:28px;stroke-width:1.8}.immersive .scene-toolbar button.active{background:linear-gradient(#668d78,#244f43);border-color:#f2ce8f;color:#fff3d4;box-shadow:inset 0 2px 0 #a3bd99,0 2px 0 #173b2c}
.immersive .cat-chip{right:13px;bottom:244px;min-height:40px;border:1px solid #bb8d50;background:linear-gradient(#fff2d8,#e5c291);color:#674421;font-size:10px;padding:6px 9px;z-index:4;box-shadow:0 2px 6px #18332950}
.immersive .shift-bar{position:absolute;z-index:5;bottom:177px;left:14px;right:14px;margin:0;min-height:45px;display:flex;align-items:center;gap:7px;padding:6px 8px;background:#244b3fd9;border:1px solid #ceae7770;border-radius:12px;color:#ffedcf;box-shadow:0 2px 6px #1d392b40}.immersive .shift-bar>div{flex:1;min-width:0}.immersive .shift-bar .eyebrow{color:#d4ba8b;font-size:8px;letter-spacing:.5px}.immersive .shift-bar strong{color:#fff3d5;font-size:11px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.immersive .shift-bar small{display:none}.immersive .shift-bar .primary{padding:9px 13px;font-size:11px;min-height:38px;background:linear-gradient(#ffdda2,#d7a456);border:1px solid #ad7536;color:#583315;box-shadow:inset 0 2px 0 #ffefc8;white-space:nowrap}.immersive .shift-bar .secondary,.immersive .speed-button{min-height:34px;padding:7px 9px;border:1px solid #ba9964;background:#ffe8bc;color:#664728;border-radius:9px;font-size:10px}
.immersive .orders-strip{position:absolute;z-index:5;left:14px;right:14px;bottom:94px;height:72px;min-height:0;display:flex;gap:7px;overflow-x:auto;overscroll-behavior:contain;margin:0;padding:0 0 3px;scrollbar-width:thin;scrollbar-color:#bb9154 #253e2f66}.immersive .order-card{flex:0 0 138px;min-width:138px;max-width:160px;margin:0;padding:7px 10px;border:1px solid #ad854c;border-radius:12px;background:linear-gradient(#fff3d9,#e8cc9f);box-shadow:inset 0 1px 0 #fff8e8,0 2px 4px #22392b50;color:#5b4024;min-height:61px}.immersive .order-card .order-meta{font-size:8px}.immersive .order-card strong{font-size:11px}.immersive .order-card .order-action{font-size:9px}.immersive .order-card.eating{background:linear-gradient(#e6eed4,#c2d0a3);color:#405b35}.immersive .empty-orders{font-size:10px;color:#f8e8c8;background:#24483bd9;border:1px solid #bf9a6270;border-radius:12px;width:100%;min-height:61px;display:flex;align-items:center;justify-content:center;padding:9px;gap:8px}
.immersive .construction-bar{position:absolute;z-index:6;top:185px;left:14px;right:86px;max-width:380px;margin:0;padding:6px 9px;font-size:9px;background:#f4dfb8ec;border-color:#ac8049;box-shadow:0 2px 6px #1b322d40}
.immersive .management{position:absolute;z-index:15;left:12px;right:12px;top:185px;bottom:94px;width:auto;margin:0;border:2px solid #b48a51;border-radius:22px;background:linear-gradient(#fff0d6,#f2dfbd);box-shadow:0 15px 50px #102b25b0,inset 0 0 0 2px #fff5e1;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#b18b56 #f4e2bf}
.immersive .management-close{position:sticky;float:right;right:10px;top:10px;width:38px;height:38px;border-radius:50%;border:1px solid #b98e53;background:linear-gradient(#fff8e6,#e6c699);color:#654426;font-size:27px;z-index:3;margin:10px 10px -48px 0;box-shadow:0 2px 4px #6a4c2840}
.immersive .panel-heading{padding:20px 20px 10px}.immersive .panel-heading .eyebrow{font-size:9px;color:#947342}.immersive .panel-heading h2{font-size:23px;font-family:inherit;font-weight:700;color:#674523;letter-spacing:0;margin:7px 0}.immersive .panel-heading p{color:#876442;min-height:0;font-size:11px;margin-right:15px}.immersive .tabs{position:sticky;top:0;z-index:2;background:#f6e3c1;border-color:#c9aa7e}.immersive .tabs button{font-weight:700;color:#84613e}.immersive .tabs button.active{color:#284f40;border-color:#365d48}.immersive .panel-content{min-height:0;padding:15px 20px}.immersive .business-footer{background:#eddbb8;border-color:#d1b583}
.immersive .modal-backdrop{background:#122c25b8;backdrop-filter:blur(5px)}.immersive .modal{border:3px solid #b58b51;border-radius:25px;background:linear-gradient(140deg,#fff1d8,#edd4ad);box-shadow:0 15px 90px #071d18b0,inset 0 0 0 2px #ffefce;color:#573a21}.immersive .modal h2{font-family:inherit;font-weight:800;letter-spacing:-.5px;color:#315746}.immersive .modal p{color:#866440}.immersive .modal .primary{background:linear-gradient(#668d75,#2a5544);color:#fff2d4;border:1px solid #244f3d;box-shadow:inset 0 2px 0 #a4b598}.immersive .main-menu-art{background:radial-gradient(ellipse,#c6caa2,transparent 70%)}.immersive .modal-close{background:#f8e9c9;color:#876640;border:1px solid #b29563;min-width:34px;min-height:34px}.immersive .secondary{color:#795738;background:#f7e7c7;border-color:#c5a372}
.immersive .toast{bottom:105px;background:#254c3fed;border:1px solid #d1af70;color:#fff0ce;max-width:min(90vw,500px);box-shadow:0 5px 20px #18352970}
@media(min-width:650px){.immersive .app-shell{height:calc(100dvh - 22px);margin:11px auto}.immersive .money-pill{top:26px}.immersive .modal{max-width:470px}}
@media(max-width:420px){.immersive .app-shell{border-width:3px;border-radius:23px}.immersive .level-line{left:12px;width:176px;height:44px;top:12px}.immersive .money-pill{right:13px;top:14px;min-width:102px;font-size:21px;padding-right:9px}.immersive .hud-star{font-size:60px}.immersive .topbar{right:11px;top:68px}.immersive .cafe-heading{top:68px;left:12px;max-width:calc(100% - 185px)}.immersive .cafe-heading h1{font-size:14px}.immersive .top-actions button{height:36px;min-width:34px;font-size:11px;padding:0 8px}.immersive .story-card{top:111px;left:12px;width:calc(100% - 89px);padding:6px 9px}.immersive .camera-controls{top:111px;right:11px}.immersive .story-card strong{font-size:11px}.immersive .story-card em{font-size:9px}.immersive .scene-toolbar button{min-height:62px;font-size:12px}.immersive .scene-toolbar{bottom:8px}.immersive .management{top:172px}.immersive .construction-bar{top:172px}.immersive .orders-strip{left:12px;right:12px}}
@media(max-height:670px){.immersive .story-card{top:105px;min-height:42px}.immersive .story-card em{display:none}.immersive .scene-toolbar button{min-height:50px;font-size:11px}.immersive .scene-toolbar button svg{width:22px;height:22px}.immersive .orders-strip{bottom:82px;height:60px}.immersive .order-card{min-height:52px;padding-top:5px}.immersive .shift-bar{bottom:151px;min-height:38px}.immersive .cat-chip,.immersive .scene-note{bottom:203px}.immersive .management{top:160px;bottom:82px}.immersive .camera-controls{top:110px}}

@media(max-height:480px){html:has(body.immersive){overflow:auto}body.immersive{overflow:auto}.immersive .app-shell{min-height:480px;height:480px;margin:0 auto}.immersive .money-pill{position:absolute;top:12px;right:12px}}

.immersive .cafe-heading{background:linear-gradient(#fff0d3ef,#e6c493ed);border:1px solid #bb8f56;border-radius:13px;padding:0 10px;box-shadow:inset 0 1px 0 #fff6e1,0 2px 5px #1a352c50;min-height:37px}.immersive .cafe-heading h1{color:#624122;text-shadow:0 1px #fff6e1;line-height:1.2;font-size:15px;margin:9px 0}.immersive .order-card .order-row{font-size:8px;line-height:1.2}.immersive .order-card .order-action{line-height:1.2;margin-top:3px}.immersive .order-card strong{line-height:1.2;margin-top:3px}.immersive .empty-orders svg{width:25px;height:25px;flex:none}

.immersive .toast{top:185px;bottom:auto;max-width:min(86vw,450px);font-size:11px;padding:10px 14px}.immersive .toast.visible{transform:translate(-50%,0)}@media(max-height:670px){.immersive .toast{top:158px}}

/* Keep the cafe large: compact order rail and status leave the scene in front. */
.immersive .story-card{top:118px;min-height:39px;padding-top:5px;padding-bottom:5px}.immersive .story-card strong{font-size:11px}.immersive .story-card em{font-size:9px;line-height:1.2;margin-top:2px}
.immersive .orders-strip{bottom:94px;height:58px}.immersive .order-card{min-height:52px;padding:5px 9px}.immersive .order-card strong{font-size:10px}.immersive .order-card .order-row{font-size:8px}.immersive .order-card .order-action{font-size:9px;margin-top:2px}.immersive .orders-strip:has(.empty-orders){display:none}
.immersive .shift-bar{bottom:158px;min-height:37px;padding:4px 7px}.immersive .shift-bar.is-active{left:14px;right:auto;max-width:calc(100% - 112px);min-height:29px;bottom:158px;gap:8px;padding:3px 7px}.immersive .shift-bar.is-active strong{display:none}.immersive .shift-bar.is-active .eyebrow{font-size:8px;margin:0}.immersive .shift-bar.is-active .speed-button{min-height:27px;padding:3px 6px}.immersive .cat-chip{bottom:158px;min-height:32px;padding:4px 7px}.immersive .cat-chip svg{width:20px;height:20px}.immersive .scene-note{display:none}
@media(max-width:420px){.immersive .story-card{top:110px;min-height:39px}.immersive .camera-controls{top:110px}.immersive .story-card strong{font-size:10px}}
@media(max-height:670px){.immersive .story-card{top:107px;min-height:31px}.immersive .orders-strip{bottom:82px;height:53px}.immersive .shift-bar,.immersive .shift-bar.is-active,.immersive .cat-chip{bottom:141px}.immersive .order-card{min-height:48px}}
