:root {
  color-scheme: dark;
  --story-bg: #07111f;
  --story-bg-deep: #030813;
  --story-panel: rgba(10, 22, 39, 0.74);
  --story-panel-strong: rgba(14, 30, 52, 0.9);
  --story-line: rgba(151, 185, 218, 0.13);
  --story-line-strong: rgba(169, 205, 240, 0.28);
  --story-text: #f3f8ff;
  --story-muted: #9eb1c7;
  --story-soft: #c4d6eb;
  --story-gold: #d7a85d;
  --story-gold-soft: rgba(215, 168, 93, 0.18);
  --story-blue: #6db5ff;
  --story-green: #79d2a6;
  --story-rose: #e38ca8;
  --story-radius: 18px;
  --story-shadow: 0 28px 84px rgba(0, 0, 0, 0.32);
  --progress-value: 0deg;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(47, 106, 168, 0.28), transparent 30rem),
    radial-gradient(circle at 78% 72%, rgba(215, 168, 93, 0.13), transparent 24rem),
    radial-gradient(circle at 16% 72%, rgba(121, 210, 166, 0.08), transparent 22rem),
    linear-gradient(145deg, var(--story-bg-deep), var(--story-bg) 48%, #101725);
  color: var(--story-text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--story-blue);
  outline-offset: 3px;
}

.story-exp {
  position: relative;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  isolation: isolate;
}

.story-exp::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.18) 0 1px, transparent 1.4px),
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 130px 130px, 64px 64px, 64px 64px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 75%);
}

.story-exp::after {
  content: "";
  position: fixed;
  inset: 70px 0 0;
  z-index: -1;
  background:
    linear-gradient(122deg, transparent 0 23%, rgba(109, 181, 255, 0.055) 23.1% 23.25%, transparent 23.35%),
    linear-gradient(37deg, transparent 0 68%, rgba(215, 168, 93, 0.045) 68.1% 68.25%, transparent 68.35%);
  opacity: 0.8;
  pointer-events: none;
}

.story-exp-header {
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--story-line);
  background: rgba(4, 10, 20, 0.68);
  backdrop-filter: blur(18px);
}

.story-exp-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

@media (max-width: 1500px) {
  .story-exp-header {
    grid-template-columns: minmax(188px, auto) minmax(0, 1fr) auto;
    gap: 12px;
  }

  .story-exp-context {
    gap: 8px;
  }

  .story-exp-context span {
    max-width: 96px;
  }
}

@media (max-height: 820px) and (min-width: 1181px) {
  .story-exp-shell {
    padding-top: 10px;
    padding-bottom: 64px;
  }

  .story-exp-stage {
    grid-template-rows: auto minmax(0, 1fr) 170px;
  }

  .story-exp-stage-copy {
    min-height: 54px;
  }

  .story-exp-ribbon-wrap {
    gap: 8px;
    grid-template-rows: minmax(92px, auto) 46px;
    padding: 10px 12px 12px;
  }

  .story-exp-ribbon {
    gap: 12px;
    min-height: 92px;
  }

  .story-scene-card {
    flex-basis: clamp(132px, 14vw, 168px);
    min-height: 84px;
    padding: 10px 12px;
  }

  .story-scene-card.is-current {
    flex-basis: clamp(188px, 18vw, 224px);
    min-height: 96px;
  }

  .story-exp-timeline {
    min-height: 46px;
  }

  .story-exp-controls {
    bottom: 10px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

@media (max-width: 1400px) and (min-width: 1181px) {
  .story-exp-ribbon {
    gap: 12px;
  }

  .story-scene-card {
    flex-basis: clamp(132px, 11vw, 160px);
  }

  .story-scene-card.is-current {
    flex-basis: clamp(188px, 15vw, 220px);
  }
}

.story-exp-brand strong {
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}

.story-exp-brand span,
.story-exp-context span,
.story-exp-eyebrow,
.story-exp-zone-label,
.story-exp-controls span {
  color: var(--story-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.story-exp-context {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.story-exp-context span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-exp-background,
.story-exp-controls button {
  min-height: 38px;
  border: 1px solid rgba(215, 168, 93, 0.46);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(215, 168, 93, 0.13);
  color: #fff5dc;
  font-weight: 800;
}

.story-exp-background:hover,
.story-exp-controls button:hover {
  background: rgba(215, 168, 93, 0.2);
}

.story-exp-background {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.story-exp-run-selector {
  position: fixed;
  left: 50%;
  top: 68px;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(720px, calc(100vw - 48px));
  max-height: min(560px, calc(100vh - 160px));
  overflow: auto;
  border: 1px solid rgba(151, 185, 218, 0.18);
  border-radius: 16px;
  padding: 14px;
  background: rgba(4, 10, 20, 0.9);
  box-shadow: var(--story-shadow);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.story-exp-run-selector strong {
  color: var(--story-text);
}

.story-exp-run-selector a {
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--story-soft);
  text-decoration: none;
}

.story-exp-run-selector a:hover {
  border-color: rgba(215, 168, 93, 0.42);
  color: var(--story-text);
}

.story-exp-status-message {
  position: fixed;
  left: 50%;
  top: 68px;
  z-index: 19;
  width: min(720px, calc(100vw - 48px));
  border: 1px solid rgba(215, 168, 93, 0.32);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(6, 14, 26, 0.9);
  box-shadow: var(--story-shadow);
  color: var(--story-text);
  font-size: 0.84rem;
  line-height: 1.45;
  transform: translateX(-50%);
}

.story-exp-rebuild {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 18px 10px;
  border: 1px solid rgba(151, 185, 218, 0.12);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(4, 12, 24, 0.74);
}

.story-exp-rebuild label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--story-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-exp-rebuild select,
.story-exp-rebuild button {
  border: 1px solid rgba(151, 185, 218, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--story-soft);
  font-size: 0.76rem;
}

.story-exp-rebuild select {
  max-width: min(280px, 40vw);
  padding: 6px 22px 6px 9px;
}

.story-exp-rebuild button {
  padding: 6px 12px;
  font-weight: 800;
}

.story-exp-shell {
  display: grid;
  grid-template-columns: minmax(180px, 0.46fr) minmax(820px, 2.72fr) minmax(188px, 0.48fr);
  gap: 12px;
  min-height: 0;
  padding: 12px 18px 58px;
}

.story-exp-left,
.story-exp-right {
  display: grid;
  align-content: start;
  gap: 9px;
  max-height: calc(100vh - 126px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.story-exp-left::-webkit-scrollbar,
.story-exp-right::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.story-exp-left {
  grid-template-rows: auto auto minmax(170px, 1fr) minmax(96px, 0.56fr);
}

.story-exp-right {
  grid-template-rows: minmax(218px, 1.35fr) minmax(185px, 1.08fr) auto;
}

.story-exp-left,
.story-exp-right,
.story-exp-stage {
  min-width: 0;
}

.story-exp-progress,
.story-exp-panel,
.story-exp-stats {
  border: 1px solid rgba(151, 185, 218, 0.11);
  border-radius: var(--story-radius);
  background:
    linear-gradient(180deg, rgba(18, 34, 58, 0.62), rgba(7, 17, 31, 0.42));
  box-shadow: var(--story-shadow);
  backdrop-filter: blur(18px);
}

.story-exp-progress,
.story-exp-panel {
  padding: 8px;
}

.story-exp-panel {
  display: grid;
  grid-template-rows: auto auto;
  min-height: 0;
  overflow: hidden;
}

.story-exp-panel--compact {
  padding: 9px;
}

.story-exp-progress-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 190px);
  aspect-ratio: 1;
  margin: 8px auto 16px;
  border-radius: 50%;
  background:
    conic-gradient(from -90deg, var(--story-gold) var(--progress-value), rgba(255, 255, 255, 0.08) 0),
    radial-gradient(circle, rgba(109, 181, 255, 0.18), transparent 58%);
  box-shadow: 0 0 44px rgba(109, 181, 255, 0.18), inset 0 0 34px rgba(215, 168, 93, 0.06);
  transition: background 900ms cubic-bezier(.2, .8, .2, 1);
}

.story-exp-progress-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(8, 19, 34, 0.98), rgba(3, 8, 19, 0.96));
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.035);
}

.story-exp-progress-orbit {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(215, 168, 93, 0.28);
  border-radius: 50%;
  opacity: 0.72;
}

.story-exp-progress-core {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
}

.story-exp-progress-core strong {
  font-size: clamp(2.4rem, 4.8vw, 3.25rem);
  line-height: 0.95;
}

.story-exp-progress-core span {
  color: var(--story-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-exp-progress-times {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.story-exp-progress-times div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.story-exp-progress-times span {
  color: var(--story-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-exp-progress-times strong {
  color: var(--story-soft);
  font-size: 0.85rem;
  text-align: right;
}

.story-exp-stats {
  display: grid;
  gap: 1px;
  overflow: hidden;
  padding: 0;
}

.story-exp-stats div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.025);
}

.story-exp-stats dt {
  color: var(--story-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.story-exp-stats dd {
  margin: 0;
  color: var(--story-text);
  font-weight: 800;
}

.story-exp-panel h2 {
  margin: 0 0 5px;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.story-exp-list,
.story-exp-feed {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 0;
  overflow: visible;
}

.story-exp-list li,
.story-exp-feed li,
.story-exp-insight {
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 7px;
  padding: 6px 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--story-soft);
  min-width: 0;
  overflow-wrap: anywhere;
}

.story-exp-list li {
  display: grid;
  grid-template-columns: 14px 1fr;
  align-items: start;
  gap: 6px;
}

.story-exp-list li span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--story-blue);
  box-shadow: 0 0 14px rgba(109, 181, 255, 0.5);
}

.story-exp-list li[data-discovery-type="asset"] span {
  border-radius: 3px;
  background: var(--story-gold);
}

.story-exp-list li[data-discovery-type="location"] span {
  background: var(--story-green);
}

.story-exp-list li[data-discovery-type="relationship"] span {
  background: var(--story-rose);
}

.story-exp-list li[data-discovery-type="knowledge"] span {
  background: #b6a2ff;
}

.story-exp-list p {
  margin: 0;
}

.story-exp-feed li {
  color: var(--story-muted);
}

.story-exp-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 186px;
  gap: 8px;
  min-height: 0;
}

.story-exp-stage-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
}

.story-exp-stage-copy h1 {
  grid-column: 1;
  margin: 0;
  overflow: hidden;
  font-size: clamp(1rem, 1.2vw, 1.34rem);
  line-height: 1.12;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-exp-scene-summary,
.story-exp-stage-copy p:last-child {
  grid-column: 1;
  margin: 0;
  color: var(--story-soft);
  font-size: clamp(0.78rem, 0.86vw, 0.92rem);
  line-height: 1.28;
  max-width: 100%;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.story-exp-visual {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(151, 185, 218, 0.045);
  border-radius: 24px;
  padding: 0;
  background:
    radial-gradient(circle at 20% 22%, rgba(109, 181, 255, 0.14), transparent 16rem),
    radial-gradient(circle at 58% 46%, rgba(109, 181, 255, 0.13), transparent 18rem),
    radial-gradient(circle at 78% 55%, rgba(215, 168, 93, 0.11), transparent 18rem),
    linear-gradient(180deg, rgba(11, 24, 43, 0.34), rgba(4, 10, 20, 0.18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 22px 72px rgba(0, 0, 0, 0.22);
}

.story-exp-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.28) 0 1px, transparent 1.6px),
    linear-gradient(122deg, transparent 0 34%, rgba(109, 181, 255, 0.08) 34.05% 34.18%, transparent 34.28%),
    linear-gradient(28deg, transparent 0 62%, rgba(215, 168, 93, 0.08) 62.05% 62.18%, transparent 62.28%);
  background-size: 112px 112px, auto, auto;
  opacity: 0.34;
  pointer-events: none;
}

.story-exp-connections {
  position: absolute;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.story-exp-connection {
  stroke: rgba(215, 168, 93, 0.48);
  stroke-linecap: round;
  stroke-width: 1.8;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  fill: none;
  filter: drop-shadow(0 0 5px rgba(215, 168, 93, 0.18));
  animation: drawLine 760ms cubic-bezier(.16, .84, .28, 1) forwards;
}

.story-exp-connection-group--presence .story-exp-connection,
.story-exp-connection-group--presence-soft .story-exp-connection {
  stroke: rgba(125, 193, 255, 0.52);
}

.story-exp-connection-group--presence-soft .story-exp-connection,
.story-exp-connection-group--knowledge .story-exp-connection,
.story-exp-connection-group--asset-link .story-exp-connection {
  stroke-dasharray: 0.16 0.12;
}

.story-exp-connection-group--support .story-exp-connection {
  stroke: rgba(121, 210, 166, 0.58);
}

.story-exp-connection-group--conflict .story-exp-connection {
  stroke: rgba(227, 140, 168, 0.7);
  stroke-dasharray: 0.2 0.12;
}

.story-exp-connection-group--uncertain .story-exp-connection {
  stroke: rgba(182, 162, 255, 0.48);
  stroke-dasharray: 0.12 0.11;
}

.story-exp-connection-group--knowledge .story-exp-connection {
  stroke: rgba(182, 162, 255, 0.44);
}

.story-exp-connection-label {
  display: -webkit-box;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  border: 1px solid rgba(151, 185, 218, 0.18);
  border-radius: 8px;
  padding: 4px 7px 5px;
  background: rgba(4, 10, 20, 0.86);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32), 0 0 14px rgba(4, 10, 20, 0.55);
  color: var(--story-soft);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  text-align: center;
  text-transform: lowercase;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.story-exp-connection-label-wrap {
  overflow: visible;
  pointer-events: none;
}

.story-exp-zone {
  position: absolute;
  inset: 0;
  z-index: 20;
  min-width: 0;
  min-height: 0;
  pointer-events: none;
}

.story-exp-zone-label {
  position: absolute;
  margin: 0;
  color: rgba(158, 177, 199, 0.54);
  font-size: 0.64rem;
  opacity: 0.56;
}

.story-exp-zone--characters .story-exp-zone-label {
  left: 24px;
  top: 22px;
}

.story-exp-zone--location .story-exp-zone-label {
  left: 55%;
  top: 22px;
}

.story-exp-zone--assets .story-exp-zone-label {
  right: 8%;
  top: 22px;
}

.story-exp-characters {
  position: relative;
  z-index: 120;
  width: 100%;
  height: 100%;
}

.story-character {
  position: absolute;
  display: block;
  width: var(--node-size, 150px);
  height: var(--node-size, 150px);
  transform: translate(var(--x, 0), var(--y, 0)) scale(var(--scale, 1));
  opacity: var(--opacity, 1);
  z-index: calc(var(--z, 3) + 120);
  pointer-events: auto;
  transition: transform 1050ms cubic-bezier(.16, .84, .28, 1), opacity 780ms ease;
}

.story-character.is-pov {
  z-index: 190;
}

.story-character.is-context .story-character__image {
  filter: saturate(0.82);
}

.story-character__image,
.story-location__image,
.story-asset__image {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(169, 205, 240, 0.36);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.32), 0 0 28px rgba(109, 181, 255, 0.08);
}

.story-character__image {
  width: var(--node-size, 150px);
  height: var(--node-size, 150px);
  border-radius: 50%;
}

.story-character__image img,
.story-location__image img,
.story-asset__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-character.is-pov .story-character__image {
  border-color: rgba(215, 168, 93, 0.82);
  box-shadow: 0 0 0 7px rgba(215, 168, 93, 0.1), 0 34px 78px rgba(215, 168, 93, 0.22), 0 0 36px rgba(215, 168, 93, 0.22);
}

.story-character__text {
  position: absolute;
  z-index: 180;
  top: calc(var(--node-size, 150px) + 8px);
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 1px;
  width: min(188px, calc(var(--node-size, 150px) + 58px));
  max-width: calc(100vw - 32px);
  margin-left: 0;
  border: 1px solid rgba(151, 185, 218, 0.16);
  border-radius: 9px;
  padding: 5px 7px 6px;
  background: rgba(4, 10, 20, 0.91);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(4, 10, 20, 0.22);
  backdrop-filter: blur(8px);
  text-align: center;
  transform: translateX(-50%);
}

.story-character[data-layout-role="context"] .story-character__text {
  width: min(132px, calc(var(--node-size, 150px) + 34px));
  left: 50%;
  top: calc(var(--node-size, 150px) + 7px);
}

.story-character__text strong {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  font-size: clamp(0.82rem, 0.9vw, 0.98rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.story-character__text span {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  color: var(--story-muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.story-character.is-context .story-character__text {
  padding: 4px 6px;
  opacity: 0.9;
}

.story-location {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: var(--node-size, 190px);
  transform: translate(var(--x, 0), var(--y, 0));
  z-index: 42;
  pointer-events: auto;
  transition: opacity 560ms ease, transform 850ms cubic-bezier(.16, .84, .28, 1);
}

.story-location.is-changing {
  opacity: 0.35;
  transform: translate(var(--x, 0), var(--y, 0)) scale(0.98);
}

.story-location__image {
  width: var(--node-size, 190px);
  height: var(--node-size, 190px);
  border-radius: 50%;
  border-color: rgba(125, 193, 255, 0.82);
  box-shadow: 0 0 0 7px rgba(109, 181, 255, 0.1), 0 30px 82px rgba(0, 0, 0, 0.38), 0 0 58px rgba(109, 181, 255, 0.22);
}

.story-location h2,
.story-location p {
  margin: 0;
}

.story-location__text {
  position: relative;
  z-index: 80;
  display: grid;
  justify-items: center;
  gap: 3px;
  max-width: min(244px, calc(100vw - 32px));
  border: 1px solid rgba(125, 193, 255, 0.12);
  border-radius: 12px;
  padding: 7px 10px;
  background: rgba(4, 10, 20, 0.62);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(9px);
}

.story-location h2 {
  overflow: hidden;
  max-width: 100%;
  font-size: clamp(1.12rem, 1.55vw, 1.55rem);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-location p {
  overflow: hidden;
  max-width: 100%;
  color: var(--story-muted);
  font-size: 0.78rem;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-exp-assets {
  position: relative;
  width: 100%;
  height: 100%;
}

.story-asset {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: max(var(--node-size, 78px), 104px);
  opacity: var(--opacity, 1);
  transform: translate(var(--x, 0), var(--y, 0)) scale(var(--scale, 1));
  z-index: calc(var(--z, 3) + 30);
  pointer-events: auto;
  transition: transform 860ms cubic-bezier(.16, .84, .28, 1), opacity 620ms ease;
}

.story-asset__image {
  width: var(--node-size, 78px);
  height: var(--node-size, 78px);
  border-radius: 50%;
  border-color: rgba(215, 168, 93, 0.68);
  box-shadow: 0 0 0 4px rgba(215, 168, 93, 0.08), 0 18px 38px rgba(0, 0, 0, 0.28), 0 0 24px rgba(215, 168, 93, 0.13);
}

.story-asset__text {
  position: relative;
  z-index: 80;
  display: grid;
  justify-items: center;
  gap: 2px;
  width: min(140px, calc(var(--node-size, 78px) + 52px));
  border: 1px solid rgba(215, 168, 93, 0.11);
  border-radius: 10px;
  padding: 4px 7px 5px;
  background: rgba(4, 10, 20, 0.6);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  text-align: center;
}

.story-asset strong,
.story-asset span {
  display: block;
  overflow: hidden;
  max-width: 100%;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-asset strong {
  font-size: 0.78rem;
}

.story-asset span {
  color: var(--story-muted);
  font-size: 0.64rem;
}

.story-exp-ribbon-wrap {
  display: grid;
  grid-template-rows: auto minmax(104px, auto) 56px;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(151, 185, 218, 0.1);
  border-radius: 24px;
  padding: 14px 16px 16px;
  background: rgba(6, 16, 30, 0.54);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.story-exp-replay-browser {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.story-exp-replay-browser button,
.story-exp-replay-browser select,
.story-exp-controls select {
  border: 1px solid rgba(151, 185, 218, 0.18);
  border-radius: 999px;
  background: rgba(4, 12, 24, 0.84);
  color: var(--story-soft);
}

.story-exp-replay-browser button {
  padding: 7px 12px;
  font-size: 0.74rem;
  font-weight: 800;
}

.story-exp-replay-browser label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--story-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-exp-replay-browser select {
  max-width: min(300px, 36vw);
  padding: 7px 24px 7px 10px;
  font-size: 0.76rem;
}

.story-exp-ribbon {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  min-height: 104px;
  overflow: hidden;
}

.story-scene-card {
  flex: 0 0 clamp(174px, 16vw, 218px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  min-height: 94px;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.032);
  color: var(--story-muted);
  opacity: 0.68;
  transform: scale(0.96) translateY(3px);
  transition: transform 840ms cubic-bezier(.16, .84, .28, 1), opacity 760ms ease, background 760ms ease, border-color 760ms ease, box-shadow 760ms ease;
}

.story-scene-card.is-complete {
  opacity: 0.82;
}

.story-scene-card.is-current {
  flex-basis: clamp(224px, 20vw, 280px);
  min-height: 106px;
  border-color: rgba(215, 168, 93, 0.64);
  background: linear-gradient(180deg, rgba(215, 168, 93, 0.18), rgba(109, 181, 255, 0.075));
  color: var(--story-text);
  opacity: 1;
  transform: scale(1.02) translateY(0);
  box-shadow: 0 18px 42px rgba(215, 168, 93, 0.16);
}

.story-scene-card strong {
  display: -webkit-box;
  overflow: hidden;
  color: inherit;
  font-size: 0.92rem;
  line-height: 1.16;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.story-scene-card span {
  color: var(--story-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.story-scene-card small {
  display: block;
  overflow: hidden;
  color: var(--story-muted);
  font-size: 0.7rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-exp-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--timeline-count, 1), minmax(0, 1fr));
  gap: 0;
  min-height: 56px;
}

.story-exp-timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 17px;
  height: 2px;
  background: linear-gradient(90deg, rgba(109, 181, 255, 0.24), rgba(215, 168, 93, 0.78));
  box-shadow: 0 0 18px rgba(109, 181, 255, 0.16);
}

.story-timeline-marker {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--story-muted);
  font-size: 0.66rem;
  font-weight: 700;
  text-align: center;
  transition: opacity 560ms ease, transform 720ms cubic-bezier(.16, .84, .28, 1);
}

.story-timeline-marker span {
  display: block;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-timeline-marker.is-label-hidden span {
  opacity: 0;
}

.story-timeline-marker::before {
  content: "";
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 10px;
  border: 2px solid rgba(215, 168, 93, 0.8);
  border-radius: 50%;
  background: var(--story-bg);
}

.story-timeline-marker.is-current::before {
  width: 22px;
  height: 22px;
  margin-top: 6px;
  background: var(--story-gold);
  box-shadow: 0 0 0 7px rgba(215, 168, 93, 0.12), 0 0 24px rgba(215, 168, 93, 0.55);
}

.story-exp-insight-list {
  display: grid;
  gap: 5px;
  min-height: 0;
  overflow: visible;
}

.story-exp-insight {
  display: grid;
  gap: 1px;
  border-color: rgba(255, 255, 255, 0.055);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.018));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.16);
  transition: opacity 560ms ease, transform 700ms cubic-bezier(.16, .84, .28, 1);
  min-width: 0;
  overflow-wrap: anywhere;
}

.story-exp-panel--compact .story-exp-insight {
  padding: 6px 7px;
}

.story-exp-insight p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.16;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.story-exp-panel--compact .story-exp-insight p {
  -webkit-line-clamp: 2;
}

.story-exp-list li,
.story-exp-feed li {
  transition: opacity 520ms ease, transform 640ms cubic-bezier(.16, .84, .28, 1);
}

.story-exp-insight strong {
  color: var(--story-text);
  font-size: 0.76rem;
  line-height: 1.12;
}

.story-exp-insight span {
  display: none;
  color: var(--story-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-exp-controls {
  position: fixed;
  right: 24px;
  bottom: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 9px 10px 9px 14px;
  background: rgba(4, 10, 20, 0.82);
  box-shadow: var(--story-shadow);
  backdrop-filter: blur(16px);
}

.story-exp-controls div {
  display: grid;
  padding-right: 6px;
}

.story-exp-controls small {
  color: var(--story-muted);
  font-size: 0.72rem;
}

.story-exp-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--story-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-exp-controls select {
  padding: 5px 20px 5px 9px;
  font-size: 0.76rem;
}

.story-exp-detail {
  position: fixed;
  right: 24px;
  top: 96px;
  z-index: 12;
  width: min(360px, calc(100vw - 48px));
  border: 1px solid rgba(151, 185, 218, 0.16);
  border-radius: 16px;
  padding: 16px;
  background: rgba(4, 10, 20, 0.9);
  box-shadow: var(--story-shadow);
  color: var(--story-soft);
  backdrop-filter: blur(16px);
}

.story-exp-detail button {
  float: right;
  border: 1px solid rgba(151, 185, 218, 0.16);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--story-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.story-exp-detail span {
  display: block;
  margin-bottom: 9px;
  color: var(--story-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-exp-detail h2 {
  margin: 0 0 8px;
  color: var(--story-text);
  font-size: 1.08rem;
}

.story-exp-detail p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.story-exp-diagnostics {
  position: fixed;
  left: 24px;
  bottom: 18px;
  z-index: 11;
  width: min(420px, calc(100vw - 48px));
  border: 1px solid rgba(151, 185, 218, 0.16);
  border-radius: 16px;
  background: rgba(4, 10, 20, 0.84);
  box-shadow: var(--story-shadow);
  color: var(--story-soft);
  backdrop-filter: blur(16px);
}

.story-exp-diagnostics summary {
  cursor: pointer;
  padding: 10px 13px;
  color: var(--story-text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-exp-diagnostics dl {
  display: grid;
  gap: 1px;
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 0 10px 10px;
}

.story-exp-diagnostics div {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 0;
}

.story-exp-diagnostics dt {
  color: var(--story-muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.story-exp-diagnostics dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--story-soft);
  font-size: 0.72rem;
}

.is-entering {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
}

.story-character.is-entering,
.story-asset.is-entering {
  opacity: 0;
  transform: translate(var(--x, 0), var(--y, 0)) scale(0.82);
}

.story-location.is-entering {
  opacity: 0;
  transform: translate(var(--x, 0), var(--y, 0)) scale(0.94);
}

.story-exp-connection-group.is-entering .story-exp-connection {
  stroke-dashoffset: 1;
}

.is-removing {
  opacity: 0 !important;
  transform: translateY(12px) scale(0.96) !important;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .story-exp {
    height: auto;
    min-height: 100vh;
  }

  .story-exp-shell,
  .story-exp-stage-copy,
  .story-exp-visual {
    grid-template-columns: 1fr;
  }

  .story-exp-header {
    grid-template-columns: 1fr auto;
  }

  .story-exp-context {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: start;
  }

  .story-exp-shell {
    padding-bottom: 110px;
  }

  .story-exp-stage {
    grid-template-rows: auto auto auto;
  }

  .story-exp-visual {
    min-height: 760px;
  }

  .story-exp-stage-copy p:last-child {
    grid-column: 1;
  }

  .story-exp-context {
    justify-content: start;
    flex-wrap: wrap;
  }

  .story-exp-controls {
    left: 14px;
    right: 14px;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 22px;
  }
}

@media (max-width: 760px) {
  .story-exp-header,
  .story-exp-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .story-exp-ribbon {
    justify-content: start;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .story-exp-connection {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}
