:root {
  color-scheme: light;
  --sand: #d7b684;
  --leaf: #2f7a3a;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, #efe0b8 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, #8fbf6a 0%, transparent 40%),
    linear-gradient(160deg, #c9a66b, #8f6a3a 55%, #3d6b3a);
}

body {
  display: grid;
  place-items: center;
  touch-action: none;
  user-select: none;
  font-family: "Segoe UI", system-ui, sans-serif;
}

#rotate-device {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  text-align: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(50, 128, 78, .96), rgba(15, 55, 42, .99) 68%),
    #173f32;
}

#rotate-device img {
  width: min(68vw, 330px);
  height: auto;
  animation: rotate-hint 1.8s ease-in-out infinite;
}

#rotate-device h1,
#rotate-device p {
  margin: 0;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow:
    -2px -2px 0 #1a2e18,
     2px -2px 0 #1a2e18,
    -2px  2px 0 #1a2e18,
     2px  2px 0 #1a2e18;
}

#rotate-device h1 { font-size: clamp(30px, 8vw, 52px); line-height: 1.25; }
#rotate-device p { font-size: clamp(20px, 5vw, 30px); }

@keyframes rotate-hint {
  0%, 100% { transform: rotate(-3deg) scale(.98); }
  50% { transform: rotate(3deg) scale(1.03); }
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  #rotate-device { display: grid; }
  #game-shell { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  #rotate-device img { animation: none; }
}

#game-shell {
  width: min(100vw, calc(100vh * 9 / 16));
  height: min(100vh, calc(100vw * 16 / 9));
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(30, 20, 8, 0.45);
  background: var(--sand);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
  image-rendering: auto;
}
