/* Planetary Clock layout extensions over shared /styles.css */

#planet-panel {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  width: min(1440px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#warp-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(16, 16, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  max-width: 100%;
}

#utc-readout {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.warp-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.warp-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.warp-btn.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

#planet-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.planet-card {
  appearance: none;
  text-align: left;
  font-family: inherit;
  background: rgba(14, 14, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px 12px;
  color: #f4f4f6;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.planet-card:hover,
.planet-card.is-active {
  background: rgba(28, 28, 38, 0.92);
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-2px);
}

.planet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.planet-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planet-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.planet-day-badge {
  font-size: 13px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.planet-day-badge.is-day {
  background: rgba(250, 204, 21, 0.18);
  color: #fde68a;
}

.planet-day-badge.is-night {
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

.planet-time-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.planet-clock {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.planet-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}

.planet-progress-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.planet-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.2s linear;
}

body.fullscreen #warp-bar,
body.polar-screensaver #warp-bar,
body.lively-mode #warp-bar {
  display: none;
}

@media (max-width: 1024px) {
  #planet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planet-clock {
    font-size: 20px;
  }
}

@media (max-width: 639px), (max-height: 500px) and (orientation: landscape) {
  #planet-panel {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    padding: 4px 10px 10px;
    gap: 6px;
  }

  #warp-bar {
    width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: 12px;
    padding: 5px 10px;
    gap: 4px;
  }

  #warp-bar::-webkit-scrollbar,
  #planet-grid::-webkit-scrollbar {
    display: none;
  }

  #utc-readout {
    flex-shrink: 0;
    white-space: nowrap;
    padding-right: 8px;
  }

  .warp-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 11px;
    padding: 3px 8px;
  }

  #planet-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
  }

  .planet-card {
    flex: 0 0 148px;
    scroll-snap-align: start;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .planet-card-header {
    margin-bottom: 4px;
    gap: 4px;
  }

  .planet-name {
    font-size: 12px;
    gap: 5px;
  }

  .planet-dot {
    width: 8px;
    height: 8px;
  }

  .planet-day-badge {
    font-size: 10px;
    padding: 1px 6px;
  }

  .planet-time-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    margin-bottom: 6px;
  }

  .planet-clock {
    font-size: 15px;
    line-height: 1.15;
  }

  .planet-meta {
    font-size: 10px;
  }

  .planet-progress-track {
    height: 3px;
  }
}
