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

html {
  -ms-touch-action: none;
  background: #2d1812;
}

body, canvas, div, main {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  color: #f8ecdc;
  background: radial-gradient(circle at 50% 20%, #573023 0%, #2d1812 72%);
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

canvas {
  background: transparent;
  user-select: none;
  -webkit-user-select: none;
}

#GameDiv {
  width: min(100vw, calc(100vh * 390 / 844)) !important;
  height: min(100vh, calc(100vw * 844 / 390)) !important;
  max-width: 100vw;
  max-height: 100vh;
  box-shadow: 0 0 28px rgba(20, 8, 4, 0.35);
}

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

#GameStatus {
  position: fixed;
  z-index: 10;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 220px;
  padding: 18px 22px;
  border-radius: 12px;
  background: rgba(34, 15, 10, 0.88);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  font-size: 14px;
}

#GameStatus[hidden] {
  display: none;
}

#GameRetry {
  padding: 9px 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #2d1812;
  background: #f3cf8f;
  font: inherit;
  cursor: pointer;
}

#ComplianceFooter {
  position: fixed;
  z-index: 9;
  right: calc(10px + var(--safe-right));
  bottom: calc(6px + var(--safe-bottom));
  left: calc(10px + var(--safe-left));
  display: flex;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  font-size: 11px;
}

#ComplianceFooter[hidden] {
  display: none;
}

#ComplianceFooter a {
  color: rgba(255, 255, 255, 0.64);
  pointer-events: auto;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

#ComplianceFooter a:hover,
#ComplianceFooter a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
  }
}
