html,
body {
  margin: 0;
  height: 100%;
  background-image: url(../assets/images/backgrounds/background.png);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

#gameContainer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameContainer::before {
  content: "";
  position: absolute;
  width: 820px;
  height: 580px;
  background: radial-gradient(circle,
      rgba(255, 210, 140, 0.25),
      rgba(0, 0, 0, 0) 70%);
  filter: blur(35px);
  z-index: 0;
}

canvas {
  position: relative;
  z-index: 1;
  width: 720px;
  height: 480px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 12px;
  border: 14px solid #3b2515;
  box-shadow:
    inset 0 0 0 3px #b58a45,
    inset 0 0 0 6px #6b4425,
    inset 0 0 0 10px #2a1a0f,
    0 20px 60px rgba(0, 0, 0, 0.75);
  touch-action: none;
}

:fullscreen canvas,
:-webkit-full-screen canvas {
  width: 100vw;
  height: 100vh;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.tc-btn.tc-active {
  background: rgba(155, 115, 26, 0.78) !important;
  border-color: rgba(240, 200, 78, 0.95) !important;
  color: rgba(255, 248, 168, 1.0) !important;
}

#rotateOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 6, 3, 0.94);
  color: #f0c040;
  text-align: center;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 32px;
  box-sizing: border-box;
}

#rotateOverlay .rotate-icon {
  font-size: 72px;
  line-height: 1;
  animation: rotatePulse 2s ease-in-out infinite;
}

@keyframes rotatePulse {
  0%,
  100% {
    opacity: 1.0;
    transform: rotate(0deg);
  }

  50% {
    opacity: 0.65;
    transform: rotate(90deg);
  }
}

#rotateOverlay .rotate-main {
  font-size: 20px;
  font-weight: bold;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

#rotateOverlay .rotate-sub {
  font-size: 15px;
  color: #c8b090;
}

@media (pointer: coarse) {
  #gameContainer::before {
    display: none;
  }
}

@media (pointer: coarse) and (orientation: landscape) {
  html,
  body {
    width: 100vw;
    height: 100vh;
    width: 100dvw;
    height: 100dvh;
    min-width: 100dvw;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    background: #050505;
    background-image: none;
  }

  body {
    position: fixed;
    inset: 0;
  }

  #gameContainer {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    width: 100dvw;
    height: 100dvh;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #000;
  }

  #gameContainer::before {
    display: none !important;
  }

  canvas {
    display: block;
    width: min(100vw, calc(100vh * 1.5));
    width: min(100dvw, calc(100dvh * 1.5));
    height: min(100vh, calc(100vw * 0.6667));
    height: min(100dvh, calc(100dvw * 0.6667));
    max-width: none;
    max-height: none;
    aspect-ratio: 3 / 2;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (pointer: coarse) and (orientation: portrait) {
  #rotateOverlay {
    display: flex;
  }
}
