:root {
  --bg1: #fff;
  --bg2: #fff;
  --panel: #ffffffcc;
  --card: #ffffffc9;
  --muted: #4b568a;
  --ink: #0d1230;
  --accent: #49b542;
  --accent2: #49b542;
  --stroke: #0000001f;
  --link: #4452a8;
  --linkStrong: #2d44c9;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 20% 0%, var(--bg2), var(--bg1));
  font-family: Inter, ui-sans-serif, system-ui, Segoe UI, Roboto, Helvetica,
    Arial;
}
.wrapper {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

header {
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(
    180deg,
    #ffffffa0,
    #ffffff33 28%,
    #ffffff10 60%,
    #ffffff00
  );
  border-bottom: 1px solid #00000012;
  backdrop-filter: blur(6px);
  justify-content: space-between;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.3px;
  opacity: 0.92;
}
.controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.controls button {
  padding: 11px 14px;
  border-radius: 12px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 8px 18px #0003;
}
.small {
  font-size: 12px;
  color: var(--muted);
}

.main {
  position: relative;
}
svg {
  width: 100%;
  height: 100%;
}
/*.panel{position:absolute;left:16px;bottom:16px;display:flex;gap:12px;flex-wrap:wrap}*/

.panel {
  position: absolute;
  left: 16px;
  top: 16px; /* tam yükseklik için top + bottom birlikte */
  bottom: 16px;
  right: auto;

  display: flex;
  flex-direction: column; /* kartlar alt alta */
  justify-content: flex-end; /* ALT hizalama */
  align-items: stretch;
  gap: 12px;

  max-width: 320px;
  overflow: auto; /* içerik taşarsa kaydır */
}
.card {
  width: 100%;
  backdrop-filter: blur(6px);
  background: var(--card);
  border: 1px solid #00000022;
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--ink);
}

/*.card{backdrop-filter:blur(6px);background:var(--card);border:1px solid #00000022;border-radius:14px;padding:10px 12px;box-shadow:0 8px 24px #0004;color:var(--ink)}*/
.legendTitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.legendGrid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.flag {
  font-size: 16px;
  line-height: 1;
}
#legend img.emoji {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}
.stat {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}
.kpi {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  text-align: justify;
}

.zoombar {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.zoombar button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffffd8;
  border: 1px solid #00000022;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px #0003;
}
.zoombar button:hover {
  background: #ffffffee;
}

.tooltip {
  position: absolute;
  pointer-events: none;
  background: #ffffffee;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid #00000022;
  border-radius: 12px;
  font-size: 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 26px #0005;
}
.tooltip .t {
  font-weight: 700;
}
.tooltip img.emoji {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
}

/* Düğüm yazıları: konturlu ve tıklamayı engellemesin */
.node text {
  paint-order: stroke;
  stroke: #00000080;
  stroke-width: 2.5px;
  pointer-events: none;
}
.node circle {
  filter: url(#glow);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    40% 60% at 50% 40%,
    #ffffffd9,
    #ffffffb8,
    #ffffff99
  );
  backdrop-filter: blur(3px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.loading-overlay.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader {
  position: relative;
  width: 110px; /* boyutu buradan ayarla */
  height: 110px;
  margin-bottom: 12px;
  /* loader’da spin yok; halkalar dönecek */
}

.ring {
  position: absolute;
  inset: 0;
  animation: spin var(--speed, 1.6s) linear infinite;
}
.ring.inner {
  --speed: 2.2s; /* iç halka biraz daha yavaş ve ters */
  animation-name: spin-rev;
}

/* Noktalar (dış halka varsayılan accent rengi) */
.loader .dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px #0001;
  animation: pulse 1.2s ease-in-out infinite;
}

/* İç halka noktaları (farklı renk ve daha küçük) */
.ring.inner .dot {
  background: var(--accent2);
}
.dot.small {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
}

/* Animasyonlar */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes spin-rev {
  to {
    transform: rotate(-360deg);
  }
}
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.65);
  }
  100% {
    transform: scale(1);
  }
}

.loading-overlay .loader {
  transform: scale(1.8); /* 1.2–2.2 arası olabilir */
  transform-origin: center center;
}

@media (max-width: 640px) {
  .loading-overlay .loader {
    transform: scale(1.35);
  }
}

.loading-text {
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 1px 0 #fff8;
}
