/* =====================================================
   Japan Map section — DARK NAVY (inverted showpiece)
   ===================================================== */

.map-wrap {
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(180, 70, 79, 0.18), transparent 60%),
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(180, 70, 79, 0.08), transparent 60%),
    linear-gradient(135deg, #1a242c 0%, #212d35 50%, #283641 100%);
  border: 1px solid #2a3741;
  border-radius: 24px;
  padding: 44px 48px 48px;
  position: relative;
  overflow: hidden;
  color: var(--bg-0);
  box-shadow:
    0 30px 80px rgba(33, 45, 53, 0.25),
    0 4px 12px rgba(33, 45, 53, 0.1);
}

/* topographic line pattern on the dark map */
.map-wrap::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(236, 232, 233, 0.018) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(-45deg, rgba(236, 232, 233, 0.018) 0 1px, transparent 1px 60px),
    linear-gradient(rgba(236, 232, 233, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 232, 233, 0.03) 1px, transparent 1px);
  background-size: 60px 60px, 60px 60px, 80px 80px, 80px 80px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 30%, transparent 95%);
}

/* warm corner glow */
.map-wrap::after {
  content: "";
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(180, 70, 79, 0.2) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}

.map-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; margin-bottom: 14px;
  position: relative; z-index: 2;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(236, 232, 233, 0.12);
}
.map-head-info { display: flex; flex-direction: column; gap: 8px; }
.map-head-title { font-size: 15px; color: var(--bg-0); font-weight: 600; letter-spacing: 0.005em; }
.map-head-meta {
  font-family: var(--font-en); font-size: 10.5px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(236, 232, 233, 0.5); font-weight: 500;
}
.map-head-stats { display: flex; gap: 36px; }
.map-head-stat { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.map-head-stat .label {
  font-family: var(--font-en); font-size: 9.5px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(236, 232, 233, 0.45); font-weight: 600;
}
.map-head-stat .val {
  font-family: var(--font-en); font-size: 32px; font-weight: 600;
  letter-spacing: -0.04em; color: var(--bg-0); line-height: 1;
}
.map-head-stat .val .unit {
  font-family: var(--font-sans);
  font-size: 12px; color: rgba(236, 232, 233, 0.6);
  font-weight: 500; margin-left: 5px; letter-spacing: 0;
}

.map-svg-frame {
  position: relative;
  margin-top: 28px;
  aspect-ratio: 1000 / 720;
  width: 100%;
  z-index: 2;
}

.map-svg { width: 100%; height: 100%; position: relative; z-index: 1; }

.map-prefs path {
  vector-effect: non-scaling-stroke;
}

/* pin pulse */
.map-node-pulse {
  fill: none;
  stroke: #b4464f;
  stroke-width: 1.2;
  opacity: 0;
  animation: nodePulse 2.6s ease-out infinite;
}
@keyframes nodePulse {
  0% { r: 6px; opacity: 0.7; }
  100% { r: 36px; opacity: 0; }
}

.map-pin-label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  fill: var(--bg-0);
  paint-order: stroke;
  stroke: rgba(26, 36, 44, 0.9);
  stroke-width: 4px;
  stroke-linejoin: round;
  letter-spacing: 0.005em;
  pointer-events: none;
}
.map-pin-label .pin-num {
  font-family: var(--font-en);
  font-weight: 600;
  fill: #d97a82;
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* tooltip / call-out card — light card on dark map */
.map-callout {
  position: absolute;
  z-index: 5;
  pointer-events: auto;
  transform: translate(-50%, calc(-100% - 18px));
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  min-width: 240px;
  max-width: 300px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4),
              0 4px 14px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--ink-0);
}
.map-callout::after {
  content: ""; position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 14px; height: 14px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.callout-pref-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.callout-pref {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--ink-0);
  font-weight: 700;
}
.callout-count {
  font-family: var(--font-en); font-size: 10px;
  color: var(--accent); letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 600;
}
.callout-companies { display: flex; flex-direction: column; gap: 6px; }
.callout-company {
  font-size: 12.5px; color: var(--ink-0); font-weight: 500;
  padding: 9px 13px; border-radius: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; cursor: pointer;
  transition: all 0.15s;
}
.callout-company:hover {
  background: var(--accent); border-color: var(--accent); color: var(--bg-0);
  transform: translateX(2px);
}
.callout-company:hover .members { color: rgba(236, 232, 233, 0.9); }
.callout-company .members {
  font-family: var(--font-en); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.1em; font-weight: 600;
}
.callout-people {
  font-size: 11px; color: var(--ink-3);
  line-height: 1.6; margin-top: 6px;
  font-family: var(--font-sans);
}
.callout-people span { color: var(--ink-1); }

/* legend */
.map-legend {
  display: flex; gap: 22px; align-items: center;
  margin-top: 22px;
  font-family: var(--font-en); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(236, 232, 233, 0.5); font-weight: 500;
  position: relative; z-index: 2;
}
.map-legend-item { display: flex; align-items: center; gap: 8px; }
.map-legend-item .dot {
  width: 9px; height: 9px; border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(180, 70, 79, 0.6);
}

@media (max-width: 720px) {
  .map-wrap { padding: 24px; border-radius: 18px; }
  .map-head { flex-direction: column; }
  .map-head-stats { gap: 22px; }
  .map-head-stat { align-items: flex-start; }
  .map-callout { min-width: 200px; }
}

/* ===== Zoom controls ===== */
.map-zoom-controls {
  position: absolute;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  z-index: 3;
  background: rgba(33, 45, 53, 0.7);
  border: 1px solid rgba(236, 232, 233, 0.16);
  border-radius: 12px;
  padding: 6px;
  backdrop-filter: blur(8px);
}
.map-zoom-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--bg-0);
  font-size: 18px;
  font-family: var(--font-en);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: grid; place-items: center;
}
.map-zoom-btn:hover:not(:disabled) {
  background: var(--accent);
  color: var(--bg-0);
}
.map-zoom-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.map-zoom-btn.reset { font-size: 16px; }
.map-zoom-level {
  text-align: center;
  font-family: var(--font-en);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(236, 232, 233, 0.6);
  font-weight: 600;
  padding: 4px 0 2px;
  border-top: 1px solid rgba(236, 232, 233, 0.12);
  margin-top: 2px;
}
