:root {
  color-scheme: dark;
  --bg: #070a12;
  --panel: #0e1526;
  --text: #e6eefc;
  --muted: #8aa0c8;
  --accent: #77f2ff;
  --accent-2: #6b7cff;
  --glow: 0 0 24px rgba(119, 242, 255, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  background: radial-gradient(circle at 20% 10%, #121a2e, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

.skip-link{position:absolute;top:-100%;left:1rem;z-index:100;padding:.5rem 1rem;border-radius:999px;background:var(--accent);color:var(--bg);font-weight:700;font-size:.85rem;text-decoration:none}
.skip-link:focus{top:.5rem}

.app {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px clamp(20px, 4vw, 48px);
}

.app__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.app__header h1 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.04em;
}

.app__header p {
  color: var(--muted);
  margin-top: 8px;
}

.app__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  background: rgba(8, 12, 24, 0.7);
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(119, 242, 255, 0.2);
  box-shadow: var(--glow);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input[type="range"] {
  width: 140px;
  accent-color: var(--accent);
}

button {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(119, 242, 255, 0.4);
  background: linear-gradient(120deg, rgba(119, 242, 255, 0.2), rgba(107, 124, 255, 0.35));
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(107, 124, 255, 0.25);
}

.stage {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(119, 242, 255, 0.1), transparent 60%);
  border: 1px solid rgba(119, 242, 255, 0.15);
  box-shadow: 0 30px 60px rgba(4, 10, 22, 0.8);
}

#scene {
  width: 100%;
  display: block;
  background: transparent;
}

.stage__overlay {
  position: absolute;
  inset: 20px;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent);
  border: 1px solid rgba(119, 242, 255, 0.3);
  background: rgba(8, 12, 24, 0.6);
  box-shadow: var(--glow);
}

@media (max-width: 720px) {
  .app__controls {
    width: 100%;
  }

  input[type="range"] {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Track-color legend */
.legend { display:flex; align-items:center; gap:10px; justify-content:center; padding:10px 0; font-size:.85rem; color:rgba(255,255,255,.7); }
.legend__swatch { display:inline-block; width:14px; height:14px; border-radius:3px; vertical-align:middle; margin-right:3px; }
.legend__swatch--electron { background: #4af; }
.legend__swatch--positron { background: #f55; }
.legend__swatch--neutrino { background: #999; }
