:root {
  --bg: #0b0f14;
  --bg-elev: #0f151d;
  --fg: #e6f1ff;
  --muted: #8aa2c0;
  --accent: #6ecbff;
  --accent-strong: #4fb6ff;
  --glow: 0 0 16px rgba(110, 203, 255, 0.45), 0 0 32px rgba(79, 182, 255, 0.25);
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 10% 10%, #0d1622 0%, var(--bg) 40%) no-repeat,
              radial-gradient(1200px 800px at 90% 0%, #0b1522 0%, var(--bg) 50%) no-repeat,
              var(--bg);
  color: var(--fg);
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
  background: linear-gradient(to bottom, rgba(10,17,25,0.9), rgba(10,17,25,0.6));
  border-bottom: 1px solid rgba(110,203,255,0.15);
}
.brand {
  margin: 0;
  padding: 18px 0;
  letter-spacing: 1px;
  font-weight: 800;
  color: var(--fg);
  text-shadow: 0 0 20px rgba(110,203,255,0.2);
}
.brand{ cursor: pointer; }
.brand:focus{ outline: 2px solid rgba(110,203,255,0.5); outline-offset: 4px; border-radius: 6px; }

.controls { border-bottom: 1px dashed rgba(110,203,255,0.15); }
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 20px;
}
.points-label { color: var(--muted); margin-right: 8px; }
.points-value { font-weight: 700; color: var(--accent); text-shadow: var(--glow); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.points-tokens { display: inline-flex; gap: 8px; vertical-align: middle; }
.points-tokens .token {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  box-shadow: 0 0 0 0 rgba(110,203,255,0.0);
  transform: scale(1);
}
.points-tokens .token.filled { background: var(--accent); box-shadow: 0 0 10px 2px rgba(110,203,255,0.55); }

/* Flying token animation */
.flying-token {
  position: fixed;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent);
  box-shadow: 0 0 10px 2px rgba(110,203,255,0.55);
  pointer-events: none;
  z-index: 1000;
}

/* Impact effect at node center */
.impact-ring {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 18px 3px rgba(110,203,255,0.75);
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%) scale(0.35);
  opacity: 0.95;
  animation: impactExpand 520ms ease-out forwards;
  mix-blend-mode: screen;
}
.impact-ring.secondary { animation-delay: 90ms; opacity: 0.8; }

.impact-core {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px 4px rgba(110,203,255,0.7);
  pointer-events: none;
  z-index: 1001;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 1;
  animation: coreFlash 260ms ease-out forwards;
  mix-blend-mode: screen;
}

@keyframes impactExpand {
  0% { transform: translate(-50%, -50%) scale(0.35); opacity: 0.95; }
  60% { transform: translate(-50%, -50%) scale(1.8); opacity: 0.65; }
  100% { transform: translate(-50%, -50%) scale(2.8); opacity: 0; }
}

@keyframes coreFlash {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.45; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

/* Spark particles */
.spark {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 2px rgba(110,203,255,0.7);
  pointer-events: none;
  z-index: 1001;
  transform: translate(-50%, -50%) translate(0, 0) scale(0.9);
  opacity: 1;
  animation: sparkFly 540ms ease-out forwards;
  mix-blend-mode: screen;
}

@keyframes sparkFly {
  100% {
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(0.5);
    opacity: 0;
  }
}
.control-buttons { display: flex; gap: 10px; }
.btn {
  background: linear-gradient(180deg, #0f1b29, #0b1420);
  color: var(--fg);
  border: 1px solid rgba(110,203,255,0.35);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.25s ease;
}
.btn:hover { box-shadow: var(--glow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-darker { background: linear-gradient(180deg, #0b121b, #09101a); opacity: 0.9; }

.layout { padding: 22px 0 32px; }
.tree-container {
  position: relative;
  background: linear-gradient(180deg, rgba(79,182,255,0.05), rgba(110,203,255,0.02));
  border: 1px solid rgba(110,203,255,0.15);
  border-radius: 14px;
  min-height: 520px;
  box-shadow: inset 0 0 60px rgba(79,182,255,0.05);
  overflow: hidden;
}
.fallback { color: var(--muted); padding: 16px; }
/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 10, 16, 0.6);
  backdrop-filter: blur(6px);
  z-index: 50;
}
.modal-overlay[hidden] { display: none !important; }
.modal {
  width: min(680px, 92vw);
  background: linear-gradient(180deg, #0c121a, #0b1017);
  border: 1px solid rgba(110,203,255,0.25);
  border-radius: 14px;
  box-shadow: 0 10px 50px rgba(0,0,0,0.5), inset 0 0 40px rgba(79,182,255,0.05);
  padding: 18px 18px 8px;
}
.modal h2 { margin: 0 24px 8px 0; color: var(--accent); text-shadow: var(--glow); }
.modal-body { color: var(--fg); line-height: 1.7; }
.modal-body a { color: var(--accent-strong); }
.modal-close {
  position: absolute;
  align-self: flex-start;
  right: 14px;
  top: 10px;
  background: transparent;
  border: none;
  color: var(--fg);
  font-size: 24px;
  cursor: pointer;
}

/* Impressum section removed; will be shown via Legal modal */

.site-footer { border-top: 1px solid rgba(110,203,255,0.12); }
.site-footer small { color: var(--muted); display: block; padding: 16px 0 28px; }

.noscript-content { margin-top: 20px; }
.noscript-content h2 { color: var(--accent); text-shadow: var(--glow); }
.noscript-content h3 { margin-bottom: 6px; }
.noscript-content a { color: var(--accent-strong); }

/* Progressive enhancement project list (source of truth) */
#projectList { margin: 28px auto 60px; }
#projectList h2 { color: var(--accent); text-shadow: var(--glow); }
#projectList h3 { margin-bottom: 6px; }
#projectList a { color: var(--accent-strong); }

/* D3 tree visuals */
svg {
  width: 100%;
  height: 100%;
  display: block;
}
.link {
  fill: none;
  stroke: rgba(110,203,255,0.35);
  stroke-width: 2px;
}
.node circle {
  fill: #0f1824;
  stroke: var(--accent);
  stroke-width: 2px;
  filter: drop-shadow(0 0 8px rgba(110,203,255,0.4));
  transition: transform 0.12s ease, fill 0.2s ease, stroke 0.2s ease, r 0.2s ease;
}
.node.locked circle {
  stroke: rgba(138,162,192,0.35);
  fill: #0b121a;
  filter: none;
}
.node.leaf circle { stroke: #7ee787; }
.node.revealed circle { r: 10px; }
.node.activated circle { fill: var(--accent); }
.node.pulse circle {
  animation: pulseGlow 1.6s ease-in-out infinite;
}
.node text {
  fill: var(--fg);
  font-size: 12px;
  text-shadow: 0 0 8px rgba(0,0,0,0.6);
}
.node.locked text { fill: var(--muted); }

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(110,203,255,0.45));
  }
  50% {
    transform: scale(1.2);
    filter: drop-shadow(0 0 18px rgba(110,203,255,0.85));
  }
}

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(79,182,255,0.1);
  color: var(--accent);
  border: 1px solid rgba(110,203,255,0.25);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

@media (max-width: 980px) {
}

