:root {
  --preview-aspect-width: 9;
  --preview-aspect-height: 16;
  --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);
}

html,
body {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  overflow: hidden;
  background: #030712;
}

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

#PreviewFrame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#GameDiv {
  position: relative;
  width: min(100vw, calc(100vh * var(--preview-aspect-width) / var(--preview-aspect-height))) !important;
  height: min(100vh, calc(100vw * var(--preview-aspect-height) / var(--preview-aspect-width))) !important;
  margin: 0 !important;
  overflow: hidden;
  background: #030712;
}

#Cocos3dGameContainer,
#GameCanvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

canvas {
  background-color: transparent;
}

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


/* cute-ancient-first-screen */
#CuteAncientSplash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  color: #682f2b;
  background: #f5ddbd url("./startup/background.jpg") center / cover no-repeat;
  opacity: 1;
  transition: opacity 240ms ease;
}

#CuteAncientSplash::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(255, 239, 207, 0.22);
  pointer-events: none;
}

#CuteAncientSplash.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.cute-ancient-splash__brand,
.cute-ancient-splash__case,
.cute-ancient-splash__hint,
.cute-ancient-splash__progress {
  position: relative;
  z-index: 1;
}

.cute-ancient-splash__brand {
  color: #7b3028;
  font: 700 clamp(34px, 8vw, 56px) / 1.1 "STKaiti", "KaiTi", serif;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-shadow: 0 2px 0 rgba(255, 239, 207, 0.8);
}

.cute-ancient-splash__case {
  display: block;
  width: min(58vw, 360px);
  max-height: 42vh;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(78, 35, 28, 0.22));
}

.cute-ancient-splash__hint {
  padding: 7px 20px;
  border: 1px solid rgba(217, 164, 65, 0.72);
  border-radius: 999px;
  background: rgba(255, 244, 218, 0.88);
  font: 600 16px / 1.4 "STKaiti", "KaiTi", serif;
  letter-spacing: 0.12em;
}

.cute-ancient-splash__progress {
  width: min(54vw, 280px);
  height: 7px;
  border: 1px solid rgba(217, 164, 65, 0.74);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 244, 218, 0.64);
}

.cute-ancient-splash__progress i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b9472e, #d9a441, #b9472e);
  animation: cute-ancient-loading 1.15s ease-in-out infinite alternate;
}

@keyframes cute-ancient-loading {
  from { transform: translateX(-12%); }
  to { transform: translateX(150%); }
}
