:root {
  --bg-deep: #07131a;
  --bg-mid: #0f2d3a;
  --bg-soft: #1e4a53;
  --card: rgba(8, 20, 30, 0.72);
  --card-border: rgba(170, 220, 228, 0.24);
  --text: #ecf8f7;
  --muted: #b8d0d8;
  --good: #59df9a;
  --warn: #ffd36e;
  --bad: #ff7f73;
  --accent: #71d4e8;
  --accent-2: #f6d479;
  --theme-h: 184;
  --theme-s: 78%;
  --theme-l: 66%;
  --motion-ambient: 5400ms;
  --motion-ui: 360ms;
  --motion-impact: 1200ms;
  --scene-pan-dur: 840ms;
  --scene-pan-shift-bg: 34px;
  --scene-pan-shift-mid: 22px;
  --scene-pan-shift-fg: 14px;
  --scene-transition-dur: 620ms;
  --scene-transition-ease: cubic-bezier(0.24, 0.82, 0.22, 1);
  --scene-vignette-strength: 0.2;
  --scene-floor-shadow: rgba(6, 14, 21, 0.44);
  --scene-shell-shadow: 0 26px 54px rgba(1, 7, 12, 0.42);
  --scene-inner-glow: rgba(194, 234, 243, 0.18);
  --scene-frame-line: rgba(223, 246, 251, 0.12);
  --scene-ui-separation: rgba(6, 15, 21, 0.28);
  --story-enter-dur: 420ms;
  --story-ease: cubic-bezier(0.22, 0.82, 0.24, 1);
  --story-ease-soft: cubic-bezier(0.2, 0.7, 0.25, 1);
  --story-focus-accent: 117, 214, 233;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Trebuchet MS", "Gill Sans", "Avenir Next", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 14% 8%, #1f4f63 0%, transparent 42%),
    radial-gradient(circle at 86% 4%, #315b4e 0%, transparent 35%),
    linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-mid) 55%, #0d1d27 100%);
}

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.58;
}

.aurora {
  position: fixed;
  inset: -20% -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 24%, rgba(113, 212, 232, 0.2), transparent 35%),
    radial-gradient(circle at 78% 18%, rgba(246, 212, 121, 0.14), transparent 30%),
    radial-gradient(circle at 45% 84%, rgba(89, 223, 154, 0.12), transparent 33%);
  filter: blur(24px);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(2.5%) scale(1.04);
  }
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, 95vw);
  margin: 24px auto 34px;
}

.hero {
  margin-bottom: 14px;
  animation: rise 420ms ease;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  margin: 7px 0;
  font-family: "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  font-size: clamp(2rem, 6vw, 3.8rem);
  line-height: 1.04;
}

.subtitle {
  margin: 0;
  max-width: 680px;
  color: #c2d5db;
  font-size: 0.95rem;
  line-height: 1.4;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  margin-bottom: 14px;
  animation: rise 420ms ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none;
}

h2,
h3,
h4,
p {
  margin-top: 0;
}

.section-title {
  margin-top: 14px;
  margin-bottom: 8px;
  font-size: 1.03rem;
  color: var(--accent);
}

.section-tight {
  margin-top: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
}

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

.avatar-option {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  border-radius: 14px;
  padding: 11px;
  min-height: 146px;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.avatar-option:hover {
  transform: translateY(-2px);
}

.avatar-option.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(113, 212, 232, 0.18), rgba(246, 212, 121, 0.08));
}

.avatar-name {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

.avatar-meta {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.83rem;
  margin-bottom: 6px;
}

.avatar-story {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  margin-top: 14px;
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  color: #10272d;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hud {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.hud-item {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(148deg, rgba(17, 36, 48, 0.9), rgba(8, 20, 30, 0.82)),
    radial-gradient(circle at 94% 8%, rgba(168, 218, 231, 0.2), transparent 42%);
  border: 1px solid rgba(170, 218, 230, 0.24);
  border-radius: 14px;
  padding: 9px 11px 10px 44px;
  min-height: 60px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 20px rgba(2, 8, 13, 0.24);
}

.hud-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(170, 218, 230, 0.38);
  z-index: 0;
}

.hud-item::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 12px;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.12), transparent 28%);
  opacity: 0.44;
  pointer-events: none;
  z-index: 0;
}

.hud-glyph {
  position: absolute;
  left: 11px;
  top: 10px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  z-index: 1;
}

.hud-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #dff3f8;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hud-label {
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #a9c8d2;
  position: relative;
  z-index: 1;
}

.hud-value {
  margin: 3px 0 0;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ecf8fb;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 10px rgba(8, 20, 28, 0.38);
}

.hud-item.hud-pollution .hud-glyph {
  border-color: rgba(255, 216, 138, 0.36);
}

.hud-item.hud-budget .hud-glyph {
  border-color: rgba(143, 214, 255, 0.36);
}

.hud-item.hud-trust .hud-glyph {
  border-color: rgba(158, 240, 178, 0.36);
}

.hud-item.hud-pollution .hud-icon {
  stroke: #ffd88a;
}

.hud-item.hud-budget .hud-icon {
  stroke: #8fd6ff;
}

.hud-item.hud-trust .hud-icon {
  stroke: #9ef0b2;
}

.hud-item.hud-step .hud-value {
  color: #f4e3ac;
}

.hud-item.hud-persona .hud-value {
  font-size: 0.88rem;
}

.hud-item.hud-pollution .hud-value {
  color: #ffd88a;
}

.hud-item.hud-budget .hud-value {
  color: #9ed7ff;
}

.hud-item.hud-trust .hud-value {
  color: #9ef0b2;
}

.hud-item.hud-pollution[data-level="critical"] {
  border-color: rgba(255, 123, 109, 0.54);
}

.hud-item.hud-pollution[data-level="critical"]::before {
  background: rgba(255, 123, 109, 0.82);
}

.hud-item.hud-pollution[data-level="high"]::before {
  background: rgba(255, 183, 118, 0.74);
}

.hud-item.hud-budget[data-level="strong"]::before,
.hud-item.hud-budget[data-level="stable"]::before {
  background: rgba(128, 209, 255, 0.8);
}

.hud-item.hud-budget[data-level="strained"]::before,
.hud-item.hud-budget[data-level="fragile"]::before {
  background: rgba(255, 177, 120, 0.72);
}

.hud-item.hud-trust[data-level="strong"]::before {
  background: rgba(122, 228, 154, 0.86);
}

.hud-item.hud-trust[data-level="unstable"]::before {
  background: rgba(152, 214, 129, 0.8);
}

.hud-item.hud-trust[data-level="fragile"]::before,
.hud-item.hud-trust[data-level="rupture"]::before {
  background: rgba(255, 142, 126, 0.78);
}

.scenario-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(280px, 0.72fr);
  gap: 14px;
  align-items: start;
}

.scene-card {
  position: relative;
  isolation: isolate;
  border: 1px solid hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.38);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(
      180deg,
      hsla(var(--theme-h), var(--theme-s), calc(var(--theme-l) - 14%), 0.18),
      rgba(4, 11, 18, 0.48)
    ),
    linear-gradient(180deg, rgba(4, 11, 18, 0.18), rgba(4, 11, 18, 0.44)),
    rgba(4, 11, 18, 0.36);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 18px 30px rgba(191, 234, 242, 0.05),
    var(--scene-shell-shadow);
}

.scene-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(201, 234, 242, 0.08), rgba(0, 0, 0, 0)),
    radial-gradient(circle at 18% 10%, rgba(255, 245, 220, 0.08), transparent 26%);
}

.scene-card::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 12px;
  border: 1px solid var(--scene-frame-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

.scene-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 11px;
  font-size: 0.82rem;
  color: #d3e7ed;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(4, 12, 18, 0.68), rgba(6, 16, 24, 0.84)),
    radial-gradient(circle at 80% 0%, hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.12), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.scene-modern .scene-backdrop-layer {
  filter:
    saturate(1.1)
    contrast(1.08)
    brightness(1.04)
    drop-shadow(0 18px 26px rgba(4, 10, 14, 0.14));
}

.scene-modern .scene-illustration-layer {
  filter:
    drop-shadow(0 10px 12px rgba(5, 15, 22, 0.22))
    drop-shadow(0 22px 30px rgba(5, 15, 22, 0.16));
}

.scene-modern .scene-foreground-layer {
  filter:
    saturate(1.04)
    contrast(1.06)
    drop-shadow(0 14px 18px rgba(0, 0, 0, 0.28))
    drop-shadow(0 28px 34px rgba(0, 0, 0, 0.18));
}

.scene-character-link {
  filter:
    drop-shadow(0 3px 8px rgba(4, 12, 18, 0.3))
    drop-shadow(0 10px 14px rgba(4, 12, 18, 0.14));
}

.townscape .town-house {
  filter:
    drop-shadow(0 2px 5px rgba(6, 14, 20, 0.2))
    drop-shadow(0 8px 12px rgba(6, 14, 20, 0.08));
}

.scene-enter {
  animation: sceneFadeIn 720ms cubic-bezier(0.2, 0.8, 0.22, 1);
}

.scene-enter .layer-bg,
.scene-enter .layer-mid,
.scene-enter .layer-fg {
  transform-box: fill-box;
  transform-origin: center center;
  animation: none;
}

.scene-theme-wash {
  transform-box: fill-box;
  transform-origin: center center;
  will-change: transform, opacity;
  animation: themeShiftIn 860ms ease-out;
  mix-blend-mode: screen;
}

.scene-svg.scene-theme-energy .layer-bg {
  filter: saturate(1.12) brightness(1.01) contrast(1.04);
}

.scene-svg.scene-theme-water .layer-bg {
  filter: saturate(1.14) brightness(1.03);
}

.scene-svg.scene-theme-paper .layer-bg {
  filter: saturate(0.94) brightness(1.05) contrast(1.01);
}

.scene-svg.scene-theme-mobility .layer-bg {
  filter: saturate(1.04) contrast(1.05);
}

.scene-svg.scene-theme-logistics .layer-bg {
  filter: saturate(0.98) contrast(1.06);
}

.scene-svg.scene-theme-civic .layer-bg {
  filter: saturate(1.08) brightness(1.02);
}

.scene-svg .layer-fg:last-of-type {
  filter: saturate(1.05) contrast(1.06) brightness(1.02);
}

.scene-svg .layer-fg:last-of-type .character-shadow {
  opacity: 0.4;
  filter: blur(0.5px);
}

.scene-svg.scene-theme-energy .layer-fg:last-of-type {
  filter: saturate(1.07) contrast(1.06);
}

.scene-svg.scene-theme-water .layer-fg:last-of-type {
  filter: saturate(1.08) brightness(1.03);
}

.scene-svg.scene-theme-paper .layer-fg:last-of-type {
  filter: saturate(0.98) contrast(1.02);
}

.scene-svg.scene-theme-mobility .layer-fg:last-of-type {
  filter: saturate(1.04) contrast(1.05);
}

.scene-svg.scene-theme-logistics .layer-fg:last-of-type {
  filter: saturate(1.06) contrast(1.05);
}

.scene-svg.scene-theme-civic .layer-fg:last-of-type {
  filter: saturate(1.1) brightness(1.02);
}

.theme-scene-electric {
  filter: drop-shadow(0 0 10px rgba(246, 212, 121, 0.24));
}

.theme-scene-water {
  filter: saturate(1.06) brightness(1.03);
}

.theme-scene-paper {
  filter: saturate(0.94) contrast(1.03);
}

.theme-scene-mobility {
  filter: saturate(1.02) contrast(1.04);
}

.theme-scene-logistics {
  filter: saturate(1.04) contrast(1.03);
}

.theme-scene-civic {
  filter: saturate(1.08) brightness(1.02);
}

.detail-electric-plant .plant-smoke {
  animation: smokeDrift 7.8s ease-in-out infinite;
}

.detail-electric-plant .theme-electric-grid {
  stroke-dasharray: 13 10;
}

.detail-electric-plant .plant-rotor {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotorSpin 5.2s linear infinite;
}

.detail-water-station .water-pipes path {
  animation: pipePulse 4.6s ease-in-out infinite;
}

.detail-water-station .water-wave {
  animation: laneFlow 7.2s linear infinite;
}

.detail-paper-archive .paper-stacks rect {
  animation: archiveGlow 5.4s ease-in-out infinite;
}

.detail-paper-archive .paper-stacks rect:nth-child(2) {
  animation-delay: -0.9s;
}

.detail-paper-archive .paper-stacks rect:nth-child(3) {
  animation-delay: -1.5s;
}

.detail-paper-archive .paper-output {
  animation: paperFeed 5.6s ease-in-out infinite;
}

.detail-mobility-hub .traffic-flow {
  stroke-width: 2.1;
}

.detail-mobility-hub .tram-glow {
  animation: tramGlow 3.4s ease-in-out infinite;
}

.detail-logistics-hub .theme-prop-slide {
  animation-duration: 5.2s;
}

.detail-logistics-hub .crane-arm {
  transform-box: fill-box;
  transform-origin: left center;
  animation: craneSweep 7s ease-in-out infinite alternate;
}

.detail-civic-square .theme-crowd-bob {
  animation-duration: 4.2s;
}

.detail-civic-square .civic-flag {
  transform-box: fill-box;
  transform-origin: left center;
  animation: flagWave 3.8s ease-in-out infinite;
}

.theme-electric-grid {
  animation: electricGridFlow 7.2s linear infinite;
  stroke-dasharray: 10 8;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.theme-electric-core {
  animation: electricCorePulse 4.2s ease-in-out infinite;
}

.theme-water-drop {
  transform-origin: center;
  animation: waterDropFall 5.4s ease-in infinite;
}

.theme-water-ripple {
  transform-origin: center;
  animation: waterRippleExpand 5.4s ease-out infinite;
}

.theme-paper-fly {
  transform-origin: center;
  animation: paperFlyDrift 8.4s ease-in-out infinite;
}

.theme-bus-move {
  animation: busMove 7.8s ease-in-out infinite alternate;
}

.theme-van-roll {
  animation: vanMove 8.4s ease-in-out infinite alternate;
}

.theme-crowd-bob {
  animation: crowdBob 5.2s ease-in-out infinite;
}

.character-root {
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
  transform-box: fill-box;
  transform-origin: center bottom;
  opacity: 0.99;
}

.character-root.character-walk .character-leg-left {
  transform-origin: center 46px;
  animation: legStepLeft 1s ease-in-out infinite;
}

.character-root.character-walk .character-leg-right {
  transform-origin: center 46px;
  animation: legStepRight 1s ease-in-out infinite;
}

.character-root.character-repair .character-arm-right {
  transform-origin: 24px 18px;
  animation: armRepair 1.1s ease-in-out infinite;
}

.character-root.character-carry .character-arm-left {
  transform-origin: -22px 14px;
  animation: armCarry 1.2s ease-in-out infinite;
}

.character-root.character-speak .character-arm-right {
  transform-origin: 26px 18px;
  animation: armSpeak 1.4s ease-in-out infinite;
}

.sun-breathe {
  animation: sunBreathe calc(var(--motion-ambient) * 0.9) ease-in-out infinite;
}

.sky-cloud-drift {
  animation: cloudDrift calc(var(--motion-ambient) * 1.1) ease-in-out infinite alternate;
}

.city-glow {
  animation: cityGlow calc(var(--motion-ambient) * 0.85) ease-in-out infinite;
}

.window-twinkle {
  animation: windowTwinkle calc(var(--motion-ambient) * 0.85) ease-in-out infinite;
}

.theme-scene-electric .theme-electric-grid:nth-of-type(2) {
  animation-delay: -1.4s;
}

.theme-scene-water .theme-water-drop {
  animation-delay: -0.45s;
}

.theme-scene-water .theme-water-ripple {
  animation-delay: -0.9s;
}

.theme-scene-paper .theme-paper-fly:nth-of-type(2) {
  animation-delay: -1.8s;
}

.city-building:nth-child(odd) .window-twinkle {
  animation-delay: -1.6s;
}

.city-building:nth-child(3n) .window-twinkle {
  animation-delay: -2.7s;
}

.traffic-flow {
  animation: laneFlow 6.8s linear infinite;
}

.water-flow {
  animation: laneFlow 7.4s linear infinite reverse;
}

.theme-prop-pulse {
  animation: propPulse calc(var(--motion-ambient) * 0.92) ease-in-out infinite;
}

.theme-prop-bob {
  animation: propBob calc(var(--motion-ambient) * 1.08) ease-in-out infinite;
}

.theme-prop-slide {
  animation: propSlide calc(var(--motion-ambient) * 1.12) ease-in-out infinite alternate;
}

.character-bob {
  animation: characterBob calc(var(--motion-ambient) * 0.74) ease-in-out infinite;
}

.character-breath {
  transform-origin: center 108px;
  animation: characterBreath calc(var(--motion-ambient) * 0.7) ease-in-out infinite;
}

.character-shadow {
  animation: shadowPulse calc(var(--motion-ambient) * 0.7) ease-in-out infinite;
}

.float-slow {
  animation: floatSlow var(--motion-ambient) ease-in-out infinite;
}

.float-fast {
  animation: floatFast calc(var(--motion-ambient) * 0.58) ease-in-out infinite;
}

.pulse-soft {
  animation: pulseSoft calc(var(--motion-ambient) * 0.5) ease-in-out infinite;
}

@keyframes floatSlow {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes floatFast {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pulseSoft {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes sceneFadeIn {
  0% {
    opacity: 0;
    transform: translateX(-10px) scale(1.008);
    filter: saturate(0.96) blur(0.5px);
  }
  62% {
    transform: translateX(-1px) scale(1.002);
    filter: saturate(1.01) blur(0.12px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: saturate(1) blur(0);
  }
}

@keyframes sceneFrameFadeOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: saturate(1) blur(0);
  }
  100% {
    opacity: 0;
    transform: translateX(0) scale(0.995);
    filter: saturate(0.92) blur(0.42px) brightness(0.92);
  }
}

@keyframes sceneFrameFadeIn {
  0% {
    opacity: 0.32;
    transform: translateX(0) scale(1.01);
    filter: saturate(0.94) blur(0.56px) brightness(1.04);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: saturate(1) blur(0) brightness(1);
  }
}

@keyframes themeShiftIn {
  0% {
    opacity: 0.28;
    transform: translateX(-12px);
  }
  58% {
    opacity: 0.14;
    transform: translateX(2px);
  }
  100% {
    opacity: 0.1;
    transform: translateX(0);
  }
}

@keyframes scenePanBg {
  0% {
    transform: translateX(calc(var(--scene-pan-shift-bg) * -1));
  }
  70% {
    transform: translateX(-2px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes scenePanMid {
  0% {
    transform: translateX(calc(var(--scene-pan-shift-mid) * -1));
  }
  72% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes scenePanFg {
  0% {
    transform: translateX(calc(var(--scene-pan-shift-fg) * -1));
  }
  75% {
    transform: translateX(-0.5px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes sceneBgSlideOutRight {
  0% {
    transform: translateX(0);
    filter: saturate(1) brightness(1);
  }
  100% {
    transform: translateX(16%);
    filter: saturate(0.9) brightness(0.88);
  }
}

@keyframes sceneBgSlideInFromLeft {
  0% {
    transform: translateX(-16%);
    filter: saturate(0.92) brightness(1.08);
  }
  100% {
    transform: translateX(0);
    filter: saturate(1) brightness(1);
  }
}

@keyframes sceneIllustrationOut {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(9%) scale(0.986);
    opacity: 0.18;
  }
}

@keyframes sceneIllustrationIn {
  0% {
    transform: translateX(-8%) scale(1.018);
    opacity: 0.2;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes sceneForegroundOut {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(4.5%);
    opacity: 0.34;
  }
}

@keyframes sceneForegroundIn {
  0% {
    transform: translateX(-3.5%);
    opacity: 0.3;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes electricGridFlow {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -30;
  }
}

@keyframes electricCorePulse {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.08);
  }
}

@keyframes waterDropFall {
  0% {
    transform: translateY(-16px) scale(0.94);
    opacity: 0;
  }
  30% {
    opacity: 0.92;
  }
  100% {
    transform: translateY(10px) scale(1.02);
    opacity: 0;
  }
}

@keyframes waterRippleExpand {
  0% {
    transform: scale(0.72);
    opacity: 0.44;
  }
  100% {
    transform: scale(1.16);
    opacity: 0;
  }
}

@keyframes paperFlyDrift {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.84;
  }
  50% {
    transform: translateY(-5px) rotate(-8deg);
    opacity: 0.72;
  }
}

@keyframes busMove {
  from {
    transform: translateX(-4px);
  }
  to {
    transform: translateX(5px);
  }
}

@keyframes vanMove {
  from {
    transform: translateX(-3px);
  }
  to {
    transform: translateX(4px);
  }
}

@keyframes crowdBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.4px);
  }
}

@keyframes smokeDrift {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0.38;
  }
  50% {
    transform: translateY(-4px) translateX(1px);
    opacity: 0.48;
  }
  100% {
    transform: translateY(-8px) translateX(4px);
    opacity: 0.22;
  }
}

@keyframes pipePulse {
  0%,
  100% {
    opacity: 0.64;
    filter: saturate(0.96);
  }
  50% {
    opacity: 1;
    filter: saturate(1.18);
  }
}

@keyframes archiveGlow {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@keyframes rotorSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes paperFeed {
  0% {
    transform: translateY(0);
    opacity: 0.64;
  }
  50% {
    transform: translateY(-2px);
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    opacity: 0.74;
  }
}

@keyframes tramGlow {
  0%,
  100% {
    opacity: 0.24;
  }
  50% {
    opacity: 0.72;
  }
}

@keyframes craneSweep {
  from {
    transform: rotate(-2deg);
  }
  to {
    transform: rotate(4deg);
  }
}

@keyframes flagWave {
  0%,
  100% {
    transform: skewX(0deg) translateX(0);
  }
  50% {
    transform: skewX(-5deg) translateX(1px);
  }
}

@keyframes legStepLeft {
  0%,
  100% {
    transform: rotate(-7deg);
  }
  50% {
    transform: rotate(9deg);
  }
}

@keyframes legStepRight {
  0%,
  100% {
    transform: rotate(9deg);
  }
  50% {
    transform: rotate(-7deg);
  }
}

@keyframes armRepair {
  0%,
  100% {
    transform: rotate(4deg);
  }
  50% {
    transform: rotate(-14deg);
  }
}

@keyframes armCarry {
  0%,
  100% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(4deg);
  }
}

@keyframes armSpeak {
  0%,
  100% {
    transform: rotate(4deg);
  }
  50% {
    transform: rotate(-10deg);
  }
}

@keyframes sunBreathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.86;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.96;
  }
}

@keyframes cloudDrift {
  0% {
    transform: translateX(-4px) translateY(0);
  }
  100% {
    transform: translateX(7px) translateY(-3px);
  }
}

@keyframes cityGlow {
  0%,
  100% {
    opacity: 0.64;
  }
  50% {
    opacity: 0.88;
  }
}

@keyframes windowTwinkle {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 0.84;
  }
}

@keyframes laneFlow {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -64;
  }
}

@keyframes propPulse {
  0%,
  100% {
    transform: scale(0.98);
    opacity: 0.88;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

@keyframes propBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes propSlide {
  from {
    transform: translateX(-3px);
  }
  to {
    transform: translateX(3px);
  }
}

@keyframes characterBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes characterBreath {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.03);
  }
}

@keyframes shadowPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.22;
    transform: scale(1.06);
  }
}

.scenario-content {
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.question-spotlight {
  margin: 0;
  padding: 10px 11px 11px;
  border-radius: 14px;
  border: 1px solid hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.52);
  background:
    linear-gradient(145deg, rgba(13, 34, 46, 0.96), rgba(8, 20, 31, 0.9)),
    radial-gradient(circle at 90% 10%, hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.28), transparent 46%);
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.24),
    0 0 0 8px var(--scene-ui-separation);
  position: relative;
  overflow: hidden;
}

.question-spotlight::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.95);
}

.question-kicker-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.question-kicker {
  margin: 0;
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #e5f5fb;
  border: 1px solid rgba(189, 219, 229, 0.34);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(17, 44, 58, 0.56);
}

.question-theme {
  margin: 0;
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: hsla(var(--theme-h), var(--theme-s), calc(var(--theme-l) + 8%), 0.95);
}

.question-title {
  margin: 7px 0 4px;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.24;
  color: #f4fcff;
}

.question-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.38;
  color: #d7e9f0;
}

.decision-timer-wrap {
  margin: 6px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 7px 9px;
  background: rgba(0, 0, 0, 0.22);
}

.decision-timer-wrap.pressure-mode {
  border-color: rgba(255, 127, 115, 0.5);
  background: rgba(43, 12, 12, 0.26);
}

.decision-timer-wrap.calm-mode {
  border-color: rgba(113, 212, 232, 0.36);
  background: rgba(8, 26, 34, 0.26);
}

.decision-timer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 6px;
  color: #d6e9ee;
}

#decision-timer-text {
  font-weight: 800;
  color: var(--accent-2);
  transition: color 120ms ease, transform 120ms ease;
}

#decision-timer-text.urgent {
  color: var(--bad);
  transform: scale(1.08);
}

.decision-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.decision-fill {
  --danger: 0;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 70ms linear, filter 120ms ease, opacity 120ms ease;
  background: linear-gradient(90deg, #78e7a2 0%, #f7d57f 60%, #ff8f83 100%);
  filter: saturate(calc(1 + var(--danger))) brightness(calc(1 + var(--danger) * 0.2));
  box-shadow: 0 0 calc(4px + var(--danger) * 12px) rgba(255, 128, 114, 0.56);
}

.decision-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.decision-timer-wrap.pressure-mode.is-critical {
  animation: timerShake 150ms ease-in-out infinite alternate;
}

@keyframes timerShake {
  from {
    transform: translateX(-1px);
  }
  to {
    transform: translateX(1px);
  }
}

.scene-alerts-mini {
  display: grid;
  gap: 6px;
  margin: 4px 0 6px;
}

.scene-alert-mini {
  border: 1px solid rgba(255, 212, 131, 0.34);
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 0.8rem;
  color: #fbe7c0;
  background: rgba(48, 32, 15, 0.46);
  line-height: 1.35;
}

.progress-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 9px;
}

.dot {
  width: 14px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.dot.done {
  background: rgba(89, 223, 154, 0.86);
}

.dot.current {
  width: 20px;
  background: rgba(246, 212, 121, 0.94);
}

.story-compact {
  margin: 6px 0 8px;
  border: 1px solid rgba(162, 212, 224, 0.24);
  border-radius: 12px;
  padding: 7px;
  background: rgba(10, 28, 36, 0.46);
}

.story-compact.empty {
  color: #bdd5dd;
  font-size: 0.76rem;
  border-style: dashed;
}

.story-compact-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.story-compact-title {
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #d6ebf2;
}

.story-compact-count {
  font-size: 0.66rem;
  color: #bfd7df;
}

.story-compact-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(162, 212, 224, 0.22);
  border-radius: 10px;
  padding: 6px 7px;
  background: rgba(6, 22, 31, 0.42);
}

.story-compact-item + .story-compact-item {
  margin-top: 6px;
}

.story-compact-item.is-current {
  border-color: hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.5);
}

.story-compact-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.story-compact-icon .story-icon {
  width: 30px;
  height: 30px;
}

.story-compact-copy {
  min-width: 0;
}

.story-compact-choice {
  margin: 0;
  font-size: 0.82rem;
  color: #f0fbff;
  line-height: 1.25;
}

.story-compact-beat {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: #bdd4dc;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-compact-tag {
  display: none;
}

.story-compact-more {
  margin-top: 6px;
}

.story-compact-more > summary {
  cursor: pointer;
  font-size: 0.74rem;
  color: #b8d2db;
  list-style: none;
}

.story-compact-more > summary::-webkit-details-marker {
  display: none;
}

.story-compact-history {
  margin-top: 6px;
}

.story-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0 14px;
}

.story-focus {
  --focus-rgb: var(--story-focus-accent);
  position: relative;
  margin: 0 0 11px;
  padding: 11px 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(var(--focus-rgb), 0.34);
  background:
    linear-gradient(140deg, rgba(14, 33, 43, 0.9), rgba(9, 24, 34, 0.76)),
    radial-gradient(circle at 86% 14%, rgba(var(--focus-rgb), 0.2), transparent 52%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.27);
  overflow: hidden;
  animation: storyFocusReveal var(--story-enter-dur) var(--story-ease) both;
}

.story-focus::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(var(--focus-rgb), 0.35), rgba(var(--focus-rgb), 0.95), rgba(var(--focus-rgb), 0.4));
}

.story-focus::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 22px;
  border: 1px solid rgba(var(--focus-rgb), 0.28);
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
  animation: storyFocusAura 620ms var(--story-ease-soft) 110ms both;
}

.story-focus.tone-up {
  --focus-rgb: 89, 223, 154;
}

.story-focus.tone-down {
  --focus-rgb: 255, 127, 115;
}

.story-focus.tone-mix {
  --focus-rgb: 255, 211, 110;
}

.story-focus-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.story-focus-kicker {
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #d7edf3;
}

.story-focus-count {
  font-size: 0.68rem;
  color: #e8f8fc;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(8, 26, 36, 0.6);
}

.story-focus-title {
  margin: 7px 0 0;
  font-size: 0.97rem;
  line-height: 1.25;
  color: #f4fcff;
}

.story-focus-beat {
  margin: 5px 0 0;
  color: #cae0e7;
  font-size: 0.84rem;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-focus .story-impact {
  margin-top: 8px;
}

.story-strip.timeline {
  position: relative;
  gap: 12px;
  padding-left: 13px;
  content-visibility: auto;
  contain-intrinsic-size: 520px;
}

.story-strip.timeline::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 3px;
  bottom: 3px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(117, 214, 233, 0.52), rgba(117, 214, 233, 0.14));
}

.story-strip.empty {
  border: 1px dashed rgba(157, 211, 222, 0.34);
  border-radius: 13px;
  padding: 12px;
  color: #bfd6dd;
  font-size: 0.88rem;
  background: linear-gradient(140deg, rgba(14, 36, 47, 0.56), rgba(12, 30, 40, 0.4));
}

.story-chip {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(167, 217, 227, 0.2);
  padding: 10px 12px;
  background:
    linear-gradient(140deg, rgba(16, 36, 46, 0.88), rgba(8, 23, 32, 0.72)),
    radial-gradient(circle at 82% 12%, rgba(117, 214, 233, 0.16), transparent 44%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  animation: storyRise var(--story-enter-dur) var(--story-ease);
  animation-delay: var(--story-delay, 0ms);
  animation-fill-mode: both;
  transition:
    border-color var(--motion-ui) var(--story-ease-soft),
    background var(--motion-ui) var(--story-ease-soft),
    transform var(--motion-ui) var(--story-ease),
    box-shadow var(--motion-ui) var(--story-ease-soft),
    opacity var(--motion-ui) var(--story-ease-soft),
    filter var(--motion-ui) var(--story-ease-soft);
  contain: layout style paint;
  contain-intrinsic-size: 148px;
}

.story-chip::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(145, 227, 244, 0.86);
  box-shadow: 0 0 0 3px rgba(18, 45, 57, 0.96);
}

.story-chip::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 12px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.16), transparent 28%);
  pointer-events: none;
  opacity: 0;
}

.story-chip-main {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.story-icon-wrap {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(204, 237, 244, 0.26);
  display: grid;
  place-items: center;
}

.story-icon-wrap::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.story-icon {
  width: 54px;
  height: 54px;
  display: block;
}

.story-chip-copy h5 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: #f2fbff;
}

.story-chip p {
  margin: 6px 0 0;
  color: #d2e5ea;
  font-size: 0.84rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-causality {
  margin-top: 8px;
  display: grid;
  grid-template-columns: auto minmax(18px, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.story-cause-label,
.story-effect-label {
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b7ced5;
}

.story-flow-arrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b7e6ef;
  font-size: 0.76rem;
  line-height: 1;
}

.story-flow-arrow::before {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  transform: translateY(-50%) scaleX(0.35);
  transform-origin: left center;
  opacity: 0.52;
  background: linear-gradient(90deg, rgba(117, 214, 233, 0.28), rgba(117, 214, 233, 0.92));
}

.story-impact {
  margin-top: 7px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.story-impact-pill {
  border-radius: 10px;
  border: 1px solid rgba(186, 227, 236, 0.24);
  background: rgba(13, 29, 38, 0.82);
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.story-impact-key {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ec3cd;
}

.story-impact-value {
  font-size: 0.86rem;
  line-height: 1.1;
  color: #e9fbff;
}

.story-impact-pill.is-good {
  border-color: rgba(89, 223, 154, 0.44);
  background: rgba(23, 56, 43, 0.72);
}

.story-impact-pill.is-good .story-impact-value {
  color: #b9ffd7;
}

.story-impact-pill.is-bad {
  border-color: rgba(255, 127, 115, 0.42);
  background: rgba(64, 27, 29, 0.72);
}

.story-impact-pill.is-bad .story-impact-value {
  color: #ffd0cb;
}

.story-impact-pill.is-neutral {
  border-color: rgba(255, 211, 110, 0.34);
  background: rgba(63, 48, 20, 0.56);
}

.story-impact-pill.is-neutral .story-impact-value {
  color: #ffe8b2;
}

.story-tone-tag {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #e6f7fd;
  background: rgba(255, 255, 255, 0.05);
}

.story-chip-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.story-step {
  font-size: 0.66rem;
  color: #dff3f9;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(11, 30, 40, 0.74);
}

.story-theme {
  font-size: 0.7rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
}

.story-chip.tone-up {
  border-color: rgba(89, 223, 154, 0.38);
  background:
    linear-gradient(138deg, rgba(14, 42, 34, 0.82), rgba(9, 24, 32, 0.74)),
    radial-gradient(circle at 90% 12%, rgba(89, 223, 154, 0.18), transparent 45%);
}

.story-chip.tone-down {
  border-color: rgba(255, 127, 115, 0.38);
  background:
    linear-gradient(138deg, rgba(49, 24, 25, 0.84), rgba(14, 24, 33, 0.74)),
    radial-gradient(circle at 90% 12%, rgba(255, 127, 115, 0.18), transparent 45%);
}

.story-chip.tone-mix {
  border-color: rgba(255, 211, 110, 0.38);
  background:
    linear-gradient(138deg, rgba(53, 39, 17, 0.82), rgba(9, 24, 33, 0.74)),
    radial-gradient(circle at 90% 12%, rgba(255, 211, 110, 0.18), transparent 45%);
}

.story-chip.tone-up .story-tone-tag {
  border-color: rgba(89, 223, 154, 0.55);
}

.story-chip.tone-down .story-tone-tag {
  border-color: rgba(255, 127, 115, 0.55);
}

.story-chip.tone-mix .story-tone-tag {
  border-color: rgba(255, 211, 110, 0.55);
}

.story-chip:not(.is-latest) {
  opacity: 0.74;
  filter: saturate(0.8) brightness(0.95);
}

.story-chip.is-latest.theme-energy .icon-energy-bolt {
  transform-origin: 32px 32px;
  animation: iconEnergy 660ms ease-in-out 2 alternate;
}

.story-chip.is-latest.theme-water .icon-water-drop {
  transform-origin: 32px 32px;
  animation: iconWater 980ms ease-in-out 2;
}

.story-chip.is-latest.theme-paper .icon-paper-sheet {
  transform-origin: 32px 30px;
  animation: iconPaper 1080ms ease-in-out 2;
}

.story-chip.is-latest.theme-mobility .icon-mobility-car {
  animation: iconMobilityCar 840ms ease-in-out 2 alternate;
}

.story-chip.is-latest.theme-mobility .icon-mobility-wheel {
  transform-origin: 32px 32px;
  animation: iconMobilityWheel 720ms linear 2;
}

.story-chip.is-latest.theme-logistics .icon-logistics-box-a {
  animation: iconBoxA 880ms ease-in-out 2 alternate;
}

.story-chip.is-latest.theme-logistics .icon-logistics-box-b {
  animation: iconBoxB 910ms ease-in-out 2 alternate;
}

.story-chip.is-latest.theme-civic .icon-civic-core {
  animation: iconCivicCore 940ms ease-in-out 2;
}

.story-chip.is-latest.theme-civic .icon-civic-ring {
  transform-origin: 32px 32px;
  animation: iconCivicRing 1100ms ease-out 2;
}

@keyframes iconEnergy {
  from {
    transform: scale(0.95) translateY(1px);
  }
  to {
    transform: scale(1.08) translateY(-1px);
  }
}

@keyframes iconWater {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(2px) scale(0.95);
  }
}

@keyframes iconPaper {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-8deg);
  }
}

@keyframes iconMobilityCar {
  from {
    transform: translateX(-2px);
  }
  to {
    transform: translateX(2px);
  }
}

@keyframes iconMobilityWheel {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes iconBoxA {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-2px);
  }
}

@keyframes iconBoxB {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(2px);
  }
}

@keyframes iconCivicCore {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

@keyframes iconCivicRing {
  0% {
    transform: scale(0.82);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.2);
    opacity: 0.1;
  }
}

.story-chip.is-latest .story-chip-copy h5 {
  animation: storyCauseFlow 320ms var(--story-ease-soft) both;
}

.story-chip.is-latest .story-chip-copy p {
  animation: storyEffectLift 420ms var(--story-ease-soft) 120ms both;
}

.story-chip.is-latest .story-flow-arrow::before {
  animation: storyCauseFlow 540ms var(--story-ease-soft) 120ms both;
}

.story-chip.is-latest .story-flow-arrow {
  animation: storyArrowHop 440ms var(--story-ease-soft) 220ms both;
}

.story-chip.is-latest .story-impact-pill {
  opacity: 0;
  transform: translateY(5px);
}

.story-chip.is-latest .story-impact-pill:nth-child(1) {
  animation: storyMetricLift 320ms var(--story-ease-soft) 260ms both;
}

.story-chip.is-latest .story-impact-pill:nth-child(2) {
  animation: storyMetricLift 320ms var(--story-ease-soft) 340ms both;
}

.story-chip.is-latest .story-impact-pill:nth-child(3) {
  animation: storyMetricLift 320ms var(--story-ease-soft) 420ms both;
}

@keyframes storyRise {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.story-chip.is-latest {
  opacity: 1;
  filter: none;
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.32),
    0 14px 28px rgba(0, 0, 0, 0.34);
  animation: storyRise var(--story-enter-dur) var(--story-ease), storyFocusPulse 560ms var(--story-ease-soft);
}

.story-chip.is-latest::before {
  background: #8ff0ff;
  box-shadow: 0 0 0 4px rgba(22, 53, 67, 0.98), 0 0 0 8px rgba(143, 240, 255, 0.17);
}

.story-chip.is-latest::after {
  opacity: 1;
  animation: storySheen 620ms var(--story-ease-soft) both;
}

.story-chip.is-delayed {
  border-style: dashed;
  border-width: 1px;
}

@keyframes storyFocusPulse {
  from {
    box-shadow: 0 0 0 0 hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.72);
  }
  to {
    box-shadow: 0 0 0 1px hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.32),
      0 14px 28px rgba(0, 0, 0, 0.34);
  }
}

@keyframes storySheen {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes storyCauseFlow {
  from {
    opacity: 0.2;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes storyArrowHop {
  0% {
    transform: translateX(-3px);
    opacity: 0.45;
  }
  70% {
    transform: translateX(2px);
    opacity: 1;
  }
  100% {
    transform: translateX(0);
    opacity: 0.95;
  }
}

@keyframes storyEffectLift {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes storyMetricLift {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes storyFocusReveal {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.986);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes storyFocusAura {
  from {
    opacity: 0.16;
    transform: scale(0.97);
  }
  to {
    opacity: 0;
    transform: scale(1.05);
  }
}

.choice-list {
  display: grid;
  gap: 7px;
  margin-top: 2px;
}

.choice-btn {
  display: block;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.choice-btn:hover:not(:disabled) {
  border-color: hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.5);
  background: hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.11);
}

.choice-btn.selected {
  border-color: var(--accent-2);
  background: rgba(246, 212, 121, 0.14);
}

.choice-btn.auto-selected {
  border-color: rgba(255, 127, 115, 0.8);
  background: rgba(255, 127, 115, 0.14);
}

.choice-copy {
  display: block;
}

.choice-btn strong {
  display: block;
  margin-bottom: 0;
  font-size: 0.94rem;
  line-height: 1.3;
}

.choice-meta {
  display: none;
}

.choice-feedback {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  font-weight: 700;
  animation: flashIn calc(var(--motion-ui) * 0.75) ease;
}

.choice-feedback.tone-up {
  color: #e9fff2;
  background: rgba(89, 223, 154, 0.24);
  border: 1px solid rgba(89, 223, 154, 0.44);
}

.choice-feedback.tone-down {
  color: #fff0ee;
  background: rgba(255, 127, 115, 0.22);
  border: 1px solid rgba(255, 127, 115, 0.44);
}

.choice-feedback.tone-mix {
  color: #fff8e7;
  background: rgba(255, 211, 110, 0.2);
  border: 1px solid rgba(255, 211, 110, 0.44);
}

@keyframes flashIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#cinematic-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.choice-cinematic {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  animation: cineIn var(--cine-total, var(--motion-impact)) cubic-bezier(0.25, 0.7, 0.1, 1) forwards;
}

.cine-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 14, 20, 0.66);
}

.cine-card {
  position: relative;
  z-index: 1;
  width: min(720px, 92%);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(8, 20, 30, 0.92);
  padding: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 calc(1px + var(--cine-glow, 0.2) * 2)
    rgba(255, 238, 190, calc(var(--cine-glow, 0.2) * 0.9));
  max-height: 82dvh;
  overflow: auto;
}

.cine-svg {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

.cine-copy h4 {
  margin: 0 0 8px;
  font-size: 1.06rem;
}

.cine-copy p {
  margin: 0;
  color: #cde2e8;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.choice-cinematic.tone-up .cine-card {
  border-color: rgba(89, 223, 154, 0.62);
}

.choice-cinematic.tone-down .cine-card {
  border-color: rgba(255, 127, 115, 0.62);
}

.choice-cinematic.tone-mix .cine-card {
  border-color: rgba(255, 211, 110, 0.62);
}

.cine-float {
  animation: cineFloat 1.25s ease-in-out infinite alternate;
}

.cine-spin {
  animation: cineSpin 3.2s linear infinite;
  transform-origin: 80px 68px;
}

.cine-slide {
  animation: cineSlide 1s ease-in-out infinite alternate;
}

.cine-pulse {
  animation: cinePulse 1.2s ease-in-out infinite;
}

@keyframes cineIn {
  0% {
    opacity: 0;
    transform: scale(0.97);
  }
  18% {
    opacity: 1;
    transform: scale(1);
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes cineFloat {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}

@keyframes cineSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes cineSlide {
  from {
    transform: translateX(-3px);
  }
  to {
    transform: translateX(3px);
  }
}

@keyframes cinePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.86;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.result-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 10px;
}

.result-badge.good {
  background: rgba(89, 223, 154, 0.22);
  color: var(--good);
}

.result-badge.neutral {
  background: rgba(255, 211, 110, 0.22);
  color: var(--warn);
}

.result-badge.bad {
  background: rgba(255, 127, 115, 0.22);
  color: var(--bad);
}

.edu-summary {
  margin: 10px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px 11px;
  background: rgba(7, 24, 30, 0.35);
}

.edu-summary h4 {
  margin: 0 0 8px;
}

.edu-summary p {
  margin: 0 0 8px;
  color: #d5e6eb;
}

.edu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.edu-item {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.04);
}

.edu-item p {
  margin: 6px 0 0;
  font-size: 0.84rem;
  color: #cfe2e8;
}

.edu-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.edu-theme {
  font-size: 0.82rem;
  color: #e2f2f7;
}

.edu-level {
  font-size: 0.74rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--accent-2);
}

.sources-panel {
  margin: 10px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px 11px;
  background: rgba(7, 24, 30, 0.3);
}

.sources-head h4 {
  margin: 0 0 4px;
}

.sources-head p {
  margin: 0 0 10px;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.source-card {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.source-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.source-org {
  font-size: 0.74rem;
  color: #dff2f8;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 2px 7px;
}

.source-theme {
  font-size: 0.72rem;
  color: var(--accent-2);
}

.source-card h5 {
  margin: 0;
  font-size: 0.9rem;
}

.source-card p {
  margin: 0;
  color: #c6dde4;
  font-size: 0.81rem;
  line-height: 1.35;
}

.source-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(113, 212, 232, 0.44);
  background: rgba(113, 212, 232, 0.14);
  color: #e9fbff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 8px;
}

.source-link:hover {
  background: rgba(113, 212, 232, 0.22);
}

.path-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  gap: 7px;
}

.path-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.path-index {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.18);
}

.path-item.good .path-index,
.path-item.soft .path-index {
  background: rgba(89, 223, 154, 0.25);
}

.path-item.mid .path-index {
  background: rgba(255, 211, 110, 0.25);
}

.path-item.bad .path-index {
  background: rgba(255, 127, 115, 0.25);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 580px;
}

th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.leaderboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.toast {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 1120px) {
  :root {
    --scene-pan-shift-bg: 24px;
    --scene-pan-shift-mid: 15px;
    --scene-pan-shift-fg: 10px;
  }

  .scenario-layout {
    grid-template-columns: 1fr;
  }

  .scenario-content {
    min-height: unset;
  }

  #cinematic-host {
    position: fixed;
    inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    z-index: 30;
  }
}

@media (max-width: 980px) {
  .scene-stage {
    aspect-ratio: 16 / 9;
  }

  .persona-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-focus .story-impact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-focus .story-impact-pill:last-child {
    grid-column: 1 / -1;
  }

  .story-strip.timeline {
    padding-left: 11px;
  }

  .story-compact-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .story-compact-tag {
    display: none;
  }

  .cine-card {
    grid-template-columns: 1fr;
    width: min(620px, 94%);
  }

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

@media (max-width: 780px) {
  :root {
    --scene-pan-shift-bg: 18px;
    --scene-pan-shift-mid: 11px;
    --scene-pan-shift-fg: 7px;
  }

  .grid-2,
  .persona-grid {
    grid-template-columns: 1fr;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud-item.hud-persona {
    grid-column: 1 / -1;
  }

  .hud-item {
    min-height: 56px;
    padding: 8px 9px 9px 40px;
  }

  .hud-glyph {
    left: 10px;
    top: 9px;
    width: 22px;
    height: 22px;
  }

  .hud-icon {
    width: 13px;
    height: 13px;
  }

  .scene-caption {
    padding: 7px 8px;
    font-size: 0.78rem;
  }

  .scene-stage {
    aspect-ratio: 16 / 9;
  }

  .story-chip-main {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px;
  }

  .story-chip.story-chip-alert .story-chip-main {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .story-chip.story-chip-alert .story-icon-wrap {
    width: 44px;
    height: 44px;
  }

  .story-chip {
    padding: 9px 10px;
  }

  .story-impact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-impact-pill:last-child {
    grid-column: 1 / -1;
  }

  .story-focus {
    padding: 10px 10px 11px;
  }

  .story-focus-title {
    font-size: 0.92rem;
  }

  .story-focus-beat {
    font-size: 0.82rem;
  }

  .story-compact {
    padding: 7px;
  }

  .story-compact-choice {
    font-size: 0.82rem;
  }

  .story-compact-beat {
    font-size: 0.73rem;
  }

  .story-causality {
    grid-template-columns: auto minmax(14px, 1fr) auto;
    gap: 6px;
  }

  .question-kicker-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .app-shell {
    margin-top: 14px;
  }

  h1 {
    font-size: clamp(1.9rem, 9vw, 2.8rem);
  }
}

@media (max-width: 520px) {
  .story-impact {
    grid-template-columns: 1fr;
  }

  .story-impact-pill:last-child {
    grid-column: auto;
  }

  .story-chip p {
    -webkit-line-clamp: 3;
  }

  .choice-meta {
    display: none;
  }
}

.scene-card {
  overflow: hidden;
  border-radius: 22px;
}

.scene-stage {
  position: relative;
  min-width: 0;
  min-height: clamp(420px, 47vw, 620px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 245, 220, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(4, 11, 18, 0.08), rgba(4, 11, 18, 0.22));
}

.scene-stage::before,
.scene-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-stage::before {
  z-index: 6;
  background:
    radial-gradient(circle at 78% 16%, rgba(255, 245, 204, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0.14) 100%);
}

.scene-stage::after {
  z-index: 1;
  background:
    linear-gradient(180deg, transparent 60%, rgba(3, 10, 15, 0.08) 100%),
    radial-gradient(120% 88% at 50% 100%, transparent 58%, rgba(3, 10, 15, 0.24) 100%);
}

.scene-frame,
.scene-frame .scene-plate {
  width: 100%;
  height: 100%;
}

.scene-frame {
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.scene-plate {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
  overflow: hidden;
  background: #0b1620;
}

.scene-plate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 26%),
    radial-gradient(circle at 80% 16%, color-mix(in srgb, var(--scene-accent) 24%, transparent), transparent 28%);
  pointer-events: none;
}

.scene-plate-bg,
.scene-plate-wash,
.scene-plate-vignette,
.scene-plate-copy,
.scene-foreground-seat {
  position: absolute;
  inset: 0;
}

.scene-plate-bg {
  z-index: 0;
  background-size: cover;
  background-position: var(--scene-bg-position, 58% 50%);
  background-repeat: no-repeat;
  filter: saturate(1.02) contrast(1.02) brightness(0.94);
  transform: scale(var(--scene-bg-scale, 1.02));
}

.scene-plate-wash {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(7, 14, 22, 0.14) 0%, rgba(7, 14, 22, 0.02) 36%, rgba(7, 14, 22, 0.18) 100%),
    linear-gradient(180deg, rgba(7, 14, 22, 0.04), rgba(7, 14, 22, 0.26)),
    radial-gradient(circle at var(--scene-ground-light-x, 22%) var(--scene-ground-light-y, 54%), rgba(255, 244, 224, 0.12), transparent 28%),
    radial-gradient(circle at 18% 72%, rgba(var(--scene-persona-accent-rgb, 180 214 228) / 0.08), transparent 26%);
}

.scene-persona-samir-livreur .scene-plate-wash {
  background:
    linear-gradient(90deg, rgba(7, 14, 22, 0.18) 0%, rgba(7, 14, 22, 0.03) 34%, rgba(7, 14, 22, 0.16) 100%),
    linear-gradient(180deg, rgba(7, 14, 22, 0.04), rgba(7, 14, 22, 0.24)),
    radial-gradient(circle at 20% 74%, rgba(194, 234, 156, 0.14), transparent 30%);
}

.scene-persona-leila-infirmiere .scene-plate-wash {
  background:
    linear-gradient(90deg, rgba(7, 14, 22, 0.14) 0%, rgba(7, 14, 22, 0.02) 36%, rgba(7, 14, 22, 0.18) 100%),
    linear-gradient(180deg, rgba(7, 14, 22, 0.03), rgba(7, 14, 22, 0.22)),
    radial-gradient(circle at 20% 72%, rgba(191, 227, 247, 0.16), transparent 30%);
}

.scene-persona-hugo-etudiant .scene-plate-wash {
  background:
    linear-gradient(90deg, rgba(7, 14, 22, 0.14) 0%, rgba(7, 14, 22, 0.02) 36%, rgba(7, 14, 22, 0.18) 100%),
    linear-gradient(180deg, rgba(7, 14, 22, 0.03), rgba(7, 14, 22, 0.24)),
    radial-gradient(circle at 19% 73%, rgba(255, 243, 197, 0.14), transparent 30%);
}

.scene-persona-nora-parent-solo .scene-plate-wash {
  background:
    linear-gradient(90deg, rgba(7, 14, 22, 0.14) 0%, rgba(7, 14, 22, 0.02) 36%, rgba(7, 14, 22, 0.18) 100%),
    linear-gradient(180deg, rgba(7, 14, 22, 0.03), rgba(7, 14, 22, 0.24)),
    radial-gradient(circle at 19% 75%, rgba(255, 207, 220, 0.14), transparent 30%);
}

.scene-persona-camille-artisan .scene-plate-wash {
  background:
    linear-gradient(90deg, rgba(7, 14, 22, 0.14) 0%, rgba(7, 14, 22, 0.02) 36%, rgba(7, 14, 22, 0.18) 100%),
    linear-gradient(180deg, rgba(7, 14, 22, 0.03), rgba(7, 14, 22, 0.24)),
    radial-gradient(circle at 20% 76%, rgba(245, 217, 127, 0.14), transparent 30%);
}

.scene-persona-marc-gardien .scene-plate-wash {
  background:
    linear-gradient(90deg, rgba(7, 14, 22, 0.16) 0%, rgba(7, 14, 22, 0.03) 36%, rgba(7, 14, 22, 0.18) 100%),
    linear-gradient(180deg, rgba(7, 14, 22, 0.03), rgba(7, 14, 22, 0.24)),
    radial-gradient(circle at 19% 74%, rgba(210, 220, 255, 0.12), transparent 30%);
}

.scene-plate-vignette {
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(6, 12, 18, 0) 58%, rgba(6, 12, 18, 0.32) 100%),
    radial-gradient(120% 90% at 50% 100%, transparent 56%, rgba(4, 10, 14, 0.34) 100%);
}

.scene-plate-copy {
  z-index: 5;
  inset: 18px 18px auto auto;
  width: min(28ch, 32%);
  display: grid;
  gap: 6px;
  align-content: start;
  justify-items: start;
  opacity: 1 !important;
  transform: none !important;
}

.scene-plate-tag {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #eff8fb;
  background: color-mix(in srgb, var(--scene-accent) 22%, rgba(8, 18, 28, 0.82));
  border: 1px solid color-mix(in srgb, var(--scene-accent) 52%, rgba(255, 255, 255, 0.12));
  box-shadow: 0 12px 24px rgba(4, 10, 14, 0.18);
}

.scene-plate-story {
  margin: 0;
  padding: 10px 12px;
  border-radius: 16px;
  color: rgba(239, 247, 250, 0.92);
  font-size: 0.79rem;
  line-height: 1.34;
  background:
    linear-gradient(180deg, rgba(10, 20, 30, 0.72), rgba(7, 16, 24, 0.52)),
    rgba(7, 16, 24, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 42px rgba(4, 10, 14, 0.22);
  backdrop-filter: blur(10px);
}

.scene-plate-context {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(230, 243, 247, 0.9);
  background: rgba(7, 16, 24, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.scene-plate-note {
  display: none;
}

.scene-character-shell {
  position: absolute;
  left: var(--scene-character-x);
  right: auto;
  top: auto;
  bottom: calc(100% - var(--scene-character-y));
  width: var(--scene-character-width);
  height: 74%;
  transform: translateX(-50%);
  z-index: 5;
  opacity: 1 !important;
  pointer-events: none;
}

.scene-character-shell::before {
  content: "";
  position: absolute;
  left: 10%;
  bottom: 10%;
  width: 80%;
  height: 46%;
  background: radial-gradient(circle at 50% 76%, color-mix(in srgb, var(--scene-accent) 18%, transparent), transparent 58%);
  filter: blur(10px);
  opacity: 0.46;
}

.scene-character-art {
  position: relative;
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 86%, rgba(0, 0, 0, 0.96) 92%, rgba(0, 0, 0, 0.78) 97%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 86%, rgba(0, 0, 0, 0.96) 92%, rgba(0, 0, 0, 0.78) 97%, transparent 100%);
  filter:
    drop-shadow(0 12px 16px rgba(4, 10, 14, 0.24))
    drop-shadow(0 24px 34px rgba(4, 10, 14, 0.16));
  transform-origin: center bottom;
  image-rendering: auto;
}

.scene-persona-hugo-etudiant .scene-character-art,
.scene-persona-nora-parent-solo .scene-character-art,
.scene-persona-samir-livreur .scene-character-art {
  filter:
    brightness(1.06)
    contrast(1.04)
    drop-shadow(0 12px 16px rgba(4, 10, 14, 0.22))
    drop-shadow(0 24px 34px rgba(4, 10, 14, 0.14))
    drop-shadow(0 0 18px rgba(255, 241, 209, 0.08));
}

.scene-persona-marc-gardien .scene-character-art {
  filter:
    brightness(1.18)
    contrast(1.08)
    saturate(1.04)
    drop-shadow(0 12px 16px rgba(4, 10, 14, 0.22))
    drop-shadow(0 24px 34px rgba(4, 10, 14, 0.14))
    drop-shadow(0 0 20px rgba(214, 234, 245, 0.1));
}

.scene-persona-leila-infirmiere .scene-character-art,
.scene-persona-camille-artisan .scene-character-art {
  filter:
    brightness(1.03)
    contrast(1.03)
    drop-shadow(0 12px 16px rgba(4, 10, 14, 0.22))
    drop-shadow(0 24px 34px rgba(4, 10, 14, 0.14));
}

.scene-character-shadow {
  position: absolute;
  left: 14%;
  bottom: -1.5%;
  width: 62%;
  height: 6.5%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(4, 10, 14, 0.48) 0%, rgba(4, 10, 14, 0.18) 58%, transparent 100%);
  filter: blur(12px);
}

.scene-foreground-seat {
  inset: auto 0 0;
  height: 24%;
  z-index: 6;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 12, 18, 0) 0%, rgba(6, 12, 18, 0.02) 14%, rgba(6, 12, 18, 0.08) 38%, rgba(6, 12, 18, 0.32) 100%),
    radial-gradient(52% 36% at var(--scene-ground-light-x, 24%) 100%, rgba(6, 12, 18, 0.44), transparent 72%);
}

.scene-theme-water .scene-foreground-seat {
  background:
    linear-gradient(180deg, rgba(6, 12, 18, 0) 0%, rgba(6, 12, 18, 0.02) 18%, rgba(8, 28, 36, 0.12) 54%, rgba(8, 28, 36, 0.3) 100%),
    radial-gradient(56% 46% at var(--scene-ground-light-x, 24%) 100%, rgba(11, 35, 44, 0.32), transparent 72%);
}

.scene-theme-paper .scene-foreground-seat,
.scene-theme-logistics .scene-foreground-seat {
  background:
    linear-gradient(180deg, rgba(6, 12, 18, 0) 0%, rgba(24, 18, 10, 0.04) 18%, rgba(32, 23, 13, 0.16) 52%, rgba(32, 23, 13, 0.34) 100%),
    radial-gradient(56% 46% at var(--scene-ground-light-x, 24%) 100%, rgba(34, 25, 14, 0.34), transparent 72%);
}

.scene-pose-calm .scene-character-art {
  animation: sceneCharacterIdle 6.4s ease-in-out infinite;
}

.scene-pose-observe .scene-character-art {
  animation: sceneCharacterObserve 7.2s ease-in-out infinite;
}

.scene-pose-ready .scene-character-art,
.scene-pose-think .scene-character-art {
  animation: sceneCharacterIdle 5.8s ease-in-out infinite;
}

.scene-enter .scene-plate-bg {
  animation: scenePlateBgIn 620ms cubic-bezier(0.2, 0.74, 0.24, 1) both;
}

.scene-enter .scene-character-shell,
.scene-enter .scene-plate-copy {
  animation: none !important;
}

.scene-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 11px;
  font-size: 0.82rem;
  color: #d3e7ed;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(4, 12, 18, 0.68), rgba(6, 16, 24, 0.84)),
    radial-gradient(circle at 80% 0%, hsla(var(--theme-h), var(--theme-s), var(--theme-l), 0.12), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.scene-stage.is-shifting .scene-frame-out .scene-plate-bg {
  animation: scenePlateBgOut 620ms cubic-bezier(0.2, 0.74, 0.24, 1) forwards;
}

.scene-stage.is-shifting .scene-frame-in .scene-plate-bg {
  animation: scenePlateBgIn 620ms cubic-bezier(0.2, 0.74, 0.24, 1) both;
}

.scene-stage.is-shifting .scene-frame-out .scene-character-shell,
.scene-stage.is-shifting .scene-frame-out .scene-plate-copy {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.scene-stage.is-shifting .scene-frame-in .scene-character-shell,
.scene-stage.is-shifting .scene-frame-in .scene-plate-copy {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

@keyframes scenePlateBgIn {
  0% {
    transform: translateX(-10%) scale(1.03);
    opacity: 0.7;
  }
  100% {
    transform: translateX(0) scale(1.02);
    opacity: 1;
  }
}

@keyframes scenePlateBgOut {
  0% {
    transform: translateX(0) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: translateX(10%) scale(1.01);
    opacity: 0.52;
  }
}

@keyframes scenePlateContentIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scenePlateContentOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(4px);
  }
}

@keyframes sceneCharacterIdle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes sceneCharacterObserve {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-3px) rotate(-0.5deg);
  }
}

@media (max-width: 980px) {
  .scene-plate-copy {
    inset: 16px 16px auto auto;
    width: min(33ch, 48%);
  }

  .scene-character-shell {
    height: 74%;
  }
}

@media (max-width: 780px) {
  .scene-plate-copy {
    inset: 14px 14px auto 14px;
    width: auto;
  }

  .scene-plate-story {
    font-size: 0.79rem;
  }

  .scene-character-shell {
    left: 18%;
    bottom: 7%;
    width: 38%;
    height: 70%;
  }

  .scene-character-shadow {
    left: 12%;
    width: 76%;
    bottom: 9%;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-ambient: 1ms;
    --motion-ui: 1ms;
    --motion-impact: 1ms;
    --story-enter-dur: 1ms;
  }

  .aurora,
  .sun-breathe,
  .scene-enter,
  .scene-stage.is-shifting .scene-frame-out,
  .scene-stage.is-shifting .scene-frame-in,
  .scene-stage.is-shifting .scene-frame-out .scene-backdrop-layer,
  .scene-stage.is-shifting .scene-frame-in .scene-backdrop-layer,
  .scene-stage.is-shifting .scene-frame-out .scene-illustration-layer,
  .scene-stage.is-shifting .scene-frame-in .scene-illustration-layer,
  .scene-stage.is-shifting .scene-frame-out .scene-foreground-layer,
  .scene-stage.is-shifting .scene-frame-in .scene-foreground-layer,
  .scene-enter .layer-bg,
  .scene-enter .layer-mid,
  .scene-enter .layer-fg,
  .scene-theme-wash,
  .sky-cloud-drift,
  .city-glow,
  .window-twinkle,
  .traffic-flow,
  .water-flow,
  .theme-electric-grid,
  .theme-electric-core,
  .theme-water-drop,
  .theme-water-ripple,
  .theme-paper-fly,
  .theme-bus-move,
  .theme-van-roll,
  .theme-crowd-bob,
  .plant-smoke,
  .plant-rotor,
  .detail-water-station .water-pipes path,
  .water-wave,
  .detail-paper-archive .paper-stacks rect,
  .paper-output,
  .tram-glow,
  .crane-arm,
  .civic-flag,
  .theme-prop-pulse,
  .theme-prop-bob,
  .theme-prop-slide,
  .character-root.character-walk .character-leg-left,
  .character-root.character-walk .character-leg-right,
  .character-root.character-repair .character-arm-right,
  .character-root.character-carry .character-arm-left,
  .character-root.character-speak .character-arm-right,
  .character-bob,
  .character-breath,
  .character-shadow,
  .float-slow,
  .float-fast,
  .pulse-soft,
  .story-focus,
  .story-focus::after,
  .story-chip,
  .story-chip::after,
  .story-chip.is-latest,
  .story-chip.is-latest::after,
  .story-chip.is-latest .story-chip-copy h5,
  .story-chip.is-latest .story-chip-copy p,
  .story-chip.is-latest .story-flow-arrow,
  .story-chip.is-latest .story-flow-arrow::before,
  .story-chip.is-latest .story-impact-pill,
  .choice-cinematic,
  .cine-float,
  .cine-spin,
  .cine-slide,
  .cine-pulse,
  .scene-stage.is-shifting .scene-frame-out .scene-plate-bg,
  .scene-stage.is-shifting .scene-frame-in .scene-plate-bg,
  .scene-stage.is-shifting .scene-frame-out .scene-character-shell,
  .scene-stage.is-shifting .scene-frame-in .scene-character-shell,
  .scene-stage.is-shifting .scene-frame-out .scene-plate-copy,
  .scene-stage.is-shifting .scene-frame-in .scene-plate-copy,
  .scene-pose-calm .scene-character-art,
  .scene-pose-observe .scene-character-art,
  .scene-pose-ready .scene-character-art,
  .scene-pose-think .scene-character-art,
  .decision-timer-wrap.pressure-mode.is-critical {
    animation: none !important;
  }

  #fx-canvas {
    opacity: 0.24;
  }

  .story-chip,
  .story-chip:not(.is-latest),
  .story-chip.is-latest {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }

  .story-focus {
    transform: none !important;
  }

  .story-chip.is-latest .story-impact-pill {
    opacity: 1 !important;
    transform: none !important;
  }

  .story-flow-arrow::before {
    transform: translateY(-50%) scaleX(1);
  }

  .story-chip,
  .story-focus,
  .story-impact-pill {
    transition: none !important;
  }
}
