/* --- FULL-SCREEN BRANCHING EXPEDITION MAP --- */

.full-stage-view {
  --map-backdrop-image: url('../assets/board/background act1.png');
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #0b1c2e;
  background-image: url('../assets/board/background act1.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

/*
 * Extend the active act artwork into wide-screen gutters. Keeping this layer
 * soft and dark lets it visually continue the map without making nodes outside
 * the playable canvas look interactive.
 */
.full-stage-view::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--map-backdrop-image);
  background-size: cover;
  background-position: center;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}

/* Top Floating Act Header Bar */
.route-map-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: linear-gradient(180deg, rgba(20, 35, 55, 0.95) 0%, rgba(10, 20, 35, 0.98) 100%);
  border-bottom: 2px solid var(--accent-gold);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.route-map-header-left,
.route-map-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.route-map-header-center {
  flex: 1;
  text-align: center;
}

.route-map-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #f6e05e;
  text-shadow: 2px 2px 0 #2d1810;
}

.route-map-subtitle {
  font-size: 12px;
  color: #e2e8f0;
  margin-top: 2px;
  font-weight: 600;
}

/* --- SCROLLABLE & DRAGGABLE 15-FLOOR MAP VIEWPORT --- */
.route-map-viewport {
  flex: 1;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
  background: transparent;
}

.route-map-viewport.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

/* Expedition-map scrollbar */
.route-map-viewport::-webkit-scrollbar {
  width: 12px;
}
.route-map-viewport::-webkit-scrollbar-track {
  background: #ecdcb9;
  border-left: 2px solid var(--panel-border);
}
.route-map-viewport::-webkit-scrollbar-thumb {
  background: #8c7355;
  border-radius: 6px;
  border: 2px solid #ecdcb9;
}
.route-map-viewport::-webkit-scrollbar-thumb:hover {
  background: #6e5840;
}

/* Tall Map Canvas: 2600px stretched vertically across the full vertical island map */
.map-scroll-canvas {
  position: relative;
  width: calc(100% - 48px);
  max-width: 1300px;
  min-height: 2600px;
  margin: 24px auto 40px;
  box-sizing: border-box;
  background-color: #0b1c2e;
  background-image: 
    linear-gradient(to bottom, rgba(7, 23, 40, 0.08), rgba(7, 23, 40, 0.22)),
    url('../assets/images/map-coconut-cove.png');
  background-size: 100% 100%;
  background-position: center top;
  background-repeat: no-repeat;
  border: 3.5px solid #4a3427;
  border-radius: 16px;
  box-shadow: 
    0 0 0 2px #261b14,
    0 0 0 4px #5c4333,
    0 0 0 6px #1a120d,
    0 4px 8px rgba(0, 0, 0, 0.5),
    0 12px 24px rgba(0, 0, 0, 0.65),
    0 25px 60px rgba(0, 0, 0, 0.85),
    0 40px 100px rgba(0, 0, 0, 0.95),
    inset 0 0 35px rgba(0, 0, 0, 0.55);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.85));
  overflow: hidden;
}

.map-ambience-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.map-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.map-connection-line {
  stroke: #f3d49b;
  stroke-width: 5.5;
  stroke-dasharray: 8 9;
  stroke-linecap: round;
  fill: none;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.95)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9));
  transition: all 0.3s ease;
  opacity: 0.95;
}

.map-connection-line.active-path {
  stroke: #fef08a;
  stroke-width: 7.5;
  stroke-dasharray: 12 8;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px #f59e0b) drop-shadow(0 0 22px #eab308) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9));
  animation: lineDashMove 1s linear infinite;
  opacity: 1;
}

.map-connection-line.visited-path {
  stroke: #94a3b8;
  stroke-width: 4.5;
  stroke-dasharray: 5 6;
  opacity: 0.75;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.9)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}

@keyframes lineDashMove {
  from { stroke-dashoffset: 40; }
  to { stroke-dashoffset: 0; }
}

/* --- ISLAND ADVENTURE NODE MEDALLIONS & MAP SIGILS --- */
.map-nodes-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.map-node-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 4;
  transition: transform 0.24s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.24s;
  user-select: none;
}

/* Sculpted Antique Gold/Brass Outer Medallion Frame */
.node-pin-medallion {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffbeb 0%, #fde047 22%, #d97706 65%, #78350f 100%);
  padding: 4px;
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.7), 
    0 2px 4px rgba(0, 0, 0, 0.85),
    inset 0 2px 4px rgba(255, 255, 255, 0.75),
    inset 0 -3px 5px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

/* Brass Rivets on Medallion Rim */
.node-medallion-rim {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  border: 1.5px dashed rgba(254, 240, 138, 0.55);
  pointer-events: none;
}

/* Deep Enamel Center Disk */
.node-medallion-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 
    inset 0 3px 6px rgba(0, 0, 0, 0.75),
    inset 0 -2px 4px rgba(255, 255, 255, 0.2),
    0 0 0 1.5px #451a03;
}

/* Subtle Specular Glint Across Medallion */
.node-pin-glint {
  position: absolute;
  top: 4px;
  left: 8px;
  width: 24px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 100%);
  transform: rotate(-32deg);
  pointer-events: none;
}

/* Bespoke Vector SVG Icon Inside */
.node-svg-icon {
  width: 48px;
  height: 48px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65));
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- BOSS NODE MEDALLION --- */
.map-node-pin.boss-pin {
  width: 120px;
  height: 120px;
  z-index: 6;
}

.boss-pin .node-pin-medallion {
  width: 112px;
  height: 112px;
  padding: 6px;
  background: radial-gradient(circle at 35% 30%, #fef08a 0%, #eab308 28%, #b45309 68%, #451a03 100%);
  box-shadow: 
    0 14px 35px rgba(0, 0, 0, 0.85),
    0 0 30px rgba(220, 38, 38, 0.75),
    inset 0 3px 6px rgba(255, 255, 255, 0.85),
    inset 0 -4px 8px rgba(0, 0, 0, 0.9);
}

.boss-pin .node-svg-icon {
  width: 84px;
  height: 84px;
}

/* --- RICH THEMED ENAMEL BACKDROPS --- */
.node-monster .node-medallion-inner, 
.node-battle .node-medallion-inner {
  background: radial-gradient(circle at 40% 35%, #b91c1c 0%, #7f1d1d 55%, #450a0a 100%);
}

.node-elite .node-medallion-inner {
  background: radial-gradient(circle at 40% 35%, #7e22ce 0%, #581c87 55%, #2e1065 100%);
}

.node-event .node-medallion-inner,
.node-mystery .node-medallion-inner {
  background: radial-gradient(circle at 40% 35%, #0284c7 0%, #0369a1 55%, #082f49 100%);
}

.node-treasure .node-medallion-inner {
  background: radial-gradient(circle at 40% 35%, #d97706 0%, #b45309 55%, #451a03 100%);
}

.node-merchant .node-medallion-inner,
.node-shop .node-medallion-inner {
  background: radial-gradient(circle at 40% 35%, #ca8a04 0%, #a16207 55%, #713f12 100%);
}

.node-rest .node-medallion-inner {
  background: radial-gradient(circle at 40% 35%, #059669 0%, #047857 55%, #064e3b 100%);
}

.node-boss .node-medallion-inner {
  background: radial-gradient(circle at 40% 35%, #991b1b 0%, #450a0a 60%, #1c0505 100%);
}

/* --- PARCHMENT & MAHOGANY TITLE PLAQUES --- */
.node-pin-title {
  position: absolute;
  bottom: -22px;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #fef08a;
  white-space: nowrap;
  background: linear-gradient(180deg, #3d2412 0%, #201006 100%);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1.5px solid #d97706;
  box-shadow: 
    0 3px 8px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px rgba(254, 240, 138, 0.3);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  transition: all 0.2s ease;
}

.boss-pin .node-pin-title {
  bottom: -26px;
  font-size: 13px;
  letter-spacing: 1.2px;
  padding: 4px 14px;
  border-width: 2px;
  border-color: #f59e0b;
  color: #ffedd5;
  background: linear-gradient(180deg, #501313 0%, #220505 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.85), 0 0 12px rgba(220, 38, 38, 0.5);
}

/* --- INTERACTIVE NODE STATES & ANIMATIONS --- */

/* AVAILABLE: Golden Sea-Lantern Shimmer & Pulse */
.map-node-pin.available {
  z-index: 10;
  animation: pirateNodePulse 1.4s ease-in-out infinite alternate;
}

.map-node-pin.available .node-pin-medallion {
  box-shadow: 
    0 0 0 3px #fef08a,
    0 0 20px rgba(250, 204, 21, 0.95),
    0 0 35px rgba(234, 179, 8, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.6);
}

.map-node-pin.available .node-pin-title {
  border-color: #fde047;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7), 0 0 10px rgba(250, 204, 21, 0.5);
}

.map-node-pin.available:hover {
  transform: translate(-50%, -50%) scale(1.24) translateY(-6px);
  z-index: 20;
}

.map-node-pin.available:hover .node-pin-medallion {
  box-shadow: 
    0 0 0 4px #ffffff,
    0 0 30px rgba(254, 240, 138, 1),
    0 0 50px rgba(245, 158, 11, 0.8),
    0 14px 28px rgba(0, 0, 0, 0.7);
}

.map-node-pin.available:hover .node-svg-icon {
  transform: scale(1.1);
}

@keyframes pirateNodePulse {
  0% {
    transform: translate(-50%, -50%) scale(1.02);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.14);
  }
}

/* CURRENT: Nautical Anchor / Compass Aura */
.map-node-pin.current {
  z-index: 12;
  transform: translate(-50%, -50%) scale(1.18);
}

.map-node-pin.current .node-pin-medallion {
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #fde047 35%, #eab308 70%, #854d0e 100%);
  box-shadow: 
    0 0 0 4px #f59e0b,
    0 0 28px rgba(245, 158, 11, 1),
    0 0 45px rgba(245, 158, 11, 0.5),
    0 10px 24px rgba(0, 0, 0, 0.7);
}

/* VISITED: Weathered Antique Patina & Stamped Wax Seal */
.map-node-pin.visited {
  opacity: 0.78;
  cursor: default;
}

.map-node-pin.visited .node-pin-medallion {
  background: radial-gradient(circle at 35% 30%, #cbd5e1 0%, #94a3b8 50%, #475569 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.map-node-pin.visited .node-medallion-inner {
  background: #7f1d1d;
}

/* LOCKED: Weathered Bronze */
.map-node-pin.locked {
  opacity: 0.82;
  filter: contrast(0.92) brightness(0.85);
  cursor: not-allowed;
}

.map-node-pin.locked .node-pin-medallion {
  background: radial-gradient(circle at 35% 30%, #e2e8f0 0%, #b45309 30%, #78350f 75%, #271003 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}



/* ====================================================
   MOBILE EXPEDITION MAP SCREEN OVERHAUL
   ==================================================== */

.route-map-viewport {
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

@media (max-width: 768px) {
  .route-map-header {
    padding: 6px 12px;
  }
  .route-map-title {
    font-size: 16px;
    letter-spacing: 1px;
  }
  .route-map-subtitle {
    font-size: 10.5px;
  }

  /* Node Touch Target Optimization */
  .route-node-btn {
    min-width: 46px;
    min-height: 46px;
    touch-action: manipulation;
  }
  .route-node-btn:active {
    transform: scale(1.15) !important;
  }

  /* Map Bottom Footer */
  .map-dock-footer {
    padding: 6px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .relic-art-icon,
  .item-art-icon {
    width: 36px;
    height: 36px;
  }
  .map-footer-act-info {
    font-size: 12px;
    padding: 4px 10px;
  }
}

@media (max-width: 480px) {
  .map-relics-dock {
    gap: 6px;
  }
  .map-relics-label {
    font-size: 12px;
  }
  .route-node-btn {
    min-width: 42px;
    min-height: 42px;
  }
}
