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;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

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

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  cursor: default;
  color: #5d412c;
  background-color: #f7efd7;
  text-align: center;
  font-family: Helvetica, Verdana, Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

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

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

.cat-loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(224, 170, 96, 0.34) 0 42px, transparent 42px),
    radial-gradient(circle at 24% 32%, rgba(183, 215, 142, 0.5) 0 78px, transparent 79px),
    radial-gradient(circle at 82% 72%, rgba(244, 189, 126, 0.35) 0 72px, transparent 73px),
    #fff4d8;
  color: #5d412c;
  opacity: 1;
  transition: opacity 280ms ease;
}

.cat-loading--hidden {
  opacity: 0;
  pointer-events: none;
}

.cat-loading__panel {
  position: relative;
  width: min(86vw, 356px);
  min-height: 318px;
  transform: translateY(-4vh);
}

.cat-loading__rope {
  position: absolute;
  top: -70px;
  width: 10px;
  height: 104px;
  border-radius: 999px;
  background: repeating-linear-gradient(135deg, #8a5a32 0 8px, #d1a069 8px 16px);
  box-shadow: inset -2px 0 0 rgba(74, 45, 24, 0.25);
}

.cat-loading__rope--left {
  left: 44px;
}

.cat-loading__rope--right {
  right: 44px;
}

.cat-loading__sign {
  position: relative;
  height: 74px;
  border: 3px solid #82522e;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 226, 158, 0.5), rgba(188, 120, 62, 0.22)),
    repeating-linear-gradient(0deg, #c98d4d 0 17px, #d99f5c 17px 34px);
  box-shadow: 0 8px 0 rgba(111, 74, 42, 0.16), inset 0 3px 0 rgba(255, 239, 184, 0.62);
}

.cat-loading__brand {
  display: block;
  padding-top: 14px;
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  color: #5b3922;
  text-shadow: 0 2px 0 rgba(255, 224, 158, 0.75);
}

.cat-loading__paw,
.cat-loading__face {
  position: absolute;
  top: 17px;
  color: rgba(94, 61, 35, 0.72);
  font-weight: 700;
}

.cat-loading__paw {
  left: 18px;
  font-size: 11px;
  transform: rotate(-8deg);
}

.cat-loading__face {
  right: 16px;
  font-size: 16px;
}

.cat-loading__desk {
  position: relative;
  margin: 34px auto 0;
  width: min(100%, 328px);
  min-height: 196px;
  border: 3px solid rgba(126, 86, 55, 0.72);
  border-radius: 26px;
  background: #fff8df;
  box-shadow: 0 10px 0 rgba(112, 80, 45, 0.12), inset 0 4px 0 rgba(255, 255, 248, 0.9);
}

.cat-loading__desk::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 30px;
  height: 46px;
  border: 3px solid rgba(124, 82, 47, 0.62);
  border-radius: 18px;
  background:
    linear-gradient(90deg, transparent 0 32%, rgba(126, 86, 55, 0.24) 32% 34%, transparent 34% 66%, rgba(126, 86, 55, 0.24) 66% 68%, transparent 68%),
    #c88a4d;
  box-shadow: inset 0 5px 0 rgba(255, 219, 145, 0.44);
}

.cat-loading__cat {
  position: absolute;
  left: 28px;
  top: 34px;
  width: 82px;
  height: 72px;
  border: 3px solid #7c5230;
  border-radius: 46% 46% 42% 42%;
  background:
    radial-gradient(circle at 30% 48%, #5d5d5b 0 9px, transparent 10px),
    radial-gradient(circle at 72% 38%, #e4944d 0 12px, transparent 13px),
    #fff6dd;
  box-shadow: 0 6px 0 rgba(99, 67, 38, 0.13);
  animation: cat-loading-bob 1.5s ease-in-out infinite alternate;
}

.cat-loading__ear {
  position: absolute;
  top: -18px;
  width: 30px;
  height: 30px;
  border: 3px solid #7c5230;
  border-radius: 8px 8px 0 8px;
  background: #fff6dd;
  transform: rotate(45deg);
}

.cat-loading__ear--left {
  left: 7px;
}

.cat-loading__ear--right {
  right: 7px;
}

.cat-loading__eye {
  position: absolute;
  top: 30px;
  width: 7px;
  height: 8px;
  border-radius: 999px;
  background: #5d412c;
}

.cat-loading__eye--left {
  left: 27px;
}

.cat-loading__eye--right {
  right: 27px;
}

.cat-loading__mouth {
  position: absolute;
  left: 0;
  right: 0;
  top: 42px;
  font-size: 15px;
  font-weight: 700;
  color: #7c5230;
}

.cat-loading__ticket {
  position: absolute;
  right: 22px;
  top: 36px;
  width: 174px;
  min-height: 92px;
  border: 2px solid rgba(126, 86, 55, 0.38);
  border-radius: 18px;
  background: #fff2ce;
  box-shadow: inset 0 3px 0 rgba(255, 255, 248, 0.75);
}

.cat-loading__status {
  margin-top: 14px;
  min-height: 20px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #5d412c;
}

.cat-loading__hint {
  margin-top: 2px;
  font-size: 11px;
  color: #7e6b4f;
}

.cat-loading__bar {
  height: 6px;
  margin: 14px auto 0;
  width: 136px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(126, 86, 55, 0.28);
  background: rgba(126, 86, 55, 0.15);
}

.cat-loading__bar span {
  display: block;
  width: 48%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #69b2d4, #78b971, #e7aa49);
  animation: cat-loading-slide 1.15s ease-in-out infinite;
}

.cat-loading__cloud {
  position: absolute;
  width: 190px;
  height: 76px;
  border-radius: 999px;
  background: rgba(255, 255, 248, 0.48);
}

.cat-loading__cloud::before,
.cat-loading__cloud::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: inherit;
}

.cat-loading__cloud::before {
  left: 34px;
  top: -24px;
  width: 74px;
  height: 74px;
}

.cat-loading__cloud::after {
  right: 34px;
  top: -14px;
  width: 62px;
  height: 62px;
}

.cat-loading__cloud--left {
  left: -74px;
  top: 18%;
}

.cat-loading__cloud--right {
  right: -86px;
  bottom: 18%;
}

.cat-loading--error .cat-loading__bar span {
  background: #d3955d;
  animation: none;
}

@keyframes cat-loading-slide {
  0% {
    transform: translateX(-115%);
  }
  100% {
    transform: translateX(260%);
  }
}

@keyframes cat-loading-bob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}

@media (max-width: 340px) {
  .cat-loading__panel {
    width: 92vw;
  }

  .cat-loading__desk {
    width: 100%;
  }

  .cat-loading__cat {
    left: 18px;
    width: 72px;
    height: 64px;
  }

  .cat-loading__ticket {
    right: 16px;
    width: 160px;
  }
}

: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);
}
