/* World maps: full-page backgrounds on game pages, the interactive map, and map art in cards. */

/* ---------- full-page map background (game pages) ---------- */
body.has-world::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12, 12, 16, .5), rgba(12, 12, 16, .86) 40%, rgba(12, 12, 16, .94)),
    var(--world) center / cover no-repeat;
}
body.has-world .section-alt { background: rgba(17, 17, 23, .74); }
body.has-world .footer { background: rgba(17, 17, 23, .94); }
body.has-world .card { background: rgba(23, 23, 31, .9); }

body.has-world .page-hero { min-height: 540px; display: flex; align-items: center; border-bottom-color: color-mix(in srgb, var(--c) 30%, transparent); }
body.has-world .page-hero::before {
  background:
    linear-gradient(90deg, rgba(12, 12, 16, .94) 0%, rgba(12, 12, 16, .72) 45%, rgba(12, 12, 16, .2) 100%),
    linear-gradient(0deg, rgba(12, 12, 16, .9), transparent 35%),
    var(--world) center / cover no-repeat;
}
body.has-world .page-hero::after { opacity: .5; }
body.has-world .page-hero .lead { color: #c8c7d6; }
body.has-world .page-hero[style] .page-hero-art {
  width: min(36vw, 480px); opacity: .95; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .9), 0 0 0 6px rgba(12, 12, 16, .4);
  -webkit-mask-image: none; mask-image: none;
  transform: translateY(-50%) rotate(2deg);
}
@media (max-width: 1100px) { body.has-world .page-hero[style] .page-hero-art { display: none; } }
@media (max-width: 860px) { body.has-world .page-hero { min-height: 0; } }

/* ---------- the interactive map ---------- */
.section-map { padding-top: 40px; }
.map-wrap { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .map-wrap { grid-template-columns: 1fr; } }

.map {
  position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 20px; background: #000;
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line));
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}
.map img { width: 100%; height: 100%; object-fit: cover; }
.map::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px rgba(0, 0, 0, .55); }

.pin { position: absolute; z-index: 1; width: 34px; height: 34px; transform: translate(-50%, -50%); text-decoration: none; }
.pin.is-active, .pin:hover, .pin:focus-visible { z-index: 3; }
.pin-dot {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: var(--pc, var(--c)); color: #111; font: 800 .9rem/1 var(--font);
  border: 3px solid rgba(12, 12, 16, .85); box-shadow: 0 6px 16px rgba(0, 0, 0, .6);
  transition: transform .15s ease;
}
.pin-dot::before {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 2px solid var(--pc, var(--c)); opacity: .7; animation: ping 2.6s ease-out infinite;
}
@keyframes ping { from { transform: scale(.55); opacity: .85; } to { transform: scale(1.5); opacity: 0; } }
.pin:hover .pin-dot, .pin.is-active .pin-dot { transform: scale(1.15); }
.pin-label {
  position: absolute; top: 50%; left: calc(100% + 10px); transform: translate(-6px, -50%);
  padding: 6px 11px; border-radius: 9px; white-space: nowrap; pointer-events: none;
  background: rgba(12, 12, 16, .9); border: 1px solid rgba(255, 255, 255, .14);
  color: var(--text); font-weight: 700; font-size: .82rem;
  opacity: 0; transition: opacity .15s, transform .15s;
}
.pin-left .pin-label { left: auto; right: calc(100% + 10px); transform: translate(6px, -50%); }
.pin:hover .pin-label, .pin:focus-visible .pin-label, .pin.is-active .pin-label { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 600px) {
  .pin { width: 26px; height: 26px; }
  .pin-dot { font-size: .75rem; border-width: 2px; }
  .pin-label { font-size: .74rem; padding: 4px 8px; }
  .pin:hover .pin-label { opacity: 0; }
  .pin.is-active .pin-label { opacity: 1; }
}

.spots { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (max-width: 960px) { .spots { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); } }
.spot {
  display: flex; gap: 14px; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  background: rgba(23, 23, 31, .9); border: 1px solid var(--line);
  transition: border-color .15s, background .15s, transform .15s;
}
.spot:hover { transform: translateX(3px); }
.spot.is-active, .spot:target {
  border-color: var(--pc, var(--c));
  background: color-mix(in srgb, var(--pc, var(--c)) 12%, rgba(23, 23, 31, .94));
}
.spot-n {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--pc, var(--c)); color: #111; font-weight: 800; font-size: .85rem;
}
.spot h3 { font-size: 1rem; }
.spot p { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.spot .spot-by { margin-top: 10px; }
.spot-by .member-chip { font-size: .8rem; }
.spot-by .member-chip .avatar { width: 24px; height: 24px; }

/* ---------- game cards: hover peeks at the map ---------- */
.game-art { position: relative; }
.game-art .game-world { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease, transform .4s ease; }
.game-art .game-banner { position: relative; transition: opacity .35s ease, transform .4s ease; }
.game:hover .game-art .game-world, .game:focus-visible .game-art .game-world { opacity: 1; }
.game:hover .game-art .game-banner, .game:focus-visible .game-art .game-banner { opacity: 0; }

/* ---------- games overview: map with the banner as a badge ---------- */
.overview-art { position: relative; }
.overview-art .overview-badge {
  position: absolute; left: 16px; bottom: 16px; width: 40%; height: auto; aspect-ratio: 2 / 1; object-fit: cover;
  border-radius: 12px; border: 2px solid rgba(255, 255, 255, .2); box-shadow: 0 12px 30px rgba(0, 0, 0, .65);
}
.overview-pins {
  position: absolute; right: 14px; top: 14px; display: inline-flex; gap: 6px; align-items: center;
  padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--text);
  background: rgba(12, 12, 16, .82); border: 1px solid rgba(255, 255, 255, .14);
}
.overview-pins .icon { color: var(--c); }
.overview { background: linear-gradient(90deg, rgba(23, 23, 31, .96), rgba(23, 23, 31, .96)); }
