/* Chunk 3D terrain debug modal — Sheikah-slate styling */

.chunk-terrain-3d-overlay {
  position: fixed;
  inset: 0;
  z-index: 185;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.chunk-terrain-3d-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.chunk-terrain-3d-overlay__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(18, 48, 88, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(8, 20, 42, 0.85) 0%, transparent 50%),
    linear-gradient(168deg, #06101f 0%, #0a1830 38%, #071428 100%);
}

.chunk-terrain-3d-overlay__frame {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: clamp(12px, 2.5vh, 28px) clamp(16px, 3vw, 40px);
  min-height: 0;
  border: 2px solid rgba(72, 196, 255, 0.35);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(12, 32, 58, 0.9) inset,
    0 0 48px rgba(40, 140, 220, 0.12),
    0 24px 64px rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, rgba(8, 22, 42, 0.92) 0%, rgba(5, 14, 28, 0.96) 100%);
  overflow: hidden;
}

.chunk-terrain-3d-overlay__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(72, 168, 220, 0.18);
}

.chunk-terrain-3d-overlay__title {
  margin: 0;
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(180, 230, 255, 0.95);
}

.chunk-terrain-3d-overlay__subtitle {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: rgba(140, 190, 220, 0.72);
}

.chunk-terrain-3d-overlay__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(72, 168, 220, 0.35);
  border-radius: 4px;
  background: rgba(8, 24, 48, 0.65);
  color: rgba(220, 240, 255, 0.9);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.chunk-terrain-3d-overlay__close:hover {
  background: rgba(24, 56, 96, 0.85);
  border-color: rgba(120, 210, 255, 0.55);
}

.chunk-terrain-3d-overlay__body {
  flex: 1;
  display: flex;
  min-height: 0;
  gap: 0;
}

.chunk-terrain-3d-overlay__viewport {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  background: radial-gradient(ellipse 80% 70% at 50% 40%, rgba(16, 40, 72, 0.5) 0%, rgba(4, 10, 22, 0.95) 100%);
}

.chunk-terrain-3d-overlay__canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.chunk-terrain-3d-overlay__canvas:active {
  cursor: grabbing;
}

.chunk-terrain-3d-overlay__sidebar {
  width: min(240px, 32vw);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px;
  border-left: 1px solid rgba(72, 168, 220, 0.18);
  background: rgba(4, 12, 26, 0.55);
  overflow-y: auto;
}

.chunk-terrain-3d-overlay__section-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(120, 190, 230, 0.75);
}

.chunk-terrain-3d-overlay__mode-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chunk-terrain-3d-overlay__mode {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(210, 228, 240, 0.88);
  cursor: pointer;
}

.chunk-terrain-3d-overlay__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(210, 228, 240, 0.88);
  cursor: pointer;
}

.chunk-terrain-3d-overlay__readout {
  margin: 0;
  padding: 10px;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  color: rgba(180, 220, 245, 0.92);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(72, 168, 220, 0.15);
  border-radius: 3px;
  min-height: 120px;
}

.chunk-terrain-3d-overlay__hint {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: rgba(120, 160, 190, 0.65);
}

.minimap-widget__3d-label {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}

.minimap-widget__corner-controls--top-right {
  top: calc(var(--minimap-ring-pad) - 6px);
  right: calc(var(--minimap-ring-pad) - 6px);
}

.minimap-widget.is-interior .minimap-widget__corner-controls--top-right {
  display: none;
}
