.tsc-app {
  --space-bg-a: #0b0f19;
  --space-bg-b: #111827;
  --space-cyan: #06b6d4;
  --space-purple: #a855f7;
  --space-gold: #f59e0b;
  --space-ink: #e5e7eb;
  --space-muted: #94a3b8;
  --panel: rgba(15, 23, 42, .68);
  --line: rgba(148, 163, 184, .2);
  --planet-accent: var(--space-cyan);
  color: var(--space-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tsc-app * {
  box-sizing: border-box;
}

.tsc-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(6, 182, 212, .24);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 32px);
  background:
    radial-gradient(circle at 20% 10%, rgba(6, 182, 212, .22), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(245, 158, 11, .16), transparent 25%),
    linear-gradient(135deg, var(--space-bg-a), var(--space-bg-b));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.tsc-app.is-night .tsc-stage {
  background:
    radial-gradient(circle at 72% 18%, rgba(168, 85, 247, .22), transparent 28%),
    linear-gradient(135deg, #050814, #111827);
}

.tsc-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .78), transparent);
}

.tsc-hero,
.tsc-grid,
.tsc-panel {
  position: relative;
  z-index: 1;
}

.tsc-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.tsc-kicker {
  margin: 0 0 6px;
  color: var(--space-gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.tsc-hero h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 6vw, 72px);
  line-height: .95;
  letter-spacing: 0;
}

.tsc-live-clock,
.tsc-split-flap {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 158, 11, .36);
  border-radius: 6px;
  padding: 10px 14px;
  background: #050814;
  color: var(--space-gold);
  font-family: "Courier New", monospace;
  font-weight: 700;
  box-shadow: inset 0 -18px 0 rgba(255, 255, 255, .04);
}

.tsc-grid {
  display: grid;
  grid-template-columns: minmax(240px, .9fr) minmax(280px, 1.2fr) minmax(280px, 1fr);
  gap: 16px;
}

.tsc-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .22);
  backdrop-filter: blur(16px);
}

.tsc-controls {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.tsc-controls label {
  display: grid;
  gap: 6px;
  color: var(--space-muted);
  font-size: 13px;
  font-weight: 700;
}

.tsc-controls input,
.tsc-controls select {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(2, 6, 23, .72);
  color: #fff;
  font: inherit;
}

.tsc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.tsc-actions button,
.tsc-tabs button,
.tsc-extras button,
.tsc-share-row a {
  min-height: 40px;
  border: 1px solid rgba(6, 182, 212, .32);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(2, 6, 23, .68);
  color: #e0f2fe;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.tsc-actions button:hover,
.tsc-tabs button:hover,
.tsc-extras button:hover,
.tsc-share-row a:hover {
  transform: translateY(-1px);
  border-color: var(--planet-accent);
}

.tsc-actions .tsc-primary {
  background: linear-gradient(135deg, var(--space-cyan), var(--space-purple));
  color: #fff;
}

.tsc-planet-card {
  height: clamp(320px, 34vw, 430px);
  min-height: 320px;
  overflow: hidden;
}

.tsc-orbit-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.tsc-planet-image {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: min(38%, 170px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .24);
  box-shadow: 0 0 42px var(--planet-accent);
  animation: tsc-rotate 24s linear infinite;
}

.tsc-daynight {
  position: absolute;
  left: 18px;
  bottom: 18px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(2, 6, 23, .72);
  color: #fff;
  font-weight: 800;
}

.tsc-results {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 16px;
}

.tsc-split-flap {
  min-height: 74px;
  font-size: clamp(28px, 4vw, 44px);
  color: #fff;
  border-color: rgba(6, 182, 212, .4);
}

.tsc-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tsc-stat-grid article,
[data-role="history"] article,
[data-role="rocket"] article,
[data-role="news-list"] article {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 6px;
  padding: 12px;
  background: rgba(15, 23, 42, .58);
}

.tsc-stat-grid span,
[data-role="history"] span,
[data-role="rocket"] span {
  color: var(--space-muted);
  font-size: 12px;
}

.tsc-stat-grid strong {
  color: #fff;
  font-size: 15px;
}

.tsc-results p {
  margin: 0;
  color: #cbd5e1;
}

.tsc-earth-duration {
  border: 1px solid rgba(245, 158, 11, .22);
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, .08);
  color: #fde68a;
  font-weight: 800;
}

.tsc-badge {
  width: fit-content;
  border: 1px solid rgba(245, 158, 11, .42);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, .13);
  color: #fde68a;
  font-weight: 900;
}

.tsc-chart-wrap {
  grid-column: span 2;
  padding: 16px;
}

.tsc-extras {
  grid-column: span 3;
  padding: 16px;
}

.tsc-tabs,
.tsc-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tsc-tabs button.is-active {
  border-color: var(--space-gold);
  background: rgba(245, 158, 11, .14);
  color: #fff7ed;
}

.tsc-tab-panel {
  display: none;
}

.tsc-tab-panel.is-active {
  display: block;
}

[data-role="history"],
[data-role="rocket"],
[data-role="news-list"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.tsc-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.tsc-model-grid article {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(6, 182, 212, .18);
  border-radius: 8px;
  padding: 12px;
  background: radial-gradient(circle at 50% 36%, rgba(6, 182, 212, .18), rgba(2, 6, 23, .92) 68%);
}

.tsc-model-grid span {
  color: var(--space-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tsc-model-grid model-viewer {
  width: 100%;
  min-height: 260px;
  border-radius: 6px;
  background: transparent;
}

.tsc-ar-status {
  margin: 10px 0 0;
  color: var(--space-muted);
  font-size: 13px;
}

@keyframes tsc-rotate {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .tsc-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tsc-results,
  .tsc-extras,
  .tsc-chart-wrap {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  .tsc-stage {
    padding: 14px;
  }

  .tsc-hero,
  .tsc-grid,
  .tsc-actions {
    grid-template-columns: 1fr;
  }

  .tsc-hero {
    display: grid;
  }

  .tsc-results,
  .tsc-extras,
  .tsc-chart-wrap {
    grid-column: span 1;
  }

  .tsc-stat-grid {
    grid-template-columns: 1fr;
  }

  .tsc-model-grid {
    grid-template-columns: 1fr;
  }
}
