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

body {
  overflow: hidden;
  font-family: 'Arial', sans-serif;
  background: #181929;
  color: #fff;
  transition: background 0.3s, color 0.3s;
}

body.light-theme {
  background: #f4f4f4;
  color: #222;
}

body.light-theme #info-panel,
body.light-theme #speed-panel {
  background: rgba(255,255,255,0.85);
  color: #222;
}

body.light-theme .btn {
  background: rgba(0,0,0,0.06);
  color: #222;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
}

body.light-theme .btn:hover, body.light-theme .btn:focus {
  background: #e3e8f0;
  color: #1976d2;
  box-shadow: 0 4px 16px 0 rgba(25, 118, 210, 0.10);
}

body.light-theme .btn:active {
  background: #c7d0e0;
  color: #222;
  box-shadow: 0 1px 4px 0 rgba(25, 118, 210, 0.10);
}

body.light-theme .speed-control input[type="range"]::-webkit-slider-thumb {
  background: #1976d2;
}

body.light-theme .speed-control input[type="range"] {
  background: #ddd;
}

body.light-theme .speed-control span {
  color: #222;
}

body.light-theme #loading-screen {
  background: #fff;
  color: #222;
}

#c {
  background: black;
  background-size: cover;
}

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: white;
}

.loading-content {
  text-align: center;
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: #333;
  margin-top: 20px;
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: #fff;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

#info-panel {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 20px;
  border-radius: 10px;
  max-width: 300px;
  backdrop-filter: blur(5px);
}

#info-panel h2 {
  margin-bottom: 15px;
  font-size: 1.5em;
}

#planet-info {
  font-size: 0.9em;
  line-height: 1.4;
}

.controls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
}

.btn-wrapper {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: bold;
  font-size: 1.1em;
  border-radius: 16px;
  width: 150px;
  height: 56px;
  border: none;
  user-select: none;
  outline: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
  margin: 0 8px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn:hover, .btn:focus {
  background: rgba(255,255,255,0.22);
  color: #1976d2;
  box-shadow: 0 4px 16px 0 rgba(25, 118, 210, 0.10);
  transform: translateY(-2px) scale(1.04);
}

.btn:active {
  background: rgba(25, 118, 210, 0.18);
  color: #fff;
  box-shadow: 0 1px 4px 0 rgba(25, 118, 210, 0.10);
  transform: scale(0.98);
}

.btn-zoom {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Planet labels */
.planet-label {
  position: absolute;
  color: white;
  font-size: 14px;
  pointer-events: none;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.planet-label.visible {
  opacity: 1;
}

/* 3D scene planet labels */
.planet-label-3d {
  position: absolute;
  color: white;
  font-size: 14px;
  pointer-events: none;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.planet-label-3d.visible {
  opacity: 1;
}

#speed-panel {
  position: fixed;
  top: 40px;
  right: 40px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 24px 32px;
  border-radius: 12px;
  max-width: 500px;
  min-width: 340px;
  z-index: 100;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.18);
  text-align: left;
}

#speed-panel h3 {
  margin-bottom: 10px;
  font-size: 1.2em;
}

.speed-control {
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.speed-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  margin-bottom: 8px;
  width: 100%;
}

.speed-row .planet-label {
  min-width: 90px;
  text-align: left;
  font-weight: 500;
  font-size: 1em;
  flex-shrink: 0;
  color: inherit;
  opacity: 1;
  position: static;
  text-shadow: none;
}

.speed-row input[type="range"] {
  width: 260px;
  margin: 0 18px 0 0;
  flex-grow: 1;
  accent-color: #1976d2;
}

.speed-row span {
  min-width: 48px;
  display: inline-block;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 1em;
}

body.light-theme #speed-panel {
  background: rgba(255,255,255,0.92);
  color: #222;
}

@media (max-width: 900px) {
  #speed-panel {
    right: 10px;
    top: 10px;
    min-width: 220px;
    max-width: 95vw;
    padding: 12px 8px;
    font-size: 0.95em;
  }
  .speed-row input[type="range"] {
    width: 120px;
  }
}

@media (max-width: 600px) {
  #speed-panel {
    right: 0;
    left: 0;
    top: 0;
    margin: 0 auto;
    min-width: unset;
    max-width: 100vw;
    border-radius: 0 0 12px 12px;
    padding: 8px 2vw;
    font-size: 0.9em;
    z-index: 200;
  }
  .speed-row input[type="range"] {
    width: 80px;
  }
  .speed-row .planet-label, .speed-row span {
    font-size: 0.95em;
    min-width: 60px;
  }
}

#speed-toggle {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 201;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1.1em;
  border: none;
  cursor: pointer;
}

@media (max-width: 600px) {
  #speed-toggle {
    display: block;
  }
  #speed-panel {
    display: none;
  }
  #speed-panel.open {
    display: block;
  }
}