/* Full-viewport Windows 95 maze — no letterboxing */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

#viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  touch-action: none;
}

#maze-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  touch-action: none;
  cursor: crosshair;
}

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  pointer-events: none;
}

#hud > * { pointer-events: auto; }

.hud-label {
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 3px #000;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
}

button.hud-btn {
  appearance: none;
  border: 1px solid #888;
  background: linear-gradient(180deg, #e8e8e8, #b8b8b8);
  color: #111;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 1px 1px 0 #fff, 0 1px 2px rgba(0,0,0,0.4);
}

button.hud-btn:active {
  background: linear-gradient(180deg, #b8b8b8, #e8e8e8);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.35);
}

button.hud-btn.active {
  background: linear-gradient(180deg, #9cf, #5af);
  border-color: #48c;
}

@media (pointer: coarse), (max-width: 900px) {
  button.hud-btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
    touch-action: manipulation;
  }
  #hud {
    z-index: 20;
    gap: 10px;
    padding: 12px;
  }
}

#hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  color: #fff;
  font-size: 13px;
  text-align: center;
  text-shadow: 0 1px 4px #000;
  background: rgba(0,0,0,0.5);
  padding: 8px 14px;
  border-radius: 6px;
  max-width: 90vw;
  transition: opacity 1s;
  pointer-events: none;
}

#hint.fade { opacity: 0; }

/* Virtual stick (mobile) */
#stick {
  display: none;
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 120px;
  height: 120px;
  z-index: 12;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.25);
  touch-action: none;
}

#stick.visible { display: block; }

#stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: 2px solid rgba(255,255,255,0.5);
  pointer-events: none;
}

.look-hint {
  display: none;
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(36px, env(safe-area-inset-bottom));
  z-index: 11;
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  text-align: right;
  pointer-events: none;
}

@media (pointer: coarse), (max-width: 900px) {
  .look-hint { display: block; }
  #hint { bottom: 150px; }
}

#minimap {
  position: absolute;
  top: 52px;
  right: 10px;
  z-index: 10;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  background: rgba(0,0,0,0.5);
}

#minimap.hidden { display: none; }

@media (max-width: 500px) {
  #minimap {
    width: 120px;
    height: 120px;
    top: auto;
    bottom: max(150px, env(safe-area-inset-bottom));
    right: 8px;
  }
}
