/* Tab — hide all UI */
.ui-hidden { display: none !important; }

/* Hide Google Maps alpha development warning banner */
.vAygCK-api-load-alpha-banner { display: none !important; }

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Courier New', Courier, monospace;
}

/* ── Map fills the entire viewport ── */
#map-container {
  position: absolute;
  inset: 0;
}

#map-container gmp-map-3d {
  width: 100%;
  height: 100%;
}

/* ── Transport panel (draggable) ── */
#transport {
  position: fixed;
  right: 20px;
  bottom: 115px;
  touch-action: none;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  width: 130px;
  transition: opacity 0.4s ease;
  user-select: none;
}


#transport-handle {
  height: 10px;
  border-radius: 6px 6px 0 0;
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

#transport-handle:active {
  cursor: grabbing;
}

#transport-handle::after {
  content: '';
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1px;
}

#hud-stats {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 1px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  padding: 8px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
}

#hud-stats .hidden {
  display: none;
}

#hud-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px 8px;
}

.transport-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 2px 0;
}

#hud-controls button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 0 14px;
  height: 27px;
  line-height: 1;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}

#hud-controls button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

#hud-controls button:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

#btn-record {
  color: #ff5555 !important;
  border-color: rgba(255, 50, 50, 0.45) !important;
}

#btn-record.recording {
  background: rgba(255, 20, 20, 0.18) !important;
  border-color: rgba(255, 20, 20, 0.9) !important;
  animation: pulse 1.2s ease-in-out infinite;
}

#btn-record.paused {
  background: rgba(255, 160, 0, 0.12) !important;
  border-color: rgba(255, 160, 0, 0.7) !important;
  color: #ffa000 !important;
}

@keyframes pulse {
  0%, 100% { border-color: rgba(255, 20, 20, 0.5); }
  50%       { border-color: rgba(255, 20, 20, 1.0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.dot-blink {
  animation: blink 1.2s ease-in-out infinite;
}

#btn-fill.active {
  background: rgba(255, 30, 30, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

.split-btn {
  display: flex;
}

.split-btn .split-left {
  border-radius: 3px 0 0 3px !important;
  border-right: none !important;
  flex: 1;
}

.split-btn .split-right {
  border-radius: 0 3px 3px 0 !important;
  padding: 0 10px !important;
}

.split-btn .split-left,
#btn-iss-toggle,
#btn-tiangong-toggle {
  color: rgba(150, 150, 150, 0.7) !important;
  border-color: rgba(150, 150, 150, 0.3) !important;
}

#btn-iss-toggle.active {
  background: rgba(30, 200, 80, 0.15) !important;
  border-color: rgba(30, 200, 80, 0.7) !important;
  color: #20c850 !important;
}

#btn-iss-toggle.active + .split-right {
  border-color: rgba(30, 200, 80, 0.7) !important;
}

#btn-tiangong-toggle.active {
  background: rgba(50, 180, 255, 0.15) !important;
  border-color: rgba(50, 180, 255, 0.7) !important;
  color: #32b4ff !important;
}

#btn-tiangong-toggle.active + .split-right {
  border-color: rgba(50, 180, 255, 0.7) !important;
}

/* ── Dev metrics panel (top-right) ── */
#dev-hud {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 0, 0.2);
  border-radius: 4px;
  padding: 12px 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: rgba(255, 255, 0, 0.7);
  min-width: 180px;
}

#dev-hud.hidden,
#camera-hud.hidden {
  display: none;
}

#dev-title {
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(255, 255, 0, 0.55);
  margin-bottom: 10px;
  text-transform: uppercase;
}

#dev-ugo-name {
  font-size: 11px;
  font-weight: bold;
  color: rgba(255, 255, 0, 0.9);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

#dev-ugo-sep {
  height: 1px;
  background: rgba(255, 255, 0, 0.15);
  margin: 6px 0 8px;
}

.dev-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  line-height: 2;
}

.dev-label {
  color: rgba(255, 255, 0, 0.65);
}

#dev-elev-error {
  margin-top: 8px;
  color: rgba(255, 80, 80, 0.8);
  font-size: 10px;
  word-break: break-all;
}

/* ── Search bar (top-center) ── */
#search-bar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 6px;
}

#search-input {
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 7px 12px;
  width: 220px;
  outline: none;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

#search-input:focus {
  border-color: rgba(255, 255, 255, 0.45);
}

#search-bar button {
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

#search-bar button:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
}

/* ── Camera readout (bottom-left) ── */
#camera-hud {
  position: fixed;
  bottom: 50px;
  left: 20px;
  z-index: 100;
  display: grid;
  grid-template-columns: max-content max-content;
  column-gap: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 12px;
  font-family: 'Courier New', Courier, monospace;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.9;
}

.c-row {
  display: contents;
}

#site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 1;
  transition: opacity 1s ease;
}

#site-nav.nav-autohidden {
  opacity: 0;
  pointer-events: none;
}

#nav-hover-zone {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 9;
}

#site-nav .logo {
  color: rgba(255,255,255,0.95);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

#site-nav a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.15s;
  text-shadow: 0 1px 5px rgba(0,0,0,0.8);
}

#site-nav a:hover { color: rgba(255,255,255,0.95); }

#transport-hint {
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: #fff;
  padding: 2px 0 6px;
}

.transport-about {
  display: block;
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  padding: 2px 0 4px;
  transition: color 0.15s;
}

.transport-about:hover {
  color: #ff2020;
}

.transport-controls-link {
  display: block;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.3);
  padding: 2px 0 6px;
  cursor: pointer;
  transition: color 0.15s;
}

.transport-controls-link:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Controls help overlay ── */
#controls-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

#controls-modal {
  background: #f8f8f6;
  border-radius: 16px;
  width: 560px;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

#controls-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 18px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(0, 0, 0, 0.85);
  font-family: 'Inter', sans-serif;
}

#btn-controls-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: 1.5px solid rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  color: rgba(0, 0, 0, 0.45);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  flex-shrink: 0;
}

#btn-controls-close:hover {
  border-color: rgba(0, 0, 0, 0.6);
  color: rgba(0, 0, 0, 0.8);
}

#controls-modal-body {
  padding: 8px 28px 32px;
  display: grid;
  grid-template-columns: auto auto auto;
  column-gap: 20px;
  row-gap: 10px;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.cm-row {
  display: contents;
}

.cm-spacer span {
  display: block;
  height: 8px;
}

.cm-action {
  text-align: right;
  color: rgba(0, 0, 0, 0.85);
  white-space: nowrap;
}

.cm-kb {
  color: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  padding-left: 16px;
}

.cm-mouse {
  color: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.cm-faint {
  opacity: 0.35;
}

.cm-mouse em,
.cm-kb em {
  font-style: italic;
}

#c-hint {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 6px;
}

.c-label {
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-align: right;
}

#load-error {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  font-family: 'Courier New', Courier, monospace;
  text-align: center;
  padding: 24px;
}

#load-error div:first-child {
  font-size: 18px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.9);
}

#load-error div:last-of-type {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  max-width: 320px;
}

#load-error a {
  font-size: 11px;
  letter-spacing: 1px;
  color: #ff2020;
  text-decoration: none;
  margin-top: 8px;
}

#load-error a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  #search-bar {
    top: 52px;
  }
}

.hint-touch { display: none; }

@media (pointer: coarse) {
  .hint-kb           { display: none; }
  .hint-touch        { display: inline; }
  #btn-controls-help { display: none; }
}
