/* ───────── Victory overlay ───────── */
.victory {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 214, 10, 0.12), rgba(5, 5, 5, 0.94) 60%);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: grid; place-items: center;
  animation: fadein 0.5s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.victory-card {
  background: rgba(11, 11, 11, 0.9);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  padding: 56px 64px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 80px rgba(255, 214, 10, 0.2);
  max-width: 520px;
}
.victory-card h1 {
  font-family: var(--font-heading);
  font-style: normal;
  font-size: 60px; line-height: 1;
  font-weight: 900;
  margin: 0 0 14px;
  color: var(--c-goal);
  letter-spacing: 0;
}
.victory-card p {
  font-size: 15.5px; color: var(--text-soft);
  margin: 0 0 32px;
  line-height: 1.6;
}
.victory-card button {
  appearance: none;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 13px 28px; border-radius: 99px;
  font: 600 12px/1 'Outfit', sans-serif;
  letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
}
.victory-card button:hover { background: rgba(255,255,255,0.14); }

/* Tweaks panel — match dark theme */
.twk-panel {
  background: rgba(11, 11, 11, 0.88) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6) !important;
}
.twk-x { color: rgba(255,255,255,0.5) !important; }
.twk-x:hover { background: rgba(255,255,255,0.08) !important; color: var(--text) !important; }
.twk-lbl { color: rgba(255,255,255,0.7) !important; }
.twk-val { color: rgba(255,255,255,0.5) !important; }
.twk-sect { color: rgba(255,255,255,0.45) !important; }

/* Hide UI when "Focus" mode is on */
.focus-mode .topbar,
.focus-mode .legend { opacity: 0; pointer-events: none; transition: opacity 0.25s; }

/* ─── Build animation ─── */
.topbar, .sidepanel, .legend {
  transition: opacity 0.8s ease;
}
.anim-hide {
  opacity: 0 !important;
  pointer-events: none !important;
}
body.anim-active .twk-panel {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.8s ease;
}
/* During animation: all nodes monochrome */
body.anim-active .node {
  --c: rgba(255, 255, 255, 0.45) !important;
  --c-soft: rgba(255, 255, 255, 0.15) !important;
}
body.anim-active .node .gate-title,
body.anim-active .node .gate-sub {
  color: rgba(255, 255, 255, 0.7) !important;
}
body.anim-active .node .node-label {
  color: rgba(255, 255, 255, 0.5) !important;
}
body.anim-active .node.completed .shape {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 3px 10px rgba(0,0,0,0.5) !important;
}
body.anim-active .node.completed .gate-title,
body.anim-active .node.completed .gate-sub {
  color: rgba(255, 255, 255, 0.7) !important;
}
body.anim-active .node.completed .node-label {
  color: rgba(255, 255, 255, 0.5) !important;
}
body.anim-active .node.tier-topic.completed .shape .check-mark {
  color: rgba(255, 255, 255, 0.8) !important;
}
body.anim-active .node.current .shape {
  transform: scale(1) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 3px 10px rgba(0,0,0,0.5) !important;
}
body.anim-active .node.locked .shape {
  background: rgba(255, 255, 255, 0.03) !important;
}
body.anim-active .node.locked .gate-title,
body.anim-active .node.locked .gate-sub,
body.anim-active .node.locked .node-label {
  color: rgba(255, 255, 255, 0.3) !important;
}
body.anim-active .edges-layer path {
  stroke: rgba(255, 255, 255, 0.12) !important;
  filter: none !important;
}
body.anim-active .stars-row,
body.anim-active .star-gate-badge,
body.anim-active .xp-badge {
  opacity: 0 !important;
}

.node.anim-hidden {
  opacity: 0 !important;
  filter: blur(6px);
  transform: translate(-50%, -50%) scale(0.88);
  pointer-events: none;
}
.node.anim-revealed {
  animation: nodeReveal 0.7s cubic-bezier(.25, .1, .25, 1) forwards;
}
@keyframes nodeReveal {
  from { opacity: 0; filter: blur(6px); transform: translate(-50%, -50%) scale(0.88); }
  to   { opacity: 1; filter: blur(0);   transform: translate(-50%, -50%) scale(1); }
}
.anim-overlay {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 32px 0;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  pointer-events: none;
  animation: fadein 0.5s ease;
}
.anim-title {
  font: 900 13px/1 var(--font-heading);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.anim-progress-bar {
  width: 240px; height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px; overflow: hidden;
}
.anim-progress-fill {
  height: 100%;
  background: var(--text-faint);
  border-radius: 3px;
  transition: width 0.3s ease;
}
