/* Solar Planets — Premiere Enterprise chrome */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Syne:wght@600;700&display=swap');

:root {
  --void: #010208;
  --glass: rgba(8, 12, 24, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.09);
  --glass-shine: rgba(255, 255, 255, 0.04);
  --stroke: rgba(110, 231, 247, 0.22);
  --stroke-gold: rgba(212, 175, 55, 0.35);
  --text: #f2f6ff;
  --muted: #8a94b8;
  --cyan: #6ee7f7;
  --gold: #d4af37;
  --gold-bright: #f0d878;
  --solar: #ffb347;
  --radius: 16px;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-ui: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--void);
  color: var(--text);
  font: 14px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

#view { position: absolute; inset: 0; z-index: 1; }
#view canvas { display: block; width: 100%; height: 100%; }

.premiere-vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% 50%, transparent 48%, rgba(0, 0, 0, 0.42) 100%),
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 179, 71, 0.04), transparent 55%);
}

.premiere-grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

#loading {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, rgba(255, 140, 40, 0.12), transparent),
    rgba(1, 2, 8, 0.94);
  backdrop-filter: blur(20px) saturate(1.2);
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.9s;
}
#loading.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.premiere-loading-inner { text-align: center; max-width: 420px; padding: 0 24px; }
.premiere-ring {
  width: 72px; height: 72px; margin: 0 auto 28px; position: relative;
}
.premiere-ring::before,
.premiere-ring::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid transparent;
}
.premiere-ring::before {
  border-top-color: var(--solar);
  border-right-color: rgba(255, 179, 71, 0.25);
  animation: orbit-spin 2.4s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 28px rgba(255, 179, 71, 0.45);
}
.premiere-ring::after {
  inset: 10px;
  border-bottom-color: var(--cyan);
  border-left-color: rgba(110, 231, 247, 0.2);
  animation: orbit-spin 1.6s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }

.premiere-eyebrow {
  margin: 0 0 8px; font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold);
}
.premiere-title {
  margin: 0 0 12px; font: 700 26px/1.15 var(--font-display);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, var(--solar) 45%, var(--cyan) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.premiere-status { margin: 0; font-size: 13px; color: var(--muted); }

#brand {
  position: absolute; top: 22px; left: 24px; z-index: 4;
  display: flex; gap: 14px; align-items: center; pointer-events: none;
}
#brand .logo {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background:
    radial-gradient(circle at 32% 28%, #fff 0%, var(--gold-bright) 18%, var(--solar) 50%, #c44a00 72%, transparent 78%);
  box-shadow:
    0 0 24px rgba(255, 179, 71, 0.85),
    0 0 56px rgba(255, 120, 40, 0.45),
    inset 0 0 14px rgba(255, 255, 255, 0.3);
  animation: sun-pulse 3.5s ease-in-out infinite;
}
@keyframes sun-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 24px rgba(255,179,71,0.8), 0 0 56px rgba(255,120,40,0.4), inset 0 0 14px rgba(255,255,255,0.25); }
  50% { transform: scale(1.04); box-shadow: 0 0 36px rgba(255,200,100,1), 0 0 72px rgba(255,140,50,0.55), inset 0 0 18px rgba(255,255,255,0.4); }
}
#brand .brand-text { display: flex; flex-direction: column; gap: 2px; }
#brand .eyebrow {
  margin: 0; font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 8px;
}
#brand .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--solar);
  box-shadow: 0 0 10px var(--solar);
  animation: live-blink 2s ease-in-out infinite;
}
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
#brand h1 {
  margin: 0; font: 700 24px/1.1 var(--font-display);
  letter-spacing: -0.01em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.8);
}
#brand p { margin: 0; font-size: 12.5px; color: var(--muted); }

#panel {
  position: absolute; top: 96px; left: 24px; z-index: 6;
  pointer-events: auto;
  width: 280px; max-height: calc(100vh - 180px); overflow-y: auto;
  padding: 4px 18px 16px;
  background: linear-gradient(165deg, var(--glass-shine) 0%, transparent 40%), var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  backdrop-filter: blur(22px) saturate(1.35);
  box-shadow: 0 0 0 1px rgba(255, 179, 71, 0.05) inset, 0 24px 80px rgba(0, 0, 0, 0.65);
}
#panel section {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#panel section:last-child { border-bottom: 0; }
.panel-live { padding-top: 12px !important; }
.live-link {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; border-radius: 10px; text-decoration: none;
  font: 600 12.5px/1 var(--font-ui); color: #041018;
  background: linear-gradient(135deg, var(--cyan) 0%, #67e8f9 40%, var(--gold-bright) 100%);
  background-size: 200% 200%;
  animation: live-shimmer 4s ease-in-out infinite;
  box-shadow: 0 4px 22px rgba(255, 179, 71, 0.28);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.live-link:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(255, 179, 71, 0.38);
}
.live-link .live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #0a5c14; box-shadow: 0 0 8px #4ade80, 0 0 14px #22c55e;
  animation: live-pulse 2s ease-in-out infinite;
}
.sibling-link {
  display: block; margin-top: 8px; text-align: center;
  font: 500 11px/1 var(--font-ui); color: var(--muted);
  text-decoration: none; letter-spacing: 0.02em;
  transition: color 0.15s;
}
.sibling-link:hover { color: var(--gold-bright); }
@keyframes live-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.88); }
}
#panel h2 {
  margin: 0 0 12px; padding-bottom: 8px;
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--cyan);
  border-bottom: 1px solid rgba(110, 231, 247, 0.15);
  position: relative;
}
#panel h2::after {
  content: ''; position: absolute; left: 0; bottom: -1px;
  width: 32px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent);
}
#panel label { display: block; font-size: 12.5px; color: #c8d2f0; margin: 10px 0; }
#panel label.row { display: flex; align-items: center; gap: 10px; }
#panel .hint { color: var(--muted); font-size: 11px; line-height: 1.5; }
.info-title {
  margin: 0 0 8px; font: 700 20px/1.2 var(--font-display);
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(212, 175, 55, 0.35);
}
.stats-dl { margin: 10px 0 0; font-size: 11.5px; }
.stats-dl dt { color: var(--muted); margin-top: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.stats-dl dd { margin: 3px 0 0; color: var(--text); }

select, input[type="range"] { width: 100%; margin-top: 7px; accent-color: var(--gold); }
input[type="checkbox"] { accent-color: var(--solar); }

.btnrow { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
#stopMotion {
  flex: 1 1 100%;
  width: 100%;
  border-color: rgba(110, 231, 247, 0.45);
  background: linear-gradient(180deg, rgba(110, 231, 247, 0.14), rgba(8, 12, 24, 0.9));
  color: #e8f4ff;
}
#stopMotion.stopped {
  border-color: rgba(74, 222, 128, 0.65);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.22), rgba(8, 12, 24, 0.9));
  color: #b9ffd0;
}
button {
  flex: 1; cursor: pointer;
  font: 600 12.5px/1 var(--font-ui); color: #041018;
  background: linear-gradient(135deg, var(--solar) 0%, var(--gold-bright) 50%, var(--cyan) 100%);
  border: 0; border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 4px 20px rgba(255, 179, 71, 0.25);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
button.ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
button:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(255, 179, 71, 0.3); }
button.ghost:hover { border-color: var(--stroke-gold); background: rgba(212, 175, 55, 0.06); }

#hud {
  position: absolute; left: 24px; right: 24px; bottom: 20px; z-index: 4;
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; pointer-events: none;
}
.glass-bar {
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%), var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 14px;
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 0 0 1px rgba(255, 179, 71, 0.04) inset, 0 16px 48px rgba(0,0,0,0.5);
}
#legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: 55vw;
  padding: 12px 16px; pointer-events: auto;
}
.legend-chip {
  display: flex; align-items: center; gap: 7px;
  font: 500 11px/1 var(--font-ui); color: #d0daf5;
  cursor: pointer; padding: 4px 6px; border-radius: 8px;
  transition: background 0.15s;
}
.legend-chip:hover, .legend-chip.active {
  background: rgba(255, 179, 71, 0.12);
  box-shadow: inset 0 0 12px rgba(255, 179, 71, 0.08);
}
.swatch {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 12px currentColor, 0 0 6px rgba(255,255,255,0.45);
  transition: transform 0.15s ease;
}
.legend-chip.active .swatch {
  box-shadow: 0 0 16px currentColor, 0 0 8px #fff;
  transform: scale(1.15);
}
#stats {
  display: flex; gap: 18px; padding: 12px 18px;
  font: 500 11px/1 var(--font-mono); color: var(--muted);
  white-space: nowrap;
}
#stats strong { color: var(--text); text-shadow: 0 0 16px rgba(255, 179, 71, 0.3); }

.planet-label {
  padding: 3px 10px; border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(8, 12, 28, 0.82));
  border: 1px solid rgba(212, 175, 55, 0.28);
  color: #e8eeff; font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.04em; white-space: nowrap;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

#error {
  display: none; position: fixed; z-index: 60; top: 50%; left: 50%;
  transform: translate(-50%, -50%); max-width: 420px;
  padding: 22px 26px; text-align: center;
  background: rgba(40, 12, 18, 0.96); border: 1px solid rgba(255, 107, 107, 0.5);
  border-radius: 14px; color: #ffd9d9;
}

@media (max-width: 720px) {
  #panel { width: calc(100vw - 48px); max-height: 42vh; }
  #legend { display: none; }
  #hud { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .premiere-ring::before, .premiere-ring::after,
  #brand .logo, #brand .live-dot,
  .live-link, .live-link .live-dot { animation: none; }
}