/* v61: mobile-first portrait layout for phone play. Loaded last on purpose. */
:root{
  --mcb-vh:1vh;
  --mcb-ui-pad:clamp(10px,3vw,18px);
  --mcb-touch:clamp(46px,12vw,58px);
  --mcb-radius:22px;
  --mcb-glass:linear-gradient(180deg,rgba(65,30,12,.78),rgba(22,9,4,.9));
  --mcb-line:rgba(255,211,100,.34);
}
html,body{width:100%;height:100%;height:calc(var(--mcb-vh)*100);overscroll-behavior:none;overflow:hidden;touch-action:manipulation;background:#0c0502;}
body{padding:0;margin:0;}
.ui-mobile-v61{width:100vw;height:100vh;height:calc(var(--mcb-vh)*100);min-width:320px;min-height:560px;max-width:none;margin:0 auto;background:#120805;}
.ui-mobile-v61 .screen{padding:calc(var(--safe-top) + var(--mcb-ui-pad)) var(--mcb-ui-pad) calc(var(--safe-bottom) + var(--mcb-ui-pad))!important;overflow:hidden!important;}
.ui-mobile-v61 button{min-height:var(--mcb-touch);touch-action:manipulation;-webkit-user-select:none;user-select:none;}
.ui-mobile-v61 .primary-button,.ui-mobile-v61 .secondary-button,.ui-mobile-v61 .small-button,.ui-mobile-v61 .icon-button{border-radius:18px!important;}
.ui-mobile-v61 .primary-button:active,.ui-mobile-v61 .secondary-button:active,.ui-mobile-v61 .small-button:active,.ui-mobile-v61 .icon-button:active,.ui-mobile-v61 .restaurant-pin:active,.ui-mobile-v61 .level-node:active{transform:translateY(2px) scale(.985)!important;}
.mobile-rotate-prompt{display:none;position:fixed;inset:0;z-index:9999;place-items:center;padding:28px;background:radial-gradient(circle at 50% 12%,rgba(255,198,74,.2),transparent 36%),linear-gradient(180deg,rgba(17,7,2,.96),rgba(5,2,1,.98));color:#fff4df;text-align:center;}
.mobile-rotate-prompt strong{display:block;font-size:clamp(24px,7vw,38px);line-height:1.05;margin-bottom:10px;}
.mobile-rotate-prompt span{display:block;color:#f6d28c;font-weight:800;line-height:1.35;}
.mobile-wizard-chip{position:fixed;z-index:430;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));bottom:calc(max(10px,env(safe-area-inset-bottom)) + 4px);display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;min-height:54px;padding:10px 12px;border-radius:18px;border:2px solid rgba(255,217,105,.52);background:linear-gradient(180deg,rgba(59,27,10,.94),rgba(18,7,3,.96));box-shadow:0 12px 28px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.1);color:#fff5d8;pointer-events:auto;}
.mobile-wizard-chip[hidden]{display:none!important;}
.mobile-wizard-chip b{display:block;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:#ffd76b;}
.mobile-wizard-chip span{display:block;font-size:13px;line-height:1.22;color:#f8dfab;font-weight:700;}
.mobile-wizard-chip button{width:38px;min-width:38px;height:38px;min-height:38px;border-radius:50%;background:rgba(255,235,160,.14);border:1px solid rgba(255,221,120,.46);color:#fff4df;font-weight:1000;}
html[data-active-screen="screenGame"] .mobile-wizard-chip{bottom:calc(max(74px,env(safe-area-inset-bottom) + 70px));left:10px;right:10px;min-height:44px;padding:8px 10px;opacity:.96;}
html[data-mobile-wizard-closed="1"] .mobile-wizard-chip{display:none!important;}
@media (orientation:landscape) and (max-height:520px){
  html[data-mobile-device="true"] .mobile-rotate-prompt{display:grid;}
}
@media (min-width:721px) and (orientation:portrait){
  body{background:radial-gradient(circle at top,#4b2a16,#090604 70%);}
  .ui-mobile-v61{max-width:480px;box-shadow:0 0 0 1px rgba(255,214,100,.14),0 30px 90px rgba(0,0,0,.6);}
}
@media (orientation:portrait), (max-width:720px){
  .ui-mobile-v61 .screen-active{display:flex!important;}
  .ui-mobile-v61 .splash-screen,.ui-mobile-v61 .menu-screen,.ui-mobile-v61 .settings-screen,.ui-mobile-v61 .howto-screen,.ui-mobile-v61 .result-screen{flex-direction:column!important;}
  .ui-mobile-v61 .top-bar{width:100%!important;min-height:48px;margin:0!important;padding:8px 10px!important;border-radius:18px!important;background:rgba(18,7,2,.52)!important;border:1px solid rgba(255,214,100,.22)!important;backdrop-filter:blur(10px);}
  .ui-mobile-v61 .top-bar strong{font-size:clamp(16px,4.4vw,20px)!important;}
  .ui-mobile-v61 .top-bar span{font-size:10px!important;}

  .ui-mobile-v61 .splash-screen{justify-content:center!important;background-image:linear-gradient(180deg,rgba(15,7,3,.1),rgba(15,7,3,.2)),var(--concept-menu-bg,var(--ui-loading-bg))!important;background-size:cover!important;background-position:center!important;}
  .ui-mobile-v61 .splash-screen .brand-card{display:grid!important;width:min(86vw,360px)!important;border-radius:28px!important;padding:26px 18px!important;background:rgba(25,10,4,.72)!important;}
  .ui-mobile-v61 .splash-screen .brand-badge{width:136px!important;height:96px!important;}

  .ui-mobile-v61 .menu-screen{display:flex!important;justify-content:flex-end!important;gap:12px!important;background-image:linear-gradient(180deg,rgba(12,5,2,.04),rgba(12,5,2,.72) 54%,rgba(12,5,2,.96)),var(--concept-menu-bg,var(--ui-menu-bg))!important;background-size:cover!important;background-position:center top!important;color:#fff4df!important;}
  .ui-mobile-v61 .menu-screen::before,.ui-mobile-v61 .menu-screen::after{display:none!important;content:none!important;}
  .ui-mobile-v61 .menu-screen .top-bar{display:flex!important;position:absolute!important;top:calc(var(--safe-top) + 10px)!important;left:12px!important;right:12px!important;width:auto!important;z-index:6!important;}
  .ui-mobile-v61 .menu-screen .hero-panel{display:grid!important;position:relative!important;width:100%!important;min-height:128px!important;margin-top:auto!important;padding:16px!important;border-radius:28px!important;background:linear-gradient(180deg,rgba(74,31,9,.54),rgba(24,9,3,.86))!important;border:1px solid rgba(255,217,105,.28)!important;text-align:center!important;align-content:center!important;box-shadow:0 16px 38px rgba(0,0,0,.34)!important;}
  .ui-mobile-v61 .menu-screen .hero-panel::before{height:62px!important;width:min(280px,86%)!important;}
  .ui-mobile-v61 .menu-screen .hero-panel h2{display:block!important;font-size:clamp(24px,8vw,34px)!important;}
  .ui-mobile-v61 .menu-screen .hero-panel p{display:block!important;font-size:14px!important;color:#ffd36e!important;}
  .ui-mobile-v61 .menu-screen .mode-grid{display:none!important;}
  .ui-mobile-v61 .menu-screen .menu-actions{position:relative!important;left:auto!important;top:auto!important;bottom:auto!important;width:100%!important;height:auto!important;display:grid!important;grid-template-columns:1fr!important;gap:10px!important;z-index:8!important;background:transparent!important;}
  .ui-mobile-v61 .menu-screen .menu-actions button{position:relative!important;left:auto!important;top:auto!important;width:100%!important;height:auto!important;min-height:56px!important;border:5px solid #842d0d!important;border-radius:20px!important;background:linear-gradient(#ffe669,#f29a17)!important;color:#fff!important;text-shadow:0 3px 0 #70220a!important;box-shadow:0 6px 0 #4d1807,0 0 0 3px #fff0a5 inset!important;font-weight:1000!important;}
  .ui-mobile-v61 .menu-screen .stat-strip{display:grid!important;width:100%!important;grid-template-columns:repeat(3,1fr)!important;border-radius:20px!important;padding:10px!important;margin:0!important;background:rgba(28,11,4,.72)!important;}
  .ui-mobile-v61 .menu-screen #btnSettings{position:relative!important;left:auto!important;bottom:auto!important;width:auto!important;height:auto!important;color:transparent!important;background:rgba(255,189,66,.14)!important;border:1px solid rgba(255,214,100,.28)!important;box-shadow:none!important;}
  .ui-mobile-v61 .menu-screen #btnSettings::before{content:"⚙";color:#fff4df;font-size:22px;}

  .ui-mobile-v61 .world-map-screen{display:block!important;padding:0!important;background-image:linear-gradient(180deg,rgba(5,18,24,.04),rgba(5,18,24,.28)),var(--concept-world-bg,var(--ui-world-bg))!important;background-size:cover!important;background-position:center!important;}
  .ui-mobile-v61 .world-back-button{left:12px!important;top:calc(var(--safe-top) + 10px)!important;min-width:82px!important;min-height:46px!important;z-index:70!important;}
  .ui-mobile-v61 .restaurant-map-pins{inset:calc(var(--safe-top) + 62px) 0 calc(var(--safe-bottom) + 176px) 0!important;z-index:30!important;}
  .ui-mobile-v61 .restaurant-pin{width:clamp(54px,18vw,92px)!important;min-height:54px!important;}
  .ui-mobile-v61 .restaurant-pin .restaurant-name,.ui-mobile-v61 .restaurant-pin small{display:none!important;}
  .ui-mobile-v61 .restaurant-selected,.ui-mobile-v61 .restaurant-pin[aria-disabled="false"]:hover,.ui-mobile-v61 .restaurant-pin[aria-disabled="false"]:focus-visible{outline:4px solid rgba(255,255,255,.76)!important;}
  .ui-mobile-v61 .restaurant-popover{left:12px!important;right:12px!important;bottom:calc(var(--safe-bottom) + 12px)!important;width:auto!important;min-height:0!important;display:grid!important;grid-template-columns:72px 1fr!important;gap:10px!important;padding:12px!important;border-radius:22px!important;z-index:88!important;}
  .ui-mobile-v61 .restaurant-popover-copy strong{font-size:clamp(20px,6vw,28px)!important;}
  .ui-mobile-v61 .restaurant-popover-copy span,.ui-mobile-v61 .restaurant-popover-copy em{font-size:12px!important;line-height:1.24!important;}
  .ui-mobile-v61 .restaurant-popover-action{grid-column:1 / -1!important;min-height:50px!important;}

  .ui-mobile-v61 .level-map-screen{display:block!important;padding:0!important;background-image:linear-gradient(180deg,rgba(10,4,2,.04),rgba(10,4,2,.72)),var(--concept-burger-map-bg,var(--ui-burger-level-bg))!important;background-size:cover!important;background-position:center top!important;}
  .ui-mobile-v61 .level-map-screen .top-bar{display:flex!important;position:absolute!important;left:12px!important;right:12px!important;top:calc(var(--safe-top) + 10px)!important;width:auto!important;z-index:42!important;}
  .ui-mobile-v61 .level-map-screen #btnCloseLevelMap{position:relative!important;left:auto!important;bottom:auto!important;min-width:78px!important;min-height:46px!important;}
  .ui-mobile-v61 .level-map-screen .map-panel{position:absolute!important;left:12px!important;right:12px!important;bottom:calc(var(--safe-bottom) + 82px)!important;top:auto!important;width:auto!important;height:auto!important;min-height:48vh!important;padding:14px!important;border-radius:24px!important;background:linear-gradient(180deg,rgba(66,28,9,.86),rgba(22,8,3,.94))!important;border:4px solid rgba(245,180,62,.88)!important;box-shadow:0 14px 36px rgba(0,0,0,.4),inset 0 0 0 2px rgba(255,240,165,.2)!important;overflow:visible!important;}
  .ui-mobile-v61 .level-map-screen .map-panel>h2,.ui-mobile-v61 .level-map-screen .map-panel>p{display:block!important;margin:0;text-align:center;}
  .ui-mobile-v61 .level-map-screen .map-panel>h2{font-size:clamp(22px,6.2vw,30px);color:#fff5d7;text-shadow:0 3px 0 #4d1807;}
  .ui-mobile-v61 .level-map-screen .map-panel>p{margin:3px 0 10px;color:#f6d28c;font-weight:800;}
  .ui-mobile-v61 .level-map-screen .level-grid{position:relative!important;left:auto!important;top:auto!important;width:100%!important;height:auto!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;grid-auto-rows:minmax(56px,1fr)!important;gap:8px!important;}
  .ui-mobile-v61 .level-map-screen .level-node{min-height:58px!important;border-radius:16px!important;border:3px solid rgba(255,231,135,.32)!important;background:linear-gradient(180deg,rgba(255,211,88,.18),rgba(98,39,9,.76))!important;box-shadow:0 5px 0 rgba(54,17,4,.7)!important;}
  .ui-mobile-v61 .level-map-screen .level-node strong{font-size:clamp(18px,6vw,28px)!important;}
  .ui-mobile-v61 .level-map-screen .level-node.selected{border-color:#ffe45e!important;background:linear-gradient(180deg,rgba(255,219,78,.44),rgba(146,65,12,.88))!important;}
  .ui-mobile-v61 .level-map-playbar{left:12px!important;right:12px!important;bottom:calc(var(--safe-bottom) + 12px)!important;width:auto!important;display:grid!important;grid-template-columns:1fr 120px!important;gap:10px!important;padding:10px 12px!important;border-radius:20px!important;z-index:50!important;}
  .ui-mobile-v61 .level-map-playbar button{min-width:0!important;width:100%!important;min-height:50px!important;}

  .ui-mobile-v61 .game-screen.screen-active{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;gap:8px!important;padding:calc(var(--safe-top) + 6px) 6px calc(var(--safe-bottom) + 6px)!important;background-image:linear-gradient(180deg,rgba(15,7,3,.02),rgba(15,7,3,.3)),var(--scene-game-bg,var(--ui-burger-interior-bg))!important;background-size:cover!important;background-position:center top!important;}
  .ui-mobile-v61 .game-hud{height:auto!important;min-height:0!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr)) auto!important;grid-auto-rows:38px!important;gap:5px!important;padding:5px!important;border-radius:16px!important;background:rgba(24,9,3,.68)!important;}
  .ui-mobile-v61 .game-hud div{min-width:0!important;min-height:38px!important;padding:3px 4px!important;border-radius:12px!important;background:rgba(255,244,223,.06)!important;}
  .ui-mobile-v61 .game-hud div:nth-child(2),.ui-mobile-v61 .game-hud div:nth-child(4){display:none!important;}
  .ui-mobile-v61 .game-hud .mission-hud{grid-column:1 / span 2!important;}
  .ui-mobile-v61 .game-hud strong{font-size:clamp(14px,4.2vw,18px)!important;}
  .ui-mobile-v61 .game-hud small{font-size:8px!important;letter-spacing:.04em!important;}
  .ui-mobile-v61 #btnQuit{min-width:48px!important;min-height:38px!important;padding:0 8px!important;font-size:11px!important;}
  .ui-mobile-v61 .game-stage{height:100%!important;min-height:0!important;display:grid!important;grid-template-columns:1fr!important;grid-template-rows:minmax(140px,30%) minmax(0,1fr)!important;gap:7px!important;overflow:hidden!important;}
  .ui-mobile-v61 .restaurant-zone{height:100%!important;min-height:0!important;padding:7px!important;border-radius:20px!important;background:rgba(20,8,3,.32)!important;overflow:hidden!important;}
  .ui-mobile-v61 .restaurant-sign{display:none!important;}
  .ui-mobile-v61 .customer-queue{height:100%!important;min-height:0!important;display:flex!important;align-items:stretch!important;gap:7px!important;padding:0!important;overflow-x:auto!important;overflow-y:hidden!important;-webkit-overflow-scrolling:touch;}
  .ui-mobile-v61 .customer-card{min-width:clamp(150px,44vw,190px)!important;width:clamp(150px,44vw,190px)!important;height:100%!important;grid-template-columns:52px 1fr!important;padding:6px!important;border-radius:17px!important;}
  .ui-mobile-v61 .customer-avatar{height:70px!important;align-self:center!important;}
  .ui-mobile-v61 .customer-avatar img{max-height:70px!important;}
  .ui-mobile-v61 .customer-info strong{font-size:12px!important;}
  .ui-mobile-v61 .customer-info span{font-size:10px!important;}
  .ui-mobile-v61 .order-icons{max-height:45px!important;gap:3px!important;}
  .ui-mobile-v61 .order-icon{width:22px!important;height:22px!important;}
  .ui-mobile-v61 .order-icon img{max-width:20px!important;max-height:19px!important;}
  .ui-mobile-v61 .counter-area{height:100%!important;min-height:0!important;display:grid!important;grid-template-rows:50px 48px minmax(0,1fr) 46px 22px!important;gap:6px!important;padding:0!important;background:transparent!important;overflow:hidden!important;}
  .ui-mobile-v61 .grill-station,.ui-mobile-v61 .side-station,.ui-mobile-v61 .tray{border-radius:18px!important;background:rgba(32,13,5,.6)!important;border:1px solid rgba(255,214,106,.26)!important;}
  .ui-mobile-v61 .grill-station{display:grid!important;grid-template-columns:44px 96px 1fr!important;gap:6px!important;align-items:center!important;padding:6px!important;}
  .ui-mobile-v61 .grill-station>span,.ui-mobile-v61 .side-station>span,.ui-mobile-v61 .tray>span{font-size:10px!important;font-weight:1000!important;color:#ffd870!important;text-transform:uppercase!important;}
  .ui-mobile-v61 .grill-button{min-height:38px!important;border-radius:14px!important;font-size:11px!important;padding:0 8px!important;}
  .ui-mobile-v61 .grill-status{font-size:11px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  .ui-mobile-v61 .side-station{display:grid!important;grid-template-columns:42px minmax(0,1fr) 74px!important;gap:6px!important;align-items:center!important;padding:5px!important;}
  .ui-mobile-v61 .side-food-bar{gap:5px!important;overflow-x:auto!important;}
  .ui-mobile-v61 .side-food-button{min-width:62px!important;height:36px!important;min-height:36px!important;border-radius:12px!important;font-size:9px!important;grid-template-columns:25px 1fr!important;padding:3px!important;}
  .ui-mobile-v61 .side-food-button img{max-width:25px!important;max-height:25px!important;}
  .ui-mobile-v61 .side-stack{gap:3px!important;overflow:hidden!important;}
  .ui-mobile-v61 .side-stack-item{width:30px!important;height:30px!important;}
  .ui-mobile-v61 .tray{min-height:0!important;display:grid!important;grid-template-rows:auto 30px minmax(0,1fr)!important;padding:6px!important;overflow:hidden!important;}
  .ui-mobile-v61 .plate-tabs{min-height:28px!important;gap:5px!important;}
  .ui-mobile-v61 .plate-tab{min-height:28px!important;height:28px!important;border-radius:12px!important;font-size:10px!important;padding:0 6px!important;}
  .ui-mobile-v61 .burger-stack{height:100%!important;min-height:0!important;justify-content:center!important;}
  .ui-mobile-v61 .stack-item-asset{width:min(178px,58vw)!important;height:28px!important;margin-top:-8px!important;background-size:contain!important;background-repeat:no-repeat!important;background-position:center!important;}
  .ui-mobile-v61 .serve-row{display:grid!important;grid-template-columns:1fr 1fr 1.35fr!important;gap:6px!important;min-height:46px!important;}
  .ui-mobile-v61 .serve-row button{min-height:42px!important;border-radius:15px!important;padding:0 8px!important;font-size:12px!important;}
  .ui-mobile-v61 .feedback{min-height:22px!important;margin:0!important;font-size:12px!important;line-height:20px!important;text-align:center!important;background:rgba(16,6,2,.52)!important;border-radius:12px!important;}
  .ui-mobile-v61 .ingredient-bar{height:72px!important;min-height:72px!important;display:flex!important;gap:7px!important;padding:6px!important;border-radius:18px!important;background:rgba(23,9,3,.82)!important;overflow-x:auto!important;overflow-y:hidden!important;-webkit-overflow-scrolling:touch;}
  .ui-mobile-v61 .ingredient-button{min-width:96px!important;min-height:58px!important;height:58px!important;padding:5px!important;border-radius:15px!important;grid-template-columns:38px 1fr!important;font-size:10px!important;}
  .ui-mobile-v61 .ingredient-preview.asset-preview{width:38px!important;height:34px!important;}
  .ui-mobile-v61 .ingredient-preview.asset-preview img{max-width:38px!important;max-height:34px!important;}

  .ui-mobile-v61 .settings-screen,.ui-mobile-v61 .howto-screen,.ui-mobile-v61 .result-screen,.ui-mobile-v61 .admin-screen{justify-content:center!important;background:linear-gradient(180deg,rgba(28,11,4,.92),rgba(6,2,1,.98))!important;}
  .ui-mobile-v61 .narrow-panel,.ui-mobile-v61 .result-panel,.ui-mobile-v61 .admin-panel{width:min(94vw,430px)!important;max-height:calc(var(--mcb-vh)*92)!important;overflow:auto!important;border-radius:24px!important;padding:18px!important;}
  .ui-mobile-v61 .result-actions{display:grid!important;grid-template-columns:1fr 1fr 1.2fr!important;gap:8px!important;}
  .ui-mobile-v61 .result-stats{grid-template-columns:repeat(2,1fr)!important;}
}
@media (max-height:700px) and (orientation:portrait){
  .ui-mobile-v61 .menu-screen .hero-panel{min-height:96px!important;padding:12px!important;}
  .ui-mobile-v61 .menu-screen .hero-panel::before{height:46px!important;}
  .ui-mobile-v61 .menu-screen .stat-strip{display:none!important;}
  .ui-mobile-v61 .level-map-screen .map-panel{min-height:43vh!important;bottom:calc(var(--safe-bottom) + 72px)!important;}
  .ui-mobile-v61 .level-map-screen .level-node{min-height:48px!important;}
  .ui-mobile-v61 .level-map-playbar{padding:8px 10px!important;}
  .ui-mobile-v61 .customer-card{grid-template-columns:46px 1fr!important;}
  .ui-mobile-v61 .customer-avatar{height:58px!important;}
  .ui-mobile-v61 .ingredient-bar{height:66px!important;min-height:66px!important;}
  .ui-mobile-v61 .ingredient-button{height:52px!important;min-height:52px!important;}
}
@media (max-width:360px) and (orientation:portrait){
  .ui-mobile-v61 .level-map-screen .level-grid{gap:6px!important;}
  .ui-mobile-v61 .level-map-screen .level-node{border-radius:13px!important;}
  .ui-mobile-v61 .game-hud{grid-auto-rows:34px!important;}
  .ui-mobile-v61 .game-stage{grid-template-rows:minmax(120px,28%) minmax(0,1fr)!important;}
  .ui-mobile-v61 .counter-area{grid-template-rows:46px 44px minmax(0,1fr) 42px 20px!important;}
  .mobile-wizard-chip span{font-size:12px;}
}
