body {
  margin: 0;
  background: #111;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  /* Safe-area insets for notched mobile devices */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
canvas {
  position: absolute;
  image-rendering: pixelated;
}
#game {
  z-index: 1;
  cursor: default;
}
#light {
  z-index: 2;
  pointer-events: none; /* to not intercept mouse events */
}

/* ── Mobile Controls ── */
#mobile-controls {
  touch-action: none;
}

/* ── Orientation Lock Overlay ── */
#rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  font-family: sans-serif;
  text-align: center;
  padding: 20px;
}
#rotate-overlay .icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: rotate-icon 2s ease-in-out infinite;
}
@keyframes rotate-icon {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}
#rotate-overlay .text {
  font-size: 18px;
  max-width: 300px;
  line-height: 1.4;
}

/* ── Mobile Layout Breakpoints ── */
@media (max-width: 768px) {
  /* On small screens, reduce UI element sizes */
  #character-info {
    width: 160px !important;
    font-size: 10px !important;
    padding: 6px !important;
    left: 10px !important;
    bottom: 180px !important;
  }

  #skill-bar {
    display: none !important; /* hidden on mobile — uses MobileControls instead */
  }
}

/* Landscape phone or small tablet */
@media (max-width: 1024px) and (orientation: landscape) {
  #character-info {
    width: 160px !important;
  }
}

/* ── Fullscreen prompt ── */
#fullscreen-prompt {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9998;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-family: sans-serif;
  text-align: center;
  padding: 30px 40px;
  border-radius: 12px;
  border: 1px solid #4a9eff;
}
#fullscreen-prompt button {
  margin-top: 16px;
  padding: 10px 24px;
  font-size: 16px;
  background: #4a9eff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#fullscreen-prompt button:hover {
  background: #6ab0ff;
}