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

body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  overflow: hidden;
  color: #665c48;
  background-color: #fff8e8;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
}

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

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

#startup-loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: #fff8e8;
  opacity: 1;
  transition: opacity 0.3s ease;
}

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

.startup-loading__card {
  width: min(86vw, 430px);
  padding: 42px 24px 38px;
  box-sizing: border-box;
  border: 2px solid rgba(190, 169, 112, 0.38);
  border-radius: 36px;
  background: rgba(255, 252, 238, 0.96);
  box-shadow: 0 18px 50px rgba(111, 104, 75, 0.12);
}

.startup-loading__title,
.startup-loading__subtitle,
.startup-loading__message {
  margin: 0;
}

.startup-loading__title {
  color: #596a46;
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.startup-loading__subtitle {
  margin-top: 12px;
  color: #b28d56;
  font-size: clamp(21px, 6vw, 30px);
  font-weight: 600;
  letter-spacing: 0.12em;
}

.startup-loading__meadow {
  display: flex;
  justify-content: center;
  gap: 10px;
  height: 20px;
  margin: 34px 0 20px;
}

.startup-loading__meadow span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #a8b989;
  animation: startup-dot 1.2s ease-in-out infinite;
}

.startup-loading__meadow span:nth-child(2) {
  animation-delay: 0.16s;
  background: #d5b97b;
}

.startup-loading__meadow span:nth-child(3) {
  animation-delay: 0.32s;
}

.startup-loading__message {
  min-height: 28px;
  color: #786f59;
  font-size: 17px;
  line-height: 28px;
}

.startup-loading__retry {
  min-width: 150px;
  min-height: 50px;
  margin-top: 22px;
  padding: 0 28px;
  border: 2px solid #9bac7e;
  border-radius: 25px;
  color: #536344;
  background: #eef3df;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

.startup-loading__retry[hidden] {
  display: none;
}

@keyframes startup-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
  30% { transform: translateY(-8px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .startup-loading__meadow span { animation: none; }
  #startup-loading { transition-duration: 0.2s; }
}

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