:root {
  color-scheme: dark;
  --bg: #03040a;
  --panel: rgba(2, 8, 20, 0.72);
  --txt: #d8f8ff;
  --cyan: #00e5ff;
  --green: #39ff88;
  --violet: #7a5cff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Segoe UI, Tahoma, Geneva, Verdana, sans-serif;
  color: var(--txt);
  background: radial-gradient(circle at 20% 10%, rgba(0, 229, 255, 0.12), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(57, 255, 136, 0.12), transparent 45%), var(--bg);
}

.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px;
  display: grid;
  gap: 14px;
}

.app-header {
  text-align: center;
}

.app-header h1 {
  margin: 0;
  letter-spacing: 0.18em;
  color: #8ceeff;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.62);
  font-size: 32px;
}

.app-header p {
  margin: 8px 0 0;
  opacity: 0.9;
}

.panel {
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.18);
  backdrop-filter: blur(6px);
}

.panel-title {
  margin-bottom: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #98eeff;
}

.controls-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 0, 0, 0.55);
  border-radius: 8px;
  padding: 10px 12px;
  color: #d8f8ff;
}

input:focus {
  outline: 2px solid rgba(0, 229, 255, 0.45);
  border-color: rgba(0, 229, 255, 0.7);
}

.btn {
  border-radius: 8px;
  border: 1px solid;
  padding: 10px 14px;
  font-weight: 600;
  background: transparent;
  color: #e8fcff;
  cursor: pointer;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-cyan {
  border-color: rgba(0, 229, 255, 0.6);
  background: rgba(0, 229, 255, 0.08);
}

.btn-violet {
  border-color: rgba(122, 92, 255, 0.65);
  background: rgba(122, 92, 255, 0.12);
}

.btn-green {
  border-color: rgba(57, 255, 136, 0.65);
  background: rgba(57, 255, 136, 0.12);
}

.dns-row {
  margin-top: 8px;
}

.dns-input-wrap {
  flex: 1;
}

.dns-input-wrap label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8af0b2;
}

.dns-message {
  font-size: 12px;
  color: #b3ffd0;
}

.topology {
  position: relative;
  height: 350px;
  overflow: hidden;
}

.zone {
  position: absolute;
  border-radius: 8px;
  border: 2px dotted;
  background: rgba(0, 0, 0, 0.15);
  padding: 6px 8px;
  font-size: 10px;
  z-index: 1;
}

.zone-title {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-bottom: 4px;
}

.zone-user {
  left: 16px;
  top: 20px;
  width: 320px;
  height: 268px;
  border-color: rgba(0, 229, 255, 0.5);
}

.zone-core {
  left: 360px;
  top: 20px;
  width: 260px;
  height: 268px;
  border-color: rgba(122, 92, 255, 0.5);
}

.zone-bcp {
  left: 640px;
  top: 20px;
  width: 300px;
  height: 208px;
  border-color: rgba(57, 255, 136, 0.5);
}

.edge-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.edge {
  stroke-width: 2;
  opacity: 1;
  fill: none;
  stroke-dasharray: 10;
}

.edge-dashed {
  stroke-dasharray: 6 4;
}

.edge.active {
  stroke-dasharray: 8;
  animation: edgeTravel 1.15s linear infinite;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.8));
}

.edge.muted {
  opacity: 0.25;
  animation: none;
}

.edge-cyan {
  stroke: var(--cyan);
}

.edge-green {
  stroke: var(--green);
}

.edge-violet {
  stroke: var(--violet);
}

.node {
  position: absolute;
  z-index: 3;
  border: 1px solid rgba(0, 229, 255, 0.5);
  background: rgba(2, 8, 20, 0.76);
  color: #b8f7ff;
  border-radius: 10px;
  padding: 9px 10px;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.25);
  user-select: none;
  font-size: 13px;
}

.node.active {
  animation: glowPulse 2s ease-in-out infinite;
}

.hover-card {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 4;
  max-width: 340px;
  border-radius: 8px;
  border: 1px solid rgba(0, 229, 255, 0.5);
  background: rgba(0, 0, 0, 0.84);
  padding: 10px;
  font-size: 12px;
  color: #c7f7ff;
}

.hover-card.hidden {
  display: none;
}

.hover-card .title {
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8eefff;
  font-weight: 600;
}

.route-panel {
  border-color: rgba(122, 92, 255, 0.4);
  color: #d9ccff;
}

.route-panel span:first-child {
  font-weight: 700;
  margin-right: 6px;
}

.stats {
  display: grid;
  gap: 7px;
  font-size: 14px;
}

.stats-line .label {
  color: #88e8ff;
  margin-right: 4px;
}

.screenshot {
  display: block;
  margin-top: 12px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: #071122;
}

@keyframes glowPulse {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
  }
  50% {
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.65);
  }
}

@keyframes edgeTravel {
  to {
    stroke-dashoffset: -16;
  }
}

@media (max-width: 980px) {
  .controls-row {
    flex-wrap: wrap;
  }

  .topology {
    overflow-x: auto;
    min-height: 350px;
  }

  .edge-layer,
  .zone,
  .node {
    min-width: 980px;
  }
}