* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #08080f;
  color: #c0dde0;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* --- HUD Top Bar --- */
#hud-top {
  width: 1024px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 40, 50, 0.6);
  border: 1px solid rgba(0, 229, 204, 0.3);
  border-bottom: none;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#map-name { color: #00e5cc; }

#compass {
  color: #ff6633;
  font-size: 16px;
  letter-spacing: 4px;
}

/* --- Viewport --- */
#viewport {
  position: relative;
  width: 1024px;
  height: 768px;
  background: #050510;
  border: 1px solid rgba(0, 229, 204, 0.4);
  box-shadow: 0 0 30px rgba(0, 229, 204, 0.1), inset 0 0 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

#view-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#view-canvas:active {
  cursor: grabbing;
}

#scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 2;
}

#vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
  z-index: 3;
}

#room-label {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 20, 30, 0.85);
  border: 1px solid rgba(0, 229, 204, 0.3);
  padding: 8px 24px;
  font-size: 13px;
  color: #c0dde0;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 4;
  text-align: center;
  max-width: 600px;
  pointer-events: none;
}

#room-label.visible {
  opacity: 1;
}

/* --- Minimap --- */
#minimap {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 15, 20, 0.8);
  border: 1px solid rgba(0, 229, 204, 0.3);
  z-index: 5;
}

/* --- HUD Bottom --- */
#hud-bottom {
  width: 1024px;
  background: rgba(0, 40, 50, 0.6);
  border: 1px solid rgba(0, 229, 204, 0.3);
  border-top: none;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#room-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#room-name {
  font-size: 16px;
  color: #00e5cc;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#room-desc {
  font-size: 12px;
  color: rgba(192, 221, 224, 0.6);
}

#nav-controls {
  display: flex;
  gap: 6px;
}

.nav-btn {
  background: rgba(0, 40, 50, 0.7);
  border: 1px solid rgba(0, 229, 204, 0.4);
  color: #00e5cc;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 13px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(0, 229, 204, 0.15);
  box-shadow: 0 0 12px rgba(0, 229, 204, 0.3);
}

.nav-btn:active:not(:disabled) {
  background: rgba(0, 229, 204, 0.25);
}

.nav-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  border-color: rgba(0, 229, 204, 0.15);
}

/* --- Responsive --- */
@media (max-width: 1060px) {
  #hud-top, #viewport, #hud-bottom {
    width: 100vw;
  }
  #viewport {
    height: calc(100vw * 0.75);
  }
}

/* --- Loading overlay --- */
#loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #050510;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  transition: opacity 0.4s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#loading-title {
  font-size: 14px;
  letter-spacing: 4px;
  color: #00e5cc;
  text-transform: uppercase;
}

#loading-bar {
  width: 60%;
  max-width: 480px;
  height: 12px;
  background: rgba(0, 40, 50, 0.6);
  border: 1px solid rgba(0, 229, 204, 0.5);
  overflow: hidden;
  position: relative;
}

#loading-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(0, 229, 204, 0.7), #00e5cc);
  box-shadow: 0 0 12px rgba(0, 229, 204, 0.6);
  transition: width 0.15s linear;
}

#loading-detail {
  font-size: 12px;
  color: rgba(192, 221, 224, 0.7);
  letter-spacing: 1px;
}
