/* ============================
   Timescape — Core Theme
   ============================ */

:root {
  --bg-main: #050611;
  --bg-main-alt: #050814;
  --bg-panel: #111320;
  --bg-panel-soft: #181b2a;
  --bg-chip: #151621;

  --accent-gold: #f4c56c;
  --accent-gold-soft: #f6d48d;
  --accent-gold-deep: #dca64a;

  --accent-passage: #7fd7c6;      /* Passage – sea-jade */
  --accent-rites: #f08ab6;        /* GMRO – warm rose */
  --accent-enchantment: #7dd0ff;  /* DP/EV – jade/sky */
  --accent-odyssey: #cf4b56;      /* Odyssey – crimson ember */

  --text-main: #f6f2e9;
  --text-muted: #b6b3c8;
  --text-soft: #8d8aa4;
  --text-gold: #f6d48d;

  --border-soft: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --shadow-soft: 0 28px 60px rgba(0, 0, 0, 0.75);
  --shadow-chip: 0 14px 35px rgba(0, 0, 0, 0.75);

  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-display: "Cinzel", "Georgia", serif;
  --font-body: "EB Garamond", "Georgia", serif;
}

/* ============================
   Global Layout & Typography
   ============================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body.ts-body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, #1b1730 0, transparent 50%),
    radial-gradient(circle at bottom right, #1d223c 0, transparent 55%),
    linear-gradient(180deg, #050611 0, #020308 50%, #050611 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-gold-soft);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.ts-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

@media (min-width: 1280px) {
  .ts-page {
    padding: 28px 12px 48px;
  }
}

/* ============================
   Top Bar & Navigation
   ============================ */

.ts-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 22px;
  border-radius: 999px;
  background:
   linear-gradient(135deg, #060613, #111320);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
/* Make the whole brand block clickable */
.ts-brand-link {
  text-decoration: none;
  color: inherit;
}

.ts-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}
/* Orb container */
.ts-glyph {
  position: relative;
  width: 3.75rem;   /* 60px – matches your 75px source with some padding */
  height: 3.75rem;
  flex-shrink: 0;
}

/* Both orb states stacked on top of each other */
.ts-glyph-orb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}

/* Default: outer orb visible, inner orb hidden */
.ts-glyph-orb--default {
  opacity: 1;
}

.ts-glyph-orb--hover {
  opacity: 0;
}

/* On hover/focus, fade to the "inner" glowing version */
.ts-brand-link:hover .ts-glyph-orb--default,
.ts-brand-link:focus-visible .ts-glyph-orb--default {
  opacity: 0;
  transform: scale(0.97);
}

.ts-brand-link:hover .ts-glyph-orb--hover,
.ts-brand-link:focus-visible .ts-glyph-orb--hover {
  opacity: 1;
  transform: scale(1.02);
}
/* Kill underlines on the brand link in all states */
.ts-brand-link,
.ts-brand-link:hover,
.ts-brand-link:focus,
.ts-brand-link:focus-visible {
  text-decoration: none;
}

.ts-brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
   justify-content: center;
}

.ts-brand-title {
  font-family: "Cinzel", serif; /* or whatever you’re using now */
  font-size: 1.22rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ts-brand-sub {
   font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.8;
  color: var(--text-soft);
}

/* Nav pills */

.ts-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.ts-nav-pill {
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--text-muted);
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 60%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 140ms ease-out,
    background 140ms ease-out,
    border-color 140ms ease-out,
    box-shadow 140ms ease-out,
    transform 70ms ease-out;
}

.ts-nav-pill:hover {
  border-color: rgba(244, 197, 108, 0.8);
  color: #fffbe8;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
  transform: translateY(-1px);
}

.ts-nav-pill--active {
  background: radial-gradient(circle at top left, #f9e2b8 0, #f4c56c 35%, #c8832a 80%);
  color: #130b05;
  border-color: rgba(244, 197, 108, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9);
}

/* ============================
   Hero Section + Oracle Icon
   ============================ */

.ts-main {
  margin-top: 6px;
}

.ts-hero {
  border-radius: var(--radius-lg);
  padding: 26px 26px 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 70%),
    radial-gradient(circle at bottom right, rgba(250, 212, 143, 0.07), transparent 65%),
    linear-gradient(145deg, #151729, #060712);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  margin-bottom: 26px;
}

.ts-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(220px, 1fr);
  gap: 2.2rem;
  align-items: stretch;
}

.ts-hero-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.ts-hero-text {
  margin: 0 0 14px;
  color: var(--text-muted);
}

.ts-hero-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 18px;
}

.ts-hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Make sure nothing is clipping */
  overflow: visible;
}

.ts-oracle-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;        /* no cropping */
  display: block;
}

/* Buttons */

.ts-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1b0d06;
  background: radial-gradient(circle at top left, #ffecc7 0, #f6d48d 35%, #d79a3a 80%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.8);
  transition:
    transform 80ms ease-out,
    box-shadow 80ms ease-out,
    filter 80ms ease-out;
}

.ts-primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.95);
}

.ts-primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.85);
}

.ts-ghost-link {
  font-size: 13px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  padding-bottom: 2px;
}

.ts-ghost-link:hover {
  color: var(--accent-gold-soft);
  border-color: var(--accent-gold-soft);
}

@media (max-width: 1280px) {
  .ts-topbar {
    gap: 10px;
    padding: 8px 12px;
  }

  .ts-topbar-left {
    gap: 0.75rem;
  }

  .ts-brand-title {
    font-size: 1.1rem;
    letter-spacing: 0.12em;
  }

  .ts-brand-sub {
    font-size: 0.62rem;
    letter-spacing: 0.14em;
  }

  .ts-nav {
    gap: 6px;
  }

  .ts-nav-pill {
    padding: 6px 12px;
    font-size: 10.5px;
    letter-spacing: 0.12em;
  }
}

/* Hero – responsive */

@media (max-width: 600px) {
  .ts-topbar {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 18px;
  }

  .ts-hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .ts-primary-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================
   Ten Stages Grid
   ============================ */

.ts-section {
  margin-top: 8px;
  margin-bottom: 20px;
}

.ts-section--wide {
  margin-top: 20px;
}

.ts-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.ts-section-sub {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-left: 8px;
}

.ts-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1000px) {
  .ts-stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ts-stage-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ts-stage-card {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 65%),
    linear-gradient(145deg, #111320, #05060f);
  border-radius: 18px;
  padding: 14px 18px 15px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-chip);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ts-stage-card h3 {
  margin: 0 0 3px;
  font-size: 15px;
}

.ts-stage-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.ts-stage-number {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-right: 6px;
}
/* ---------- Stage cards: hover & active glow ---------- */

:root {
  /* Default stage glow (Trionfi / gold) */
  --stage-glow-color: rgba(247, 196, 108, 0.55);
}

/* Optional per-oracle palette (hooked via data attribute in JS below) */
:root[data-oracle="trionfi"] {
  --stage-glow-color: rgba(247, 196, 108, 0.55); /* warm gold */
}
:root[data-oracle="passage"] {
  --stage-glow-color: rgba(127, 215, 198, 0.60); /* sea-jade */
}
:root[data-oracle="rites"] {
  --stage-glow-color: rgba(240, 138, 182, 0.60); /* ember / ritual */
}
:root[data-oracle="enchantment"] {
  --stage-glow-color: rgba(125, 208, 255, 0.60); /* moonlit blue */
}
:root[data-oracle="odyssey"] {
  --stage-glow-color: rgba(207, 75, 86, 0.62); /* crimson ember */
}

.ts-stage-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 180ms ease-out,
    box-shadow 180ms ease-out,
    border-color 180ms ease-out,
    background 200ms ease-out;
}

/* Soft lift + glow on rollover */
.ts-stage-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 24px var(--stage-glow-color);
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.05),
      transparent 55%
    );
}

/* Pulse class we toggle when "Choose a Stage" link is clicked */
@keyframes ts-stage-pulse {
  0% {
    box-shadow: 0 0 0 0 transparent;
    transform: translateY(0);
    border-color: var(--border-soft);
  }
  28% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.055),
      0 0 16px color-mix(in srgb, var(--stage-glow-color) 58%, transparent);
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--stage-glow-color) 42%, var(--border-soft));
  }
  58% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.085),
      0 0 26px color-mix(in srgb, var(--stage-glow-color) 78%, transparent),
      0 0 44px color-mix(in srgb, var(--stage-glow-color) 34%, transparent);
    transform: translateY(-1.5px);
    border-color: color-mix(in srgb, var(--stage-glow-color) 68%, var(--border-soft));
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    transform: translateY(0);
    border-color: var(--border-soft);
  }
}

.ts-stage-card.ts-stage-pulse {
  animation: ts-stage-pulse 1650ms cubic-bezier(.4, 0, .2, 1);
}
.ts-stage-card.ts-stage-selected {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 32px var(--stage-glow-color);
  border-color: var(--stage-glow-color);
  transform: translateY(-1px);
}

/* Tiny note style on the stage link */
.ts-ghost-note {
  opacity: 0.8;
  font-size: 0.9em;
}
/* stage attract glow */
.ts-stage-card.ts-stage-pulse {
  will-change: box-shadow, transform, border-color;
}

/* ============================
   Body copy & links
   ============================ */

.ts-body-copy {
  margin: 0 0 12px;
  color: var(--text-muted);
}

.ts-link {
  font-size: 14px;
  border-bottom: 1px solid rgba(244, 197, 108, 0.6);
}

.ts-link:hover {
  border-color: var(--accent-gold-soft);
}

/* ============================
   Footer
   ============================ */

.ts-footer {
  margin-top: 40px;
  padding-top: 16px;
  padding-bottom: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* ============================
   Modal (Draw a Sign)
   ============================ */

.ts-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.ts-modal.is-open {
  display: flex;
}

.ts-modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(15, 7, 27, 0.9), rgba(3, 2, 6, 0.98));
  backdrop-filter: blur(4px);
}

.ts-modal-dialog {
  position: relative;
  max-width: 460px;
  width: calc(100% - 32px);
  padding: 22px 22px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 70%),
    linear-gradient(145deg, #151729, #05060f);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.9);
  z-index: 50;
}

.ts-modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.ts-modal-text {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 15px;
}
#ts-modal-oracle-img {
  display: block;
  max-width: 240px;
  width: 60%;
  height: auto;
  margin: 0 auto 16px;
}

.ts-modal-text a {
  color: var(--accent-gold);
  text-decoration: underline;
  cursor: pointer;
}

.ts-modal-text a:hover {
  text-decoration: none;
}

.ts-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 20px;
  cursor: pointer;
}

.ts-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(244, 197, 108, 0.8);
  background: transparent;
  color: var(--text-gold);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ============================
   Oracle Color Themes
   ============================ */

/* base is Trionfi: we already use golden defaults */
/* --- Passage --- */

body.oracle-passage .ts-nav-pill[data-oracle="passage"],
body.oracle-passage .ts-nav-pill--active[data-oracle="passage"],
body.oracle-passage .ts-nav-pill.is-active[data-oracle="passage"] {
  background: radial-gradient(circle at top left, #e8fffb 0, #7fd7c6 38%, #2f7f77 92%);
  color: #051311;
  border-color: rgba(127, 215, 198, 0.92);
}

body.oracle-passage .ts-hero {
  background:
    radial-gradient(circle at top left, rgba(127, 215, 198, 0.16), transparent 70%),
    linear-gradient(145deg, #0f1a1a, #030709);
}

body.oracle-passage .ts-stage-card {
  border-color: rgba(127, 215, 198, 0.18);
}
/* --- Rites (GMRO) --- */

body.oracle-rites .ts-nav-pill[data-oracle="rites"],
body.oracle-rites .ts-nav-pill--active[data-oracle="rites"] {
  background: radial-gradient(circle at top left, #ffe0ed 0, #f08ab6 40%, #a83a74 90%);
  color: #1a0610;
  border-color: rgba(240, 138, 182, 0.9);
}

body.oracle-rites .ts-hero {
  background:
    radial-gradient(circle at top left, rgba(255, 192, 218, 0.16), transparent 70%),
    linear-gradient(145deg, #1a1121, #05040c);
}

body.oracle-rites .ts-stage-card {
  border-color: rgba(240, 138, 182, 0.18);
}
/* Hero layout wrapper */
.ts-hero-inner {
  display: flex;
  gap: 3.5rem;
  align-items: center;
}

/* Left & right columns */
.ts-hero-copy {
  flex: 3 1 0;
}

.ts-hero-image {
  flex: 2 1 0;
  display: flex;
  justify-content: center;
}

/* Oracle icon block */
.ts-oracle-hero {
  position: relative;
  max-width: 420px;           /* tweak as desired */
  width: 100%;
  aspect-ratio: 1 / 1;        /* keeps it perfectly circular */
}

/* Icon image itself */
.ts-oracle-hero-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}

/* Caption under icon */
.ts-oracle-hero-caption {
  margin-top: 1.4rem;
  text-align: center;
  font-family: var(--ts-serif, "Cormorant Garamond", serif);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #f3e2bd;
}

/* Stack nicely on mobile */
@media (max-width: 960px) {
  .ts-hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .ts-hero-image {
    align-self: center;
    margin-top: 2rem;
  }
}

/* --- Enchantment (Dragon Pearl / Eternal Vessel) --- */

body.oracle-enchantment .ts-nav-pill[data-oracle="enchantment"],
body.oracle-enchantment .ts-nav-pill--active[data-oracle="enchantment"] {
  background: radial-gradient(circle at top left, #e2fbff 0, #8dd6ff 35%, #2276a8 90%);
  color: #03101a;
  border-color: rgba(125, 208, 255, 0.9);
}

body.oracle-enchantment .ts-hero {
  background:
    radial-gradient(circle at top left, rgba(141, 214, 255, 0.18), transparent 70%),
    linear-gradient(145deg, #101a24, #03040b);
}

.ts-stage-card {
  cursor: pointer;
  user-select: none;
}
body.oracle-enchantment .ts-stage-card {
  border-color: rgba(141, 214, 255, 0.18);
}

/* --- Odyssey --- */

body.oracle-odyssey .ts-nav-pill[data-oracle="odyssey"],
body.oracle-odyssey .ts-nav-pill--active[data-oracle="odyssey"],
body.oracle-odyssey .ts-nav-pill.is-active[data-oracle="odyssey"] {
  background: radial-gradient(circle at top left, #ffe0d2 0, #f2a36d 28%, #cf4b56 62%, #5a1117 96%);
  color: #1a0708;
  border-color: rgba(242, 163, 109, 0.84);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.34),
    0 0 26px rgba(207, 75, 86, 0.24),
    0 0 0 2px rgba(242, 163, 109, 0.16) inset;
}

body.oracle-odyssey .ts-hero {
  background:
    radial-gradient(circle at top left, rgba(242, 163, 109, 0.16), transparent 66%),
    radial-gradient(circle at right center, rgba(207, 75, 86, 0.12), transparent 48%),
    linear-gradient(145deg, #1d0a0d, #050308);
}

body.oracle-odyssey .ts-stage-card {
  border-color: rgba(207, 75, 86, 0.22);
}
.ts-stage-card.ts-stage-selected {
  background: radial-gradient(circle at top left, rgba(255,255,255,0.05), transparent 65%),
              linear-gradient(145deg, #111320, #05060f) !important;
  border: 1px solid var(--stage-glow-color) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--stage-glow-color) 55%, transparent) !important,
    0 0 30px var(--stage-glow-color) !important;
}
#ts-modal-oracle-img {
  max-width: 240px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 1rem auto;
}
/* Force active pill styling with higher specificity */
.ts-nav .ts-nav-pill.ts-nav-pill--active {
  background: linear-gradient(135deg, #d4af37, #b8932f);
  color: #111;
  border-color: #d4af37;
}
/* Ensure selected state wins over hover */
.ts-stage-grid .ts-stage-card.ts-stage-selected,
.ts-stage-grid .ts-stage-card.ts-stage-selected:hover {
  background: radial-gradient(circle at top left, rgba(255,255,255,0.05), transparent 65%),
              linear-gradient(145deg, #111320, #05060f);
  border: 1px solid var(--stage-glow-color);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--stage-glow-color) 55%, transparent),
    0 0 30px var(--stage-glow-color);
}
/* Active oracle pill must override theme */
.ts-nav .ts-nav-pill.ts-nav-pill--active {
  background: linear-gradient(135deg, #d4af37, #b8932f);
  color: #111;
  border-color: #d4af37;
}
.ts-oracle-pill.is-active {
  background: linear-gradient(
    135deg,
    rgba(255,215,140,0.95),
    rgba(212,160,70,0.95)
  );
  color: #111;
  border-color: rgba(255,215,140,0.8);
  box-shadow: 0 0 0 2px rgba(255,215,140,0.25) inset;
}
/* FORCE active pill styling to win (fixes Trionfi not coloring) */
.ts-nav .ts-nav-pill.is-active,
.ts-nav .ts-nav-pill.ts-nav-pill--active {
  background: linear-gradient(180deg, rgba(214,176,98,0.95), rgba(156,115,44,0.92));
  border-color: rgba(255, 215, 140, 0.70);
  color: rgba(20, 12, 6, 0.95);
  box-shadow:
    0 10px 24px rgba(0,0,0,0.35),
    0 0 0 2px rgba(255,215,140,0.20) inset;
}
/* ============================
   Trionfi Theme Pills (Match Stage Cards)
   ============================ */

.ts-trionfi-theme {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.05), transparent 65%),
    linear-gradient(145deg, #111320, #05060f);
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-chip);
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  padding: 14px 16px;
  cursor: pointer;
  transition:
    transform 180ms ease-out,
    box-shadow 180ms ease-out,
    border-color 180ms ease-out;
}

.ts-trionfi-theme:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 0 24px var(--stage-glow-color);
}

.ts-trionfi-theme.is-active {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12),
    0 0 32px var(--stage-glow-color);
  border-color: var(--stage-glow-color);
  transform: translateY(-1px);
}
.ts-trionfi-theme.is-spent{
  opacity: 0.42;
  border-color: rgba(255,255,255,0.10);
  box-shadow: none;
}
/* ============================
   Shared Lightbox & Animation Viewer
   ============================ */

.ts-lightbox,
.ts-anim-viewer {
  position: fixed;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  isolation: isolate;
}

.ts-lightbox {
  z-index: 99999;
}

.ts-anim-viewer {
  z-index: 100000;
}

.ts-lightbox.is-open,
.ts-anim-viewer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ts-lightbox-backdrop,
.ts-anim-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 12, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1;
}

.ts-lightbox-frame,
.ts-anim-panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
}

.ts-lightbox-frame {
  padding: 24px;
  pointer-events: none;
}

.ts-lightbox-frame img {
  position: relative;
  z-index: 3;
  display: block;
  max-width: min(92vw, 1100px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.72);
  pointer-events: auto;
}

.ts-anim-panel {
  padding: 18px;
}

.ts-anim-panel video {
  position: relative;
  z-index: 3;
  display: block;
  width: auto;
  max-width: min(96vw, 1180px);
  max-height: 94vh;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.72);
  background: #000;
}

body.ts-lightbox-open,
body.ts-anim-open {
  overflow: hidden;
}

body.ts-lightbox-open .ts-page,
body.ts-anim-open .ts-page {
  pointer-events: none;
}

body.ts-lightbox-open .ts-lightbox,
body.ts-anim-open .ts-anim-viewer {
  pointer-events: auto;
}

@media (max-width: 640px) {
  .ts-lightbox-frame,
  .ts-anim-panel {
    padding: 12px;
  }

  .ts-lightbox-frame img,
  .ts-anim-panel video {
    max-width: 96vw;
    max-height: 90vh;
    border-radius: 14px;
  }
}


/* ============================
   Odyssey crimson top-bar / stage-glow override
   ============================ */

body.oracle-odyssey .ts-nav .ts-nav-pill.is-active,
body.oracle-odyssey .ts-nav .ts-nav-pill.ts-nav-pill--active {
  background: radial-gradient(circle at top left, #ffe0d2 0, #f2a36d 28%, #cf4b56 62%, #5a1117 96%);
  border-color: rgba(242, 163, 109, 0.84);
  color: #1a0708;
  box-shadow:
    0 10px 24px rgba(0,0,0,0.34),
    0 0 26px rgba(207,75,86,0.24),
    0 0 0 2px rgba(242,163,109,0.16) inset;
}

body.oracle-odyssey .ts-stage-grid .ts-stage-card.ts-stage-selected,
body.oracle-odyssey .ts-stage-grid .ts-stage-card.ts-stage-selected:hover {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.05), transparent 65%),
    linear-gradient(145deg, #1a0b10, #060308);
  border: 1px solid rgba(207, 75, 86, 0.70);
  box-shadow:
    0 0 0 2px rgba(242,163,109,0.20),
    0 0 18px rgba(242,163,109,0.18),
    0 0 34px rgba(207,75,86,0.30);
}

body.oracle-odyssey .ts-stage-card:hover {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 0 24px rgba(207, 75, 86, 0.40);
}


/* Chamber reshuffle buttons — serif polish */
.reading-controls .btn-ghost,
.reading-controls--passage .btn-ghost,
.reading-controls--trionfi .btn-ghost,
#btnShuffle.btn-ghost {
  font-family: var(--font-display);
}


/* ============================
   Timescape intermediate home
   ============================ */

.ts-hero-copy {
  flex: 1.5 1 0;
}

.ts-hero-image {
  flex: 1 1 0;
}

.ts-oracle-hero {
  max-width: 360px;
  width: 100%;
}

.ts-oracle-hero-subcaption {
  margin-top: 0.8rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.ts-nav .ts-nav-pill.is-active,
.ts-nav .ts-nav-pill.ts-nav-pill--active {
  background: linear-gradient(180deg, rgba(214,176,98,0.95), rgba(156,115,44,0.92));
  border-color: rgba(255, 215, 140, 0.70);
  color: rgba(20, 12, 6, 0.95);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35), 0 0 0 2px rgba(255,215,140,0.20) inset;
}

.ts-hero .ts-primary-btn {
  min-width: 220px;
}

@media (max-width: 960px) {
  .ts-oracle-hero {
    max-width: 280px;
  }
}


/* Direct navigation pill: Mystery Rites */
.ts-nav-pill--link,
.ts-nav-pill--link:hover,
.ts-nav-pill--link:focus,
.ts-nav-pill--link:focus-visible {
  text-decoration: none;
}

.ts-nav-pill--link:hover,
.ts-nav-pill--link:focus-visible {
  border-color: rgba(240, 138, 182, 0.82);
  color: #fff0f7;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(240, 138, 182, 0.18);
}
