:root {
  color-scheme: dark;
  --ink: #07101d;
  --ink-2: #0d1829;
  --stone: #1b2a41;
  --stone-light: #304561;
  --paper: #eef3f2;
  --muted: #9aaabd;
  --gold: #efc66b;
  --gold-bright: #ffe29a;
  --vermillion: #e56b5d;
  --cobalt: #68a6e8;
  --mineral: #72b49b;
  --violet: #ac86d5;
  --smoke: #bac4ca;
  --line: rgba(232, 239, 240, 0.13);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  color: var(--paper);
  overflow-x: hidden;
  overflow-y: auto;
}

.minilab-ecosystem-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  min-height: 58px;
  padding: 8px 16px;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(159, 181, 202, 0.16);
  background: rgba(3, 8, 18, 0.92);
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
}

.minilab-ecosystem-brand {
  display: inline-flex;
  min-width: 0;
  gap: 9px;
  align-items: center;
  color: #f4f0e6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.minilab-ecosystem-brand img {
  display: block;
  width: 25px;
  height: auto;
}

.minilab-ecosystem-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.minilab-ecosystem-links a {
  display: inline-flex;
  min-height: 34px;
  padding: 7px 11px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(159, 181, 202, 0.24);
  border-radius: 999px;
  color: #dce5ec;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.minilab-ecosystem-links a:hover,
.minilab-ecosystem-links a:focus-visible {
  border-color: rgba(239, 198, 107, 0.62);
  color: var(--gold-bright);
}

.minilab-ecosystem-links .essay-link {
  border-color: rgba(239, 198, 107, 0.48);
  background: rgba(239, 198, 107, 0.1);
  color: var(--gold-bright);
}

.experience-stage {
  display: grid;
  min-height: calc(100svh - 58px);
  place-items: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(23, 38, 60, 0.82), transparent 36%),
    #02060d;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

.story-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: calc(100svh - 58px);
  min-height: 600px;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 55% 15%,
      rgba(255, 234, 174, 0.34) 0,
      rgba(239, 198, 107, 0.17) 3%,
      rgba(239, 198, 107, 0.05) 6.5%,
      transparent 10.5%
    ),
    linear-gradient(180deg, rgba(7, 16, 30, 0.94), rgba(5, 11, 21, 0.97) 70%);
  isolation: isolate;
}

.release-context {
  position: relative;
  padding: clamp(72px, 10vw, 112px) 22px;
  border-top: 1px solid rgba(159, 181, 202, 0.14);
  background:
    radial-gradient(circle at 18% 12%, rgba(104, 166, 232, 0.08), transparent 32%),
    linear-gradient(180deg, #07101e, #050b15);
  color: #d7e0e8;
}

.release-context-inner {
  width: min(760px, 100%);
  margin: 0 auto;
}

.release-context-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.release-context h2 {
  max-width: 16ch;
  margin: 0 0 28px;
  color: #f4f0e6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.release-context p:not(.release-context-kicker) {
  max-width: 66ch;
  margin: 0 0 18px;
  color: #b9c7d3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
}

.release-context-links {
  display: flex;
  margin-top: 32px;
  gap: 12px 26px;
  flex-wrap: wrap;
}

.release-context-links a {
  color: #c5d2dd;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.release-context-links a:hover { color: var(--gold-bright); }
.release-context-links .release-context-primary { color: var(--gold-bright); }

.story-shell::before {
  position: absolute;
  inset: -2%;
  z-index: -2;
  background-image:
    linear-gradient(180deg, rgba(3, 8, 18, 0.12), rgba(3, 8, 18, 0.72)),
    url("./assets/monasterio-campanario.jpg");
  background-position: center 42%;
  background-size: cover;
  content: "";
  filter: grayscale(1) saturate(0.18) contrast(0.92) brightness(0.54);
  opacity: 0.24;
  pointer-events: none;
  transform: scale(1.03);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(56px + var(--safe-top));
  min-width: 0;
  padding: calc(10px + var(--safe-top)) 16px 6px;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(239, 198, 107, 0.45);
  border-radius: 50%;
  color: var(--gold);
  font-size: 24px;
  line-height: 1;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.15em;
  font-size: 11px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.icon-button,
.sheet-close {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.icon-button span {
  font-family: Georgia, serif;
  font-size: 18px;
}

.scene {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  min-width: 0;
  padding: 2px 16px 8px;
}

.scene-heading {
  min-width: 0;
  min-height: 108px;
  padding: 4px 2px 6px;
}

.scene-kicker,
.sheet-kicker {
  margin: 0 0 7px;
  color: var(--gold);
  letter-spacing: 0.13em;
  font-size: 10px;
  font-weight: 800;
}

.scene h1 {
  max-width: 340px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 7vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}

.scene-copy {
  max-width: 350px;
  min-height: 34px;
  margin: 8px 0 0;
  color: #c9d3dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(14px, 3.7vw, 16px);
  line-height: 1.25;
  text-wrap: balance;
}

.visual-wrap {
  position: relative;
  display: grid;
  min-height: 0;
  min-width: 0;
  width: 100%;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  background: rgba(5, 12, 23, 0.38);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.monastery {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  max-height: 500px;
  min-height: 288px;
}

.sky {
  opacity: 0.9;
}

.stars circle {
  fill: #a9bdd1;
  opacity: 0.38;
  animation: star-pulse 4.8s ease-in-out infinite alternate;
}

.stars circle:nth-child(2n) {
  animation-delay: -2.3s;
}

.outer-wall,
.tower,
.central-shaft {
  fill: url(#stone);
  stroke: #3d526e;
  stroke-width: 1.5;
}

.roof,
.tower-roof {
  fill: #152238;
  stroke: #53657c;
  stroke-width: 1.3;
}

.empty-belfry {
  fill: #060d18;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.5;
}

.threshold-line {
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
  opacity: 0;
  transition: opacity 280ms ease;
}

.threshold-label {
  fill: var(--gold);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
  opacity: 0;
  transition: opacity 280ms ease;
}

.bell {
  transform-box: fill-box;
  transform-origin: 50% 10%;
}

.bell-body {
  fill: #6d6f6d;
  stroke: #a7a69a;
  stroke-width: 1.5;
  transition: fill 300ms ease, stroke 300ms ease;
}

.bell-lip {
  fill: none;
  stroke: #b2b0a5;
  stroke-width: 3;
  stroke-linecap: round;
}

.bell-clapper {
  fill: #aaa89d;
}

.bell-glow {
  fill: url(#gold-glow);
  opacity: 0;
}

.room {
  cursor: pointer;
  outline: none;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 180ms ease, opacity 280ms ease;
}

.room:focus-visible .room-body {
  stroke: var(--gold-bright);
  stroke-width: 2.5;
}

.room:active,
.room.attention {
  transform: scale(1.025);
}

.room-body {
  fill: rgba(20, 34, 54, 0.95);
  stroke: rgba(159, 181, 202, 0.25);
  stroke-width: 1.4;
  transition: fill 380ms ease, stroke 380ms ease;
}

.room-halo {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
  transition: fill 300ms ease, stroke 300ms ease, opacity 300ms ease;
}

.room-name {
  fill: #e8edef;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.room-output {
  fill: #93a5b7;
  font-size: 11.5px;
  transition: fill 300ms ease;
}

.room-output tspan {
  dominant-baseline: alphabetic;
}

.peripheral-room .room-name {
  font-size: 11.7px;
}

.local-core {
  fill: var(--cobalt);
  filter: url(#soft-glow);
  transform-box: fill-box;
  transform-origin: center;
  animation: local-pulse 4.8s ease-in-out infinite;
}

.room {
  --room-strength-color: var(--cobalt);
}

.room-strength-track,
.room-strength-fill {
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease, width 220ms ease;
}

.room-strength-track {
  fill: rgba(159, 181, 202, 0.18);
}

.room-strength-fill {
  fill: var(--room-strength-color);
  filter: url(#soft-glow);
}

.story-shell[data-phase="competition"] :is(.room-strength-track, .room-strength-fill) {
  opacity: 1;
}

.story-shell[data-phase="competition"] .room.attention .room-strength-fill {
  fill: var(--gold-bright);
}

.room-library .local-core {
  fill: var(--violet);
  animation-delay: -0.8s;
}

.room-library {
  --room-strength-color: var(--violet);
}

.room-infirmary .local-core {
  fill: var(--vermillion);
  animation-delay: -1.6s;
}

.room-infirmary {
  --room-strength-color: var(--vermillion);
}

.room-garden .local-core {
  fill: var(--mineral);
  animation-delay: -2.4s;
}

.room-garden {
  --room-strength-color: var(--mineral);
}

.room-workshop .local-core {
  fill: #d59b64;
  animation-delay: -3.2s;
}

.room-workshop {
  --room-strength-color: #d59b64;
}

.room-cell .local-core {
  fill: #8d96c9;
  animation-delay: -4s;
}

.room-cell {
  --room-strength-color: #8d96c9;
}

.event-smoke {
  opacity: 0;
  transition: opacity 450ms ease;
}

.event-smoke path {
  fill: none;
  stroke: var(--smoke);
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.45;
}

.event-smoke circle {
  fill: var(--smoke);
  filter: url(#mist);
  opacity: 0.18;
}

.signal {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 0.05 0.08;
  opacity: 0;
  transition: opacity 280ms ease, stroke-width 250ms ease;
}

.signal-kitchen {
  stroke: var(--cobalt);
}

.signal-library {
  stroke: var(--violet);
}

.signal-infirmary {
  stroke: var(--vermillion);
}

.signal-garden {
  stroke: var(--mineral);
}

.signal-workshop {
  stroke: #d59b64;
}

.signal-cell {
  stroke: #8d96c9;
}

.peal-ring {
  fill: none;
  stroke: var(--gold-bright);
  stroke-width: 2.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.global-message {
  opacity: 0;
  transition: opacity 260ms ease;
}

.global-message rect {
  fill: #332a17;
  stroke: var(--gold);
  stroke-width: 1.2;
}

.global-message text,
.phase-labels text {
  fill: var(--gold-bright);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.phase {
  opacity: 0;
}

.state-chip {
  position: absolute;
  top: 12px;
  left: 50%;
  max-width: calc(100% - 24px);
  padding: 7px 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(4, 10, 19, 0.78);
  color: #aebdcc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.choice-feedback {
  position: absolute;
  z-index: 5;
  top: 52px;
  left: 50%;
  max-width: calc(100% - 48px);
  padding: 7px 11px;
  border: 1px solid rgba(239, 198, 107, 0.5);
  border-radius: 999px;
  background: rgba(40, 31, 14, 0.94);
  color: var(--gold-bright);
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.38);
  font-family: Inter, system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.035em;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  transform: translateX(-50%);
}

.action-card {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  min-width: 156px;
  padding: 10px 13px;
  border: 1px solid rgba(239, 198, 107, 0.4);
  border-radius: 14px;
  background: rgba(18, 16, 11, 0.9);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 350ms ease, transform 350ms ease;
}

.action-card span {
  color: var(--gold);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.action-card strong {
  margin-top: 3px;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 500;
}

.memory-thread {
  position: absolute;
  right: 16px;
  bottom: 15px;
  left: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  align-items: start;
  padding: 13px 8px 8px;
  border: 1px solid rgba(239, 198, 107, 0.24);
  border-radius: 14px;
  background: rgba(5, 10, 18, 0.9);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.memory-line {
  position: absolute;
  top: 17px;
  right: 13%;
  left: 13%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.memory-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #bac6cf;
  font-size: 8px;
  text-align: center;
}

.memory-step i {
  width: 8px;
  height: 8px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #111a27;
  box-shadow: 0 0 12px rgba(239, 198, 107, 0.45);
}

.scene-hint {
  display: flex;
  width: 100%;
  min-height: 44px;
  margin: 7px 0 0;
  padding: 8px 12px;
  gap: 9px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #aab8c6;
  font-size: 11px;
  cursor: pointer;
}

.hint-glyph {
  color: var(--gold);
  font-size: 16px;
}

.controls {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(112px, 140px);
  width: 100%;
  min-width: 0;
  min-height: calc(72px + var(--safe-bottom));
  padding: 8px 16px calc(12px + var(--safe-bottom));
  gap: 12px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(4, 9, 17, 0.88);
  backdrop-filter: blur(18px);
}

.nav-button {
  display: flex;
  min-width: 48px;
  max-width: 100%;
  min-height: 48px;
  padding: 0 16px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  cursor: pointer;
}

.nav-button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.nav-button.primary {
  border: 1px solid rgba(239, 198, 107, 0.4);
  background: var(--gold);
  color: #171207;
  font-size: 12px;
  font-weight: 850;
}

.nav-button:disabled {
  opacity: 0.32;
  cursor: default;
}

.progress {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.progress-dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: #425169;
  transition: width 180ms ease, background 180ms ease;
}

.progress-dot.active {
  width: 25px;
  background: var(--gold);
}

.room-sheet {
  position: absolute;
  right: 10px;
  bottom: calc(76px + var(--safe-bottom));
  left: 10px;
  z-index: 20;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(10, 18, 31, 0.97);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.42);
  animation: sheet-in 220ms ease-out both;
  backdrop-filter: blur(20px);
}

.room-sheet .sheet-close,
.about-dialog .sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.room-sheet h2,
.about-dialog h2 {
  margin: 0 48px 7px 0;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 500;
}

.room-sheet > p:not(.sheet-kicker),
.about-dialog > p:not(.sheet-kicker) {
  margin: 0;
  color: #bcc8d2;
  font-size: 13px;
  line-height: 1.45;
}

.room-sheet dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 15px 0 0;
  gap: 8px;
}

.room-sheet dl div {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.room-sheet dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.room-sheet dd {
  margin: 4px 0 0;
  font-size: 12px;
}

.about-dialog {
  width: min(calc(100% - 28px), 398px);
  padding: 24px;
  border: 1px solid rgba(239, 198, 107, 0.28);
  border-radius: 24px;
  background: #0b1525;
  color: var(--paper);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}

.about-dialog::backdrop {
  background: rgba(1, 5, 10, 0.76);
  backdrop-filter: blur(8px);
}

.about-sequence {
  margin-top: 16px !important;
  padding: 12px;
  border-radius: 12px;
  background: rgba(239, 198, 107, 0.08);
  color: var(--gold-bright) !important;
  font-size: 11px !important;
}

/* Movimiento II: el acontecimiento ya existe; todavía no hay ganador. */
.story-shell[data-scene="2"] .event-smoke,
.story-shell[data-scene="3"] .event-smoke {
  opacity: 1;
}

.story-shell[data-scene="2"] .room-halo {
  fill: rgba(104, 166, 232, 0.04);
  stroke: rgba(104, 166, 232, 0.18);
}

.story-shell[data-scene="2"] .room-infirmary .room-halo {
  fill: rgba(229, 107, 93, 0.08);
  stroke: rgba(229, 107, 93, 0.34);
}

/* Movimiento III: varias lecturas; el toque refuerza una. */
.story-shell[data-scene="3"] .threshold-line,
.story-shell[data-scene="3"] .threshold-label {
  opacity: 0.72;
}

.story-shell[data-scene="3"] .signal {
  opacity: 0.38;
  animation: signal-climb 1.6s linear infinite;
}

.story-shell[data-scene="3"] .signal-kitchen {
  opacity: 0.72;
  stroke-width: 4.2;
}

.story-shell[data-scene="3"] .signal-infirmary {
  opacity: 1;
  stroke-width: 5.4;
  filter: url(#soft-glow);
}

.story-shell[data-scene="3"] .room-infirmary .room-halo,
.story-shell[data-scene="3"] .room-infirmary.attention .room-halo {
  fill: rgba(229, 107, 93, 0.09);
  stroke: var(--vermillion);
}

.story-shell[data-scene="3"] .room.attention .room-halo {
  fill: rgba(239, 198, 107, 0.1);
  stroke: var(--gold);
}

/* Movimiento IV: acceso, difusión y reorganización son un solo episodio. */
.story-shell[data-scene="4"] .bell {
  animation: bell-swing 1.4s ease-in-out infinite;
}

.story-shell[data-scene="4"] .bell-body,
.story-shell[data-scene="5"] .bell-body {
  fill: var(--gold);
  stroke: var(--gold-bright);
}

.story-shell[data-scene="4"] .bell-lip,
.story-shell[data-scene="5"] .bell-lip {
  stroke: var(--gold-bright);
}

.story-shell[data-scene="4"] .bell-clapper,
.story-shell[data-scene="5"] .bell-clapper {
  fill: #fff2b8;
}

.story-shell[data-scene="4"] .bell-glow {
  opacity: 1;
  animation: glow-breathe 1.4s ease-in-out infinite;
}

.story-shell[data-scene="4"] .peal-ring {
  animation: peal-wave 1.4s ease-out infinite;
}

.story-shell[data-scene="4"] .peal-ring-b {
  animation-delay: 180ms;
}

.story-shell[data-scene="4"] .peal-ring-c {
  animation-delay: 360ms;
}

.story-shell[data-scene="4"] .global-message {
  opacity: 1;
}

.story-shell[data-scene="4"] .phase {
  animation: phase-sequence 2.8s steps(1, end) infinite;
}

.story-shell[data-scene="4"] .phase-diffusion {
  animation-delay: 0.7s;
}

.story-shell[data-scene="4"] .phase-reorganization {
  animation-delay: 1.4s;
}

.story-shell[data-scene="4"] .room-body,
.story-shell[data-scene="5"] .room-body {
  fill: rgba(52, 46, 29, 0.72);
  stroke: rgba(239, 198, 107, 0.44);
}

.story-shell[data-scene="4"] .room-output,
.story-shell[data-scene="5"] .room-output {
  fill: #e9d7ac;
}

.story-shell[data-scene="4"] .local-core,
.story-shell[data-scene="5"] .local-core {
  fill: var(--gold);
}

.story-shell[data-scene="4"] .action-card {
  opacity: 1;
  transform: translateY(0);
}

/* Movimiento V: el yo es continuidad, no ocupante de la torre. */
.story-shell[data-scene="5"] .bell-glow {
  opacity: 0.2;
}

.story-shell[data-scene="5"] .memory-thread {
  opacity: 1;
  transform: translateY(0);
}

.story-shell[data-scene="5"] .memory-step {
  animation: memory-arrive 900ms ease-out both;
}

.story-shell[data-scene="5"] .memory-step:nth-child(3) {
  animation-delay: 120ms;
}

.story-shell[data-scene="5"] .memory-step:nth-child(4) {
  animation-delay: 240ms;
}

.story-shell[data-scene="5"] .memory-step:nth-child(5) {
  animation-delay: 360ms;
}

body.capture-clean .topbar,
body.capture-clean .controls,
body.capture-clean .scene-hint {
  display: none;
}

body.capture-clean :is(.minilab-ecosystem-header, .release-context, .nc-minilab-footer),
body.capture-frame :is(.minilab-ecosystem-header, .release-context, .nc-minilab-footer) {
  display: none;
}

body.capture-clean .experience-stage,
body.capture-frame .experience-stage {
  min-height: 100svh;
  padding: 0;
}

body.capture-clean .story-shell {
  height: 100svh;
  grid-template-rows: minmax(0, 1fr);
}

body.capture-clean .scene {
  padding: max(24px, var(--safe-top)) 16px max(24px, var(--safe-bottom));
}

body.capture-frame {
  width: var(--capture-width, 390px);
  height: var(--capture-height, 844px);
  min-height: var(--capture-height, 844px);
}

body.capture-frame .story-shell {
  position: fixed;
  inset: 0 auto auto 0;
  width: var(--capture-width, 390px);
  height: var(--capture-height, 844px);
  min-height: var(--capture-height, 844px);
}

body.motion-freeze .story-shell * {
  transition: none !important;
}

body.motion-freeze .stars circle,
body.motion-freeze .local-core,
body.motion-freeze .signal,
body.motion-freeze .bell,
body.motion-freeze .bell-glow,
body.motion-freeze .peal-ring,
body.motion-freeze .phase,
body.motion-freeze .memory-step {
  animation: none !important;
}

body.motion-freeze .story-shell[data-scene="4"] .bell {
  transform: rotate(4deg);
}

body.motion-freeze .story-shell[data-scene="4"] .peal-ring-a {
  opacity: 0.24;
  transform: scale(4.6);
}

body.motion-freeze .story-shell[data-scene="4"] .peal-ring-b {
  opacity: 0.42;
  transform: scale(3.15);
}

body.motion-freeze .story-shell[data-scene="4"] .peal-ring-c {
  opacity: 0.7;
  transform: scale(1.75);
}

body.motion-freeze .story-shell[data-scene="4"] .phase {
  opacity: 1;
}

body.motion-freeze .story-shell[data-scene="5"] .memory-step {
  opacity: 1;
  transform: none;
  animation: none !important;
}

@keyframes local-pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1.32);
  }
}

@keyframes star-pulse {
  from {
    opacity: 0.18;
  }
  to {
    opacity: 0.48;
  }
}

@keyframes signal-climb {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -0.52;
  }
}

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

@keyframes glow-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes peal-wave {
  0% {
    opacity: 0.9;
    transform: scale(0.35);
  }
  100% {
    opacity: 0;
    transform: scale(6.4);
  }
}

@keyframes phase-sequence {
  0%,
  24% {
    opacity: 1;
  }
  25%,
  100% {
    opacity: 0.18;
  }
}

@keyframes memory-arrive {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 560px) {
  body {
    background:
      radial-gradient(circle at 50% 20%, #17263c, transparent 35%),
      #02060d;
  }

  .experience-stage {
    min-height: calc(100svh - 58px);
    padding: 18px;
  }

  .story-shell {
    width: 430px;
    height: min(932px, calc(100svh - 94px));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.58);
  }
}

@media (max-width: 390px) {
  .minilab-ecosystem-brand span { display: none; }
  .minilab-ecosystem-header { gap: 8px; }
}

@media (max-height: 700px) {
  .scene-heading {
    min-height: 84px;
  }

  .scene h1 {
    font-size: 24px;
  }

  .scene-copy {
    margin-top: 5px;
    font-size: 13px;
  }

  .monastery {
    min-height: 262px;
  }

  .scene-hint {
    min-height: 38px;
    margin-top: 2px;
  }

  .controls {
    min-height: calc(64px + var(--safe-bottom));
    padding-top: 6px;
    padding-bottom: calc(8px + var(--safe-bottom));
  }
}

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

  .story-shell[data-scene="4"] .peal-ring-a {
    opacity: 0.56;
    transform: scale(2.2);
  }

  .story-shell[data-scene="4"] .peal-ring-b {
    opacity: 0.28;
    transform: scale(4.1);
  }
}

/* Tres escenarios y un monasterio fuera de campo */
.scenario-trigger {
  display: inline-flex;
  min-height: 26px;
  padding: 3px 0;
  gap: 7px;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.scenario-trigger span:last-child {
  color: rgba(239, 198, 107, 0.7);
  font-size: 13px;
  transform: translateY(-1px);
}

.scenario-trigger .kicker-icon {
  align-items: center;
}

.scenario-trigger:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

.scale-chip {
  position: absolute;
  top: 44px;
  left: 50%;
  z-index: 3;
  max-width: calc(100% - 24px);
  color: rgba(236, 221, 186, 0.95);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 13.5px;
  letter-spacing: 0.015em;
  text-align: center;
  text-shadow: 0 1px 10px rgba(4, 10, 19, 0.95);
  transform: translateX(-50%);
  white-space: nowrap;
}

.deep-rooms {
  opacity: 0.7;
  transition: opacity 600ms ease;
}

.deep-rooms rect {
  fill: rgba(93, 122, 153, 0.025);
  stroke: rgba(131, 160, 187, 0.13);
  stroke-width: 0.8;
  animation: depth-local 5.2s ease-in-out infinite alternate;
  animation-delay: var(--depth-delay, 0ms);
}

.story-shell[data-phase="candidates"] .deep-rooms rect:nth-child(5n),
.story-shell[data-phase="competition"] .deep-rooms rect:nth-child(7n) {
  fill: rgba(239, 198, 107, 0.08);
  stroke: rgba(239, 198, 107, 0.2);
}

.story-shell[data-phase="broadcast"] .deep-rooms rect {
  animation: depth-broadcast 1.8s ease-out both;
  animation-delay: calc(var(--depth-delay, 0ms) / -4);
}

.story-shell[data-phase="reorganization"] .deep-rooms rect:nth-child(3n) {
  fill: rgba(239, 198, 107, 0.1);
  stroke: rgba(239, 198, 107, 0.26);
}

.room-disabled,
.peripheral-room,
.peripheral-foundation,
.signal-gate,
.signal-walls {
  display: none;
}

.story-shell:is([data-scenario="visit"], [data-scenario="hunger"]) .peripheral-room,
.story-shell:is([data-scenario="visit"], [data-scenario="hunger"]) .peripheral-foundation,
.story-shell:is([data-scenario="visit"], [data-scenario="hunger"]) :is(.signal-gate, .signal-walls) {
  display: block;
}

.peripheral-foundation {
  fill: rgba(12, 24, 40, 0.88);
  stroke: rgba(83, 101, 124, 0.66);
  stroke-width: 1.2;
}

.room-gate .local-core {
  fill: #d8b277;
  animation-delay: -1.1s;
}

.room-gate {
  --room-strength-color: #d8b277;
}

.room-walls .local-core {
  fill: #69a5a3;
  animation-delay: -2.7s;
}

.room-walls {
  --room-strength-color: #69a5a3;
}

.signal-gate {
  stroke: #d8b277;
}

.signal-walls {
  stroke: #69a5a3;
}

.visit-origin,
.hunger-origin {
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.knock-wave,
.knock-mark {
  fill: none;
  stroke: #d8b277;
  stroke-linecap: round;
}

.knock-wave {
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.knock-mark {
  stroke-width: 2.6;
}

.story-shell[data-scenario="visit"]:is([data-phase="ignition"], [data-phase="candidates"], [data-phase="competition"], [data-phase="access"]) .visit-origin {
  opacity: 0.9;
}

.story-shell[data-scenario="visit"][data-phase="ignition"] .knock-wave {
  animation: knock-spread 1.4s ease-out infinite;
}

.story-shell[data-scenario="visit"][data-phase="ignition"] .knock-wave-b {
  animation-delay: 170ms;
}

.story-shell[data-scenario="visit"][data-phase="ignition"] .knock-wave-c {
  animation-delay: 340ms;
}

.hunger-ring,
.hunger-wave {
  fill: none;
  stroke: var(--vermillion);
  stroke-linecap: round;
}

.hunger-ring {
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
}

.hunger-wave {
  stroke-width: 2.3;
}

.story-shell[data-scenario="hunger"]:is([data-phase="ignition"], [data-phase="candidates"], [data-phase="competition"], [data-phase="access"]) .hunger-origin {
  opacity: 0.9;
}

.story-shell[data-scenario="hunger"] .hunger-ring-a {
  animation: hunger-pulse 1.94s ease-out infinite;
}

.story-shell[data-scenario="hunger"] .hunger-ring-b {
  animation: hunger-pulse 1.94s 970ms ease-out infinite;
}

.fire-origin,
.event-smoke {
  display: none;
}

.story-shell[data-scenario="fire"] :is(.fire-origin, .event-smoke) {
  display: block;
}

.story-shell[data-scenario="visit"][data-scene="2"] .room-halo {
  fill: rgba(216, 178, 119, 0.035);
  stroke: rgba(216, 178, 119, 0.14);
}

.story-shell[data-scenario="visit"][data-scene="2"] :is(.room-gate, .room-walls) .room-halo {
  fill: rgba(216, 178, 119, 0.09);
  stroke: rgba(216, 178, 119, 0.42);
}

.story-shell[data-scenario="hunger"][data-scene="2"] .room-halo {
  fill: rgba(229, 107, 93, 0.025);
  stroke: rgba(229, 107, 93, 0.12);
}

.story-shell[data-scenario="hunger"][data-scene="2"] :is(.room-infirmary, .room-cell) .room-halo {
  fill: rgba(229, 107, 93, 0.08);
  stroke: rgba(229, 107, 93, 0.36);
}

.story-shell[data-scenario="visit"][data-scene="3"] .signal,
.story-shell[data-scenario="hunger"][data-scene="3"] .signal {
  opacity: 0.24;
  stroke-width: 2.8;
  filter: none;
}

.story-shell[data-scenario="visit"][data-scene="3"] :is(.signal-gate, .signal-walls),
.story-shell[data-scenario="hunger"][data-scene="3"] :is(.signal-infirmary, .signal-cell) {
  opacity: 0.9;
  stroke-width: 4.8;
  filter: url(#soft-glow);
}

.story-shell[data-scenario="visit"][data-scene="3"] :is(.room-gate, .room-walls) .room-halo,
.story-shell[data-scenario="hunger"][data-scene="3"] :is(.room-infirmary, .room-cell) .room-halo {
  fill: rgba(239, 198, 107, 0.07);
  stroke: rgba(239, 198, 107, 0.4);
}

.story-shell[data-scenario="visit"][data-scene="3"] .room-infirmary:not(.attention, .pending-winner) .room-halo {
  fill: transparent;
  stroke: rgba(159, 181, 202, 0.18);
}

.story-shell:is([data-phase="access"], [data-phase="broadcast"]) :is(.room-gate, .room-walls) .local-core {
  fill: #d8b277;
}

.scenario-dialog {
  width: min(410px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(720px, calc(100svh - 28px));
  margin: auto;
  padding: 24px;
  overflow: auto;
  border: 1px solid rgba(239, 198, 107, 0.28);
  border-radius: 24px;
  background: #0b1525;
  color: var(--paper);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.66);
}

.scenario-dialog::backdrop {
  background: rgba(1, 5, 10, 0.8);
  backdrop-filter: blur(8px);
}

body.capture-frame .scenario-dialog[open] {
  right: auto;
  left: calc(var(--capture-width, 390px) / 2);
  width: calc(var(--capture-width, 390px) - 24px);
  max-width: calc(var(--capture-width, 390px) - 24px);
  transform: translateX(-50%);
}

.scenario-dialog .sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.scenario-dialog h2 {
  margin: 0 44px 7px 0;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
}

.scenario-dialog > p:not(.sheet-kicker) {
  margin: 0;
  color: #bcc8d2;
  font-size: 13px;
  line-height: 1.45;
}

.scenario-options {
  display: grid;
  margin: 18px 0 14px;
  gap: 8px;
}

.scenario-option {
  display: grid;
  min-height: 68px;
  padding: 12px 14px;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  text-align: left;
}

.scenario-option strong {
  color: var(--paper);
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
}

.scenario-option span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.scenario-option.active {
  border-color: rgba(239, 198, 107, 0.56);
  background: rgba(239, 198, 107, 0.08);
}

.scenario-option.active::after {
  color: var(--gold);
  content: "ACTUAL";
  letter-spacing: 0.12em;
  font-size: 8px;
  font-weight: 900;
}

.scenario-note {
  padding-top: 4px;
  color: rgba(188, 200, 210, 0.68) !important;
  font-size: 10px !important;
}

@keyframes depth-local {
  from { opacity: 0.28; }
  to { opacity: 0.9; }
}

@keyframes depth-broadcast {
  0% { fill: rgba(93, 122, 153, 0.025); stroke: rgba(131, 160, 187, 0.13); }
  45% { fill: rgba(239, 198, 107, 0.24); stroke: rgba(255, 226, 154, 0.62); }
  100% { fill: rgba(239, 198, 107, 0.06); stroke: rgba(239, 198, 107, 0.18); }
}

@keyframes knock-spread {
  0% { opacity: 0.9; transform: scale(0.72); }
  100% { opacity: 0; transform: scale(1.12); }
}

@keyframes hunger-pulse {
  0% { opacity: 0.9; transform: scale(0.65); }
  100% { opacity: 0; transform: scale(2.1); }
}

body.motion-freeze :is(.deep-rooms rect, .knock-wave, .hunger-ring) {
  animation: none !important;
}

body.motion-freeze .story-shell[data-scenario="visit"] .knock-wave-a,
body.motion-freeze .story-shell[data-scenario="hunger"] .hunger-ring-a {
  opacity: 0.38;
}

body.motion-freeze .story-shell[data-scenario="visit"] .knock-wave-b,
body.motion-freeze .story-shell[data-scenario="hunger"] .hunger-ring-b {
  opacity: 0.68;
}

.story-shell:is([data-scenario="visit"], [data-scenario="hunger"]):is([data-phase="reorganization"], [data-phase="memory"], [data-phase="complete"]) .monastery {
  height: calc(100% - 62px);
  align-self: start;
}

@media (max-height: 700px) {
  .scale-chip {
    top: 38px;
    font-size: 11.5px;
  }

  .story-shell:is([data-scenario="visit"], [data-scenario="hunger"]) .monastery {
    min-height: 274px;
  }

  .story-shell:is([data-phase="reorganization"], [data-phase="memory"], [data-phase="complete"]) .monastery {
    height: calc(100% - 62px);
    align-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deep-rooms rect,
  .knock-wave,
  .hunger-ring {
    animation: none !important;
  }

  .story-shell[data-phase="broadcast"] .deep-rooms rect {
    fill: rgba(239, 198, 107, 0.12);
    stroke: rgba(239, 198, 107, 0.34);
  }
}

/* Experiencia continua */
.top-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.icon-button > span:where(:not(.scenario-icon)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.scenario-button {
  color: var(--gold);
  border-color: rgba(239, 198, 107, 0.42);
  background: rgba(239, 198, 107, 0.07);
}

.scenario-icon {
  display: none;
  align-items: center;
  justify-content: center;
}

[data-scenario="fire"] .icon-fire,
[data-scenario="visit"] .icon-visit,
[data-scenario="hunger"] .icon-hunger {
  display: inline-flex;
}

.sound-button .sound-on {
  display: none;
  color: var(--gold);
}

.sound-button[aria-pressed="true"] {
  border-color: rgba(239, 198, 107, 0.48);
  background: rgba(239, 198, 107, 0.08);
}

.sound-button[aria-pressed="true"] .sound-on {
  display: inline;
}

.sound-button[aria-pressed="true"] .sound-off {
  display: none;
}

.fire-origin {
  opacity: 0;
  transition: opacity 300ms ease;
}

.fire-flame {
  transform-box: fill-box;
  transform-origin: center bottom;
}

.fire-glow {
  fill: url(#gold-glow);
  opacity: 0.72;
}

.flame-outer {
  fill: #ec704f;
  stroke: #ffb65a;
  stroke-width: 1;
}

.flame-inner {
  fill: #ffe190;
}

.story-shell:is([data-scene="2"], [data-scene="3"], [data-scene="4"]) .fire-origin {
  opacity: 1;
}

.story-shell:is([data-scene="2"], [data-scene="3"], [data-scene="4"]) .fire-flame {
  animation: flame-flicker 620ms ease-in-out infinite alternate;
}

.story-shell[data-phase="ignition"] .event-smoke {
  opacity: 0.26;
}

.story-shell:is([data-phase="candidates"], [data-phase="competition"], [data-phase="access"]) .event-smoke {
  opacity: 1;
  animation: smoke-rise 2.8s ease-in-out infinite alternate;
}

.story-shell:is([data-phase="broadcast"], [data-phase="reorganization"]) .event-smoke {
  opacity: 0.42;
}

.story-shell[data-phase="access"] .signal.winner {
  opacity: 1;
  stroke: var(--gold-bright);
  stroke-width: 5.4;
  filter: url(#soft-glow);
}

.story-shell[data-phase="access"] .bell,
.story-shell[data-phase="access"] .bell-glow,
.story-shell[data-phase="access"] .peal-ring {
  animation: none;
}

.story-shell[data-phase="access"] .peal-ring {
  opacity: 0;
}

.story-shell[data-phase="access"] .room-body,
.story-shell[data-phase="broadcast"] .room-body {
  fill: rgba(20, 34, 54, 0.95);
  stroke: rgba(159, 181, 202, 0.25);
}

.story-shell[data-phase="access"] .room-output,
.story-shell[data-phase="broadcast"] .room-output {
  fill: #93a5b7;
}

.story-shell[data-phase="access"] .local-core,
.story-shell[data-phase="broadcast"] .local-core {
  fill: var(--cobalt);
}

.story-shell[data-phase="access"] .room-library .local-core,
.story-shell[data-phase="broadcast"] .room-library .local-core {
  fill: var(--violet);
}

.story-shell[data-phase="access"] .room-infirmary .local-core,
.story-shell[data-phase="broadcast"] .room-infirmary .local-core {
  fill: var(--vermillion);
}

.story-shell[data-phase="access"] .room-garden .local-core,
.story-shell[data-phase="broadcast"] .room-garden .local-core {
  fill: var(--mineral);
}

.story-shell[data-phase="access"] .room-workshop .local-core,
.story-shell[data-phase="broadcast"] .room-workshop .local-core {
  fill: #d59b64;
}

.story-shell[data-phase="access"] .room-cell .local-core,
.story-shell[data-phase="broadcast"] .room-cell .local-core {
  fill: #8d96c9;
}

.story-shell:is([data-phase="access"], [data-phase="broadcast"]) .action-card {
  opacity: 0;
  transform: translateY(10px);
}

.story-shell[data-phase="access"] .phase,
.story-shell[data-phase="broadcast"] .phase,
.story-shell[data-phase="reorganization"] .phase {
  animation: none;
}

.story-shell[data-phase="access"] .phase-access,
.story-shell[data-phase="broadcast"] .phase-access,
.story-shell[data-phase="broadcast"] .phase-diffusion,
.story-shell[data-phase="reorganization"] .phase {
  opacity: 1;
}

.story-shell[data-phase="access"] :is(.phase-diffusion, .phase-reorganization),
.story-shell[data-phase="broadcast"] .phase-reorganization {
  opacity: 0.18;
}

.story-shell[data-phase="reorganization"] .action-card {
  opacity: 1;
  transform: translateY(0);
}

.room.attention .room-body {
  stroke: var(--gold-bright);
  stroke-width: 2.2;
}

.room.pending-winner .room-halo {
  fill: rgba(239, 198, 107, 0.12);
  stroke: var(--gold);
  animation: candidate-ready 420ms ease-in-out infinite alternate;
}

.room.committed-winner .room-halo {
  fill: rgba(239, 198, 107, 0.18);
  stroke: var(--gold-bright);
}

.experience-controls {
  grid-template-columns: 48px minmax(0, 1fr) minmax(145px, 158px);
}

.experience-controls .nav-button.primary {
  line-height: 1.05;
}

.phase-progress {
  gap: 4px;
}

.phase-progress .progress-dot {
  width: 6px;
  height: 6px;
}

.phase-progress .progress-dot.active {
  width: 19px;
}

.phase-progress .progress-dot.complete {
  background: rgba(239, 198, 107, 0.52);
}

.attention-button {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 1px solid rgba(239, 198, 107, 0.42);
  border-radius: 13px;
  background: rgba(239, 198, 107, 0.1);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.attention-button:disabled {
  opacity: 0.36;
  cursor: default;
}

.sr-status {
  position: fixed;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes flame-flicker {
  from {
    transform: scaleX(0.94) scaleY(0.9) rotate(-2deg);
  }
  to {
    transform: scaleX(1.05) scaleY(1.08) rotate(2deg);
  }
}

@keyframes smoke-rise {
  from {
    transform: translateY(2px);
  }
  to {
    transform: translateY(-5px);
  }
}

@keyframes candidate-ready {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 374px) {
  .experience-controls {
    grid-template-columns: 48px minmax(0, 1fr) 140px;
    gap: 8px;
  }

  .experience-controls .nav-button.primary {
    padding-inline: 10px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fire-origin,
  .fire-flame,
  .event-smoke,
  .room.pending-winner .room-halo {
    animation: none !important;
  }
}
