html {
  -ms-touch-action: none;
}

body,
canvas,
div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -khtml-user-select: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  overflow: hidden;
  cursor: default;
  color: #212a34;
  background: #f7f5ee;
  text-align: center;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

#GameDiv,
#Cocos3dGameContainer,
#GameCanvas {
  width: 100%;
  height: 100%;
}

#shelf-pop-loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 22px;
  padding: 32px;
  background: #f7f5ee;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.shelf-pop-ready #shelf-pop-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-sign {
  width: min(650px, calc(100vw - 48px));
  border-radius: 16px;
  padding: 30px 22px;
  background: #234958;
  box-sizing: border-box;
}

.loader-title {
  color: #ffffff;
  font-size: clamp(34px, 8vw, 58px);
  line-height: 1;
  font-weight: 700;
}

.loader-subtitle {
  margin-top: 16px;
  color: #ffe498;
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 700;
}

.loader-shelf {
  display: flex;
  justify-content: center;
  gap: 18px;
  width: min(560px, calc(100vw - 64px));
  margin: 0 auto;
  padding: 24px 22px;
  border-radius: 14px;
  background: #2f545a;
  box-sizing: border-box;
}

.loader-product {
  display: grid;
  place-items: center;
  width: clamp(48px, 12vw, 72px);
  aspect-ratio: 1;
  border-radius: 10px;
  box-shadow: inset 0 10px 0 rgba(255, 255, 255, 0.22);
}

.loader-product.apple { background: #e54b4b; }
.loader-product.bread { background: #dea24a; }
.loader-product.milk { background: #5a97d6; }
.loader-product.soda { background: #36ad8e; }
.loader-product.candy { background: #bc60be; }

.product-icon {
  position: relative;
  display: block;
  width: 62%;
  height: 62%;
}

.product-icon::before,
.product-icon::after {
  position: absolute;
  display: block;
  content: "";
}

.loader-product.apple .product-icon::before {
  left: 24%;
  top: 28%;
  width: 52%;
  height: 48%;
  border-radius: 42% 42% 48% 48%;
  background: #fff6dc;
}

.loader-product.apple .product-icon::after {
  left: 52%;
  top: 14%;
  width: 28%;
  height: 16%;
  border-radius: 999px;
  background: #70cb80;
}

.loader-product.bread .product-icon::before {
  left: 12%;
  top: 30%;
  width: 76%;
  height: 42%;
  border-radius: 40% 40% 22% 22%;
  background: #fff6dc;
}

.loader-product.bread .product-icon::after {
  left: 25%;
  top: 39%;
  width: 50%;
  height: 10%;
  border-radius: 999px;
  background: rgba(222, 162, 74, 0.7);
}

.loader-product.milk .product-icon::before {
  left: 30%;
  top: 18%;
  width: 40%;
  height: 66%;
  border-radius: 7px;
  background: #ffffff;
}

.loader-product.milk .product-icon::after {
  left: 36%;
  top: 34%;
  width: 28%;
  height: 16%;
  border-radius: 5px;
  background: rgba(90, 151, 214, 0.72);
}

.loader-product.soda .product-icon::before {
  left: 32%;
  top: 18%;
  width: 36%;
  height: 66%;
  border-radius: 9px;
  background: #ffffff;
}

.loader-product.soda .product-icon::after {
  left: 37%;
  top: 47%;
  width: 26%;
  height: 14%;
  border-radius: 999px;
  background: rgba(54, 173, 142, 0.72);
}

.loader-product.candy .product-icon {
  width: 70%;
}

.loader-product.candy .product-icon::before {
  left: 26%;
  top: 36%;
  width: 48%;
  height: 30%;
  border-radius: 8px;
  background: #ffffff;
}

.loader-product.candy .product-icon::after {
  left: 10%;
  top: 39%;
  width: 80%;
  height: 24%;
  border-radius: 6px;
  background:
    linear-gradient(90deg, #fff6dc 0 18%, transparent 18% 82%, #fff6dc 82% 100%),
    linear-gradient(90deg, transparent 0 45%, rgba(188, 96, 190, 0.58) 45% 55%, transparent 55% 100%);
}

.loader-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(420px, calc(100vw - 64px));
  margin: 0 auto;
  color: #212a34;
  font-size: 15px;
  font-weight: 700;
}

.loader-guide span {
  padding: 10px 8px;
  border-radius: 10px;
  background: #ffffff;
}

.loader-bar {
  width: min(420px, calc(100vw - 64px));
  height: 14px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: #ffe498;
}

.loader-bar span {
  display: block;
  width: 48%;
  height: 100%;
  border-radius: inherit;
  background: #36ad8e;
  animation: shelf-pop-load 1.15s ease-in-out infinite alternate;
}

@keyframes shelf-pop-load {
  from {
    transform: translateX(-18%);
  }
  to {
    transform: translateX(122%);
  }
}

:root {
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
}
