:root {
  --black: #02010a;
  --prussian-blue: #04052e;
  --deep-twilight: #140152;
  --navy: #22007c;
  --navy-electric: #0d00a4;
  --lime: #d4ff00;
}

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

body {
  background: #000;
  overflow: hidden;
  font-family: Consolas, "Courier New", monospace;
  color: #ccc;
}

#space {
  display: block;
  width: 100vw;
  height: 100vh;
}

#loader {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background:
    radial-gradient(ellipse at 50% 115%, rgba(13, 0, 164, 0.22), transparent 60%),
    #02010a;
  transition: opacity 0.6s ease;
}

#loader.done {
  opacity: 0;
  pointer-events: none;
}

#loader-logo {
  width: 42px;
  height: 46px;
  opacity: 0.9;
}

#boot-text {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.8;
  color: #7c86b8;
  white-space: pre;
}

#loader-bar {
  width: 220px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

#loader-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--navy-electric);
  transition: width 0.3s ease;
}

/* --- hud ---------------------------------------------------------------- */

#hud {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: rgba(4, 5, 46, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  font-size: 11px;
  color: #9aa3c8;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 24px);
}

#hud.hidden,
#panel.hidden {
  display: none;
}

#hud button {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccc;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#hud button:hover {
  background: rgba(255, 255, 255, 0.12);
}

#hud button.on {
  border-color: rgba(212, 255, 0, 0.6);
  color: var(--lime);
}

#btnPlay {
  min-width: 34px;
  font-size: 13px;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-group label {
  color: #6c75a0;
}

.hud-val {
  color: var(--lime);
  min-width: 34px;
  text-align: right;
}

.hud-hint {
  color: #4c5580;
  font-size: 10px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--lime);
  border: none;
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--lime);
  border: none;
}

input[type="date"] {
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccc;
  padding: 3px 6px;
  border-radius: 5px;
  outline: none;
  color-scheme: dark;
}

/* --- info panel --------------------------------------------------------- */

#panel {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 240px;
  background: rgba(4, 5, 46, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  font-size: 11px;
  color: #9aa3c8;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#pName {
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.06em;
}

#btnClose {
  background: none;
  border: none;
  color: #6c75a0;
  font-size: 12px;
  cursor: pointer;
}

#btnClose:hover {
  color: #fff;
}

#pFacts {
  padding: 8px 12px;
}

.fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.fact b {
  color: var(--lime);
  font-weight: normal;
}

.panel-editor {
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-row {
  margin-bottom: 8px;
}

.editor-row label {
  display: flex;
  justify-content: space-between;
  color: #6c75a0;
  margin-bottom: 4px;
}

.editor-row label span {
  color: var(--lime);
}

.editor-row input[type="range"] {
  width: 100%;
}

#btnReset {
  width: 100%;
  margin-top: 4px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccc;
  padding: 5px 0;
  border-radius: 5px;
  cursor: pointer;
}

#btnReset:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* --- mobile ------------------------------------------------------------- */

@media (max-width: 700px) {
  #panel {
    top: auto;
    bottom: 76px;
    right: 8px;
    left: 8px;
    width: auto;
  }

  .hud-hint {
    display: none;
  }

  input[type="range"] {
    width: 80px;
  }
}
