:root {
  color-scheme: dark;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  font-family: -apple-system, "Segoe UI", sans-serif;
}

#game-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#game-container canvas {
  touch-action: none;
}

#hud {
  position: fixed;
  top: env(safe-area-inset-top, 6px);
  left: env(safe-area-inset-left, 8px);
  right: env(safe-area-inset-right, 8px);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  color: rgba(200, 210, 220, 0.6);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

#control-hint {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  transform: translateX(-50%);
  pointer-events: none;
  color: rgba(255, 242, 194, 0.55);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  z-index: 15;
  white-space: nowrap;
}

/* Faint, always-on zone markers so touch controls are discoverable without
   covering the screen in solid buttons. Positions must stay in sync with
   the zone fractions in config.js (CONFIG.controls.touch). */
#touch-zone-hints {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

@media (pointer: coarse) {
  #touch-zone-hints {
    display: block;
  }
}

.zone-hint {
  position: absolute;
  color: rgba(255, 242, 194, 0.3);
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: translate(-50%, -50%);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.zone-hint-move-left {
  left: 12.5%;
  bottom: 18%;
  font-size: 28px;
}

.zone-hint-move-right {
  left: 37.5%;
  bottom: 18%;
  font-size: 28px;
}

.zone-hint-jump {
  left: 75%;
  top: 30%;
  font-size: 13px;
}

.zone-hint-crouch {
  left: 75%;
  top: 80%;
  font-size: 13px;
}

#fullscreen-btn {
  display: none;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  z-index: 20;
  background: rgba(10, 13, 18, 0.55);
  border: 1px solid rgba(255, 242, 194, 0.3);
  color: #fff2c2;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 7px 12px;
  border-radius: 6px;
}

/* touch/phone/tablet as primary input — desktop mouse users never see this,
   even if they resize a narrow window */
@media (pointer: coarse) {
  #fullscreen-btn {
    display: inline-block;
  }
}

#rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at center, rgba(8, 9, 12, 0.97) 0%, rgba(2, 2, 4, 0.99) 80%);
  text-align: center;
  padding: 24px;
  cursor: pointer; /* tappable as a manual re-check if auto-detection ever gets stuck */
}

#rotate-overlay.hidden {
  display: none;
}

.rotate-icon {
  font-size: 56px;
  animation: rotate-hint 1.6s ease-in-out infinite;
}

@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
}

.rotate-title {
  font-size: 19px;
  letter-spacing: 2px;
  color: #fff2c2;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(255, 242, 194, 0.35);
}

.rotate-sub {
  font-size: 13px;
  color: rgba(200, 210, 220, 0.6);
  max-width: 280px;
  line-height: 1.5;
}

.rotate-retry-hint {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 242, 194, 0.45);
  margin-top: 6px;
}
