:root {
  --bg-0: #060b19;
  --bg-1: #0b1736;
  --bg-2: #153067;

  --glass-1: rgba(20, 43, 89, 0.68);
  --glass-2: rgba(12, 27, 58, 0.82);
  --glass-line: rgba(157, 201, 255, 0.35);

  --ink-main: #2f241b;
  --ink-body: #433225;
  --paper-1: #e8ddc8;
  --paper-2: #d5c5a7;
  --paper-line: rgba(104, 77, 53, 0.24);

  --text-main: #eaf3ff;
  --text-dim: #a2bde3;
  --accent: #84cfff;
  --accent-deep: #4ea6ea;
  --space-1: 0.38rem;
  --space-2: 0.62rem;
  --space-3: 0.9rem;
  --space-4: 1.2rem;
}

* {
  box-sizing: border-box;
}

.view-hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(90% 70% at 14% 8%, #214a8f 0%, transparent 54%),
    radial-gradient(80% 70% at 86% 18%, #1a356f 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1) 40%, var(--bg-0));
  color: var(--text-main);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  border-bottom: 1px solid var(--glass-line);
  background:
    linear-gradient(180deg, var(--glass-1), var(--glass-2)),
    radial-gradient(90% 120% at 50% -30%, rgba(180, 221, 255, 0.18), rgba(180, 221, 255, 0));
  backdrop-filter: blur(10px) saturate(1.08);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  box-shadow: 0 10px 26px rgba(3, 10, 26, 0.46);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(183, 223, 255, 0.88), transparent);
}

.topbar-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0.66rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  margin: 0;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(0.98rem, 1.28vw, 1.22rem);
  color: var(--text-main);
}

.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.42rem 0.92rem;
}

.menu a {
  position: relative;
  text-decoration: none;
  color: var(--text-dim);
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-variant-caps: all-small-caps;
  font-size: clamp(0.72rem, 0.86vw, 0.95rem);
  letter-spacing: 0.045em;
  font-weight: 600;
  opacity: 0.9;
  transition: color 0.16s ease, opacity 0.16s ease;
  outline: none;
}

.menu a + a::before {
  content: "|";
  position: absolute;
  left: -0.66rem;
  color: rgba(140, 171, 214, 0.7);
}

.menu a:hover,
.menu a:focus-visible,
.menu a.active {
  color: var(--text-main);
  opacity: 1;
}

.menu a.active::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -0.42rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(132, 205, 255, 0), rgba(132, 205, 255, 1), rgba(132, 205, 255, 0));
  box-shadow: 0 0 10px rgba(132, 205, 255, 0.28);
}

.split-layout {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

.split-layout::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 0.5px);
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(170, 209, 255, 0.08),
    rgba(170, 209, 255, 0.36) 14%,
    rgba(170, 209, 255, 0.18) 50%,
    rgba(170, 209, 255, 0.34) 86%,
    rgba(170, 209, 255, 0.08)
  );
  pointer-events: none;
  z-index: 1;
}

.left-half {
  position: relative;
  padding: 0;
  border-right: 0;
  background:
    linear-gradient(180deg, rgba(16, 36, 80, 0.38), rgba(8, 20, 47, 0.7)),
    radial-gradient(42% 36% at 16% 12%, rgba(129, 199, 255, 0.2), transparent 74%),
    radial-gradient(46% 42% at 82% 82%, rgba(97, 132, 216, 0.22), transparent 74%);
}

.art-placeholder {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 56px);
  overflow: hidden;
  background: #0b1737;
}

.art-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 1;
  mix-blend-mode: normal;
  filter: none;
}

.art-placeholder::before {
  content: none;
}

.story-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 1.2rem;
  background:
    radial-gradient(120% 90% at 50% 0, rgba(120, 176, 255, 0.1), rgba(120, 176, 255, 0)),
    linear-gradient(180deg, rgba(5, 12, 30, 0.88), rgba(8, 18, 45, 0.96));
}

.story-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(2, 9, 24, 0.42);
  background: #02050d;
}

.magic-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 1;
}

.location-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.sigil,
.sigil-core,
.spire {
  display: none;
}

.spire {
  position: absolute;
  bottom: 20%;
  width: 0;
  height: 0;
  border-left: 28px solid transparent;
  border-right: 28px solid transparent;
  border-bottom: 200px solid rgba(229, 240, 255, 0.22);
  filter: drop-shadow(0 0 10px rgba(155, 206, 255, 0.18));
}

.spire-a {
  left: 50%;
  transform: translateX(-50%);
}

.spire-b {
  left: calc(50% - 120px);
  border-left-width: 22px;
  border-right-width: 22px;
  border-bottom-width: 150px;
  opacity: 0.84;
}

.spire-c {
  left: calc(50% + 76px);
  border-left-width: 18px;
  border-right-width: 18px;
  border-bottom-width: 120px;
  opacity: 0.76;
}

.location-mark {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(0.74rem, 0.9vw, 0.9rem);
  text-transform: uppercase;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.07em;
  color: rgba(221, 238, 255, 0.9);
  text-shadow: 0 0 12px rgba(151, 205, 255, 0.24);
}

.sigil {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(130, 212, 255, 0.34);
  box-shadow: 0 0 24px rgba(128, 208, 255, 0.15), inset 0 0 20px rgba(128, 208, 255, 0.12);
}

.sigil-a {
  width: min(58%, 360px);
  aspect-ratio: 1;
}

.sigil-b {
  width: min(42%, 250px);
  aspect-ratio: 1;
}

.sigil-core {
  width: 14px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(173, 235, 255, 0.95), rgba(131, 206, 255, 0.46));
  box-shadow: 0 0 16px rgba(121, 207, 255, 0.5);
}

.magic-mark {
  position: absolute;
  bottom: 14%;
  margin: 0;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(0.84rem, 1vw, 1rem);
  text-transform: uppercase;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  color: rgba(209, 238, 255, 0.9);
  text-shadow: 0 0 12px rgba(118, 202, 255, 0.26);
}

.name-block {
  position: absolute;
  left: 1.12rem;
  bottom: 1rem;
  z-index: 2;
  max-width: min(78%, 540px);
}

.name-script {
  margin: 0;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.44rem, 3.2vw, 2.7rem);
  font-weight: 700;
  color: #e5f1ff;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 12px rgba(4, 10, 24, 0.74);
}

.voice {
  margin: 0.24rem 0 0;
  font-size: clamp(0.8rem, 0.9vw, 0.92rem);
  color: #b8cde8;
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(4, 10, 24, 0.54);
}

.right-half {
  position: relative;
  padding: 0;
  background: transparent;
}

.paper-panel {
  width: 100%;
  min-height: calc(100vh - 56px);
  position: relative;
  padding: calc(var(--space-4) + 0.1rem) calc(var(--space-4) + 0.16rem) calc(var(--space-3) + 0.24rem);
  background:
    radial-gradient(70% 50% at 88% 20%, rgba(114, 88, 65, 0.16), rgba(114, 88, 65, 0)),
    radial-gradient(60% 42% at 70% 82%, rgba(159, 136, 110, 0.13), rgba(159, 136, 110, 0)),
    linear-gradient(180deg, var(--paper-1), var(--paper-2));
  color: var(--ink-main);
  box-shadow:
    inset 0 18px 30px rgba(255, 248, 231, 0.22),
    inset 0 0 0 1px rgba(242, 231, 210, 0.36);
}

.paper-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(88, 64, 44, 0.03) 0,
      rgba(88, 64, 44, 0.03) 1px,
      rgba(88, 64, 44, 0) 1px,
      rgba(88, 64, 44, 0) 41px
    ),
    radial-gradient(130% 18% at 50% -6%, rgba(255, 249, 236, 0.56), rgba(255, 249, 236, 0)),
    radial-gradient(120% 16% at 50% 106%, rgba(142, 111, 81, 0.16), rgba(142, 111, 81, 0));
}

.panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
  padding-bottom: calc(var(--space-2) + 0.04rem);
  border-bottom: 1px solid var(--paper-line);
}

.panel-title {
  margin: 0;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  text-transform: uppercase;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  font-size: clamp(0.82rem, 0.88vw, 0.9rem);
  color: #4a3425;
  opacity: 0.9;
}

.character-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  padding: 0.16rem;
  border: 1px solid rgba(126, 95, 66, 0.22);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(246, 237, 220, 0.7), rgba(225, 206, 178, 0.58));
  max-width: min(68%, 980px);
}

#character-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.58rem 0.74rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  max-width: min(100%, 1060px);
}

.chip-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.26rem;
}

.chip-group-label {
  position: static;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(0.6rem, 0.7vw, 0.72rem);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
  color: rgba(85, 58, 36, 0.7);
  margin: 0;
  padding: 0;
}

.chip-group-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.18rem;
  border: 1px solid rgba(126, 95, 66, 0.22);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(246, 237, 220, 0.7), rgba(225, 206, 178, 0.58));
  max-width: 100%;
}

.chip {
  border: 1px solid rgba(110, 83, 56, 0.36);
  border-radius: 999px;
  padding: 0.3rem 0.78rem;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(0.66rem, 0.78vw, 0.8rem);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  color: #4f3929;
  background: linear-gradient(180deg, rgba(243, 232, 210, 0.74), rgba(222, 202, 172, 0.74));
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
  outline: none;
}

.chip.active {
  border-color: rgba(103, 74, 47, 0.56);
  color: #3d2b1f;
  background: linear-gradient(180deg, rgba(232, 215, 186, 0.98), rgba(205, 180, 145, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 246, 230, 0.42);
}

.chip:hover {
  border-color: rgba(100, 72, 47, 0.48);
}

.chip:focus-visible {
  border-color: rgba(95, 68, 45, 0.66);
  box-shadow: 0 0 0 2px rgba(156, 127, 93, 0.26);
}

.content-section {
  position: relative;
  z-index: 1;
  margin-top: calc(var(--space-3) + 0.04rem);
  padding-bottom: calc(var(--space-2) + 0.02rem);
  border-bottom: 1px solid var(--paper-line);
}

.content-section h3 {
  margin: 0 0 var(--space-2);
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(0.9rem, 0.95vw, 0.98rem);
  font-weight: 700;
  text-transform: uppercase;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
  color: #3b2b1f;
}

.content-section h3::before {
  content: "";
  width: 0.56rem;
  height: 0.56rem;
  flex: 0 0 0.56rem;
  background:
    linear-gradient(90deg, transparent 44%, #6d4b31 44%, #6d4b31 56%, transparent 56%),
    linear-gradient(0deg, transparent 44%, #6d4b31 44%, #6d4b31 56%, transparent 56%);
  opacity: 0.84;
}

.content-section p,
.content-section li {
  margin: 0 0 0.34rem;
  color: var(--ink-body);
  font-size: clamp(0.86rem, 0.9vw, 0.93rem);
  line-height: 1.58;
  max-width: 66ch;
}

#relationships-view .content-section p,
#relationships-view .content-section li {
  max-width: 72ch;
}

#magic-view .content-section p,
#magic-view .content-section li {
  max-width: 72ch;
}

#locations-view .content-section p,
#locations-view .content-section li {
  max-width: 72ch;
}

#relationships-view {
  display: block;
}

.rel-intro {
  border-bottom-color: var(--paper-line);
}

.rel-lead {
  font-size: clamp(0.91rem, 0.96vw, 1rem);
  font-weight: 500;
  color: var(--ink-body);
}

.relationship-grid {
  display: grid;
  gap: 0.9rem;
  margin-top: calc(var(--space-3) + 0.04rem);
}

.relationship-grid.two-up {
  grid-template-columns: 1fr 1fr;
}

.rel-card {
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.rel-card h3 {
  margin-top: 0;
}

.rel-rule {
  border-bottom: 1px solid var(--paper-line);
  padding-bottom: calc(var(--space-2) + 0.02rem);
}

.content-section:first-of-type p {
  font-size: clamp(0.91rem, 0.96vw, 1rem);
  line-height: 1.62;
  max-width: 68ch;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  position: relative;
}

.stats-grid::after {
  content: "";
  position: absolute;
  left: calc(50% - 0.5px);
  top: 0.08rem;
  bottom: 0.08rem;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(122, 90, 60, 0),
    rgba(122, 90, 60, 0.26) 14%,
    rgba(122, 90, 60, 0.12) 50%,
    rgba(122, 90, 60, 0.24) 86%,
    rgba(122, 90, 60, 0)
  );
  pointer-events: none;
}

.facts,
.bullets {
  list-style: none;
  margin: 0;
  padding: 0;
}

.facts li,
.bullets li {
  padding: 0.26rem 0;
  border-bottom: 1px solid rgba(113, 83, 56, 0.22);
}

.bullets li {
  position: relative;
  padding-left: 0.96rem;
}

.bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #735037;
}

.quote p {
  font-style: italic;
}

@media (max-width: 1024px) {
  .split-layout {
    grid-template-columns: 1fr;
  }

  .split-layout::before,
  .stats-grid::after {
    display: none;
  }

  .left-half {
    border-right: 0;
    border-bottom: 1px solid rgba(154, 196, 251, 0.2);
  }

  .art-placeholder,
  .paper-panel {
    min-height: 58vh;
  }

  .story-stage {
    padding: 0.85rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .relationship-grid.two-up {
    grid-template-columns: 1fr;
    gap: 0.56rem;
  }

}

@media (max-width: 640px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.58rem 0.78rem;
  }

  .menu {
    justify-content: flex-start;
    gap: 0.36rem 0.75rem;
  }

  .menu a + a::before {
    display: none;
  }

  .content-section p,
  .content-section li {
    max-width: none;
  }

  .name-block {
    max-width: min(92%, 540px);
  }

  .location-mark {
    white-space: normal;
    width: min(86%, 360px);
    text-align: center;
  }

  .chip-group {
    width: 100%;
  }

  #character-switch {
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .chip-group-pills {
    max-width: 100%;
  }
}

.prompt-page .topbar-inner {
  max-width: 1200px;
}

.prompt-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.4rem 1rem 3rem;
  display: grid;
  gap: 1.25rem;
}

.prompt-panel {
  border: 1px solid rgba(160, 209, 255, 0.3);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(17, 36, 79, 0.78), rgba(9, 21, 48, 0.9)),
    radial-gradient(96% 80% at 6% 0%, rgba(138, 208, 255, 0.16), rgba(138, 208, 255, 0));
  box-shadow: 0 14px 28px rgba(3, 10, 26, 0.44);
  overflow: hidden;
}

.prompt-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.2rem 0.95rem;
  border-bottom: 1px solid rgba(165, 214, 255, 0.22);
}

.prompt-panel-head h1 {
  margin: 0;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.3rem, 2vw, 1.72rem);
}

.prompt-kicker {
  margin: 0 0 0.28rem;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.prompt-note {
  margin: 0.48rem 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.prompt-note code {
  color: var(--text-main);
}

.copy-button {
  border: 1px solid rgba(177, 224, 255, 0.5);
  background: linear-gradient(180deg, rgba(149, 218, 255, 0.26), rgba(108, 185, 236, 0.17));
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.58rem 0.94rem;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.copy-button:hover,
.copy-button:focus-visible {
  border-color: rgba(188, 230, 255, 0.86);
  outline: none;
}

.prompt-code-shell {
  margin: 0;
  padding: 1.16rem;
  max-height: calc(100vh - 210px);
  overflow: auto;
  font-family: "SFMono-Regular", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #d7ebff;
  background: rgba(4, 11, 27, 0.72);
}

@media (max-width: 640px) {
  .prompt-main {
    padding-top: 1rem;
  }

  .prompt-panel-head {
    align-items: flex-start;
  }

  .prompt-code-shell {
    max-height: none;
    min-height: 58vh;
  }
}

.timeline-page .topbar-inner {
  max-width: 1600px;
}

.timeline-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.8rem 1rem 2.6rem;
}

.timeline-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.timeline-kicker {
  margin: 0 0 0.3rem;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.timeline-hero h1 {
  margin: 0;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.46rem, 2.2vw, 2.1rem);
}

.timeline-note {
  margin: 0.45rem 0 0;
  max-width: 70ch;
  color: var(--text-dim);
  line-height: 1.58;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.timeline-legend-chip {
  padding: 0.48rem 0.75rem;
  border-radius: 999px;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(171, 220, 255, 0.22);
  background: rgba(16, 32, 68, 0.6);
}

.timeline-legend-chip.story {
  color: #bde3ff;
}

.timeline-legend-chip.faction {
  color: #ffe2a8;
}

.timeline-legend-chip.event {
  color: #ffc7d8;
}

.timeline-frame {
  border: 1px solid rgba(170, 214, 255, 0.2);
  border-radius: 20px;
  overflow: auto;
  cursor: grab;
  background:
    linear-gradient(180deg, rgba(9, 22, 51, 0.92), rgba(6, 16, 36, 0.98)),
    radial-gradient(90% 120% at 50% 0, rgba(110, 180, 255, 0.08), rgba(110, 180, 255, 0));
  box-shadow: 0 16px 36px rgba(4, 10, 24, 0.45);
}

.timeline-frame-dragging {
  cursor: grabbing;
  user-select: none;
}

.timeline-frame-dragging .timeline-board {
  user-select: none;
}

.timeline-board {
  min-width: 1700px;
  display: grid;
  grid-template-columns: 84px 180px minmax(1200px, 1fr);
  grid-auto-rows: minmax(76px, auto);
}

.timeline-cell {
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 0.9rem 1rem;
  border-right: 1px solid rgba(157, 204, 255, 0.12);
  border-bottom: 1px solid rgba(157, 204, 255, 0.1);
  background: rgba(8, 18, 42, 0.94);
}

.timeline-sticky {
  position: sticky;
  z-index: 5;
}

.timeline-sticky-name {
  left: 84px;
}

.timeline-sticky-avatar {
  left: 0;
}

.timeline-header-meta {
  z-index: 8;
  min-height: 96px;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(8, 19, 42, 0.98);
}

.timeline-row-name {
  font-weight: 700;
  color: var(--text-main);
}

.timeline-row-avatar,
.timeline-avatar-header {
  justify-content: center;
  padding: 0.75rem;
}

.timeline-avatar-shell {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(174, 220, 255, 0.22);
  background: linear-gradient(180deg, rgba(23, 50, 99, 0.95), rgba(11, 23, 49, 0.98));
  box-shadow: 0 8px 18px rgba(2, 9, 24, 0.26);
}

.timeline-avatar-shell-faction {
  border-color: rgba(238, 204, 130, 0.22);
  background: linear-gradient(180deg, rgba(88, 57, 18, 0.94), rgba(46, 30, 9, 0.98));
}

.timeline-avatar-image,
.timeline-avatar-fallback {
  width: 100%;
  height: 100%;
}

.timeline-avatar-image {
  display: block;
  object-fit: cover;
  object-position: center;
}

.timeline-avatar-fallback {
  display: grid;
  place-items: center;
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: #e7f2ff;
  background: linear-gradient(135deg, rgba(39, 82, 156, 0.95), rgba(27, 49, 90, 0.95));
}

.timeline-avatar-fallback-faction {
  color: #fff0cf;
  background: linear-gradient(135deg, rgba(156, 117, 39, 0.95), rgba(88, 62, 21, 0.95));
}

.timeline-row-faction {
  background: rgba(26, 20, 8, 0.92);
}

.timeline-track {
  position: relative;
  display: grid;
  min-height: 76px;
}

.timeline-header-track {
  min-height: 96px;
  background: rgba(8, 19, 42, 0.98);
  border-bottom: 1px solid rgba(157, 204, 255, 0.16);
}

.timeline-lane-head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.9rem 0.75rem;
  border-right: 1px solid rgba(157, 204, 255, 0.12);
  cursor: pointer;
  transition: opacity 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}

.timeline-lane-head-chapter {
  background: rgba(14, 28, 60, 0.82);
}

.timeline-lane-head-event {
  background: linear-gradient(180deg, rgba(79, 30, 51, 0.78), rgba(52, 20, 34, 0.92));
}

.timeline-lane-head:hover,
.timeline-lane-head:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.timeline-lane-head-active {
  box-shadow: inset 0 -3px 0 rgba(222, 239, 255, 0.85);
}

.timeline-lane-head-muted {
  opacity: 0.34;
}

.timeline-lane-label {
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.timeline-lane-title {
  font-size: 0.86rem;
  line-height: 1.25;
  color: var(--text-main);
}

.timeline-row-track {
  border-bottom: 1px solid rgba(157, 204, 255, 0.08);
}

.timeline-lane {
  min-height: 76px;
  border-right: 1px solid rgba(157, 204, 255, 0.1);
  background: rgba(11, 24, 52, 0.32);
}

.timeline-lane-event {
  background: rgba(68, 21, 38, 0.28);
}

.timeline-bar {
  grid-row: 1;
  align-self: center;
  margin: 0.6rem 0.35rem;
  padding: 0.68rem 0.85rem;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 10px 18px rgba(3, 9, 22, 0.2);
  overflow: hidden;
  z-index: 2;
}

.timeline-bar strong,
.timeline-bar span {
  display: block;
}

.timeline-bar strong {
  font-size: 0.84rem;
  line-height: 1.25;
  color: #f7fbff;
}

.timeline-bar span {
  margin-top: 0.14rem;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: rgba(247, 251, 255, 0.82);
}

.timeline-bar-blue {
  background: linear-gradient(135deg, rgba(49, 118, 220, 0.92), rgba(70, 171, 243, 0.8));
}

.timeline-bar-rose {
  background: linear-gradient(135deg, rgba(172, 61, 98, 0.92), rgba(220, 99, 143, 0.82));
}

.timeline-bar-ember {
  background: linear-gradient(135deg, rgba(164, 92, 33, 0.92), rgba(219, 142, 71, 0.82));
}

.timeline-bar-violet {
  background: linear-gradient(135deg, rgba(105, 74, 186, 0.92), rgba(157, 120, 232, 0.82));
}

.timeline-bar-gold {
  background: linear-gradient(135deg, rgba(160, 126, 47, 0.92), rgba(212, 182, 92, 0.82));
}

.timeline-bar-slate {
  background: linear-gradient(135deg, rgba(59, 78, 105, 0.92), rgba(101, 132, 176, 0.8));
}

.timeline-bar-stone {
  background: linear-gradient(135deg, rgba(110, 102, 89, 0.92), rgba(160, 151, 135, 0.8));
}

.timeline-bar-teal {
  background: linear-gradient(135deg, rgba(39, 124, 131, 0.92), rgba(84, 182, 190, 0.82));
}

@media (max-width: 900px) {
  .timeline-main {
    padding-top: 1rem;
  }

  .timeline-hero {
    align-items: flex-start;
  }
}
