/* style.css */
:root {
  --bg: #04030d;
  --accent: #a78bfa;
  --accent2: #7c3aed;
  --accent3: #c4b5fd;
  --text: #ede9fe;
  --muted: #6b5a8e;
  --border: rgba(138,100,255,0.18);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Custom cursor */
body { cursor: none; }
#cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px var(--accent);
  mix-blend-mode: screen;
  transition: transform 0.05s;
}
#cursorRing {
  position: fixed;
  width: 36px; height: 36px;
  border: 1px solid rgba(167,139,250,0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, left 0.08s ease, top 0.08s ease;
}

/* Stars */
canvas#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Nebula wash */
.nebula {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 15% 20%, rgba(88,28,220,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 75%, rgba(124,58,237,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 50% 50%, rgba(167,139,250,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  animation: nebulaShift 25s ease-in-out infinite alternate;
}
@keyframes nebulaShift {
  0%   { opacity: 0.8; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* Main solar system container */
.solar-container {
  position: relative;
  z-index: 10;
  width: min(100vw, 100vh);
  height: min(100vw, 100vh);
  max-width: 700px;
  max-height: 700px;
}

/* Sun (Polaris center) */
.sun {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ede9fe 0%, #a78bfa 40%, #5b21b6 80%, #2e1065 100%);
  box-shadow:
    0 0 20px 8px rgba(167,139,250,0.6),
    0 0 50px 20px rgba(124,58,237,0.35),
    0 0 100px 50px rgba(88,28,220,0.15);
  animation: sunPulse 4s ease-in-out infinite;
  z-index: 20;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
}
.sun img {
  width: 65px; height: 65px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.9;
}
@keyframes sunPulse {
  0%, 100% { box-shadow: 0 0 20px 8px rgba(167,139,250,0.6), 0 0 50px 20px rgba(124,58,237,0.35), 0 0 100px 50px rgba(88,28,220,0.15); }
  50%       { box-shadow: 0 0 30px 14px rgba(167,139,250,0.8), 0 0 70px 30px rgba(124,58,237,0.45), 0 0 130px 70px rgba(88,28,220,0.2); }
}

.sun-label {
  position: absolute;
  top: calc(50% + 52px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.25em;
  color: var(--accent3);
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(167,139,250,0.6);
  pointer-events: none;
}

/* Orbital rings */
.orbit {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(138,100,255,0.12);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Planet wrapper — moved during animation */
.planet-orbit {
  position: absolute;
  width: 1px;
  height: 1px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Planet button */
.planet {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  pointer-events: all;
  cursor: none;
  transition: filter 0.3s ease, transform 0.3s ease;
  transform: translate(-50%, -50%);
  z-index: 30;
}
.planet:hover {
  filter: brightness(1.4) saturate(1.3);
  transform: translate(-50%, -50%) scale(1.25);
  z-index: 50;
}
.planet:hover .planet-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}
.planet-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  position: relative;
}
.planet-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
}
.planet-tooltip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(0px);
  background: rgba(10,5,30,0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--accent3);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 100;
}
.planet-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}

/* Disabled planet */
.planet.disabled {
  opacity: 0.35;
  filter: grayscale(0.6);
  pointer-events: none;
}

/* Live badge on Twitch planet */
.live-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #9146ff;
  animation: liveRingPulse 2s ease-in-out infinite;
}
@keyframes liveRingPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.08); }
}

/* Status indicator */
.status-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  text-transform: uppercase;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: statusBlink 2s ease-in-out infinite;
}
@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* Warning box for merch */
.warning-float {
  position: fixed;
  top: 24px;
  right: 24px;
  background: rgba(10,5,30,0.85);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 6px;
  padding: 10px 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: rgba(251,191,36,0.6);
  text-transform: uppercase;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Corner decorations */
.corner {
  position: fixed;
  width: 30px; height: 30px;
  border-color: rgba(138,100,255,0.3);
  border-style: solid;
  pointer-events: none;
  z-index: 5;
}
.corner.tl { top: 16px; left: 16px; border-width: 1px 0 0 1px; }
.corner.tr { top: 16px; right: 16px; border-width: 1px 1px 0 0; }
.corner.bl { bottom: 16px; left: 16px; border-width: 0 0 1px 1px; }
.corner.br { bottom: 16px; right: 16px; border-width: 0 1px 1px 0; }

/* Footer */
.footer {
  position: fixed;
  bottom: 24px;
  left: 24px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.25em;
  color: rgba(107,90,142,0.4);
  text-transform: uppercase;
}

/* ── SECRET PLANET ── */
.planet[data-secret] {
  opacity: 0.45;
  transition: opacity 0.5s ease, filter 0.5s ease, transform 0.3s ease !important;
}
.planet[data-secret]:hover {
  opacity: 1;
  filter: brightness(1.6) saturate(1.4);
  transform: translate(-50%, -50%) scale(1.3) !important;
}
.planet[data-secret] .planet-label {
  color: rgba(100,50,160,0.3);
  letter-spacing: 0.35em;
  transition: color 0.4s;
}
.planet[data-secret]:hover .planet-label {
  color: rgba(167,139,250,0.7);
}
.planet[data-secret] .planet-inner i {
  transition: color 0.4s, text-shadow 0.4s;
}
.planet[data-secret]:hover .planet-inner i {
  color: rgba(167,139,250,0.9) !important;
  text-shadow: 0 0 12px rgba(124,58,237,0.8);
}
/* Secret orbit ring — dashed and very dim */
.orbit[data-secret-orbit] {
  border-style: dashed !important;
  border-color: rgba(80,30,140,0.12) !important;
  animation: secretOrbitPulse 8s ease-in-out infinite;
}
@keyframes secretOrbitPulse {
  0%,100% { border-color: rgba(80,30,140,0.08) !important; }
  50%      { border-color: rgba(120,50,200,0.18) !important; }
}
@media (max-width: 600px) {
  .solar-container {
    max-width: 380px;
    max-height: 380px;
  }
  .warning-float { display: none; }
}