/* =========================================================
   Worlds — original UI systems inspired by three settings.
   Mint Lab stays in skins.css.
   ========================================================= */

/* Shared cinematic stage (not the mint phone) */
html[data-skin="survey"] .story-canvas,
html[data-skin="domain"] .story-canvas,
html[data-skin="throne"] .story-canvas { opacity: 1; }

html[data-skin="survey"] .device-frame,
html[data-skin="domain"] .device-frame,
html[data-skin="throne"] .device-frame,
html[data-skin="survey"] .device-frame--wide,
html[data-skin="survey"] .device-frame--tall,
html[data-skin="domain"] .device-frame--wide,
html[data-skin="domain"] .device-frame--tall,
html[data-skin="throne"] .device-frame--wide,
html[data-skin="throne"] .device-frame--tall {
  aspect-ratio: 16 / 10;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  max-height: 210px;
  margin: 0;
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%),
    var(--surface);
}

html[data-skin="survey"] .device-frame img,
html[data-skin="domain"] .device-frame img,
html[data-skin="throne"] .device-frame img {
  object-fit: cover;
  object-position: top center;
  padding: 0;
}

/* ---------- SURVEY CORPS — walls, cables, vertical drop ---------- */
html[data-skin="survey"] {
  color-scheme: dark;
  --bg: #12180f;
  --bg-elevated: #1a2214;
  --surface: #232c1b;
  --surface-2: #2d3824;
  --border: rgba(226, 196, 142, 0.28);
  --border-strong: #9f2b22;
  --text: #f6edd6;
  --text-muted: #d5c7a2;
  --text-dim: #8f8668;
  --accent: #c2412d;
  --accent-2: #e7d3a1;
  --accent-soft: rgba(194, 65, 45, 0.16);
  --accent-glow: rgba(194, 65, 45, 0.45);
  --btn-fg-on-accent: #1a0c08;
  --btn-radius: 2px;
  --radius: 2px;
  --radius-sm: 0;
  --font-display: "Staatliches", Impact, sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --display-tracking: 0.04em;
  --cursor-dot: 8px;
  --cursor-ring: 0px;
  --cursor-dot-radius: 0;
  --cursor-lag: 0.08;
  --mesh-a: transparent;
  --mesh-b: transparent;
  --mesh-c: transparent;
}

html[data-skin="survey"] body::before {
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 72px,
      color-mix(in srgb, var(--field, #6e2a22) 35%, transparent) 72px 74px
    ),
    linear-gradient(180deg, rgba(18, 24, 15, 0.2), var(--field, #1c2614) 80%);
  background-position: calc(var(--story-p, 0) * -120px) 0, 0 0;
  animation: none;
}
html[data-skin="survey"] .site-header {
  background: #141c12;
  border-bottom: 4px solid #9f2b22;
  box-shadow: none;
  backdrop-filter: none;
}
html[data-skin="survey"] .brand-mark { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
html[data-skin="survey"] .nav-links a {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: var(--font-display);
  font-size: 1rem;
}
html[data-skin="survey"] .nav-links a.is-active { color: #e7d3a1; box-shadow: inset 0 -3px 0 #9f2b22; }
html[data-skin="survey"] .display { text-transform: uppercase; line-height: 0.9; }
html[data-skin="survey"] .btn {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 0;
  box-shadow: 4px 4px 0 #1a0c08;
  background: #c2412d;
}
html[data-skin="survey"] .btn:hover { translate: 2px 2px; box-shadow: 1px 1px 0 #1a0c08; }
html[data-skin="survey"] .btn-secondary { background: transparent; color: #e7d3a1; border: 1px solid #e7d3a1; }
html[data-skin="survey"] .hero--minimal { position: relative; }
html[data-skin="survey"] .hero--minimal::before {
  content: "SCOUT  ·  WALL  ·  CABLE";
  position: absolute;
  left: 1.2rem;
  top: 18%;
  writing-mode: vertical-rl;
  letter-spacing: 0.35em;
  font-family: var(--font-display);
  color: rgba(231, 211, 161, 0.45);
}
html[data-skin="survey"] .story-chapter-inner {
  grid-template-columns: minmax(260px, 420px);
  justify-content: start;
  align-items: center;
  width: min(420px, calc(100% - 6rem));
  margin-right: auto;
}
html[data-skin="survey"] .story-title { font-size: clamp(2.8rem, 5vw, 4.2rem); }
html[data-skin="survey"] .device-frame {
  border: 0;
  border-left: 8px solid #9f2b22;
  box-shadow: none;
  background: linear-gradient(160deg, rgba(18, 24, 15, 0.2), rgba(159, 43, 34, 0.18));
}
html[data-skin="survey"] .story-rail-item {
  border-radius: 0;
  background: #141c12;
  border-color: #9f2b22;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
}
html[data-skin="survey"] .path-card {
  border-radius: 0;
  border-width: 0 0 0 6px;
  background: #1a2214;
  transform: none;
}
html[data-skin="survey"] .path-card:hover { translate: 8px 0; box-shadow: none; }
html[data-skin="survey"] .path-index { font-family: var(--font-display); font-size: 1.4rem; color: #c2412d; }

/* ---------- DOMAIN — cursed energy, expanding rings ---------- */
html[data-skin="domain"] {
  color-scheme: dark;
  --bg: #07010f;
  --bg-elevated: #10041c;
  --surface: #160826;
  --surface-2: #241038;
  --border: rgba(192, 132, 252, 0.35);
  --border-strong: #e879f9;
  --text: #faf5ff;
  --text-muted: #ddd6fe;
  --text-dim: #a78bfa;
  --accent: #c084fc;
  --accent-2: #22d3ee;
  --accent-soft: rgba(192, 132, 252, 0.16);
  --accent-glow: rgba(232, 121, 249, 0.55);
  --btn-fg-on-accent: #1e0533;
  --btn-radius: 999px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --display-tracking: -0.06em;
  --cursor-dot: 10px;
  --cursor-ring: 64px;
  --cursor-ring-hover: 110px;
  --cursor-blend: screen;
  --cursor-lag: 0.22;
  --mesh-a: transparent;
  --mesh-b: transparent;
  --mesh-c: transparent;
}
html[data-skin="domain"] body::before {
  background: #07010f;
  animation: none;
}
html[data-skin="domain"] .site-header {
  background: rgba(7, 1, 15, 0.94);
  border-bottom: 1px solid rgba(192, 132, 252, 0.45);
  box-shadow: none;
  backdrop-filter: blur(12px);
}
html[data-skin="domain"] .nav-inner {
  margin-top: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  width: min(100% - 2.5rem, var(--container));
}
html[data-skin="domain"] .nav-links a {
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}
html[data-skin="domain"] .nav-links a.is-active {
  background: rgba(192, 132, 252, 0.2);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}
html[data-skin="domain"] .display {
  background: linear-gradient(100deg, #faf5ff, #c084fc 40%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-skin="domain"] .btn {
  background: transparent;
  color: #faf5ff;
  border: 1px solid #e879f9;
  box-shadow: 0 0 0 4px rgba(192, 132, 252, 0.15), 0 0 24px rgba(232, 121, 249, 0.45);
}
html[data-skin="domain"] .btn-secondary { border-color: #22d3ee; box-shadow: none; }
html[data-skin="domain"] .story-chapter-inner {
  grid-template-columns: minmax(260px, 400px);
  justify-content: start;
  width: min(400px, calc(100% - 6rem));
  margin-right: auto;
}
html[data-skin="domain"] .nav-inner { flex-wrap: nowrap; }
html[data-skin="domain"] .nav-links a { padding: 0.4rem 0.55rem; }
html[data-skin="domain"] .skin-toggle {
  border-radius: 999px;
  padding-inline: 0.7rem;
}
html[data-skin="domain"] .story-media { order: 0; }
html[data-skin="domain"] .device-frame {
  border-radius: 18px;
  border: 1px solid rgba(232, 121, 249, 0.7);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.25);
  min-height: 0;
  max-height: 200px;
}
html[data-skin="survey"] .story-copy,
html[data-skin="domain"] .story-copy,
html[data-skin="throne"] .story-copy {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}
html[data-skin="domain"] .story-rail { gap: 0.8rem; }
html[data-skin="domain"] .story-rail-item {
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  background: rgba(7, 1, 15, 0.8);
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.35);
}
html[data-skin="domain"] .story-rail-item.is-active {
  box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.25), 0 0 24px #e879f9;
}
html[data-skin="domain"] .path-grid--4 { gap: 1.2rem; }
html[data-skin="domain"] .path-card {
  border-radius: 28px;
  background: radial-gradient(circle at 30% 0%, rgba(192, 132, 252, 0.2), #12061d 55%);
  min-height: 190px;
}
html[data-skin="domain"] .path-card:hover { transform: translateY(-10px) scale(1.03); }

/* ---------- IRON THRONE — banners, winter into fire ---------- */
html[data-skin="throne"] {
  color-scheme: dark;
  --bg: #0c0e12;
  --bg-elevated: #14171c;
  --surface: #191c22;
  --surface-2: #232830;
  --border: rgba(212, 175, 95, 0.35);
  --border-strong: #d4af5f;
  --text: #f8f1e3;
  --text-muted: #d6d3d1;
  --text-dim: #a8a29e;
  --accent: #d4af5f;
  --accent-2: #f5d78e;
  --accent-soft: rgba(212, 175, 95, 0.14);
  --accent-glow: rgba(234, 88, 12, 0.4);
  --btn-fg-on-accent: #1c1408;
  --btn-radius: 0;
  --radius: 0;
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Libre Baskerville", Georgia, serif;
  --display-tracking: 0.02em;
  --cursor-dot: 6px;
  --cursor-ring: 36px;
  --cursor-ring-radius: 0;
  --cursor-dot-radius: 0;
  --cursor-lag: 0.2;
  --mesh-a: transparent;
  --mesh-b: transparent;
  --mesh-c: transparent;
}
html[data-skin="throne"] body::before {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--field, #102033) 80%, transparent), transparent 42%),
    repeating-linear-gradient(
      90deg,
      transparent 0 10%,
      rgba(212, 175, 95, 0.08) 10% 10.4%,
      transparent 10.4% 20%
    );
  background-position: 0 calc(var(--story-p, 0) * 30vh), calc(var(--story-p, 0) * 80px) 0;
  animation: none;
}
html[data-skin="throne"] .site-header {
  background: rgba(12, 14, 18, 0.92);
  border-bottom: 1px solid #d4af5f;
  box-shadow: inset 0 -4px 0 #3f2e10;
}
html[data-skin="throne"] .brand-text { font-family: var(--font-display); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.78rem; }
html[data-skin="throne"] .nav-links a { font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }
html[data-skin="throne"] .nav-links a.is-active { color: #f5d78e; }
html[data-skin="throne"] .hero--minimal { text-align: center; }
html[data-skin="throne"] .hero-minimal-inner { margin-inline: auto; }
html[data-skin="throne"] .story-chapter .btn-group { justify-content: flex-start; }
html[data-skin="throne"] .display { font-weight: 700; }
html[data-skin="throne"] .btn {
  background: transparent;
  color: #f5d78e;
  border: 1px solid #d4af5f;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--font-display);
}
html[data-skin="throne"] .btn:hover { background: #d4af5f; color: #1c1408; }
html[data-skin="throne"] .story-chapter-inner {
  grid-template-columns: minmax(260px, 420px);
  justify-content: start;
  justify-items: start;
  text-align: left;
  width: min(420px, calc(100% - 6rem));
  margin-right: auto;
}
html[data-skin="throne"] .story-chapter { padding-top: 4.5rem; }
html[data-skin="throne"] .story-media { width: 100%; order: 0; }
html[data-skin="throne"] .story-copy { max-width: none; }
html[data-skin="throne"] .story-stats { width: 100%; }
html[data-skin="throne"] .device-frame {
  border: 1px solid #d4af5f;
  box-shadow: 0 0 0 4px rgba(12, 14, 18, 0.8), 0 0 0 5px #d4af5f;
  min-height: 0;
  max-height: 190px;
}
html[data-skin="throne"] .story-title { font-size: clamp(2.6rem, 5vw, 4rem); }
html[data-skin="throne"] .story-rail-item {
  border-radius: 0;
  background: linear-gradient(#1c1408, #0c0e12);
  border-color: #d4af5f;
  font-family: var(--font-display);
}
html[data-skin="throne"] .path-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html[data-skin="throne"] .path-card {
  border: none;
  border-radius: 0 0 40px 40px;
  background: linear-gradient(180deg, #7f1d1d, #1c1408 42%, #14171c);
  min-height: 220px;
  clip-path: polygon(8% 0, 92% 0, 100% 12%, 100% 100%, 0 100%, 0 12%);
  text-align: center;
}
html[data-skin="throne"] .path-card:hover { transform: translateY(-12px); box-shadow: 0 20px 0 rgba(212, 175, 95, 0.15); }


html[data-skin="survey"] .story-chapter-inner,
html[data-skin="throne"] .story-chapter-inner {
  margin-left: 4vw !important;
  margin-right: auto !important;
  width: min(400px, 46vw) !important;
}
html[data-skin="domain"] .story-chapter-inner {
  margin-left: 4vw !important;
  margin-right: auto !important;
  width: min(380px, 42vw) !important;
}
.lore-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

@media (max-width: 960px) {
  html[data-skin="domain"] .story-chapter-inner,
  html[data-skin="survey"] .story-chapter-inner {
    grid-template-columns: 1fr;
  }
  html[data-skin="survey"] .hero--minimal::before { display: none; }
  html[data-skin="throne"] .path-grid--4 { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-skin="survey"] body::before,
  html[data-skin="domain"] body::before,
  html[data-skin="throne"] body::before { animation: none; }
}

/* ---------- Show cursors ---------- */
/* An old iron key on a cord. The tip of the shank is the hotspot; hovering turns it in the lock. */
html[data-skin="survey"] .cursor,
html[data-skin="survey"] .cursor.is-hover,
html[data-skin="survey"] .cursor.is-press {
  width: 26px;
  height: 86px;
  border-radius: 0;
  box-shadow: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 132'%3E%3Cdefs%3E%3ClinearGradient id='i' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%232b2622'/%3E%3Cstop offset='0.38' stop-color='%237a6f61'/%3E%3Cstop offset='0.52' stop-color='%23b3a78f'/%3E%3Cstop offset='0.7' stop-color='%235c5349'/%3E%3Cstop offset='1' stop-color='%23221e1a'/%3E%3C/linearGradient%3E%3ClinearGradient id='r' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%239a8e7a'/%3E%3Cstop offset='0.5' stop-color='%234f473e'/%3E%3Cstop offset='1' stop-color='%23221e1a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M17 103 C12 112 8 122 14 128 C20 133 30 128 27 118 C26 112 24 106 22 103' fill='none' stroke='%235a3c22' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M20 2 Q22.6 2 22.6 6 V86 H17.4 V6 Q17.4 2 20 2 Z' fill='url(%23i)' stroke='%2315120f' stroke-width='0.7'/%3E%3Cpath d='M22.4 7 H33 V12 H29.5 V15.5 H33 V25 H22.4 Z' fill='url(%23i)' stroke='%2315120f' stroke-width='0.7'/%3E%3Crect x='15.4' y='84' width='9.2' height='4' rx='1' fill='url(%23i)' stroke='%2315120f' stroke-width='0.6'/%3E%3Crect x='16.2' y='89.5' width='7.6' height='3' rx='1' fill='url(%23i)' stroke='%2315120f' stroke-width='0.6'/%3E%3Cpath d='M20 92 C28 92 33.5 98 33.5 106 C33.5 114 28 120 20 120 C12 120 6.5 114 6.5 106 C6.5 98 12 92 20 92 Z M20 99 C16 99 13.5 102 13.5 106 C13.5 110 16 113 20 113 C24 113 26.5 110 26.5 106 C26.5 102 24 99 20 99 Z' fill='url(%23r)' fill-rule='evenodd' stroke='%2315120f' stroke-width='0.7'/%3E%3Cpath d='M10.5 101 Q13 95.5 19 94.6' fill='none' stroke='%23d8ccb4' stroke-opacity='0.55' stroke-width='1'/%3E%3C/svg%3E") center / 26px 86px no-repeat;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
  transform-origin: 50% 0;
  transform: translate(-50%, 0) rotate(-32deg);
  transition: opacity 0.2s ease, transform 0.28s var(--ease-out);
}
html[data-skin="survey"] .cursor.is-hover { transform: translate(-50%, 0) rotate(-32deg) scaleX(0.34); }
html[data-skin="survey"] .cursor.is-press { transform: translate(-50%, 0) rotate(-32deg) scale(0.9); }
html[data-skin="survey"] .cursor::before,
html[data-skin="survey"] .cursor::after { content: none; }
html[data-skin="survey"] .cursor-ring,
html[data-skin="survey"] .cursor-ring.is-visible,
html[data-skin="survey"] .cursor-ring.is-hover {
  opacity: 0;
  width: 0;
  height: 0;
  border: none;
  background: none;
}
html[data-skin="survey"] .cursor-ring::before { content: none; }
html[data-skin="survey"] .cursor-label {
  border-radius: 0;
  background: #1a120c;
  color: #e7d3a1;
  letter-spacing: 0.16em;
  font-family: "Staatliches", Impact, sans-serif;
  font-size: 0.95rem;
}

html[data-skin="domain"] .cursor,
html[data-skin="domain"] .cursor.is-hover {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 20%, #e879f9 45%, #7c3aed 78%);
  box-shadow: 0 0 16px #c084fc, 0 0 28px rgba(34, 211, 238, 0.45);
}
html[data-skin="domain"] .cursor-ring,
html[data-skin="domain"] .cursor-ring.is-hover {
  border: 1.5px solid rgba(125, 211, 252, 0.85);
  box-shadow: 0 0 18px rgba(217, 70, 239, 0.45);
  background: transparent;
}
html[data-skin="domain"] .cursor-ring::after { content: none; }
html[data-skin="domain"] .cursor-label {
  border-radius: 999px;
  background: #12061d;
  color: #faf5ff;
  border: 1px solid #e879f9;
  letter-spacing: 0.14em;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
}
@media (prefers-reduced-motion: no-preference) {
  html[data-skin="domain"] .cursor-ring.is-visible {
    animation: domain-spin 9s linear infinite;
  }
}
@keyframes domain-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

html[data-skin="throne"] .cursor,
html[data-skin="throne"] .cursor.is-hover,
html[data-skin="throne"] .cursor.is-press {
  width: 34px;
  height: 108px;
  border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 160'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%2378848c'/%3E%3Cstop offset='0.34' stop-color='%23f4f7f8'/%3E%3Cstop offset='0.5' stop-color='%23c5ced4'/%3E%3Cstop offset='0.66' stop-color='%2389929b'/%3E%3Cstop offset='1' stop-color='%23545e66'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpolygon points='24,2 30,18 27.4,108 20.6,108 18,18' fill='url(%23b)'/%3E%3Cpolygon points='24,10 25.2,22 24.5,104 23.5,104 22.8,22' fill='%23606870' opacity='0.7'/%3E%3Cpath d='M7,108 L24,101 L41,108 L39,113 L24,107 L9,113 Z' fill='%23b08a46'/%3E%3Cpath d='M7,110 Q1,116 5,122' fill='none' stroke='%237a5e30' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath d='M41,110 Q47,116 43,122' fill='none' stroke='%237a5e30' stroke-width='2.4' stroke-linecap='round'/%3E%3Crect x='20.5' y='112' width='7' height='30' rx='1.2' fill='%23261c14'/%3E%3Cg stroke='%23c6a15e' stroke-width='0.9'%3E%3Cpath d='M21,116 H27'/%3E%3Cpath d='M21,120.5 H27'/%3E%3Cpath d='M21,125 H27'/%3E%3Cpath d='M21,129.5 H27'/%3E%3Cpath d='M21,134 H27'/%3E%3Cpath d='M21,138.5 H27'/%3E%3C/g%3E%3Cellipse cx='24' cy='148' rx='7' ry='7.5' fill='%23c6a15e'/%3E%3Cellipse cx='24' cy='148' rx='2.6' ry='2.8' fill='%236b5228'/%3E%3C/svg%3E") center / 34px 108px no-repeat;
  box-shadow: none;
  transform: translate(-50%, -2%) rotate(-18deg);
}
html[data-skin="throne"] .cursor::before,
html[data-skin="throne"] .cursor::after { content: none; }
html[data-skin="throne"] .cursor-ring,
html[data-skin="throne"] .cursor-ring.is-visible,
html[data-skin="throne"] .cursor-ring.is-hover,
html[data-skin="throne"] .cursor-ring.is-press {
  opacity: 0;
  width: 0;
  height: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
html[data-skin="throne"] .cursor-ring::before,
html[data-skin="throne"] .cursor-ring::after { content: none; }
html[data-skin="throne"] .cursor-label {
  border-radius: 0;
  background: #1c1408;
  color: #f5d78e;
  border: 1px solid #d4af5f;
  letter-spacing: 0.2em;
  font-family: "Cinzel", Georgia, serif;
}

/* ---------- The realm map: region banners ---------- */
.realm-pins,
.realm-hint,
.realm-card { display: none; }
html[data-skin="throne"] .realm-pins {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.realm-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 52px;
  margin: -38px 0 0 -23px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
}
.realm-pin[hidden] { display: none; }
.realm-pin:focus-visible {
  outline: 2px solid #f5d78e;
  outline-offset: 2px;
  box-shadow: 0 0 0 7px rgba(245, 215, 142, 0.2);
}
html[data-skin="throne"] .story-stage.is-realm-hover { cursor: pointer; }

html[data-skin="throne"] .realm-hint {
  display: block;
  position: absolute;
  z-index: 6;
  right: clamp(1.25rem, 9vw, 9rem);
  bottom: 1.5rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 215, 142, 0.85);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  transition: opacity 0.6s ease;
}
html[data-skin="throne"] .realm-hint.is-done { opacity: 0; }

html[data-skin="throne"] .realm-card:not([hidden]) { display: block; }
.realm-card {
  --house-field: #1c1408;
  --house-accent: #f5d78e;
  position: absolute;
  z-index: 30;
  top: 5.4rem;
  right: clamp(7.5rem, 9vw, 9.5rem);
  width: min(360px, calc(100vw - 2rem));
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.6));
}
.realm-rod {
  position: relative;
  z-index: 1;
  height: 10px;
  margin: 0 -10px;
  border-radius: 5px;
  background: linear-gradient(#f7dc96, #a8853c 55%, #4a3612);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
}
.realm-rod::before,
.realm-rod::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff1c0, #b8913e 55%, #5a4316);
  transform: translateY(-50%);
}
.realm-rod::before { left: -8px; }
.realm-rod::after { right: -8px; }
.realm-cloth {
  position: relative;
  margin: -2px 8px 0;
  padding: 1rem 1.25rem 3rem;
  color: #efe6d2;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--house-accent) 70%, transparent) 0 2px, transparent 2px calc(100% - 2px), color-mix(in srgb, var(--house-accent) 70%, transparent) calc(100% - 2px)),
    linear-gradient(180deg, color-mix(in srgb, var(--house-field) 40%, #0d0b09) 0, color-mix(in srgb, var(--house-field) 14%, #100e0c) 210px, #100e0c 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 26px), 0 100%);
}
.realm-card.is-open .realm-cloth { animation: realm-unfurl 0.75s var(--ease-out) both; }
@keyframes realm-unfurl {
  from { clip-path: polygon(0 0, 100% 0, 100% 0, 50% 0, 0 0); }
  to { clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 26px), 0 100%); }
}
.realm-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--house-accent) 60%, transparent);
  border-radius: 50%;
  background: rgba(10, 8, 6, 0.55);
  color: var(--house-accent);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.realm-close:hover,
.realm-close:focus-visible { background: var(--house-accent); color: #14100b; outline: none; }
.realm-head { text-align: center; padding-bottom: 0.9rem; border-bottom: 1px solid color-mix(in srgb, var(--house-accent) 35%, transparent); }
.realm-sigil { display: block; width: 68px; height: 68px; margin: 0.2rem auto 0.5rem; }
.realm-house {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--house-accent);
}
.realm-title {
  margin: 0.2rem 0 0.35rem;
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fbf4e4;
}
.realm-words {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-style: italic;
  font-size: 0.86rem;
  color: color-mix(in srgb, var(--house-accent) 80%, #fff);
}
.realm-body {
  max-height: min(46vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.9rem 0.2rem 0 0;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--house-accent) 50%, transparent) transparent;
}
.realm-land { margin: 0 0 0.9rem; font-family: "Libre Baskerville", Georgia, serif; font-size: 0.82rem; line-height: 1.65; color: #e6dcc6; }
.realm-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0 0 1rem; }
.realm-facts div { padding: 0.45rem 0.55rem; border: 1px solid color-mix(in srgb, var(--house-accent) 25%, transparent); background: rgba(255, 255, 255, 0.03); }
.realm-facts dt { font-family: "Cinzel", Georgia, serif; font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--house-accent); }
.realm-facts dd { margin: 0.15rem 0 0; font-size: 0.78rem; color: #f3ead6; }
.realm-sub {
  margin: 0 0 0.6rem;
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--house-accent);
}
.realm-history { list-style: none; margin: 0; padding: 0 0 0 0.9rem; border-left: 1px solid color-mix(in srgb, var(--house-accent) 40%, transparent); }
.realm-history li { position: relative; margin: 0 0 0.85rem; }
.realm-history li::before {
  content: "";
  position: absolute;
  left: calc(-0.9rem - 4px);
  top: 0.3rem;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--house-accent);
}
.realm-history strong { display: block; font-family: "Cinzel", Georgia, serif; font-size: 0.78rem; letter-spacing: 0.05em; color: #fbf4e4; }
.realm-history p { margin: 0.15rem 0 0; font-family: "Libre Baskerville", Georgia, serif; font-size: 0.76rem; line-height: 1.6; color: #d9cfb8; }

@media (max-width: 899px) {
  .realm-card { top: auto; right: 0.75rem; left: 0.75rem; bottom: 0.75rem; width: auto; }
  .realm-body { max-height: 34svh; }
  .realm-sigil { width: 52px; height: 52px; }
  html[data-skin="throne"] .realm-hint { right: 0; left: 0; text-align: center; bottom: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .realm-card.is-open .realm-cloth { animation: none; }
}
