:root {
  /* Story color palettes — switched per story */
  --story-bg: #1a1a2e;
  --story-accent: #4a90d9;
  --story-warm: #e8d5b7;
  --story-text: #f0ece4;

  /* ECHO interface colors (always the same) */
  --echo-bg: #0d0f14;
  --echo-green: #00e5a0;
  --echo-green-dim: rgba(0,229,160,0.4);
  --echo-border: rgba(0,229,160,0.25);

  /* Transition speed */
  --fade: 0.8s;
}

body {
  background: var(--story-bg);
  overflow: hidden;
  height: 100vh;
  font-family: Lora;
  margin: 0;
  padding: 0;
}

body.boot-active {
  overflow: hidden;
}

#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.03), transparent 28%),
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.04), transparent 40%),
    linear-gradient(180deg, #050505 0%, #020202 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

#boot-screen.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.8s ease;
}

#boot-screen.is-exiting {
  opacity: 0;
  pointer-events: none;
}

#boot-screen-inner {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  padding: 48px 28px 24px;
  text-align: center;
  overflow: auto;
}

#boot-screen::before,
#boot-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#boot-screen::before {
  background:
    radial-gradient(circle at 50% 50%, transparent 38%, rgba(0, 0, 0, 0.38) 78%, rgba(0, 0, 0, 0.8) 100%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02), transparent 55%);
}

#boot-screen::after {
  opacity: 0.26;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 18%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 16%),
    radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 18%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.06), transparent 16%);
  mix-blend-mode: screen;
}


#boot-title {
  position: relative;
  margin: 0 0 16px;
  font-family: 'Share Tech Mono';
  font-size: clamp(1.7rem, 3.3vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f0eee8;
}
#boot-title,
#boot-copy,
#boot-copy-secondary,
.boot-divider,
#boot-warning,
#boot-content-notice,
#boot-actions,
#boot-hint {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#boot-screen.stage-title #boot-title,
#boot-screen.stage-body #boot-title,
#boot-screen.stage-warning #boot-title,
#boot-screen.stage-notice #boot-title,
#boot-screen.stage-actions #boot-title,
#boot-screen.stage-status #boot-title {
  opacity: 1;
  transform: translateY(0);
}

#boot-screen.stage-body #boot-copy,
#boot-screen.stage-body #boot-copy-secondary,
#boot-screen.stage-body .boot-divider,
#boot-screen.stage-warning #boot-copy,
#boot-screen.stage-warning #boot-copy-secondary,
#boot-screen.stage-warning .boot-divider,
#boot-screen.stage-notice #boot-copy,
#boot-screen.stage-notice #boot-copy-secondary,
#boot-screen.stage-notice .boot-divider,
#boot-screen.stage-actions #boot-copy,
#boot-screen.stage-actions #boot-copy-secondary,
#boot-screen.stage-actions .boot-divider,
#boot-screen.stage-status #boot-copy,
#boot-screen.stage-status #boot-copy-secondary,
#boot-screen.stage-status .boot-divider {
  opacity: 1;
  transform: translateY(0);
}

#boot-screen.stage-warning #boot-warning,
#boot-screen.stage-notice #boot-warning,
#boot-screen.stage-actions #boot-warning,
#boot-screen.stage-status #boot-warning {
  opacity: 1;
  transform: translateY(0);
}

#boot-screen.stage-notice #boot-content-notice,
#boot-screen.stage-actions #boot-content-notice,
#boot-screen.stage-status #boot-content-notice {
  opacity: 1;
  transform: translateY(0);
}

#boot-screen.stage-actions #boot-actions,
#boot-screen.stage-actions #boot-hint,
#boot-screen.stage-status #boot-actions,
#boot-screen.stage-status #boot-hint {
  opacity: 1;
  transform: translateY(0);
}

#boot-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

#boot-copy-secondary {
  margin-top: 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

#boot-copy p {
  margin: 0;
  max-width: 76ch;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1.4;
  text-wrap: balance;
}

#boot-copy p strong,
#boot-content-notice strong {
  color: #f0eee8;
  font-weight: 700;
}

#boot-copy-secondary p {
  margin:0;
  max-width: 76ch;
  color: rgba(255, 255, 255, 0.64);
  font-size: 16px;
  line-height: 1.4;
  text-wrap: balance;
}

.boot-divider {
  position: relative;
  width: min(460px, 52%);
  height: 1px;
  margin: 14px auto 12px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.18) 50%, transparent 100%);
}

#boot-warning {
  position: relative;
  margin: 0 auto;
  max-width: 200ch;
  color: #d9b36c;
  font-family: 'Share Tech Mono';
  font-size: 18.8px;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#boot-content-notice {
  position: relative;
  margin: 8px auto 0;
  max-width: 100%;
  font-weight: 700;
  color: hsl(0, 65%, 45%);
  font-size: 15.8px;
  line-height: 1.45;
  letter-spacing: 0.05em;
  text-wrap: balance;
}

#boot-status {
  position: relative;
  min-height: 22px;
  margin: 14px 0 10px;
  font-family: 'Share Tech Mono';
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 107, 107, 0.88);
  opacity: 0;
  transition: opacity 0.25s ease;
}

#boot-status.is-visible {
  opacity: 1;
}

#boot-actions {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

#boot-actions button {
  min-width: 124px;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.74);
  font-family: 'Share Tech Mono';
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#boot-actions button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.32);
  color: #f0eee8;
}

#boot-proceed {
  border-color: rgba(217, 179, 108, 0.28);
}

#boot-proceed:hover {
  border-color: rgba(217, 179, 108, 0.56);
  color: #d9b36c;
}

#boot-hint {
  position: relative;
  margin-top: 14px;
  font-family: 'Share Tech Mono';
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  animation: boot-hint-pulse 1.8s ease-in-out infinite;
}

#scene {
  position: fixed;
  inset: 0;
  transition: opacity 0.8s;
}

#scene.fade-out {
  opacity: 0;
  transition: opacity 0.8s;
}

#scene-bg {
  position: absolute;
  inset: 0;
  transition: background 1.5s ease;
}

#scene-character {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 280px;
}

#scene-character.character-sad {
  /* Sad posture transforms */
}

#scene-character.character-neutral {
  /* Neutral posture transforms */
}

#scene-character.character-happy {
  /* Happy posture transforms */
}

#scene-character.character-withdrawn {
  /* Withdrawn posture transforms */
}

#scene-character.character-distressed {
  /* Distressed posture transforms */
}

#echo-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--echo-bg);
  border-top: 2px solid var(--echo-border);
  padding: 20px 32px 28px;
  z-index: 100;
}

#echo-header {
  font-family: 'Share Tech Mono';
  font-size: 11px;
  color: var(--echo-green);
  letter-spacing: 2px;
  margin-bottom: 12px;
}

#narrative-text {
  font-family: Lora;
  font-style: italic;
  font-size: 17px;
  color: var(--story-warm);
  line-height: 1.8;
  max-width: 700px;
  margin: 0 auto;
  min-height: 80px;
}

#choices-container {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.choice-btn {
  background: transparent;
  border: 1px solid var(--echo-border);
  color: var(--echo-green);
  font-family: 'Share Tech Mono';
  font-size: 12px;
  padding: 12px 20px;
  max-width: 260px;
  cursor: pointer;
  transition: all 0.3s;
}

.choice-btn:hover {
  background: rgba(0,229,160,0.1);
  border-color: var(--echo-green);
  transform: translateY(-2px);
}

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

.choice-label {
  display: block;
  margin-bottom: 4px;
}

.choice-meta {
  font-size: 10px;
  color: var(--echo-green-dim);
}

#story-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #0d0f14;
  padding: 40px;
  gap: 32px;
}

#reset-state-wrap {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

#reset-state-btn {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(7, 8, 9, 0.92);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

#reset-state-btn:hover {
  transform: translateY(-2px) scale(1.08);
  border-color: rgba(223, 32, 32, 0.767);
  background: rgba(12, 13, 15, 0.98);
}

#reset-state-btn img {
  width: 20px;
  height: 20px;
  filter: invert(1);
}

#reset-state-popover {
  width: min(320px, calc(100vw - 48px));
  padding: 16px 16px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(9, 11, 14, 0.96);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms ease;
}

#reset-state-popover.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#reset-state-copy {
  font-family: 'Share Tech Mono';
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(244, 239, 231, 0.76);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 260ms ease, transform 260ms ease;
}

#reset-state-popover.is-open #reset-state-copy {
  opacity: 1;
  transform: translateY(0);
}

#reset-state-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 260ms ease 220ms, transform 260ms ease 220ms;
}

#reset-state-popover.is-open #reset-state-actions {
  opacity: 1;
  transform: translateY(0);
}

#reset-state-actions button {
  min-width: 74px;
  padding: 9px 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.74);
  font-family: 'Share Tech Mono';
  font-size: 11px;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: border-color 220ms ease, color 220ms ease, background 220ms ease, transform 220ms ease;
}

#reset-state-actions button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.03);
}

#reset-state-confirm:hover {
  border-color: rgba(223, 52, 52, 0.58);
  color: #d66c6c;
}

#reset-state-cancel:hover {
  border-color: rgba(0, 229, 160, 0.42);
  color: #8ee9c8;
}

#story-cards-wrap {
  min-height: 352px;
  justify-content: flex-start;
}

#story-select-tip {
  position: fixed;
  top: 26px;
  left: 50%;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(760px, calc(100vw - 48px));
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.68);
  font-family: 'Share Tech Mono';
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.7s ease, transform 0.7s ease, border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

#story-select-tip img {
  width: 16px;
  filter: invert(1);
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.84;
  animation: story-tip-icon-pulse 2.4s ease-in-out infinite;
}

#story-select-tip.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#story-select-tip.is-muted {
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.015);
  color: rgba(255, 255, 255, 0.36);
}

#story-select-tip.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  pointer-events: none;
}

#story-cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
  max-width: none;
  width: 100%;
  min-height: 320px;
}

#story-select-footer {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#story-select-footer.story-select-footer-unlocked {
  color: rgba(0, 229, 160, 0.74);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(0, 229, 160, 0.32);
  text-underline-offset: 4px;
}

#story-cards-wrap:has(.story-card:hover) #story-select-footer {
  opacity: 0;
  transform: translateY(-4px);
}

.story-card {
  position: relative;
  width: 164px;
  min-height: 220px;
  cursor: pointer;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 4px solid var(--story-accent-color, var(--echo-green));
  transition: width 0.3s ease, min-height 0.3s ease, transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.story-card:hover {
  width: 260px;
  min-height: 320px;
  transform: translateY(-4px);
  background: rgba(var(--story-rgb, 0,229,160), 0.08);
  border-color: rgba(var(--story-rgb, 0,229,160), 0.35);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 2;
}

.story-card-resting,
.story-card-expanded {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  padding: 20px 16px;
  box-sizing: border-box;
}

.story-card-resting {
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.story-card-expanded {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.story-card:hover .story-card-resting {
  opacity: 0;
  transform: translateY(-8px);
}

.story-card:hover .story-card-expanded {
  opacity: 1;
  transform: translateY(0);
}

.story-card-title {
  font-family: 'Playfair Display';
  color: #f0ece4;
  margin: 0;
  font-size: 15px;
}

.story-card-tagline {
  font-family: Lora;
  font-style: italic;
  color: rgba(255,255,255,0.6);
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.story-card-case,
.story-card-subject,
.story-card-complete,
.story-card-memory-label,
.story-card-analysis-label {
  font-family: 'Share Tech Mono';
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.story-card-case,
.story-card-subject {
  color: var(--story-accent-color, var(--echo-green));
}

.story-card-complete {
  color: rgba(255,255,255,0.3);
}

.story-card-memory-label,
.story-card-analysis-label {
  margin-top: 4px;
  color: rgba(255,255,255,0.34);
}

.story-card-memory,
.story-card-analysis {
  margin: 0;
  font-family: Lora;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.74);
}

#ending-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px;
  text-align: center;
}

#ending-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.92fr);
  gap: 32px;
  align-items: start;
  width: min(1080px, 100%);
  text-align: left;
}

#ending-main {
  min-width: 0;
}

#ending-title {
  font-family: 'Playfair Display';
  font-size: 32px;
  color: var(--story-warm);
}

#ending-text {
  font-family: Lora;
  font-size: 17px;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  line-height: 1.9;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 2s ease, transform 2s ease;
}

#ending-echo-log {
  font-family: 'Share Tech Mono';
  font-size: 11px;
  color: rgba(0,229,160,0.6);
  max-width: 560px;
  line-height: 1.8;
  border: 1px solid rgba(0,229,160,0.2);
  padding: 16px;
  margin-top: 8px;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 2s ease, transform 2s ease;
}

#ending-branch-panel {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  padding: 20px 18px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 2s ease, transform 2s ease;
}

#ending-text.ending-visible,
#ending-echo-log.ending-visible,
#ending-branch-panel.ending-visible {
  opacity: 1;
  transform: translateY(0);
}

#ending-branch-track {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ending-branch-node {
  padding-left: 18px;
  border-left: 2px solid rgba(255,255,255,0.12);
}

.ending-branch-node-final {
  border-left-color: rgba(0,229,160,0.4);
}

.ending-branch-node-label {
  font-family: 'Share Tech Mono';
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(0,229,160,0.68);
  margin-bottom: 8px;
}

.ending-branch-node-copy {
  font-family: Lora;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
}

.ending-branch-node-note {
  margin-top: 8px;
  font-family: 'Share Tech Mono';
  font-size: 10px;
  line-height: 1.6;
  color: rgba(255,255,255,0.42);
}

.ending-branch-shift {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.ending-branch-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(0,229,160,0.76);
  box-shadow: 0 0 0 4px rgba(0,229,160,0.08);
}

.ending-branch-shift-copy {
  font-family: Lora;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.66);
}

#mirror-ending {
  display: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top center, rgba(0, 229, 160, 0.07), transparent 28%),
    linear-gradient(180deg, #06080b 0%, #030405 100%);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#mirror-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  overflow: auto;
  box-sizing: border-box;
  padding: 88px 42px 34px;
  border: none;
  background: rgba(9, 12, 15, 0.94);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#mirror-ending.mirror-visible #mirror-shell {
  opacity: 1;
  transform: translateY(0);
}

#mirror-kicker {
  font-family: 'Share Tech Mono';
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(0, 229, 160, 0.68);
  margin-bottom: 14px;
}

#mirror-close {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: 'Share Tech Mono';
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

#mirror-close:hover {
  border-color: rgba(0, 229, 160, 0.42);
  color: #00e5a0;
  background: rgba(255, 255, 255, 0.03);
}

body.final-report-open #article-btn,
body.final-report-open #message-btn,
body.final-report-open #reset-state-wrap {
  display: none !important;
}

#mirror-topline {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#mirror-title {
  margin: 0;
  font-family: 'Playfair Display';
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  line-height: 0.94;
  color: #f0ece4;
}

#mirror-intro {
  margin: 0;
  font-family: Lora;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.68);
}

#mirror-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.mirror-metric {
  padding: 14px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.mirror-metric-label {
  font-family: 'Share Tech Mono';
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 10px;
}

.mirror-metric-value {
  font-family: 'Playfair Display';
  font-size: 28px;
  color: #f0ece4;
}

.mirror-metric-system .mirror-metric-value {
  color: rgba(0, 229, 160, 0.92);
}

.mirror-metric-good .mirror-metric-value {
  color: #8ed2ae;
}

.mirror-metric-risk .mirror-metric-value {
  color: #e2a374;
}

#mirror-cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mirror-case-card {
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.3s ease;
}

.mirror-case-card.mirror-case-visible {
  opacity: 1;
  transform: translateY(0);
}

.mirror-case-positive {
  border-color: rgba(92, 190, 142, 0.26);
}

.mirror-case-captured {
  border-color: rgba(0, 229, 160, 0.18);
}

.mirror-case-critical {
  border-color: rgba(215, 109, 109, 0.28);
}

.mirror-case-meta {
  font-family: 'Share Tech Mono';
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 10px;
}

.mirror-case-title {
  margin: 0 0 10px;
  font-family: 'Playfair Display';
  font-size: 24px;
  color: #f0ece4;
}

.mirror-case-summary {
  margin: 0 0 12px;
  font-family: Lora;
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.76);
}

.mirror-case-intensity {
  margin-bottom: 12px;
  font-family: 'Share Tech Mono';
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.48);
}

.mirror-case-outcome {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'Share Tech Mono';
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 1px;
  color: rgba(0, 229, 160, 0.72);
}

#mirror-final {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'Playfair Display';
  font-style: italic;
  font-size: 26px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#mirror-final.mirror-final-visible {
  opacity: 1;
  transform: translateY(0);
}

#restart-btn {
  margin-top: 24px;
  font-family: 'Share Tech Mono';
  font-size: 12px;
  padding: 12px 32px;
  background: transparent;
  border: 1px solid rgba(0,229,160,0.4);
  color: #00e5a0;
  cursor: pointer;
  letter-spacing: 2px;
  transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

#restart-btn:hover {
  background: rgba(0,229,160,0.08);
  transform: translateY(-1px);
}

/* Choice button meta text */
.choice-btn { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.choice-label { font-size: 13px; color: var(--echo-green); line-height: 1.5; }
.choice-meta  { font-size: 10px; color: rgba(0,229,160,0.4); letter-spacing: 1px; }
.choice-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* Narrative text fade-in */
@keyframes narrative-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#narrative-text { animation: narrative-in 0.6s ease forwards; }

/* Scene fade */
#scene { opacity: 1; transition: opacity 0.8s ease; }
#scene.fade-out { opacity: 0; }

/* ECHO panel slide up on start */
@keyframes panel-slide {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
#echo-panel { animation: panel-slide 0.6s ease forwards; }

/* Story card hover shadow */
#story-cards > div:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* Vignette overlay on scene for atmosphere */
#scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
  z-index: 10;
}

@keyframes boot-hint-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.72; }
}

@keyframes story-tip-icon-pulse {
  0%, 100% { transform: scale(1); opacity: 0.72; }
  50% { transform: scale(1.08); opacity: 1; }
}

@media (max-width: 760px) {
  #boot-screen {
    padding: 18px;
  }

  #boot-screen-inner {
    padding: 64px 18px 28px;
  }

  #boot-copy p {
    font-size: 14px;
    line-height: 1.7;
  }

  #boot-warning {
    font-size: 12px;
  }

  #boot-copy-secondary p,
  #boot-content-notice {
    font-size: 14px;
    line-height: 1.7;
  }

  .boot-divider {
    width: min(280px, 72%);
    margin: 24px auto;
  }

  #boot-actions {
    flex-direction: column;
  }

  #boot-actions button {
    width: 100%;
  }

  #story-cards {
    flex-wrap: wrap;
  }

  #story-select-tip {
    top: 16px;
    max-width: calc(100vw - 24px);
    font-size: 10px;
    line-height: 1.45;
    border-radius: 18px;
    padding: 9px 12px;
  }

  #reset-state-wrap {
    top: 16px;
    right: 16px;
  }

  #reset-state-popover {
    width: min(280px, calc(100vw - 24px));
  }

  #ending-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #mirror-shell {
    padding: 76px 18px 24px;
  }

  #mirror-topline {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #mirror-close {
    top: 16px;
    right: 16px;
  }

  #mirror-metrics,
  #mirror-cases {
    grid-template-columns: 1fr;
  }

  .story-card,
  .story-card:hover {
    width: calc(50% - 8px);
    min-height: 220px;
  }
}
