/* ==========================================================================
   MY NODE MAP — TRAVEL DNA overlay (fit viewport, no scroll chrome)
   ========================================================================== */

.mnm-dna-overlay {
  position: fixed;
  inset: 0;
  z-index: 100070;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(120% 100% at 50% 0%, rgba(6, 26, 24, 0.82), rgba(0, 0, 0, 0.88));
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mnm-dna-overlay.is-in {
  opacity: 1;
}

.mnm-dna-panel {
  position: relative;
  width: min(1000px, 100%);
  max-height: min(820px, calc(100dvh - 40px), calc(100vh - 40px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 16px;
  border-radius: 22px;
  border: 1px solid rgba(140, 220, 190, 0.28);
  background: linear-gradient(180deg, rgba(11, 26, 28, 0.97), rgba(4, 11, 15, 0.98));
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
  transform: translateY(10px) scale(0.99);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.mnm-dna-overlay.is-in .mnm-dna-panel {
  transform: translateY(0) scale(1);
}

.mnm-dna-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.4);
  color: rgba(230, 250, 240, 0.9);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 2;
}

.mnm-dna-close:hover {
  border-color: rgba(255, 120, 120, 0.55);
  box-shadow: 0 0 14px rgba(255, 120, 120, 0.24);
}

.mnm-dna-head {
  flex: 0 0 auto;
  padding-right: 44px;
}

.mnm-dna-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(157, 255, 176, 0.85);
}

.mnm-dna-archetype {
  margin: 6px 0 2px;
  font-size: clamp(20px, 2.8vw, 32px);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f2fbff;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mnm-dna-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(210, 240, 235, 0.7);
  max-width: 60ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mnm-dna-code {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 252, 138, 0.3);
  background: linear-gradient(180deg, rgba(125, 252, 138, 0.12), rgba(255, 255, 255, 0.02));
}

.mnm-dna-code-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(157, 255, 176, 0.8);
}

.mnm-dna-code-value {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #eaf8ff;
}

.mnm-dna-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-top: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.mnm-dna-art {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  background: #04100f;
  min-height: 0;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mnm-dna-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.mnm-dna-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.mnm-dna-block {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.2));
  min-height: 0;
}

.mnm-dna-block-title {
  display: block;
  margin-bottom: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(157, 255, 176, 0.8);
}

.mnm-dna-gene {
  display: grid;
  grid-template-columns: minmax(88px, 0.9fr) minmax(0, 1.6fr) 30px;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.mnm-dna-gene-name {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(224, 246, 240, 0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mnm-dna-gene-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mnm-dna-gene-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9dffb0, #35c8ff);
  box-shadow: 0 0 10px rgba(53, 200, 255, 0.3);
}

.mnm-dna-gene-val {
  font-size: 10.5px;
  font-weight: 700;
  text-align: right;
  color: #eaf8ff;
}

.mnm-dna-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mnm-dna-stat {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.24);
  min-width: 0;
}

.mnm-dna-stat-label {
  display: block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(210, 240, 235, 0.55);
}

.mnm-dna-stat-value {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #f2fbff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mnm-dna-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mnm-dna-match:last-child {
  border-bottom: 0;
}

.mnm-dna-match-name {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(234, 248, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mnm-dna-match-val {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 800;
  color: #9dffb0;
  letter-spacing: 0.04em;
}

.mnm-dna-match-val.is-muted {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(210, 240, 235, 0.45);
}

.mnm-dna-empty {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(210, 240, 235, 0.6);
}

.mnm-dna-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  flex: 0 0 auto;
}

.mnm-dna-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  color: rgba(234, 248, 255, 0.92);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.mnm-dna-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 252, 138, 0.42);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.mnm-dna-btn--primary {
  color: #061410;
  border-color: rgba(125, 252, 138, 0.5);
  background: linear-gradient(160deg, #9dffb0, #4fe6c0 55%, #35c8ff);
  box-shadow: 0 10px 24px rgba(53, 200, 255, 0.24);
}

/* Compact / tight — auto-applied when content would overflow */
.mnm-dna-panel--compact {
  padding: 14px 16px 12px;
}

.mnm-dna-panel--compact .mnm-dna-body {
  gap: 10px;
  margin-top: 8px;
}

.mnm-dna-panel--compact .mnm-dna-block {
  padding: 8px 10px;
}

.mnm-dna-panel--compact .mnm-dna-gene {
  padding: 1px 0;
}

.mnm-dna-panel--compact .mnm-dna-sub {
  -webkit-line-clamp: 1;
}

.mnm-dna-panel--tight .mnm-dna-archetype {
  font-size: clamp(18px, 2.4vw, 26px);
}

.mnm-dna-panel--tight .mnm-dna-block:nth-child(n + 3) .mnm-dna-match:nth-child(n + 4) {
  display: none;
}

.mnm-dna-panel--tight .mnm-dna-actions .mnm-dna-btn:not(.mnm-dna-btn--primary) {
  padding: 6px 10px;
}

@media (max-width: 900px) {
  .mnm-dna-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .mnm-dna-art {
    max-height: min(280px, 36vh);
  }

  .mnm-dna-panel {
    padding: 14px 14px 12px;
  }

  .mnm-dna-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-height: 720px) {
  .mnm-dna-panel {
    padding: 12px 14px 10px;
  }

  .mnm-dna-sub {
    display: none;
  }

  .mnm-dna-gene {
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mnm-dna-overlay,
  .mnm-dna-panel,
  .mnm-dna-btn {
    transition: none;
  }
}
