/* Vulcan's Inferno — interactive world map (map.css)
   Scoped to .im (rendered by map.js into #map-root).
   Uses site tokens only: --gold --ember --bg --panel --ink --muted --line
   --font-display --font-ui --radius. Realm accents are local to .im. */

.im {
  --im-acc-vulcan: var(--gold);
  --im-acc-hades: var(--ember);
  --im-acc-boreas: #8ed9ff;
  --im-acc-arcadia: #7ee9a4;
  --im-acc-notus: #f1b65d;
  --im-acc: var(--gold);
  --im-pw: 384px;
  --im-shade: color-mix(in srgb, var(--bg) 82%, transparent);
  --im-glass: color-mix(in srgb, var(--panel) 80%, transparent);
  --im-hair: color-mix(in srgb, var(--gold) 42%, transparent);
  --im-ease: cubic-bezier(.22, .8, .24, 1);

  position: relative;
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 16px;
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.45;
}
@media (min-width: 640px) { .im { padding-inline: 24px; } }
@media (min-width: 1024px) { .im { padding-inline: 32px; } }

.im [data-r="vulcan"], .im[data-realm="vulcan"] { --im-acc: var(--im-acc-vulcan); }
.im [data-r="hades"], .im[data-realm="hades"] { --im-acc: var(--im-acc-hades); }
.im [data-r="boreas"], .im[data-realm="boreas"] { --im-acc: var(--im-acc-boreas); }
.im [data-r="arcadia"], .im[data-realm="arcadia"] { --im-acc: var(--im-acc-arcadia); }
.im [data-r="notus"], .im[data-realm="notus"] { --im-acc: var(--im-acc-notus); }

/* Local resets at element specificity (0,0,1): they beat the site's bare element
   rules (map.css loads after site.css) while any .im-* class rule still wins. */
:where(.im) p, :where(.im) h3, :where(.im) ul, :where(.im) li { margin: 0; padding: 0; }
:where(.im) ul { list-style: none; }
:where(.im) button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; text-align: inherit; -webkit-tap-highlight-color: transparent;
}
:where(.im) svg { display: inline-block; flex: none; }
:where(.im) img { max-width: none; }
.im-ic { width: 16px; height: 16px; }

.im-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Redaction (████): the shared .seal-chip lives in site.css. This zero-specificity copy
   only shows if site.css hasn't shipped it yet. Never animated. */
:where(.im .seal-chip) {
  display: inline-flex; align-items: center; gap: .3em; vertical-align: -.12em;
  padding: .12em .5em .12em .4em; border-radius: 999px; white-space: nowrap;
  font-size: .86em; line-height: 1.1; letter-spacing: 0; text-transform: none;
  color: rgba(244, 189, 85, .72); background: #0b0806; border: 1px solid rgba(244, 189, 85, .55);
}
:where(.im .seal-chip svg) { width: .95em; height: .95em; flex: none; color: var(--gold); }
:where(.im) .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* =========================================================
   FRAME
   ========================================================= */
.im-main { position: relative; }

.im-frame {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1.25;
  max-height: 80vh;
  min-height: 260px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--im-hair);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--bg) 90%, transparent),
    0 0 0 6px color-mix(in srgb, var(--panel) 92%, transparent),
    0 0 0 7px color-mix(in srgb, var(--gold) 22%, transparent),
    0 40px 90px -30px color-mix(in srgb, var(--bg) 95%, transparent),
    0 0 120px -40px color-mix(in srgb, var(--ember) 55%, transparent);
}
@media (min-width: 600px) { .im-frame { aspect-ratio: 1.5; } }
@media (min-width: 1024px) { .im-frame { aspect-ratio: 1672 / 941; } }
@media (max-width: 599px) {
  .im-frame {
    box-shadow:
      0 0 0 4px color-mix(in srgb, var(--panel) 92%, transparent),
      0 0 0 5px color-mix(in srgb, var(--gold) 22%, transparent),
      0 24px 50px -24px color-mix(in srgb, var(--bg) 95%, transparent),
      0 0 70px -30px color-mix(in srgb, var(--ember) 55%, transparent);
  }
}

.im-view {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.im.is-zoomed .im-view { touch-action: none; }
.im.is-dragging .im-view { cursor: grabbing; }
.im.is-busy .im-view { cursor: progress; }
.im-view:focus-visible::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: calc(var(--radius) - 6px);
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 5px color-mix(in srgb, var(--gold) 25%, transparent);
  pointer-events: none;
  z-index: 10;
}

.im-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s var(--im-ease), transform .52s var(--im-ease);
  transform-origin: 50% 50%;
}
.im-scene.is-active { opacity: 1; }
.im-scene[hidden] { display: none; }
.im-scene--city.is-entering:not(.is-active) { opacity: 0; transform: scale(1.12); }
.im-scene--city.is-leaving { opacity: 0; transform: scale(.94); transition-duration: .45s, .6s; }
.im-scene.is-snap { transition: none !important; }

.im-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1672px;
  height: 941px;
  transform-origin: 0 0;
  --inv: 1;
}
.im-plate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.im-pins { position: absolute; inset: 0; }

/* Fog lives on the stage so it travels with the map. */
.im-fog {
  position: absolute;
  inset: -8% -12%;
  pointer-events: none;
  opacity: .5;
  mix-blend-mode: screen;
  background:
    radial-gradient(38% 26% at 22% 34%, color-mix(in srgb, var(--ink) 10%, transparent), transparent 70%),
    radial-gradient(30% 22% at 74% 62%, color-mix(in srgb, var(--ink) 8%, transparent), transparent 70%),
    radial-gradient(42% 24% at 60% 18%, color-mix(in srgb, var(--muted) 9%, transparent), transparent 70%);
  animation: im-fog 46s ease-in-out infinite alternate;
}
.im-fog--b {
  opacity: .35;
  background:
    radial-gradient(34% 20% at 40% 78%, color-mix(in srgb, var(--ember) 10%, transparent), transparent 70%),
    radial-gradient(28% 22% at 84% 30%, color-mix(in srgb, var(--ink) 8%, transparent), transparent 70%),
    radial-gradient(30% 24% at 12% 70%, color-mix(in srgb, var(--ink) 7%, transparent), transparent 70%);
  animation-duration: 62s;
  animation-direction: alternate-reverse;
}
@keyframes im-fog {
  from { transform: translate3d(-3%, 1%, 0); }
  to { transform: translate3d(4%, -2%, 0); }
}

/* =========================================================
   ATMOSPHERE (above the scenes, never catches input)
   ========================================================= */
.im-fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.im-fx > span { position: absolute; inset: 0; }
.im-vignette {
  background:
    radial-gradient(120% 95% at 50% 48%, transparent 52%, color-mix(in srgb, var(--bg) 62%, transparent) 82%, color-mix(in srgb, var(--bg) 92%, transparent) 100%);
  transition: opacity .8s var(--im-ease), transform 1s var(--im-ease);
}
.im.is-warping .im-vignette { transform: scale(.9); }
.im-tint {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 58%, transparent) 0, transparent 22%),
    linear-gradient(0deg, color-mix(in srgb, var(--bg) 50%, transparent) 0, transparent 20%);
}
.im-lava {
  background:
    radial-gradient(60% 34% at 50% 112%, color-mix(in srgb, var(--ember) 42%, transparent), transparent 70%),
    radial-gradient(30% 22% at 12% 106%, color-mix(in srgb, var(--ember) 26%, transparent), transparent 70%),
    radial-gradient(30% 22% at 88% 106%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 70%);
  mix-blend-mode: screen;
  animation: im-breathe-o 7s ease-in-out infinite;
}
.im[data-realm="boreas"] .im-lava { opacity: .45; animation: none; }
@keyframes im-breathe-o { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

.im-embers { overflow: hidden; }
.im-ember {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--x);
  width: var(--sz);
  inset-inline-start: var(--x);
  animation: im-rise var(--d) linear var(--dl) infinite;
  will-change: transform, opacity;
}
.im-ember::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  background: radial-gradient(circle, var(--ink) 0, var(--gold) 35%, var(--ember) 70%, transparent 100%);
  box-shadow: 0 0 6px 1px color-mix(in srgb, var(--ember) 80%, transparent);
  animation: im-sway 3.4s ease-in-out infinite alternate;
}
@keyframes im-rise {
  0% { transform: translate3d(0, 102%, 0); opacity: 0; }
  12% { opacity: var(--o); }
  70% { opacity: calc(var(--o) * .7); }
  100% { transform: translate3d(var(--dx), -3%, 0); opacity: 0; }
}
@keyframes im-sway { from { transform: translateX(-7px); } to { transform: translateX(7px); } }

.im-flash {
  opacity: 0;
  background: radial-gradient(60% 60% at 50% 50%, color-mix(in srgb, var(--gold) 50%, transparent), color-mix(in srgb, var(--ember) 22%, transparent) 45%, transparent 75%);
  mix-blend-mode: screen;
}
.im.is-flash .im-flash { animation: im-flash .5s ease-out both; }
@keyframes im-flash { 0% { opacity: 0; } 18% { opacity: .9; } 100% { opacity: 0; } }

/* Bezel: black marble rim with a double gold hairline */
.im-bezel {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent),
    inset 0 0 0 5px color-mix(in srgb, var(--bg) 70%, transparent),
    inset 0 0 0 6px color-mix(in srgb, var(--gold) 30%, transparent),
    inset 0 0 50px 6px color-mix(in srgb, var(--bg) 60%, transparent);
}
.im-corner {
  position: absolute;
  z-index: 4;
  width: 58px;
  height: 58px;
  color: var(--gold);
  pointer-events: none;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--ember) 45%, transparent));
}
.im-corner__svg { width: 100%; height: 100%; display: block; }
.im-corner--tl { top: 3px; left: 3px; }
.im-corner--tr { top: 3px; right: 3px; transform: scaleX(-1); }
.im-corner--bl { bottom: 3px; left: 3px; transform: scaleY(-1); }
.im-corner--br { bottom: 3px; right: 3px; transform: scale(-1, -1); }
@media (max-width: 599px) { .im-corner { width: 38px; height: 38px; } }

/* =========================================================
   HUD
   ========================================================= */
.im-hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.im-hud > * { pointer-events: auto; }

.im-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, transparent), color-mix(in srgb, var(--bg) 88%, transparent));
  border: 1px solid var(--im-hair);
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--bg) 90%, transparent), inset 0 1px 0 color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: border-color .2s, color .2s, background .2s, transform .2s;
}
.im-btn .im-ic { width: 18px; height: 18px; color: var(--gold); }
.im-btn--icon { width: 40px; padding: 0; }
.im-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.im-btn:active { transform: scale(.96); }
@media (hover: hover) {
  .im-btn:hover { border-color: var(--gold); color: var(--ink); background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 70%, var(--gold) 12%), color-mix(in srgb, var(--bg) 88%, transparent)); }
}
/* Zoom limit / default view: still focusable (aria-disabled), visibly inert. */
.im-btn[aria-disabled="true"] { opacity: .42; cursor: default; box-shadow: none; }
.im-btn[aria-disabled="true"]:active { transform: none; }
@media (hover: hover) {
  .im-btn[aria-disabled="true"]:hover { border-color: var(--im-hair); background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, transparent), color-mix(in srgb, var(--bg) 88%, transparent)); }
}

.im-back { position: absolute; top: 18px; left: 18px; }
.im-back[hidden] { display: none; }

.im-cartouche {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 26px 9px;
  min-width: 190px;
  text-align: center;
  pointer-events: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, transparent), color-mix(in srgb, var(--bg) 92%, transparent));
  border: 1px solid var(--im-hair);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 3px color-mix(in srgb, var(--bg) 80%, transparent),
    inset 0 0 0 4px color-mix(in srgb, var(--gold) 20%, transparent),
    0 10px 30px -10px color-mix(in srgb, var(--bg) 95%, transparent);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}
.im-cartouche__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
}
.im-cartouche__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--ink);
  text-shadow: 0 0 18px color-mix(in srgb, var(--im-acc) 55%, transparent);
}

.im-zoom {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 8px;
  transition: right .35s var(--im-ease), opacity .25s;
}
.im.has-panel:not(.is-sheet) .im-zoom { opacity: 0; pointer-events: none; }

.im-compass {
  position: absolute;
  right: 22px;
  bottom: 18px;
  width: 74px;
  height: 74px;
  color: var(--gold);
  opacity: .75;
  pointer-events: none;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--ember) 40%, transparent));
}
.im-compass__svg { width: 100%; height: 100%; display: block; animation: im-spin 120s linear infinite; }
@keyframes im-spin { to { transform: rotate(360deg); } }

.im-hint {
  position: absolute;
  left: 18px;
  bottom: 18px;
  max-width: calc(100% - 140px);
  padding: 7px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
  pointer-events: none;
}
.im-hint--touch { display: none; }
.im.is-coarse .im-hint--fine { display: none; }
.im.is-coarse .im-hint--touch { display: inline; }
@media (hover: none), (pointer: coarse), (max-width: 1024px) {
  .im-hint--fine { display: none; }
  .im-hint--touch { display: inline; }
}
.im[data-view="city"] .im-hint__world, .im:not([data-view="city"]) .im-hint__city { display: none; }

.im-toast {
  position: absolute;
  left: 50%;
  bottom: 58px;
  z-index: 7;
  transform: translate(-50%, 8px);
  padding: 9px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--im-hair);
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--im-ease);
}
.im-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.im-loader {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px 9px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border: 1px solid var(--im-hair);
  box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--bg) 95%, transparent);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--im-ease);
}
.im.is-loading .im-loader { transform: translate(-50%, 0); }
.im.is-loading .im-loader { opacity: 1; }
.im-loader__ring {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--gold) 22%, transparent);
  border-top-color: var(--gold);
  border-right-color: var(--ember);
}
.im.is-loading .im-loader__ring { animation: im-spin 1s linear infinite; }
.im-loader__txt {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink);
}

/* =========================================================
   PINS
   ========================================================= */
.im-pin {
  position: absolute;
  z-index: 2;
  display: block;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%) scale(var(--inv));
  color: var(--ink);
  outline: none;
}
.im-pin:hover, .im-pin:focus-visible, .im-pin.is-active { z-index: 6; }
.im-pin svg { pointer-events: none; }

.im-pin__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--im-acc);
  opacity: 0;
  pointer-events: none;
  animation: im-pulse 2.8s cubic-bezier(.2, .6, .3, 1) infinite;
}
.im-pin__pulse--2 { animation-delay: 1.4s; }
@keyframes im-pulse {
  0% { transform: scale(.85); opacity: .8; }
  100% { transform: scale(2.3); opacity: 0; }
}

/* Realm medals */
.im-pin--realm { z-index: 4; width: 58px; height: 58px; }
.im-pin__halo {
  position: absolute;
  inset: -70%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--im-acc) 42%, transparent) 0, color-mix(in srgb, var(--im-acc) 12%, transparent) 38%, transparent 66%);
  animation: im-halo 3.6s ease-in-out infinite;
}
@keyframes im-halo { 0%, 100% { transform: scale(.9); opacity: .75; } 50% { transform: scale(1.06); opacity: 1; } }
.im-medal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--im-acc);
  background:
    radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--im-acc) 34%, var(--panel)) 0, var(--panel) 52%, var(--bg) 100%);
  box-shadow:
    inset 0 0 0 2px var(--gold),
    inset 0 0 0 4px color-mix(in srgb, var(--bg) 85%, transparent),
    inset 0 0 0 5px color-mix(in srgb, var(--gold) 50%, transparent),
    inset 0 -6px 12px color-mix(in srgb, var(--bg) 70%, transparent),
    0 0 20px color-mix(in srgb, var(--im-acc) 55%, transparent),
    0 8px 18px color-mix(in srgb, var(--bg) 85%, transparent);
  transition: transform .3s var(--im-ease), box-shadow .3s;
}
.im-medal__ic {
  width: 27px;
  height: 27px;
  stroke-width: 1.6;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--im-acc) 75%, transparent));
}
.im-pin__label {
  position: absolute;
  display: grid;
  gap: 1px;
  padding: 6px 14px 7px;
  white-space: nowrap;
  text-align: left;
  pointer-events: none;
  border-radius: 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 90%, transparent), color-mix(in srgb, var(--bg) 92%, transparent));
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--bg) 95%, transparent), inset 0 1px 0 color-mix(in srgb, var(--gold) 16%, transparent);
  transition: border-color .25s, transform .3s var(--im-ease);
}
.im-pin__label b {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--ink);
  text-shadow: 0 0 14px color-mix(in srgb, var(--im-acc) 45%, transparent);
}
.im-pin__label small {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--im-acc);
}
/* Set by map.js when the full labels can't all fit without overlapping (tablet widths). */
.im.is-tight .im-pin__label { padding: 5px 11px 6px; }
.im.is-tight .im-pin__label small { display: none; }
.im-pin--realm[data-side="right"] .im-pin__label { left: calc(100% + 12px); top: 50%; transform: translateY(-50%); }
.im-pin--realm[data-side="left"] .im-pin__label { right: calc(100% + 12px); top: 50%; transform: translateY(-50%); text-align: right; }
.im-pin--realm[data-side="above"] .im-pin__label { bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); text-align: center; }
.im-pin--realm[data-side="below"] .im-pin__label { top: calc(100% + 12px); left: 50%; transform: translateX(-50%); text-align: center; }
/* <=768px: medals only; map.js marks the selected realm .is-named and only it keeps a label. */
@media (max-width: 768px) {
  .im-pin--realm:not(.is-named) .im-pin__label { display: none; }
}
.im-pin--realm:focus-visible .im-medal {
  box-shadow:
    0 0 0 3px var(--bg), 0 0 0 5px var(--ink),
    inset 0 0 0 2px var(--gold),
    inset 0 0 0 4px color-mix(in srgb, var(--bg) 85%, transparent),
    0 0 26px color-mix(in srgb, var(--im-acc) 70%, transparent);
}
.im-pin--realm:focus-visible .im-pin__label { border-color: var(--ink); }
@media (hover: hover) {
  .im-pin--realm:hover .im-medal { transform: scale(1.1); }
  .im-pin--realm:hover .im-pin__label { border-color: var(--im-acc); }
}

/* World outposts (named) */
.im-pin--outpost { z-index: 3; width: 38px; height: 38px; }
.im-pin--outpost .im-pin__pulse { inset: 9px; border-color: var(--gold); animation-duration: 3.2s; }
.im-pin--outpost:nth-child(3n) .im-pin__pulse { animation-delay: .9s; }
.im-pin--outpost:nth-child(3n+1) .im-pin__pulse { animation-delay: 1.9s; }
.im-gem {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: linear-gradient(135deg, var(--ink) 0, var(--gold) 38%, color-mix(in srgb, var(--gold) 55%, var(--ember)) 72%, color-mix(in srgb, var(--ember) 60%, var(--bg)) 100%);
  box-shadow:
    0 0 0 1.5px color-mix(in srgb, var(--bg) 80%, transparent),
    0 0 0 2.5px color-mix(in srgb, var(--gold) 60%, transparent),
    0 0 14px 2px color-mix(in srgb, var(--im-acc) 65%, transparent);
  transition: transform .25s var(--im-ease);
}
.im-pin--outpost:focus-visible .im-gem { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink), 0 0 16px 3px color-mix(in srgb, var(--im-acc) 70%, transparent); }
.im-pin--outpost.is-active .im-gem { transform: rotate(45deg) scale(1.35); }
@media (hover: hover) { .im-pin--outpost:hover .im-gem { transform: rotate(45deg) scale(1.3); } }

/* Sealed venues */
.im-pin--sealed { z-index: 1; width: 34px; height: 34px; transition: opacity .3s, visibility .3s; }
.im-seal {
  position: absolute;
  inset: 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--panel) 90%, var(--ink) 6%), var(--bg) 90%);
  border: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--bg) 90%, transparent), 0 0 12px color-mix(in srgb, var(--ember) 25%, transparent);
  transition: transform .25s var(--im-ease), border-color .25s, color .25s;
}
.im-seal .im-ic { width: 11px; height: 11px; stroke-width: 2; }
.im:not(.is-close) .im-pin--sealed { visibility: hidden; opacity: 0; }
.im-pin--sealed:focus-visible .im-seal { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); color: var(--ink); }
@media (hover: hover) {
  .im-pin--sealed:hover .im-seal { transform: scale(1.2); border-style: solid; color: var(--ink); border-color: var(--gold); }
}

/* City venues (named) */
.im-pin--venue { z-index: 3; width: 46px; height: 46px; }
.im-pin--venue .im-pin__pulse { inset: 4px; }
.im-venue-gem {
  position: absolute;
  inset: 4px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--im-acc) 42%, var(--panel)) 0, var(--panel) 56%, var(--bg) 100%);
  box-shadow:
    inset 0 0 0 1.5px var(--gold),
    inset 0 0 0 3px color-mix(in srgb, var(--bg) 80%, transparent),
    inset 0 0 0 4px color-mix(in srgb, var(--gold) 40%, transparent),
    0 0 18px color-mix(in srgb, var(--im-acc) 60%, transparent),
    0 6px 14px color-mix(in srgb, var(--bg) 85%, transparent);
  transition: transform .3s var(--im-ease), box-shadow .3s;
}
.im-venue-gem__ic { width: 19px; height: 19px; stroke-width: 1.7; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--im-acc) 80%, transparent)); }
.im-venue-plate {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(calc(-50% + var(--nudge, 0px)));
  display: grid;
  gap: 1px;
  justify-items: center;
  padding: 5px 11px 6px;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  border-radius: 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, transparent), color-mix(in srgb, var(--bg) 94%, transparent));
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--bg) 95%, transparent);
  transition: border-color .25s, opacity .2s;
}
.im-pin--venue.is-cull .im-venue-plate { opacity: 0; }
.im-pin--venue.is-up .im-venue-plate { top: auto; bottom: calc(100% + 3px); }
.im-venue-plate b {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .07em;
  line-height: 1.2;
  color: var(--ink);
}
.im-venue-plate small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--im-acc);
}
.im-pin--venue:focus-visible .im-venue-gem { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink), inset 0 0 0 1.5px var(--gold), 0 0 22px color-mix(in srgb, var(--im-acc) 70%, transparent); }
.im-pin--venue:focus-visible .im-venue-plate, .im-pin--venue.is-active .im-venue-plate { border-color: var(--im-acc); }
.im-pin--venue.is-active .im-venue-gem { transform: scale(1.12); }
@media (hover: hover) {
  .im-pin--venue:hover .im-venue-gem { transform: scale(1.12); }
  .im-pin--venue:hover .im-venue-plate { border-color: var(--im-acc); }
}

@media (max-width: 599px) {
  .im-pin--realm { width: 48px; height: 48px; }
  .im-medal__ic { width: 22px; height: 22px; }
  .im-pin__label { padding: 4px 9px 5px; }
  .im-pin__label b { font-size: 12px; letter-spacing: .12em; }
  .im-pin__label small { display: none; }
  .im-pin--realm[data-side="right"] .im-pin__label { left: calc(100% + 6px); }
  .im-pin--realm[data-side="left"] .im-pin__label { right: calc(100% + 6px); }
  .im-pin--realm[data-side="above"] .im-pin__label { bottom: calc(100% + 6px); }
  .im-pin--realm[data-side="below"] .im-pin__label { top: calc(100% + 6px); }
  .im-pin--venue { width: 44px; height: 44px; }
  .im-venue-gem { inset: 6px; }
  .im-venue-gem__ic { width: 16px; height: 16px; }
  .im-venue-plate { top: calc(100% - 3px); width: max-content; max-width: 108px; white-space: normal; padding: 3px 7px 4px; }
  .im-pin--venue.is-up .im-venue-plate { top: auto; bottom: calc(100% - 3px); }
  .im-venue-plate b { font-size: 12px; letter-spacing: .04em; line-height: 1.15; }
  .im-venue-plate small { display: none; }
}

/* =========================================================
   TOOLTIP
   ========================================================= */
.im-tip {
  position: absolute;
  z-index: 6;
  left: 0;
  top: 0;
  width: min(292px, calc(100% - 20px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .22s var(--im-ease);
}
.im-tip.is-below { transform: translateY(-6px); }
.im-tip.is-on { opacity: 1; transform: none; }
.im-tip[hidden] { display: block; visibility: hidden; }
.im-tip__in {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 13px 15px 14px;
  border-radius: 12px;
  background:
    radial-gradient(120% 80% at 0 0, color-mix(in srgb, var(--im-acc) 14%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, transparent), color-mix(in srgb, var(--bg) 97%, transparent));
  border: 1px solid color-mix(in srgb, var(--gold) 48%, transparent);
  box-shadow:
    inset 0 0 0 3px color-mix(in srgb, var(--bg) 60%, transparent),
    inset 0 0 0 4px color-mix(in srgb, var(--gold) 12%, transparent),
    0 22px 46px -14px color-mix(in srgb, var(--bg) 96%, transparent),
    0 0 40px -12px color-mix(in srgb, var(--im-acc) 50%, transparent);
}
.im-tip__in::after {
  content: "";
  position: absolute;
  left: var(--ax, 50%);
  bottom: -6px;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  transform: rotate(45deg);
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--gold) 48%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 48%, transparent);
}
.im-tip.is-below .im-tip__in::after {
  bottom: auto;
  top: -6px;
  transform: rotate(225deg);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
}
.im-tip__chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--im-acc);
}
.im-tip__chip .im-ic { width: 13px; height: 13px; }
.im-tip__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1.2;
  color: var(--ink);
}
.im-tip__sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.im-tip__count { margin-top: 2px; color: var(--ink); opacity: .85; text-wrap: balance; }
.im-tip__thumbs { display: flex; gap: 6px; margin-top: 5px; }
.im-tip__thumb {
  width: 46px;
  height: 69px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  background: var(--panel);
  box-shadow: 0 6px 12px -4px color-mix(in srgb, var(--bg) 90%, transparent);
}
.im-tip__qs { display: grid; gap: 4px; margin-top: 3px; }
.im-tip__qs li {
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
  padding-left: 10px;
  border-left: 2px solid color-mix(in srgb, var(--im-acc) 60%, transparent);
}
.im-tip__cta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}
.im-tip__cta .im-ic { width: 14px; height: 14px; }
.im-tip__in--sealed .im-tip__name { color: color-mix(in srgb, var(--ink) 85%, transparent); }
.im-tip__in--sealed .im-tip__chip { color: var(--muted); }

/* =========================================================
   VENUE PANEL
   ========================================================= */
.im-panel {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 20;
  width: min(var(--im-pw), calc(100% - 28px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  background:
    radial-gradient(90% 40% at 100% 0, color-mix(in srgb, var(--im-acc) 10%, transparent), transparent 70%),
    linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--bg) 70%, var(--panel)));
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  box-shadow:
    inset 0 0 0 4px color-mix(in srgb, var(--bg) 55%, transparent),
    inset 0 0 0 5px color-mix(in srgb, var(--gold) 14%, transparent),
    0 40px 90px -20px color-mix(in srgb, var(--bg) 96%, transparent),
    0 0 60px -20px color-mix(in srgb, var(--im-acc) 40%, transparent);
  opacity: 0;
  transform: translateX(18px);
  transition: opacity .28s ease, transform .4s var(--im-ease);
}
.im-panel[hidden] { display: none; }
.im-panel.is-open { opacity: 1; transform: none; }
@media (min-width: 720px) and (max-width: 1023px) { .im { --im-pw: 352px; } }
/* Short frames (iPad landscape): a tighter side panel keeps room for the game list,
   and the realm cartouche steps aside because the panel already names the realm. */
.im.is-compact:not(.is-sheet) .im-panel__head { padding: 16px 60px 12px 18px; gap: 4px; }
.im.is-compact:not(.is-sheet) .im-panel__title { font-size: 21px; }
.im.is-compact:not(.is-sheet) .im-panel__body { padding-top: 12px; }
.im.is-compact:not(.is-sheet) .im-panel__blurb { font-size: 13px; line-height: 1.5; }
.im.is-compact:not(.is-sheet) .im-panel__note { margin: 10px 0; padding: 7px 10px; }
.im.is-compact:not(.is-sheet) .im-panel__foot { padding: 10px 14px 12px; gap: 4px; }
.im.is-compact:not(.is-sheet) .im-cta { height: 44px; }
.im-cartouche { transition: opacity .25s ease; }
.im.is-compact.has-panel:not(.is-sheet) .im-cartouche { opacity: 0; }

.im-panel__in { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.im-panel__head {
  position: relative;
  flex: none;
  display: grid;
  gap: 6px;
  padding: 58px 20px 16px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.im-panel__art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: 340% auto;
  background-repeat: no-repeat;
  opacity: .9;
}
.im-panel__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 25%, transparent) 0, color-mix(in srgb, var(--panel) 70%, transparent) 50%, var(--panel) 100%),
    radial-gradient(80% 90% at 50% 0, transparent 40%, color-mix(in srgb, var(--bg) 50%, transparent) 100%);
}
.im-panel__x { position: absolute; top: 12px; right: 12px; }
.im-panel__chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--im-acc);
  text-shadow: 0 1px 6px var(--bg);
}
.im-panel__chip .im-ic { width: 14px; height: 14px; }
.im-panel__title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.12;
  color: var(--ink);
  outline: none;
  text-shadow: 0 2px 14px var(--bg);
}
.im-panel__title:focus-visible { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 5px; }
.im-panel__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.im-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--im-acc) 50%, transparent);
  background: color-mix(in srgb, var(--im-acc) 12%, var(--bg));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}
.im-tag .im-ic { width: 13px; height: 13px; color: var(--im-acc); }
.im-tag--dim { border-color: var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--muted); }
.im-reveal { font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--muted); }

.im-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 18px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--gold) 35%, transparent) transparent;
}
.im-panel__blurb { padding: 0 4px; font-size: 14px; line-height: 1.55; color: var(--ink); opacity: .9; }
.im-panel__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 14px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--gold) 32%, transparent);
  background: color-mix(in srgb, var(--gold) 5%, transparent);
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.im-panel__note .im-ic { width: 14px; height: 14px; margin-top: 1px; color: var(--gold); }

.im-games, .im-markets { display: grid; gap: 8px; }
.im-game {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px 8px 8px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 14%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 4%, transparent), color-mix(in srgb, var(--bg) 40%, transparent));
  text-align: left;
  transition: border-color .2s, background .2s, transform .2s;
}
.im-game:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) {
  .im-game:hover { border-color: color-mix(in srgb, var(--im-acc) 60%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--im-acc) 9%, transparent), color-mix(in srgb, var(--bg) 40%, transparent)); }
  .im-game:hover .im-game__art img { transform: scale(1.06); }
}
.im-game__art {
  position: relative;
  width: 56px;
  height: 84px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent), 0 6px 14px -6px color-mix(in srgb, var(--bg) 95%, transparent);
}
.im-game__art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--im-ease); }
.im-game__body { display: grid; gap: 3px; min-width: 0; }
.im-game__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.2;
  color: var(--ink);
}
.im-game__meta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--im-acc);
}
/* The lobby card's chip, mirrored so a venue lists the same tags as the lobby. */
.im-game__tag {
  display: inline-block; margin-left: 8px; padding: 2px 6px; border-radius: 6px; vertical-align: 1px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: none; line-height: 1.2;
  color: var(--muted); border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
}
.im-game__hook {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.im-plaque { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.im-plaque__amt { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--gold); letter-spacing: .04em; white-space: nowrap; }
.im-plaque em { font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.im-game__lock {
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.im-game__lock .im-ic { width: 16px; height: 16px; color: var(--gold); opacity: .8; }

.im-market {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 16%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 4%, transparent), color-mix(in srgb, var(--bg) 40%, transparent));
  text-align: left;
  transition: border-color .2s, background .2s;
}
.im-market:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) { .im-market:hover { border-color: color-mix(in srgb, var(--im-acc) 60%, transparent); } }
.im-market__top { display: flex; align-items: center; justify-content: space-between; }
.im-market__ex {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--im-acc) 45%, transparent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--im-acc);
}
.im-market__cat {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--im-acc);
}
.im-market__q { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.im-market__odds {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #0b0806;
  border: 1px solid rgba(244, 189, 85, .4);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
.im-market__odds .im-ic { width: 14px; height: 14px; }

.im-panel__foot {
  flex: none;
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 50%, transparent));
}
/* Sheet CTA is the shared primary button (.btn.btn-molten in site.css); layout only here. */
.im-cta { width: 100%; }
.im-cta .im-ic { width: 17px; height: 17px; }
.im-cta:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.im-link {
  justify-self: center;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--gold) 40%, transparent);
  text-underline-offset: 4px;
}
.im-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
@media (hover: hover) { .im-link:hover { color: var(--ink); text-decoration-color: var(--gold); } }

/* Bottom sheet on narrow screens. .im-main must have no transformed ancestor. */
.im-backdrop {
  position: fixed;
  inset: 0;
  z-index: 66;
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s ease;
}
.im-backdrop[hidden] { display: none; }
.im-backdrop.is-open { opacity: 1; }
.im.is-sheet .im-panel {
  position: fixed;
  top: auto;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: auto;
  max-width: 640px;
  margin-inline: auto;
  max-height: min(80vh, calc(100dvh - 96px));
  border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
  border-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(40px);
}
.im.is-sheet .im-panel.is-open { transform: none; }
.im.is-sheet .im-panel::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 2;
  width: 44px;
  height: 4px;
  margin-left: -22px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 30%, transparent);
}
.im.is-sheet .im-panel__head { padding-top: 50px; }
.im.is-sheet .im-panel__title { font-size: 22px; }

/* =========================================================
   LEGEND / QUICK-JUMP
   ========================================================= */
.im-legend { margin-top: 26px; }
.im-legend__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  margin-bottom: 14px;
}
.im-legend__eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.im-legend__eyebrow .im-ic { width: 17px; height: 17px; color: var(--im-acc); }
.im-legend__note { max-width: 62ch; font-size: 14px; color: var(--muted); }

.im-rcards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 12px;
  margin-inline: -16px;
  padding: 4px 16px 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.im-rcards::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .im-rcards { grid-auto-columns: 42%; margin-inline: -24px; padding-inline: 24px; scroll-padding-inline: 24px; } }
@media (min-width: 1024px) {
  .im-rcards { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); margin-inline: 0; padding: 0; overflow: visible; }
}
.im-rcard-li { scroll-snap-align: start; display: flex; }

.im-rcard {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  min-height: 300px;
  padding-top: 50px; /* medal row: 16 + 44, then the body's own 18px top padding keeps the region clear */
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--im-acc) 30%, var(--line));
  background: var(--panel);
  text-align: left;
  box-shadow: 0 20px 40px -24px color-mix(in srgb, var(--bg) 95%, transparent);
  transition: border-color .3s, transform .35s var(--im-ease), box-shadow .3s;
}
.im-rcard__art {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: var(--bg);
  background-size: 430% auto;
  background-repeat: no-repeat;
  transition: transform .8s var(--im-ease);
}
.im-rcard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 10%, transparent) 0, color-mix(in srgb, var(--panel) 55%, transparent) 38%, var(--panel) 72%),
    radial-gradient(90% 60% at 50% 100%, color-mix(in srgb, var(--im-acc) 16%, transparent), transparent 70%);
}
.im-rcard::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid color-mix(in srgb, var(--gold) 14%, transparent);
  pointer-events: none;
}
.im-rcard__medal {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--im-acc);
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--im-acc) 30%, var(--panel)), var(--bg) 90%);
  box-shadow: inset 0 0 0 1.5px var(--gold), inset 0 0 0 3px color-mix(in srgb, var(--bg) 80%, transparent), 0 0 18px color-mix(in srgb, var(--im-acc) 45%, transparent);
}
.im-rcard__medal .im-medal__ic { width: 21px; height: 21px; }
.im-rcard__body { display: grid; gap: 3px; padding: 18px 18px 18px; }
.im-rcard__region { font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--im-acc); }
.im-rcard__name { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: .06em; line-height: 1.1; color: var(--ink); }
.im-rcard__district { font-size: 13.5px; color: var(--muted); }
.im-rcard__count { margin-top: 2px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--ink); opacity: .85; text-wrap: balance; }
/* count groups never split: a line can end on '·' but never start with one */
.im-nw { white-space: nowrap; }
.im-rcard__thumbs { display: flex; margin: 10px 0 4px; }
.im-rcard__thumb {
  width: 38px;
  height: 57px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  background: var(--bg);
  box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--bg) 95%, transparent);
}
.im-rcard__thumb + .im-rcard__thumb { margin-left: -10px; }
.im-rcard__thumb:nth-child(2) { transform: translateY(-3px) rotate(2deg); }
.im-rcard__thumb:nth-child(3) { transform: rotate(4deg); }
.im-rcard__cta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
.im-rcard__cta .im-ic { width: 15px; height: 15px; transition: transform .3s var(--im-ease); }
.im-rcard:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) {
  .im-rcard:hover { border-color: color-mix(in srgb, var(--im-acc) 70%, transparent); transform: translateY(-3px); box-shadow: 0 26px 50px -24px color-mix(in srgb, var(--bg) 95%, transparent), 0 0 40px -16px color-mix(in srgb, var(--im-acc) 50%, transparent); }
  .im-rcard:hover .im-rcard__art { transform: scale(1.06); }
  .im-rcard:hover .im-rcard__cta .im-ic { transform: translateX(4px); }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .im-rcard__name { font-size: 18px; white-space: nowrap; }
  .im-rcard__cta-n { display: none; } /* "Enter →": the realm name is the card title right above */
  .im-rcard__body { padding: 16px 14px; }
}
/* Five-up grid: every card reserves two district lines so the rows (region, name, counts,
   thumbs, CTA) line up across cards even when one district wraps. */
@media (min-width: 1024px) {
  .im-rcard__district { min-height: calc(2 * 1.4em); line-height: 1.4; text-wrap: balance; }
}
@media (min-width: 1024px) and (max-width: 1365px) {
  .im-rcard__region { min-height: calc(2 * 1.3em); line-height: 1.3; letter-spacing: .16em; display: flex; align-items: flex-end; }
  .im-rcard__count { min-height: calc(2 * 1.35em); line-height: 1.35; }
}
/* Tighter hand-off from the realm cards to the lobby (section padding is site.css's). */
#map.map-section { padding-bottom: clamp(28px, 3vw, 40px); }

/* City mode: venue cards */
.im-vcards { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .im-vcards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .im-vcards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .im-vcards { grid-template-columns: repeat(4, 1fr); } }
.im-vcards > li { display: flex; }
.im-vcard {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 92px;
  padding: 12px 14px 12px 12px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid color-mix(in srgb, var(--im-acc) 22%, var(--line));
  background:
    radial-gradient(80% 120% at 0 50%, color-mix(in srgb, var(--im-acc) 8%, transparent), transparent 70%),
    var(--panel);
  text-align: left;
  transition: border-color .25s, transform .3s var(--im-ease);
}
.im-vcard > .im-ic { width: 18px; height: 18px; margin-left: auto; color: var(--gold); opacity: .7; transition: transform .3s var(--im-ease); }
.im-vcard.is-active { border-color: var(--im-acc); }
.im-vcard:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) {
  .im-vcard:hover { border-color: color-mix(in srgb, var(--im-acc) 65%, transparent); }
  .im-vcard:hover > .im-ic { transform: translateX(3px); opacity: 1; }
}
.im-vcard__art { display: flex; flex: none; align-items: center; min-width: 62px; }
.im-vcard__thumb {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  background: var(--bg);
}
.im-vcard__thumb + .im-vcard__thumb { margin-left: -16px; }
.im-vcard__oracle {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: var(--im-acc);
  background: radial-gradient(circle, color-mix(in srgb, var(--im-acc) 18%, var(--bg)), var(--bg));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent);
}
.im-vcard__oracle .im-ic { width: 22px; height: 22px; }
.im-vcard__body { display: grid; gap: 2px; min-width: 0; }
.im-vcard__hall {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--im-acc);
}
.im-vcard__hall .im-ic { width: 12px; height: 12px; }
.im-vcard__name { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: .03em; line-height: 1.2; color: var(--ink); }
.im-vcard__count { font-size: 12px; color: var(--muted); }
.im-vcard--sealed { border-style: dashed; background: color-mix(in srgb, var(--panel) 60%, transparent); }
.im-vcard--sealed .im-vcard__oracle { color: var(--muted); }
.im-vcard--sealed .im-vcard__hall { color: var(--muted); }

.im-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.im-jump__lbl {
  margin: 0 4px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.im-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--im-acc) 35%, var(--line));
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color .2s, background .2s;
}
.im-chip .im-ic { width: 15px; height: 15px; color: var(--im-acc); }
.im-chip--back { border-color: var(--im-hair); }
.im-chip--back .im-ic { color: var(--gold); }
.im-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) { .im-chip:hover { border-color: var(--im-acc); background: color-mix(in srgb, var(--im-acc) 10%, var(--panel)); } }

/* =========================================================
   SMALL SCREENS
   ========================================================= */
@media (max-width: 599px) {
  .im-back { top: 12px; left: 12px; width: 40px; padding: 0; }
  .im-back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .im-cartouche { min-width: 0; white-space: nowrap; }
  .im-cartouche__eyebrow { font-size: 12px; letter-spacing: .2em; }
  .im-cartouche__title { letter-spacing: .1em; }
  .im-compass { display: none; }

  /* Control deck: on phones the zoom buttons and hint move into a strip under
     the map so nothing sits on top of the realm markers. */
  .im-frame { aspect-ratio: auto; min-height: 0; max-height: none; padding-bottom: 58px; }
  .im-view { position: relative; inset: auto; aspect-ratio: 1.4; min-height: 220px; max-height: 70vh; }
  .im-hud::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 58px;
    pointer-events: none;
    background:
      linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 45%, transparent) 20%, color-mix(in srgb, var(--gold) 45%, transparent) 80%, transparent) top / 100% 1px no-repeat,
      linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, var(--gold) 4%), var(--bg));
    box-shadow: 0 -10px 24px -8px color-mix(in srgb, var(--bg) 90%, transparent);
  }
  .im-corner--bl, .im-corner--br { display: none; }
  .im-zoom { top: auto; right: 12px; bottom: 12px; display: flex; gap: 10px; } /* 34 + 10 = 44px pitch: hit areas abut, never overlap */
  .im-zoom .im-btn--icon { width: 34px; min-height: 34px; }
  .im-zoom .im-ic { width: 16px; height: 16px; }
  /* The realm title lives in the deck too; the hint stays for screen readers
     (the legend lede below says the same thing on screen). */
  .im-cartouche { top: auto; bottom: 0; left: 14px; height: 58px; max-width: calc(100% - 150px); transform: none; align-content: center; justify-items: start; text-align: left; padding: 0; background: none; border: 0; box-shadow: none; clip-path: none; }
  .im-cartouche__title { font-size: 15px; }
  .im-hint { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .im-toast { bottom: 72px; font-size: 12px; }
  .im-loader { bottom: 72px; }
  .im-tip { width: min(260px, calc(100% - 20px)); }
  .im-legend { margin-top: 20px; }
  .im-rcard { min-height: 264px; }
  .im-rcard__name { font-size: 21px; }
  /* Under the art the frame matches the deck, so the realm art never sits on a black band. */
  .im-frame { background: color-mix(in srgb, var(--panel) 96%, var(--gold) 4%); }
}
/* Touch targets: every marker and zoom control gets a 44x44 hit area; visuals keep their size. */
@media (max-width: 768px) {
  .im-zoom .im-btn { position: relative; }
  .im-zoom .im-btn::after, .im-pin::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; min-width: 100%; min-height: 100%; transform: translate(-50%, -50%); }
}
@media (min-width: 600px) and (max-width: 899px) {
  .im-compass { width: 56px; height: 56px; }
}

/* =========================================================
   MOTION
   ========================================================= */
.im.is-offscreen .im-ember,
.im.is-offscreen .im-ember::before,
.im.is-offscreen .im-lava,
.im.is-offscreen .im-fog,
.im.is-offscreen .im-pin__pulse,
.im.is-offscreen .im-pin__halo,
.im.is-offscreen .im-compass__svg { animation-play-state: paused; }
.im.is-busy .im-pin__pulse { animation-play-state: paused; opacity: 0; }

/* Idle = still: nothing animates until a mouse is actually over the map (so idle
   document.getAnimations() is empty and touch visitors get a calm, lit plate). */
.im-fog, .im-lava, .im-ember, .im-ember::before, .im-pin__pulse, .im-pin__halo, .im-compass__svg { animation: none; }
.im-embers { display: none; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .im-frame:hover .im-embers { display: block; }
  .im-frame:hover .im-fog { animation: im-fog 46s ease-in-out infinite alternate; }
  .im-frame:hover .im-fog--b { animation-duration: 62s; animation-direction: alternate-reverse; }
  .im-frame:hover .im-lava { animation: im-breathe-o 7s ease-in-out infinite; }
  .im[data-realm="boreas"] .im-frame:hover .im-lava { animation: none; }
  .im-frame:hover .im-ember { animation: im-rise var(--d) linear var(--dl) infinite; }
  .im-frame:hover .im-ember::before { animation: im-sway 3.4s ease-in-out infinite alternate; }
  .im-frame:hover .im-pin--realm .im-pin__pulse, .im-pin:hover .im-pin__pulse, .im-pin:focus-visible .im-pin__pulse { animation: im-pulse 2.8s cubic-bezier(.2, .6, .3, 1) infinite; }
  .im-frame:hover .im-pin--realm .im-pin__pulse--2 { animation-delay: 1.4s; }
  .im-frame:hover .im-pin__halo { animation: im-halo 3.6s ease-in-out infinite; }
  .im-frame:hover .im-compass__svg { animation: im-spin 120s linear infinite; }
}
/* Touch and tablet widths: outposts are reachable from each realm's venue cards, so the overworld stays readable. */
@media (max-width: 899.98px) {
  .im-pin--outpost { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .im-embers { display: none; }
  .im-fog, .im-lava, .im-pin__pulse, .im-pin__halo, .im-compass__svg, .im-loader__ring { animation: none; }
  .im-pin__pulse { opacity: 0; }
  .im.is-flash .im-flash { animation: none; }
  .im-scene, .im-panel, .im-cartouche, .im-tip, .im-toast, .im-backdrop, .im-rcard, .im-rcard__art, .im-medal, .im-venue-gem, .im-gem, .im-vignette { transition: none !important; }
  .im-scene--city.is-entering:not(.is-active), .im-scene--city.is-leaving { transform: none; }
  .im-panel, .im.is-sheet .im-panel { transform: none; }
  @media (hover: hover) { .im-rcard:hover { transform: none; } }
}

/* #map jumps (nav, hash, "Walk the map") land on the plate itself: the frame never
   exceeds the viewport under the sticky bar, and map.js writes --im-frame-off (the
   frame's offset inside #map) so the anchor puts the frame top just under the bar. */
@media (min-width: 1024px) {
  .im-frame { max-height: calc(100svh - var(--bar-h, 68px) - 24px); }
  /* html scroll-padding-top (site.css) already adds --bar-h + 8px; 4px more keeps the pass-4 landing. */
  #map { scroll-margin-top: calc(4px - var(--im-frame-off, 0px)); }
}

/* "Skip the map": hidden until focused, then a gold pill above the frame. */
.im-skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.im .im-skip:focus { position: static; width: auto; height: auto; clip: auto; clip-path: none; display: inline-flex; margin: 0 0 12px; padding: 10px 16px; border-radius: 999px; background: #0b0806; border: 1px solid var(--gold); color: var(--gold); font: 700 13px/1 var(--font-ui); text-decoration: none; }
