@font-face {
  font-family: 'Hypermarket';
  src: url('/media/games/burger-stacker/fonts/Hypermarket-ExpBold.ttf');
}

@font-face {
  font-family: 'lilita';
  src: url('/media/games/burger-stacker/fonts/LilitaOne-Regular.ttf');
}

#full-area.burger-stacker {
  position: relative;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  user-select: none;
  background: #bfe3fb;
  font-family: 'lilita', 'Trebuchet MS', sans-serif;
  color: #3a1d0b;
}

#full-area.burger-stacker * {
  box-sizing: border-box;
}

#bs-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  outline: none;
  background: url('/media/games/burger-stacker/Start_menu.png') center top / 1280px 720px no-repeat;
  touch-action: manipulation;
}

#bs-play {
  position: absolute;
  inset: 0;
  display: none;
}

#bs-stage[data-state="play"] #bs-play,
#bs-stage[data-state="complete"] #bs-play,
#bs-stage[data-state="fail"] #bs-play,
#bs-stage[data-state="over"] #bs-play {
  display: block;
}

.bs-hud {
  position: absolute;
  left: 16px;
  top: 14px;
  display: flex;
  gap: 12px;
  align-items: stretch;
  z-index: 30;
}

.bs-card {
  min-width: 120px;
  padding: 6px 16px 8px;
  border: 4px solid #3a1d0b;
  border-radius: 16px;
  background: #ffb52e;
  box-shadow: 0 5px 0 #3a1d0b;
  text-align: center;
  line-height: 1;
}

.bs-card span,
#bs-next span {
  display: block;
  font-size: 16px;
  color: #7a3b10;
}

.bs-card strong {
  display: block;
  font-size: 38px;
  color: #fff;
  -webkit-text-stroke: 2px #3a1d0b;
  paint-order: stroke fill;
}

.bs-meter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 300px;
  padding: 8px 14px;
  border: 4px solid #3a1d0b;
  border-radius: 16px;
  background: #fff7e6;
  box-shadow: 0 5px 0 #3a1d0b;
}

.bs-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bs-sens {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #7a3b10;
}

.bs-sens b {
  font-weight: normal;
  color: #3a1d0b;
}

.bs-sens button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 3px solid #3a1d0b;
  border-radius: 8px;
  background: #ffb52e;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  color: #3a1d0b;
  cursor: pointer;
}

.bs-sens button:hover:not(:disabled) {
  background: #ffd23f;
}

.bs-sens button:disabled {
  opacity: 0.4;
  cursor: default;
}

.bs-meter-label {
  font-size: 20px;
  line-height: 1;
  color: #d9480f;
}

.bs-meter-track {
  position: relative;
  height: 20px;
  border: 3px solid #3a1d0b;
  border-radius: 10px;
  background: #e9d8bd;
  overflow: hidden;
}

#bs-meter-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, #54c942, #ffd23f 60%, #ff5a36);
}

#bs-meter-mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 4px;
  margin-left: -2px;
  background: #3a1d0b;
}

.bs-meter.is-hot {
  background: #ffe066;
}

#bs-next {
  position: absolute;
  right: 16px;
  top: 12px;
  width: 300px;
  height: 90px;
  display: grid;
  grid-template-columns: 110px 1fr;
  grid-template-rows: auto 1fr;
  align-items: center;
  column-gap: 8px;
  padding: 6px 14px;
  border: 4px solid #3a1d0b;
  border-radius: 16px;
  background: #fff7e6;
  box-shadow: 0 5px 0 #3a1d0b;
  z-index: 30;
}

#bs-next span {
  grid-column: 1 / 3;
  font-size: 15px;
  line-height: 1;
}

#bs-next img {
  width: 100px;
  height: 60px;
  object-fit: contain;
}

#bs-next strong {
  font-size: 22px;
  line-height: 1.05;
  font-weight: normal;
}

#bs-bin {
  position: absolute;
  left: 8px;
  top: 440px;
  width: 190px;
  height: 190px;
  background: url('/media/games/burger-stacker/bin.png') 0 0 / 1710px 190px no-repeat;
  z-index: 12;
}

#bs-burger {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

#bs-lane {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.bs-item {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 50% 50%;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 4px 0 rgba(58, 29, 11, 0.18));
}

.bs-item.is-bad-drop {
  filter: drop-shadow(0 0 10px #ff2d2d) drop-shadow(0 0 4px #ff2d2d);
}

#bs-ticket {
  position: absolute;
  right: 22px;
  top: 270px;
  width: 250px;
  height: 330px;
  padding: 44px 26px 20px 30px;
  background: url('/media/games/burger-stacker/burger_stuff/scene/order-clean.png') center / 100% 100% no-repeat;
  transform: rotate(2deg);
  z-index: 8;
}

#bs-ticket-title {
  margin: 0 0 6px;
  text-align: center;
  font-size: 22px;
  line-height: 1;
  color: #3a1d0b;
}

#bs-ticket-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bs-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.bs-row img {
  width: 36px;
  height: 26px;
  object-fit: contain;
  flex: none;
}

.bs-row.is-done {
  opacity: 0.45;
  text-decoration: line-through;
}

.bs-row.is-next {
  background: #ffd23f;
  box-shadow: 0 0 0 2px #3a1d0b inset;
}

.bs-row.is-base {
  opacity: 0.45;
}

#bs-pops {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.bs-pop {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-size: 34px;
  color: #fff;
  -webkit-text-stroke: 3px #3a1d0b;
  paint-order: stroke fill;
  animation: bs-pop 0.9s ease-out forwards;
}

.bs-pop.is-good { color: #8ce99a; }
.bs-pop.is-bin { color: #ffd8a8; }
.bs-pop.is-big { font-size: 64px; color: #ffd23f; }
.bs-pop.is-bad { font-size: 48px; color: #ff6b6b; }

@keyframes bs-pop {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  70% { opacity: 1; transform: translate(-50%, -80%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(1); }
}

#bs-stage[data-state="fail"] #bs-play {
  animation: bs-shake 0.4s linear;
}

@keyframes bs-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-10px, 4px); }
  40% { transform: translate(9px, -4px); }
  60% { transform: translate(-6px, 2px); }
  80% { transform: translate(5px, -2px); }
}

#bs-start {
  position: absolute;
  inset: 0;
  display: none;
}

#bs-stage[data-state="start"] #bs-start {
  display: block;
}

#bs-start::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(20, 14, 10, 0.25);
}

#bs-chef {
  position: absolute;
  left: -40px;
  top: 150px;
  width: 504px;
  height: 456px;
  background: url('/media/games/burger-stacker/char.png') 0 0 / 2016px 2283px no-repeat;
  animation: bs-chef-x 0.5s steps(4) infinite, bs-chef-y 2.5s steps(5) infinite;
  filter: drop-shadow(0 10px 0 rgba(58, 29, 11, 0.25));
}

@keyframes bs-chef-x {
  to { background-position-x: -2016px; }
}

@keyframes bs-chef-y {
  to { background-position-y: -2283px; }
}

#bs-bubble {
  position: absolute;
  left: 400px;
  top: 90px;
  width: 740px;
  padding: 24px 34px 26px;
  border: 6px solid #3a1d0b;
  border-radius: 34px;
  background: linear-gradient(#fffdf6, #fff1d8);
  box-shadow: inset 0 -8px 0 rgba(232, 89, 12, 0.12), 0 10px 0 rgba(58, 29, 11, 0.3);
  color: #3a1d0b;
  animation: bs-card-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

#bs-bubble::before,
#bs-bubble::after {
  content: '';
  position: absolute;
  top: 120px;
  border-style: solid;
  border-color: transparent;
}

#bs-bubble::before {
  left: -58px;
  border-width: 26px 58px 26px 0;
  border-right-color: #3a1d0b;
}

#bs-bubble::after {
  left: -44px;
  margin-top: 8px;
  border-width: 18px 46px 18px 0;
  border-right-color: #fff8ec;
}

#bs-bubble h2 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 4px dashed rgba(58, 29, 11, 0.2);
  font-family: 'Hypermarket', 'lilita', sans-serif;
  font-size: 40px;
  font-weight: normal;
  text-align: center;
  color: #e8590c;
  -webkit-text-stroke: 5px #3a1d0b;
  paint-order: stroke fill;
}

#bs-bubble ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: bs-step;
  font-size: 25px;
  line-height: 1.3;
}

#bs-bubble li {
  position: relative;
  min-height: 38px;
  margin-bottom: 12px;
  padding-left: 54px;
  counter-increment: bs-step;
}

#bs-bubble li:last-child {
  margin-bottom: 0;
}

#bs-bubble li::before {
  content: counter(bs-step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 38px;
  height: 38px;
  border: 3px solid #3a1d0b;
  border-radius: 50%;
  background: #e8590c;
  box-shadow: 0 3px 0 #3a1d0b;
  box-sizing: border-box;
  color: #fff;
  font-size: 22px;
  line-height: 32px;
  text-align: center;
}

#bs-bubble b {
  color: #e8590c;
  font-weight: normal;
}

.bs-start-buttons {
  position: absolute;
  left: 400px;
  right: 120px;
  top: 530px;
  display: flex;
  justify-content: center;
}

.bs-start-buttons img,
.bs-over-buttons img {
  width: 300px;
  cursor: pointer;
  transition: transform 0.12s;
}

.bs-start-buttons img:hover,
.bs-over-buttons img:hover {
  transform: scale(1.06);
}

#bs-over {
  position: absolute;
  inset: 0;
  display: none;
  background: radial-gradient(ellipse at 50% 40%, rgba(20, 14, 10, 0.62), rgba(20, 14, 10, 0.88));
  z-index: 60;
}

#bs-stage[data-state="over"] #bs-over {
  display: block;
}

.bs-tower {
  position: absolute;
  left: 50%;
  top: 158px;
  width: 680px;
  margin-left: -340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45));
}

.bs-layer {
  position: relative;
  border: 5px solid #3a1d0b;
  transform-origin: 50% 100%;
  animation: bs-stack-drop 0.45s var(--drop) cubic-bezier(0.3, 0.9, 0.45, 1) both;
}

@keyframes bs-stack-drop {
  0% { opacity: 0; transform: translateY(-520px); }
  60% { opacity: 1; transform: translateY(0) scale(1.05, 0.86); }
  80% { transform: translateY(-8px) scale(0.98, 1.03); }
  100% { opacity: 1; transform: none; }
}

.bs-top-bun {
  --drop: 0.58s;
  z-index: 5;
  width: 620px;
  height: 124px;
  padding-top: 38px;
  border-radius: 310px 310px 24px 24px / 118px 118px 24px 24px;
  background:
    radial-gradient(ellipse 7px 4px at 16% 44%, #fff4d0 90%, transparent 100%),
    radial-gradient(ellipse 7px 4px at 25% 24%, #fff4d0 90%, transparent 100%),
    radial-gradient(ellipse 7px 4px at 36% 12%, #fff4d0 90%, transparent 100%),
    radial-gradient(ellipse 7px 4px at 63% 11%, #fff4d0 90%, transparent 100%),
    radial-gradient(ellipse 7px 4px at 75% 22%, #fff4d0 90%, transparent 100%),
    radial-gradient(ellipse 7px 4px at 85% 42%, #fff4d0 90%, transparent 100%),
    radial-gradient(ellipse 7px 4px at 9% 70%, #fff4d0 90%, transparent 100%),
    radial-gradient(ellipse 7px 4px at 92% 68%, #fff4d0 90%, transparent 100%),
    radial-gradient(ellipse at 40% 20%, #ffd58a 0%, transparent 45%),
    linear-gradient(#f5b24f, #e08a2c 70%, #c46a1c);
  box-shadow: inset 0 -10px 0 rgba(90, 40, 5, 0.22);
  text-align: center;
}

.bs-top-bun h2 {
  margin: 0;
  font-family: 'Hypermarket', 'lilita', sans-serif;
  font-size: 54px;
  font-weight: normal;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 7px #3a1d0b;
  paint-order: stroke fill;
  letter-spacing: 1px;
}

.bs-pick {
  position: absolute;
  left: 80%;
  bottom: 92px;
  width: 6px;
  height: 74px;
  border-radius: 3px;
  background: linear-gradient(90deg, #f3d9a6, #c9a36a);
  box-shadow: 0 0 0 2px #3a1d0b;
  transform: rotate(8deg);
  transform-origin: 50% 100%;
  display: none;
  animation: bs-pick-in 0.4s 1.15s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

#bs-over[data-best="1"] .bs-pick {
  display: block;
}

.bs-pick span {
  position: absolute;
  left: 6px;
  top: 4px;
  padding: 6px 22px 6px 12px;
  white-space: nowrap;
  font-family: 'lilita', sans-serif;
  font-size: 20px;
  line-height: 1;
  color: #3a1d0b;
  background: #ffd23f;
  border: 3px solid #3a1d0b;
  clip-path: polygon(0 0, 100% 0, 86% 50%, 100% 100%, 0 100%);
  transform-origin: 0 50%;
  animation: bs-flag-wave 1.4s 1.8s ease-in-out infinite;
}

@keyframes bs-pick-in {
  0% { opacity: 0; transform: translateY(-120px) rotate(8deg); }
  100% { opacity: 1; transform: rotate(8deg); }
}

@keyframes bs-flag-wave {
  0%, 100% { transform: skewY(0); }
  50% { transform: skewY(-5deg) scaleX(0.94); }
}

.bs-lettuce {
  --drop: 0.44s;
  z-index: 4;
  width: 660px;
  height: 26px;
  margin-top: -8px;
  border-radius: 14px;
  background: linear-gradient(#8fe05a, #4cb82f);
}

.bs-lettuce::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 100%;
  height: 16px;
  margin-top: 1px;
  background: radial-gradient(circle at 15px 0, #4cb82f 0 11px, #3a1d0b 11px 15px, transparent 15px) 0 0 / 30px 16px repeat-x;
}

.bs-patty {
  --drop: 0.3s;
  z-index: 2;
  width: 600px;
  height: 104px;
  margin-top: -2px;
  border-radius: 52px;
  background:
    repeating-linear-gradient(100deg, transparent 0 46px, rgba(30, 12, 2, 0.35) 46px 54px),
    radial-gradient(ellipse at 50% 30%, #8f4f26, #5b2c10 80%);
  box-shadow: inset 0 6px 0 rgba(255, 200, 150, 0.18), inset 0 -8px 0 rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.bs-patty-stat {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.bs-patty-stat span {
  font-size: 22px;
  letter-spacing: 2px;
  color: #ffd9a8;
}

.bs-patty-stat strong {
  font-family: 'Hypermarket', 'lilita', sans-serif;
  font-size: 54px;
  font-weight: normal;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 7px #3a1d0b;
  paint-order: stroke fill;
}

.bs-patty-best strong {
  color: #ffd23f;
}

.bs-bottom-bun {
  --drop: 0.16s;
  z-index: 1;
  width: 612px;
  height: 76px;
  margin-top: -4px;
  border-radius: 14px 14px 70px 70px / 14px 14px 40px 40px;
  background: linear-gradient(#f5b24f, #d9852b 75%, #b8651c);
  box-shadow: inset 0 8px 0 rgba(255, 230, 170, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.bs-bottom-bun span {
  font-size: 22px;
  letter-spacing: 2px;
  color: #5b2c10;
}

.bs-bottom-bun strong {
  font-family: 'Hypermarket', 'lilita', sans-serif;
  font-size: 42px;
  font-weight: normal;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 6px #3a1d0b;
  paint-order: stroke fill;
}

.bs-over-buttons {
  position: absolute;
  left: 0;
  right: 0;
  top: 512px;
  display: flex;
  justify-content: center;
  gap: 40px;
  animation: bs-buttons-in 0.35s 0.95s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes bs-buttons-in {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: none; }
}

.bs-over-buttons img {
  width: 250px;
}
