/* ════════════════════════════════════════
   MAP SYSTEM — Panel Thumbnail + Full Overlay
════════════════════════════════════════ */

/* ── Panel Thumbnail ── */
#map-island-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  padding: 20px 16px;
  gap: 14px;
  overflow: hidden;
}

#map-island-thumb {
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  transition: transform 0.2s ease;
  width: 100%;
  max-width: 230px;
}
#map-island-thumb:hover { transform: scale(1.03); }
#map-island-thumb:hover #map-island-hint { opacity: 1; }

#map-island-glow {
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(60, 160, 255, 0.5) 0%,
    rgba(30, 90, 200, 0.25) 40%,
    transparent 70%
  );
  filter: blur(22px);
  animation: mapGlowPulse 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes mapGlowPulse {
  0%, 100% { opacity: 0.55; transform: scale(1);    }
  50%       { opacity: 1.00; transform: scale(1.1); }
}

#map-island-img {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(60, 160, 255, 0.35);
  box-shadow:
    0 0 28px rgba(60, 160, 255, 0.22),
    0 6px 24px rgba(0, 0, 0, 0.65);
  display: block;
  image-rendering: auto;
}

#map-island-hint {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(10, 14, 30, 0.5);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(180, 210, 255, 0.9);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

#map-island-name {
  font-family: var(--font-title);
  font-size: 16px;
  color: var(--text-gold, #c8a96e);
  letter-spacing: 2px;
  text-shadow: 0 0 16px rgba(200, 169, 110, 0.45);
  text-align: center;
}

#map-island-sub {
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--text-dim, #888);
  letter-spacing: 1.5px;
  text-align: center;
}

/* ════════════════════════════════════════
   MAP PANEL — Simple Map Selector
════════════════════════════════════════ */

#map-select-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 12px;
  overflow-y: auto;
  flex: 1;
}

/* ── Map Card (Simple, no visible border) ── */
.msc-card {
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s;
  border: none;
  background: transparent;
}
.msc-card:hover { transform: scale(1.01); }

/* ── Card Header (Always clickable) ── */
.msc-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(200,169,110,0.15);
  padding-bottom: 8px;
}
.msc-header:hover {
  border-bottom-color: rgba(200,169,110,0.35);
}

.msc-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msc-name {
  font-family: var(--font-title);
  font-size: 13px;
  color: var(--text-gold, #c8a96e);
  letter-spacing: 1.5px;
}

.msc-lv {
  font-family: var(--font-ui);
  font-size: 9px;
  color: rgba(200,169,110,0.65);
  letter-spacing: 0.8px;
}

.msc-chevron { display: none; }

/* ── Mini Map Preview (Accordion, Hidden by default) ── */
.msc-preview {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  background: transparent;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show preview when card is open */
.msc-card.msc-open .msc-preview {
  display: flex;
  max-height: 600px;
}

/* Hide zones list */
.msc-zones { display: none; }

/* ── Mini map thumbnail with glow (image only) ── */
.msc-thumb {
  position: relative;
  cursor: pointer;
  width: 100%;
  height: auto;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  transition: filter 0.2s;
  padding: 0;
  margin: 0;
  filter: drop-shadow(0 0 8px rgba(100,220,100,0.75));
}
.msc-card[data-mapid="frostbite"] .msc-thumb {
  filter: drop-shadow(0 0 8px rgba(80,180,220,0.75));
}

.msc-thumb:hover {
  filter: drop-shadow(0 0 12px rgba(100,220,100,0.9)) brightness(1.08);
}
.msc-card[data-mapid="frostbite"] .msc-thumb:hover {
  filter: drop-shadow(0 0 12px rgba(80,180,220,0.9)) brightness(1.08);
}

.msc-thumb img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s;
  margin: 0;
  padding: 0;
}
.msc-thumb:hover img { opacity: 0.95; }

.msc-thumb-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-gold, #c8a96e);
  text-shadow: 0 0 12px rgba(200,169,110,0.8), 0 1px 3px rgba(0,0,0,0.9);
  opacity: 0;
  transition: opacity 0.2s;
  background: transparent;
  pointer-events: none;
}
.msc-thumb:hover .msc-thumb-hint { opacity: 1; }

/* ════════════════════════════════════════
   FULL-SCREEN MAP OVERLAY
════════════════════════════════════════ */
#map-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 18, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#map-overlay.active {
  display: flex;
  animation: mapOverlayFadeIn 0.25s ease-out;
}
@keyframes mapOverlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes mapOverlayFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

#map-overlay-inner {
  position: relative;
  width: min(92vw, 960px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: mapInnerExpand 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes mapInnerExpand {
  from { transform: scale(0.55); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* Header row */
#map-overlay-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  gap: 8px;
  position: relative;
}

#map-overlay-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Map navigation arrows */
.map-nav-arrow {
  background: rgba(200,169,110,0.10);
  border: 1px solid rgba(200,169,110,0.25);
  color: var(--text-gold, #c8a96e);
  width: 32px; height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.map-nav-arrow:hover {
  background: rgba(200,169,110,0.22);
  border-color: rgba(200,169,110,0.55);
}
#map-overlay-title {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--text-gold, #c8a96e);
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(200,169,110,0.4);
}
#map-overlay-close {
  position: absolute;
  right: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.55);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  flex-shrink: 0;
}
#map-overlay-close:hover {
  background: rgba(220,50,50,0.25);
  color: #ff6666;
  border-color: rgba(220,50,50,0.4);
}

/* Map image + nodes container */
#map-img-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(60, 160, 255, 0.2);
  box-shadow:
    0 0 50px rgba(60, 140, 255, 0.12),
    0 16px 60px rgba(0, 0, 0, 0.85);
  flex-shrink: 0;
}
#map-overlay-img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: auto;
  max-height: 75vh;
  object-fit: contain;
}
#map-nodes-layer {
  position: absolute;
  inset: 0;
}

/* ════════════════════════════════════════
   MAP NODES — Sphere with monster icon
════════════════════════════════════════ */
.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #0a090e;
  transition: transform 0.15s ease;
  z-index: 10;
  user-select: none;
  overflow: visible;
}
.map-node:hover:not(.map-node-locked) {
  transform: translate(-50%, -50%) scale(1.18);
  z-index: 20;
}

/* ── Outer ring ── */
.map-node-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid transparent;
  pointer-events: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

/* ── Level-based ring colors ── */
.node-color-white  .map-node-ring { border-color: #d8d8d8; box-shadow: 0 0 14px rgba(216,216,216,0.45), 0 0 30px rgba(200,200,200,0.15); }
.node-color-green  .map-node-ring { border-color: #22dd55; box-shadow: 0 0 14px rgba(34,221,85,0.55),   0 0 30px rgba(34,180,70,0.20); }
.node-color-yellow .map-node-ring { border-color: #e8bb00; box-shadow: 0 0 14px rgba(232,187,0,0.60),   0 0 30px rgba(200,160,0,0.20); }
.node-color-orange .map-node-ring { border-color: #ee7722; box-shadow: 0 0 14px rgba(238,119,34,0.60),  0 0 30px rgba(200,90,20,0.20); }
.node-color-red    .map-node-ring { border-color: #cc2222; box-shadow: 0 0 14px rgba(200,40,40,0.65),   0 0 30px rgba(180,20,20,0.20); }

/* ── Dungeon node — always magenta ── */
.map-node-dungeon {
  width: 82px;
  height: 82px;
  background: radial-gradient(circle at 38% 36%,
    #35163d 0%,
    #1a0b22 45%,
    #0c060f 100%
  );
}
.map-node-dungeon .map-node-ring {
  border-color: #e040fb;
  box-shadow: 0 0 18px rgba(220,60,250,0.70), 0 0 40px rgba(180,30,220,0.25);
  animation: dungeonPulse 2.2s ease-in-out infinite;
}
@keyframes dungeonPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(220,60,250,0.60), 0 0 35px rgba(180,30,220,0.20); }
  50%       { box-shadow: 0 0 26px rgba(240,80,255,0.90), 0 0 55px rgba(200,50,240,0.35); }
}

/* ── Locked / Coming-soon node ── */
.map-node-locked {
  cursor: default;
  background: radial-gradient(circle at 38% 36%, #1a1a1a 0%, #0d0d0d 100%);
  opacity: 0.55;
}
.map-node-locked .map-node-ring {
  border-color: #484848;
  box-shadow: none;
}
.map-node-coming-soon {
  font-family: var(--font-title);
  font-size: 26px;
  color: #444;
  line-height: 1;
  user-select: none;
}

/* ── Sphere — clips image to circle ── */
.map-node-sphere {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Monster image fills the full sphere ── */
.map-node-monster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  image-rendering: auto;
  pointer-events: none;
}

/* ── Safe-zone / village icon ── */
.map-node-safe-icon {
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* ── Selected highlight ── */
.map-node.map-node-selected .map-node-ring {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.20), 0 0 28px currentColor, 0 0 50px currentColor;
}
.map-node-dungeon.map-node-selected .map-node-ring {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.20), 0 0 30px rgba(240,80,255,1), 0 0 60px rgba(200,50,240,0.5);
}

/* ── Current area — extra pulse ── */
.map-node-current:not(.map-node-dungeon) .map-node-ring {
  animation: nodeCurrentPulse 1.8s ease-in-out infinite;
}
@keyframes nodeCurrentPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ── Label below node (level range / DUNGEON) ── */
.map-node-label {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-ui, monospace);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  color: rgba(210, 190, 150, 0.98);
  text-shadow: 0 2px 6px rgba(0,0,0,0.98), 0 0 12px rgba(0,0,0,0.9);
  pointer-events: none;
  text-align: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
}
.map-node-dungeon .map-node-label { color: rgba(230,160,255,0.85); }
.map-node-locked  .map-node-label { color: rgba(100,90,80,0.55); }

/* ════════════════════════════════════════
   NODE TOOLTIP
════════════════════════════════════════ */
#map-node-tooltip {
  position: fixed;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 100;
  width: 120px;
  height: auto;
}
#map-node-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
}

#map-tooltip-header {
  display: none;
}
#map-tooltip-name {
  font-family: var(--font-title);
  font-size: 14px;
  color: var(--text-gold, #c8a96e);
  letter-spacing: 1px;
}
#map-tooltip-level {
  display: none;
}
.map-tooltip-divider {
  display: none;
}
#map-tooltip-desc {
  display: none;
}
#map-tooltip-monsters {
  display: none;
}
.map-tt-tag {
  font-family: var(--font-ui);
  font-size: 9px;
  padding: 3px 7px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.tag-monster { background: rgba(140,30,30,0.4);  border: 1px solid rgba(180,60,60,0.35);  color: #e8a8a8; }
.tag-boss    { background: rgba(130,100,0,0.4);  border: 1px solid rgba(200,160,0,0.35);  color: #ffd633; }
.tag-locked  { background: rgba(50,50,50,0.4);   border: 1px solid rgba(80,80,80,0.4);    color: #888; }
.tag-more    { background: rgba(50,50,70,0.4);   border: 1px solid rgba(80,80,120,0.4);   color: #aaa; }
.tag-safe    { background: rgba(20,100,40,0.4);  border: 1px solid rgba(40,160,70,0.35);  color: #66ee88; }
.tag-elite   { background: rgba(100,70,0,0.4);   border: 1px solid rgba(220,170,0,0.40);  color: #ffc840; }
.tag-key     { background: rgba(60,40,80,0.4);   border: 1px solid rgba(150,80,200,0.40); color: #cc88ff; }

#map-tooltip-enter {
  width: 100%;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(180,40,40,0.85) 0%, rgba(120,15,15,0.9) 100%);
  border: 2px solid rgba(220,60,60,0.7);
  border-radius: 6px;
  color: rgba(255,220,220,1);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-transform: uppercase;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(180,40,40,0.4);
}
#map-tooltip-enter:hover {
  background: linear-gradient(180deg, rgba(220,50,50,0.95) 0%, rgba(160,20,20,1) 100%);
  border-color: rgba(255,100,100,0.9);
  box-shadow: 0 6px 16px rgba(180,40,40,0.6);
}
#map-tooltip-enter.safe-btn {
  background: linear-gradient(180deg, rgba(30,110,50,0.85) 0%, rgba(15,70,30,0.9) 100%);
  border-color: rgba(60,200,90,0.7);
  color: rgba(150,240,170,1);
  box-shadow: 0 4px 12px rgba(60,150,80,0.4);
}
#map-tooltip-enter.safe-btn:hover {
  background: linear-gradient(180deg, rgba(40,140,65,0.95) 0%, rgba(20,90,40,1) 100%);
  border-color: rgba(80,240,110,0.9);
  box-shadow: 0 6px 16px rgba(60,150,80,0.6);
}

/* ── Divider inside tooltip ── */
.map-tooltip-divider {
  height: 1px;
  background: rgba(200,169,110,0.15);
  margin: 8px 0;
}
