/* v8 - world map: an ornate chart of the whole world, region tabs, legend, "you are here" footer, region list */
#win-map.wide { --ms: calc(100vh - 226px); width: min(96vw, calc(var(--ms) + 432px)); max-height: 96vh; }
#win-map .mapwrap { grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
#win-map .mapcol { width: min(100%, var(--ms)); justify-self: center; display: grid; gap: 8px; }

/* the stage: gilded double frame, corner studs, a soft inner shadow over the parchment */
#win-map .mapstage { position: relative; aspect-ratio: 1; border-radius: 6px; padding: 5px; overflow: hidden;
  background: linear-gradient(135deg, #f6dc94, #a87826 28%, #f2d488 50%, #8a5e1a 74%, #f0cf80);
  box-shadow: 0 0 0 1px #1a1004, 0 0 0 3px #3a2810, 0 0 0 4px #c8963e, 0 10px 30px rgba(0,0,0,.55); }
#win-map .mapstage::before { content: ''; position: absolute; inset: 5px; z-index: 2; pointer-events: none; border-radius: 3px;
  box-shadow: inset 0 0 0 1px #2a1806, inset 0 0 0 3px rgba(240,205,120,.55), inset 0 0 0 4px rgba(42,24,6,.7), inset 0 0 60px rgba(60,34,8,.5); }
#win-map .mapstage #bigmap { display: block; width: 100%; height: 100%; aspect-ratio: 1; border-radius: 3px; box-shadow: none; cursor: crosshair; background: #16303a; }
#win-map .mapstage #bigmap.drag { cursor: grabbing; }
#win-map .mapstage #bigmap.swap { animation: mapswap .34s ease-out; }
@keyframes mapswap { from { opacity: 0; transform: scale(1.05); filter: blur(4px) brightness(1.3); } to { opacity: 1; transform: none; filter: none; } }
#win-map .mcorner { position: absolute; z-index: 3; width: 30px; height: 30px; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #fff4c8 0 3px, #c8963e 4px 6px, #3a2408 7px 8px, transparent 9px),
    conic-gradient(from 45deg, #f6dc94, #8a5e1a, #f2d488, #8a5e1a, #f6dc94);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
#win-map .mcorner.tl { top: -9px; left: -9px; } #win-map .mcorner.tr { top: -9px; right: -9px; }
#win-map .mcorner.bl { bottom: -9px; left: -9px; } #win-map .mcorner.br { bottom: -9px; right: -9px; }

/* region tabs */
#win-map .maptabs { position: absolute; z-index: 4; top: 18px; right: 18px; display: flex; gap: 6px; direction: rtl; }
#win-map .maptabs button { position: relative; padding: 5px 16px 6px; border: 0; border-radius: 9px; cursor: pointer; font: 700 14px var(--head); color: #f4e2b4;
  background: linear-gradient(180deg, rgba(52,34,14,.94), rgba(26,16,6,.94)); box-shadow: 0 0 0 1px #000, 0 0 0 2px #a87826, 0 3px 8px rgba(0,0,0,.45); transition: filter .15s, transform .15s; }
#win-map .maptabs button:hover { filter: brightness(1.25); transform: translateY(-1px); }
#win-map .maptabs button.on { color: #2a1606; background: linear-gradient(180deg, #ffeeb4, #e8b450 60%, #c8963e); box-shadow: 0 0 0 1px #000, 0 0 0 2px #ffe08a, 0 0 14px rgba(255,210,110,.55); }
#win-map .maptabs button.here::after { content: ''; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ffd24a; box-shadow: 0 0 0 2px #2a1606, 0 0 8px #ffd24a; animation: mapdot 1.4s ease-in-out infinite; }
@keyframes mapdot { 50% { transform: scale(1.35); box-shadow: 0 0 0 2px #2a1606, 0 0 14px #ffd24a; } }

/* zoom / locate buttons */
#win-map .mapzoom { position: absolute; z-index: 4; top: 18px; left: 18px; display: grid; gap: 5px; }
#win-map .mapzoom button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; cursor: pointer; font: 700 19px/1 var(--body); color: #f4e2b4;
  background: linear-gradient(180deg, rgba(52,34,14,.94), rgba(26,16,6,.94)); box-shadow: 0 0 0 1px #000, 0 0 0 2px #a87826, 0 3px 8px rgba(0,0,0,.45); }
#win-map .mapzoom button:hover { filter: brightness(1.3); }
#win-map .mapzoom button.me { color: #ffd24a; font-size: 20px; }

/* legend */
#win-map .maplegend { position: absolute; z-index: 4; bottom: 18px; left: 18px; padding: 7px 10px 8px; border-radius: 10px; direction: rtl; pointer-events: none;
  background: linear-gradient(180deg, rgba(40,26,10,.9), rgba(22,14,6,.9)); box-shadow: 0 0 0 1px #000, 0 0 0 2px #a87826, 0 4px 12px rgba(0,0,0,.5); }
#win-map .maplegend h5 { margin: 0 0 4px; font: 700 12.5px var(--head); color: var(--gold); text-align: center; border-bottom: 1px solid rgba(200,150,62,.45); padding-bottom: 3px; }
#win-map .maplegend ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto auto; column-gap: 12px; row-gap: 1px; }
#win-map .maplegend li { display: flex; align-items: center; gap: 6px; font: 700 11.5px/1.2 var(--body); color: #f4e2b4; white-space: nowrap; }
#win-map .maplegend img { width: 19px; height: 19px; flex: none; }

/* footer: where you are + how to use the map */
#win-map .mapfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; direction: rtl; min-height: 32px; }
#win-map .mapyou { display: flex; align-items: center; gap: 8px; padding: 3px 14px 3px 12px; border-radius: 18px; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, rgba(60,40,14,.9), rgba(30,18,6,.9)); box-shadow: inset 0 0 0 1.5px #c8963e, 0 0 12px rgba(255,210,110,.18); }
#win-map .mapyou:hover { filter: brightness(1.2); }
#win-map .mapyou i { width: 11px; height: 11px; border-radius: 50%; background: #ffd24a; box-shadow: 0 0 0 2px #2a1606, 0 0 8px #ffd24a; animation: mapdot 1.4s ease-in-out infinite; }
#win-map .mapyou b { font: 700 14px var(--head); color: #ffd98a; }
#win-map .mapyou span { font: 700 14px var(--head); color: #fff4d8; }
#win-map .mapyou em { font: 700 11px var(--num); font-style: normal; color: var(--dim); direction: ltr; }
#win-map .maphint { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* side column: every region of the world, then the quest lists */
#win-map .mapsidecol { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; max-height: calc(var(--ms) + 40px); min-width: 0; }
#win-map #mapSide { max-height: none; min-height: 0; }
#mapZones h4 { margin: 0 0 2px; font: 700 15px var(--head); color: var(--gold); display: flex; justify-content: space-between; } #mapZones h4 small { color: var(--dim); font: 700 12px var(--num); }
#mapZones h6 { margin: 6px 0 4px; font: 700 11.5px var(--body); color: var(--dim); display: flex; align-items: center; gap: 8px; } #mapZones h6::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(200,150,62,.5), transparent); }
#mapZones .mzgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
#mapZones .mz { position: relative; display: flex; align-items: center; gap: 5px; min-width: 0; padding: 4px 6px; border: 0; border-radius: 8px; cursor: pointer; color: inherit; text-align: start;
  background: linear-gradient(180deg, rgba(40,44,66,.75), rgba(22,24,38,.75)); box-shadow: inset 0 0 0 1px rgba(240,205,120,.16); }
#mapZones .mz:hover { background: rgba(240,205,120,.14); box-shadow: inset 0 0 0 1px rgba(240,205,120,.5); }
#mapZones .mz i { flex: none; width: 10px; height: 10px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.7), 0 0 0 2px rgba(255,255,255,.14); }
#mapZones .mz b { flex: 1; min-width: 0; font: 700 11.5px var(--head); color: #fff0cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mapZones .mz small { flex: none; font: 700 10.5px var(--num); padding: 0 5px; border-radius: 7px; background: rgba(0,0,0,.4); direction: ltr; }
#mapZones .mz small.easy { color: #c8c0b0; } #mapZones .mz small.ok { color: #8ae66a; } #mapZones .mz small.hard { color: #ff8a6a; } #mapZones .mz small.safe { color: #8ad8ff; direction: rtl; }
#mapZones .mz.here { box-shadow: inset 0 0 0 1.5px #ffd27a, 0 0 10px rgba(255,210,110,.3); background: rgba(255,210,110,.12); }
#mapZones .mz em { position: absolute; top: -6px; left: 6px; padding: 0 6px; border-radius: 6px; font: 700 9px/13px var(--body); font-style: normal; color: #2a1606; background: linear-gradient(180deg, #ffeeb4, #e8b450); box-shadow: 0 0 0 1px #2a1606; }

@media (max-width: 1100px) {
  #win-map .mapwrap { grid-template-columns: 1fr; }
  #win-map .mapsidecol { max-height: 260px; overflow-y: auto; }
  #win-map .maplegend ul { grid-template-columns: auto; } #win-map .maphint { display: none; }
}
@media (max-height: 760px) { #win-map .maplegend li:nth-child(n+7) { display: none; } }
