/* Bunkaweb paper-map graph */

#graph-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bwg-root {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--graph-bg, #F5EAD1);
  border-radius: 14px;
  overflow: hidden;
  font-family: var(--ui, 'Poppins', system-ui, sans-serif);
  cursor: grab;
  user-select: none;
}

.bwg-grain {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--graph-grain, rgba(141,110,99,0.08)) 1px, transparent 1.2px);
  background-size: 4px 4px;
}


.bwg-svg {
  position: absolute; inset: 0;
}

/* Links */
.bwg-link {
  stroke: var(--graph-link, rgba(42,31,24,.35));
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 3 4;
  transition: opacity 300ms ease, stroke 200ms, stroke-width 200ms;
}
.bwg-link--hi {
  stroke: var(--graph-link-hi, #2A1F18);
  stroke-width: 2.2;
}

/* Nodes */
.bwg-node {
  transform-origin: 0 0;
  transition: transform 680ms cubic-bezier(.2,.9,.25,1.2);
  cursor: pointer !important;
  outline: none;
}
.bwg-node:focus-visible .bwg-node-circle {
  stroke: var(--graph-center-ring, #E0A02F);
  stroke-width: 3.2;
}

.bwg-node-circle {
  fill: var(--graph-node, #D95D39);
  stroke: var(--graph-node-stroke, #FDF6E3);
  stroke-width: 2.2;
  transition: stroke 200ms, stroke-width 200ms;
}
.bwg-node:hover .bwg-node-circle {
  filter: url(#bwg-glow);
}
.bwg-node--highlighted .bwg-node-circle {
  stroke: var(--graph-halo, #D95D39);
  stroke-width: 3;
}
.bwg-node--secondary .bwg-node-circle {
  stroke: var(--connection-color, #008080);
  stroke-width: 2.8;
  stroke-dasharray: 4 2;
}

/* Halo (hidden by default, shown on highlighted) */
.bwg-halo-ring {
  fill: none;
  stroke: var(--graph-halo, #D95D39);
  stroke-width: 2;
  opacity: 0;
  transition: opacity 200ms;
}
.bwg-halo-fill {
  fill: var(--graph-halo, #D95D39);
  opacity: 0;
  transition: opacity 200ms;
}
.bwg-node--highlighted .bwg-halo-ring {
  opacity: .55;
  animation: bwg-halo-pulse 2.4s ease-in-out infinite;
}
.bwg-node--highlighted .bwg-halo-fill {
  opacity: .22;
}
@keyframes bwg-halo-pulse {
  0%, 100% { opacity: .65; transform: scale(1); }
  50%       { opacity: .2;  transform: scale(1.08); }
}

/* Labels */
.bwg-label {
  font-family: var(--display, 'Playfair Display', Georgia, serif);
  font-size: 12px; font-weight: 500;
  fill: var(--graph-label, #2A1F18);
  paint-order: stroke;
  stroke: var(--graph-bg, #F5EAD1);
  stroke-width: 4;       /* thicker halo keeps labels readable over links */
  stroke-linejoin: round;
  pointer-events: none;
  transition: font-size 180ms, opacity 300ms ease;
}
.bwg-label--em {
  font-size: 14px;
  font-weight: 700;
  stroke-width: 5;
}

/* Center disc */
.bwg-center {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer !important;
  z-index: 2;
  animation: bwg-center-in 480ms cubic-bezier(.2,.9,.25,1.15) both;
}
@keyframes bwg-center-in {
  from { transform: translate(-50%,-50%) scale(0.12); opacity: 0; }
  to   { transform: translate(-50%,-50%) scale(1);    opacity: 1; }
}
.bwg-center__aura {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed var(--graph-center-ring, #E0A02F);
  opacity: .5;
  pointer-events: none;
}
.bwg-center__glow {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224,160,47,0.15), transparent 70%);
  pointer-events: none;
}
.bwg-center__disc {
  position: relative;
  border-radius: 50%;
  background: var(--graph-center, #8C2F39);
  box-shadow: 0 8px 24px rgba(44,28,20,.28), inset 0 1px 0 rgba(255,255,255,.12);
  display: grid; place-items: center;
  border: 3px solid var(--graph-center-ring, #E0A02F);
}

/* Center label */
.bwg-center-label {
  position: absolute;
  transform: translateX(-50%);
  text-align: center;
  max-width: 260px;
  pointer-events: none;
  z-index: 2;
  animation: bwg-label-in 560ms ease both;
}
@keyframes bwg-label-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%); }
}
.bwg-center-label__kicker {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 9px; letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--graph-label-muted, #4A3B30);
  margin-bottom: 4px;
}
.bwg-center-label__name {
  font-family: var(--display, 'Playfair Display', Georgia, serif);
  font-weight: 700;
  color: var(--graph-label, #2A1F18);
  line-height: 1.15;
  text-shadow: 0 1px 0 var(--graph-bg, #F5EAD1);
}
.bwg-center-label__coords {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--graph-label-muted, #4A3B30);
  margin-top: 5px;
  opacity: 0.75;
}

/* Zoom group — viewport container; node positions are updated directly in JS */
.bwg-zoom-group {
  position: absolute;
  inset: 0;
}

/* Zoom controls — fixed overlay, bottom-right */
.bwg-zoom-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bwg-zoom-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: rgba(253,246,227,0.88);
  border: 1px solid var(--rule, #D7CCC8);
  color: var(--ink, #2A1F18);
  font-size: 15px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  line-height: 1;
  cursor: pointer !important;
  display: grid;
  place-items: center;
  transition: background 140ms, opacity 140ms;
  padding: 0;
}
.bwg-zoom-btn:hover { background: rgba(253,246,227,1); }
.bwg-zoom-btn:disabled { opacity: 0.35; cursor: default !important; }

/* Responsive */
@media (max-width: 768px) {
  .bwg-label { font-size: 12px; }
  .bwg-node-circle { stroke-width: 3; }
}
@media (max-width: 400px) {
  .bwg-zoom-controls { bottom: 12px; right: 10px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bwg-link, .bwg-node, .bwg-label { transition-duration: 0ms !important; }
  .bwg-halo-ring { animation: none !important; }
}
