/* Physical coordinates of the slot centres and the service boards are also read
   by the v31 renderer. Layers below decorate those measured elements in place. */
body:has(.game:not([hidden])) { background: #2b2c30; }
.game.play-page {
  --field-width: min(100vw, 1060px);
  --field-height: max(500px, var(--viewport-height));
  --station-width: clamp(60px, calc(var(--field-width) * .235), 166px);
  --cook-size: clamp(38px, calc(var(--field-width) * .13), 100px);
  --belt-width: calc(var(--order-size) + 12px);
  --chef-width: clamp(55px, calc(var(--field-width) * .188), 121px);
  --gutter: clamp(15px, 4.4vw, 42px);
  --belt-top: clamp(217px, calc(var(--field-height) * .48), 620px);
  --customer-step: clamp(21px, calc((var(--belt-top) - 142px) / 5.4), 52px);
  --customer-height: calc(var(--customer-step) * .87);
  --guide-space: 46px;
  --rail: #42464d;
  --branch-color: var(--rail);
  --red: #f8f8f8;
  --inactive: #64686e;
  --reject: #a42e37;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: var(--field-width);
  min-height: 0;
  background: #dedfe0;
  color: #292b30;
  font-family: var(--font-body);
}
.game[data-training] { --guide-space: 90px; }
.game .office-floor {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}
.game .game-hud {
  top: 0;
  inset-inline: 0;
  height: max(58px, calc(38px + env(safe-area-inset-top, 0px)));
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  z-index: 6;
  color: #f8f8f9;
  background: #292b30;
  border-bottom: 3px solid #777a80;
  box-shadow: 0 2px #393c42;
}
.game .score { display:flex;gap:8px;align-items:center;color:#ffffff;font-family:var(--font-body); }
.game .score::before {content:"Очки";font:600 11px/1.1 var(--font-body);letter-spacing:.025em;color:#cbcdd1;}
.game .score-digits {font-size:clamp(16px,3.7vw,23px);line-height:32px;}
.game .lives {gap:5px;}
.game .lives span {image-rendering:pixelated;filter:drop-shadow(1px 2px 0 #1b1c20);}
.game #sound-toggle {color:#f7f8f8;border:1px solid #70737a;background:#3a3d42;border-radius:3px;margin:0;width:37px;height:36px;}
.game #sound-toggle[aria-pressed="false"] {color:#b4b7bf;}
.game .conveyor--inlet {
  background-color: #4b4f56;
  background-image: repeating-linear-gradient(0deg, transparent 0 12px, #31353b 12px 14px, #71767d 14px 15px, transparent 15px 16px);
  border-inline: 3px solid #2e3238;
  box-shadow: inset 2px 0 #969ba3, inset -2px 0 #969ba3, 2px 1px #aa907c;
}
.game .branch { --branch-color: #585c63; }
.game .branch--left { --route-light:#bf99f2; }
.game .branch--right { --route-light:#85dda1; }
.game:not([data-phase="ready"])[data-route="0"] .branch--left,
.game:not([data-phase="ready"])[data-route="1"] .branch--right { --branch-color: var(--route-light); }
.game .station { z-index:2; }
.game .station::before {
  content:"";position:absolute;top:50%;transform:translateY(-50%);height:var(--queue-height);
  width:calc(var(--order-size) / 2 + 1px);
  background:var(--branch-color);border-block:2px solid #353940;
  transition:background-color 73ms var(--delivery-easing);
}
.game .branch--left .station::before {left:100%;}
.game .branch--right .station::before {right:100%;}
.game .queue {
  position:relative;
  background-color:var(--branch-color);
  box-shadow:inset 0 2px #32353c,inset 0 -2px #32353c,0 2px #a58974;
}
.game .queue span,.game .queue .occupied[data-shifting] {
  position:relative;
  background: #555a61;
  box-shadow: inset 0 2px #32353b,inset 2px 0 #44484f,inset 0 -1px #878c92;
  clip-path:none;
}
.game .queue span::before,.game .queue span::after { content:"";position:absolute;background:#a1a6ab; }
.game .queue span::before {width:5px;height:1px;left:calc(50% - 2px);top:50%;}
.game .queue .occupied:not([data-shifting])::before {
  inset:0;width:auto;height:auto;background:var(--ticket-art) center / contain no-repeat;image-rendering:pixelated;
}
.game .queue .occupied:not([data-shifting]) {clip-path:none; }
.game .cook {
  display:block;z-index:1;
  background:transparent!important;
  overflow:visible;
  clip-path:none;
}
.game .service {position:absolute;opacity:0;pointer-events:none;}
.game .chef-cel {
  position:absolute;
  width:var(--chef-width);aspect-ratio:56/64;
  bottom:calc(50% - var(--chef-width) * .25);
  transform:translateX(-50%);
  image-rendering:pixelated;
  background-size:800% 300%;
  background-repeat:no-repeat;
  background-position:0 0;
  pointer-events:none;
}
.game .branch--left .chef-cel,.game .branch--left .recipe-sign {left:calc(100% - var(--order-size) / 2);}
.game .branch--right .chef-cel,.game .branch--right .recipe-sign {left:calc(var(--order-size) / 2);}
.game .branch--left .chef-cel {background-image:url("assets/field/cook-body-0.png?v=8fabd3b85c1a");}
.game .branch--right .chef-cel {background-image:url("assets/field/cook-body-1.png?v=c5169016fe61");}
.game .chef-hat {
  position:absolute;inset:0;
  image-rendering:pixelated;background-size:inherit;background-position:inherit;background-repeat:no-repeat;
}
.game .branch--left .chef-hat {background-image:url("assets/field/cook-hat-0.png?v=a340eaf09143");}
.game .branch--right .chef-hat {background-image:url("assets/field/cook-hat-1.png?v=30b4d65f8a87");}
.game .recipe-sign {
  position:absolute;top:calc(50% + var(--chef-width) * .25 + 4px);transform:translateX(-50%);
  display:flex;align-items:center;justify-content:center;gap:3px;padding:2px 5px 2px 3px;min-height:20px;
  color:#f5f5f6;background:#3b3f45;border:2px solid #292c31;box-shadow:0 2px #a38a78;
  font:700 clamp(9px,2.5vw,12px)/1 var(--font-body);white-space:nowrap;
  transition:background-color 73ms var(--delivery-easing);
}
.game .recipe-sign i {width:20px;height:20px;image-rendering:pixelated;background:center/contain no-repeat;}
.game .branch--left .recipe-sign i {background-image:url("assets/field/ticket-1.png?v=d17c24369fb3");}
.game .branch--right .recipe-sign i {background-image:url("assets/field/ticket-2.png?v=50cb2ef62ab2");}
.game[data-route="0"] .branch--left .recipe-sign,.game[data-route="1"] .branch--right .recipe-sign {
  color:#202126;background:var(--route-light);border-color:#373940;box-shadow:0 2px #a38a78,0 0 0 2px #ffffff;
}
.game[data-route="0"] .branch--left .chef-cel::after,.game[data-route="1"] .branch--right .chef-cel::after {
  content:"";position:absolute;left:calc(50% - 6px);top:calc(-9px - var(--chef-width) * .12);width:12px;height:9px;
  background:var(--route-light);clip-path:polygon(0 0,100% 0,100% 30%,80% 30%,80% 55%,64% 55%,64% 80%,54% 80%,54% 100%,44% 100%,44% 80%,34% 80%,34% 55%,20% 55%,20% 30%,0 30%);
}
.game .tip-paid {
  z-index:3;bottom:calc(50% + var(--chef-width) * .88 + 14px);width:max-content;min-width:30px;padding:3px 5px;background:#34383d;color:#ffffff;
  border:1px solid #f4f5f6;font:700 12px/1 var(--font-body);
}
.game .branch--left .tip-paid {right:calc(100% - 30px);}
.game .branch--right .tip-paid {left:calc(100% - 30px);}
.game .customers {z-index:1;clip-path:inset(58px 0 0);}
.game .pickup-guests {z-index:4;}
.game .customer {top:calc(var(--belt-top) - var(--chef-width) * .90 - 7px - var(--customer-height));}
.game .customer img {visibility:hidden;}
.game .customer::before {
  content:"";display:block;height:var(--customer-height);width:min(100%,var(--customer-height));
  position:absolute;inset:0;margin-inline:auto;background:var(--guest-sprite) center bottom / contain no-repeat;image-rendering:pixelated;
}
.game .tickets {z-index:3;}
.game .ticket,.game .rejection,.game .queue span {--ticket-art:url("assets/field/ticket-0.png");--meal-art:url("assets/field/meal-0.png");}
.game [data-required-route="0"],.game .queue span[data-required-route="0"] {--ticket-art:url("assets/field/ticket-1.png?v=d17c24369fb3");--meal-art:url("assets/field/meal-1.png");}
.game [data-required-route="1"],.game .queue span[data-required-route="1"] {--ticket-art:url("assets/field/ticket-2.png?v=50cb2ef62ab2");--meal-art:url("assets/field/meal-2.png");}
.game .ticket::before,.game .rejection::before {
  inset:0;background:var(--ticket-art) center/contain no-repeat;clip-path:none;image-rendering:pixelated;
  filter:drop-shadow(1px 1px 0 #282a30);
}
.game .ticket[data-kind="served"]::before {background-image:var(--meal-art);}
.game .customer .held-meal {
  left:calc(50% + var(--customer-height) * .10);
  top:calc(var(--customer-height) * .70);
  width:calc(var(--customer-height) * .51);
  height:calc(var(--customer-height) * .41);
  transform:translate(-50%, -50%);
  pointer-events:none;
}
.game .customer .held-meal[data-required-route] {
  left:calc(50% + var(--customer-height) * .20);
  top:calc(var(--customer-height) * .69);
}
.game .ticket[data-kind="retry"]::after {
  content:"↻";position:absolute;inset:auto auto -1px -5px;padding:0 1px;background:#3c4147;color:#ffffff;
  clip-path:none;border:1px solid #dce0e3;font:bold 10px/1 var(--font-body);
}
.game .ticket[data-locked-route]::after {background:#ffffff;top:-5px;}
.game .effects {z-index:5;}
.game .rejection::after {
  content:"×";inset:auto -4px -4px auto;width:13px;height:13px;display:grid;place-items:center;
  background:#ad323e;color:white;border:1px solid #ffe9ea;box-shadow:1px 1px #62383a;
  clip-path:none;font:900 14px/10px var(--font-body);
}
.game .gate {background:repeating-linear-gradient(135deg,#a72c3c 0 3px,#f7edef 3px 5px);border-color:#643b3c;}
.game .gate-count {
  top:calc(var(--entry-y) + 49px);
  left:auto;right:calc(100% - var(--entry-x) - 4px);
  border-radius:0;border:1px solid #fbe4e6;box-shadow:1px 2px #73554a;
  background:#96303a;color:#fff7f8;font:700 11px/1.2 var(--font-body);
}
.game .refusal-effect[data-route="1"] .gate-count {right:auto;left:calc(var(--entry-x) - 4px);}
.game .gate-count::before {
  position:absolute;content:"";bottom:100%;right:2px;width:2px;height:22px;background:#a13239;box-shadow:1px 0 #ffe7e9;
}
.game .refusal-effect[data-route="1"] .gate-count::before {right:auto;left:2px;}
.game .control-guide:not([data-prompt="start"]):not([data-prompt="replay"]) {display:none;}
.game .training-note {
  z-index:6;
  background-color:#2e3136;
  color:#f7f7f8;
  border:2px solid #7e838c;
  border-radius:2px;
  box-shadow:0 3px #555457;
}
.game .training-meta { color:#c7cbd2; }
@media (min-width:740px) {
  .game .game-hud {padding-inline:32px;}
  .game .score::before{font-size:13px;}
}
@media (prefers-reduced-motion:reduce) {
  .game .queue,.game .station::before,.game .recipe-sign {transition:none;}
}
@media (max-height:510px) and (min-aspect-ratio:13/10) {
  .game.play-page {
    --field-height:max(265px,var(--viewport-height));
    --gutter:12px;
    --guest-limit-top:42px;
    --belt-top:calc(var(--field-height) * .50);
    --chef-width:clamp(49px,13vh,67px);
    --station-width:clamp(69px,14vw,126px);
    --cook-size:48px;
    --customer-step:clamp(19px,6vh,29px);
    --customer-height:var(--customer-step);
    --guide-space:15px;
  }
  .game[data-training] {--guide-space:17px;}
  .game .game-hud {height:37px;padding-inline: max(12px,env(safe-area-inset-left,0px));border-bottom-width:2px;}
  .game .lives {gap:2px;}
  .game .lives span {width:25px;height:26px;background-size:22px;}
  .game #sound-toggle {height:30px;width:35px;}
  .game .customers {clip-path:inset(38px 0 0);}
  .game .training-note {
    inset:auto max(7px,env(safe-area-inset-right,0px)) max(5px,env(safe-area-inset-bottom,0px)) auto;
    width:clamp(190px,29%,285px);max-width:none;margin:0;padding:4px 7px 5px;
    font-size:12px;line-height:1.18;
  }
  .game .training-title {font-size:13px;margin-block:2px;}
  .game .training-meta {font-size:9px;}
  .game .recipe-sign {font-size:10px;min-height:17px;padding:1px 3px;gap:2px;}
  .game .recipe-sign i {width:15px;height:15px;}
}
@media (max-height:510px) and (max-width:650px) and (min-aspect-ratio:13/10) {
  .game[data-training] {--guide-space:58px;}
  .game .training-note {inset:auto 7px 3px;width:max-content;max-width:calc(100% - 14px);margin-inline:auto;}
}

.game .worktop-props {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  image-rendering: pixelated;
}
