.zsg-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.74), transparent 0 16rem),
    linear-gradient(180deg, rgba(247, 252, 255, 0.7), rgba(243, 248, 246, 0.82));
  transition: background 0.22s ease;
}

.zsg-background svg {
  width: 100%;
  height: 100%;
  display: block;
}

.zsg-link {
  stroke: rgba(16, 92, 112, 0.2);
  stroke-width: 1.25;
}

.zsg-link-depth-2 {
  stroke: rgba(74, 101, 134, 0.14);
  stroke-width: 1;
}

.zsg-node {
  pointer-events: none;
}

.zsg-node circle {
  fill: rgba(255, 255, 255, 0.78);
  stroke: rgba(15, 118, 110, 0.34);
  stroke-width: 1.4;
}

.zsg-node-depth-0 circle {
  fill: rgba(15, 118, 110, 0.92);
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.2;
}

.zsg-node-depth-1 circle {
  fill: rgba(231, 251, 246, 0.92);
}

.zsg-node-depth-2 circle {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(88, 112, 141, 0.36);
}

.zsg-label {
  fill: rgba(16, 33, 58, 0.44);
  font: 700 12px/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(248, 251, 255, 0.84);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.zsg-node-depth-0 .zsg-label {
  fill: rgba(255, 255, 255, 0.96);
  font-size: 15px;
  stroke: rgba(15, 118, 110, 0.78);
}

.zsg-version-label {
  font-size: 10px;
  opacity: 0.78;
}

.zsg-map-toggle {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 20;
  border: 1px solid rgba(15, 118, 110, 0.32);
  border-radius: 999px;
  padding: 0.58rem 0.9rem;
  color: #063f49;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 38px rgba(16, 33, 58, 0.12);
  font: 800 0.9rem/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}

.zsg-map-toggle:hover,
.zsg-map-toggle:focus-visible {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  outline: none;
}

body.zsg-cards-hidden .zsg-background {
  pointer-events: auto;
  background:
    radial-gradient(circle at 50% 42%, rgba(32, 113, 121, 0.28), transparent 0 22rem),
    radial-gradient(circle at 16% 18%, rgba(99, 176, 184, 0.18), transparent 0 20rem),
    radial-gradient(circle at 84% 80%, rgba(123, 131, 165, 0.18), transparent 0 18rem),
    linear-gradient(180deg, #101b25, #17252e 55%, #132426);
}

body.zsg-cards-hidden .zsg-node {
  pointer-events: auto;
  cursor: pointer;
}

body.zsg-cards-hidden.zsg-map-unlocked .zsg-node {
  cursor: grab;
}

body.zsg-cards-hidden.zsg-map-unlocked .zsg-node:active {
  cursor: grabbing;
}

body.zsg-cards-hidden .zsg-link {
  stroke-opacity: 1;
  stroke: rgba(126, 206, 214, 0.42);
  stroke-width: 1.5;
}

body.zsg-cards-hidden .zsg-link-depth-2 {
  stroke: rgba(143, 164, 190, 0.32);
  stroke-width: 1.15;
}

body.zsg-cards-hidden .zsg-node circle {
  fill: rgba(17, 31, 42, 0.96);
  stroke: rgba(128, 211, 214, 0.9);
  stroke-width: 2;
}

body.zsg-cards-hidden .zsg-node-depth-2 circle {
  stroke: rgba(151, 167, 190, 0.86);
}

body.zsg-cards-hidden .zsg-node-kind-terminal-game circle {
  fill: rgba(45, 21, 58, 0.96);
  stroke: #f0a6ff;
}

body.zsg-cards-hidden .zsg-node-kind-terminal-practice circle,
body.zsg-cards-hidden .zsg-node-kind-terminal-course circle {
  fill: rgba(61, 35, 14, 0.96);
  stroke: #ffd27a;
}

body.zsg-cards-hidden .zsg-node-kind-terminal-tool circle,
body.zsg-cards-hidden .zsg-node-kind-terminal-feed circle,
body.zsg-cards-hidden .zsg-node-kind-terminal-support circle {
  fill: rgba(14, 48, 61, 0.96);
  stroke: #7bd7ff;
}

body.zsg-cards-hidden .zsg-node-kind-record circle,
body.zsg-cards-hidden .zsg-node-kind-account circle {
  fill: rgba(20, 50, 38, 0.96);
  stroke: #8df0bc;
}

body.zsg-cards-hidden .zsg-node-active circle {
  fill: #ffffff;
  stroke: #7dd8d0;
  stroke-width: 2.6;
  filter: drop-shadow(0 0 14px rgba(125, 216, 208, 0.46));
}

body.zsg-cards-hidden .zsg-node:hover circle,
body.zsg-cards-hidden .zsg-node:focus circle {
  fill: #14a39a;
  stroke: #d9fffb;
}

body.zsg-cards-hidden .zsg-node:hover .zsg-label,
body.zsg-cards-hidden .zsg-node:focus .zsg-label {
  fill: #fff;
  stroke: rgba(20, 46, 57, 0.92);
}

body.zsg-cards-hidden .zsg-label {
  fill: rgba(220, 235, 246, 0.82);
  stroke: rgba(16, 28, 38, 0.92);
  stroke-width: 5px;
}

body.zsg-cards-hidden .zsg-node-active .zsg-label {
  fill: #ffffff;
  font-size: 15px;
  stroke: rgba(20, 46, 57, 0.92);
}

body.zsg-cards-hidden .wrap,
body.zsg-cards-hidden [data-zsg-page-content] {
  opacity: 0;
  transform: translateY(0.75rem) scale(0.985);
  pointer-events: none;
}

body.zsg-cards-hidden .zsg-map-toggle {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.zsg-controls {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 20;
  display: none;
  width: min(34rem, calc(100vw - 2rem));
  padding: 0.85rem;
  border: 1px solid rgba(125, 216, 208, 0.34);
  border-radius: 8px;
  color: #e9f5fb;
  background: rgba(15, 27, 37, 0.88);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
  font: 800 0.82rem/1.25 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.zsg-cards-hidden .zsg-controls {
  display: grid;
  gap: 0.8rem;
}

.zsg-controls-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.zsg-controls-title,
.zsg-controls-mode {
  color: #9bd7dc;
  letter-spacing: 0;
}

.zsg-controls-title {
  text-transform: uppercase;
  font-size: 0.72rem;
}

.zsg-controls-mode {
  margin-top: 0.18rem;
  color: #eafcff;
  font-size: 0.8rem;
}

.zsg-controls-focus {
  justify-self: end;
  max-width: 100%;
  overflow: hidden;
  color: #eafcff;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.zsg-slider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(7.5rem, 1fr));
  gap: 0.75rem;
}

.zsg-controls label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.zsg-controls label span {
  color: #c7f3f4;
  font-size: 0.75rem;
}

.zsg-controls input {
  width: 100%;
  min-width: 0;
  accent-color: #5fd2c8;
}

.zsg-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.zsg-controls button {
  border: 1px solid rgba(159, 221, 225, 0.46);
  border-radius: 7px;
  padding: 0.54rem 0.72rem;
  color: #eaffff;
  background: rgba(20, 126, 119, 0.86);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.zsg-controls button:hover,
.zsg-controls button:focus-visible {
  color: #071b20;
  background: #9bf3eb;
  outline: none;
}

.wrap {
  position: relative;
  z-index: 2;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

[data-zsg-page-content] {
  position: relative;
  z-index: 2;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.hero,
.portal-card {
  opacity: 1;
}

@media (max-width: 760px) {
  .zsg-label {
    font-size: 10px;
  }

  .zsg-node-depth-2 .zsg-label {
    display: none;
  }

  .zsg-map-toggle {
    right: 0.75rem;
    top: 0.75rem;
    padding: 0.52rem 0.72rem;
  }

  body.zsg-cards-hidden .zsg-controls {
    width: calc(100vw - 1.5rem);
    left: 0.75rem;
    bottom: 0.75rem;
  }

  .zsg-controls-head,
  .zsg-slider-grid,
  .zsg-action-row {
    grid-template-columns: 1fr;
  }

  .zsg-controls-focus {
    justify-self: start;
  }

  .zsg-controls button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wrap {
    transition: none;
  }

  [data-zsg-page-content] {
    transition: none;
  }
}
