:root {
  color-scheme: dark;
  --color-ink: #100d0a;
  --color-panel: rgba(13, 19, 20, 0.76);
  --color-text: #f7ead2;
  --color-muted: #cbbda4;
  --color-accent: #e6a75a;
  --color-primary: #4fd1b3;
  --color-outline: rgba(247, 234, 210, 0.16);
  --shadow-panel: 0 24px 80px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-ink);
  color: var(--color-text);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(222, 147, 67, 0.28), transparent 34rem),
    linear-gradient(135deg, var(--color-ink) 0%, #21140f 48%, #07161a 100%);
}

button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

button:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.shell {
  display: grid;
  gap: 1.5rem;
  margin: 0 auto;
  max-width: 1100px;
  padding: clamp(1rem, 2vw, 2rem);
}

.hero,
.workbench {
  border: 1px solid var(--color-outline);
  border-radius: 28px;
  background: var(--color-panel);
  box-shadow: var(--shadow-panel);
  padding: clamp(1.2rem, 3vw, 2rem);
}

.title-screen {
  grid-column: 1 / -1;
  max-width: 760px;
}

/* Opening Archive object: a sealed folio followed by its opened briefing. */
.title-bookend,
.chapter-intro {
  border-radius: 2px;
  color: var(--color-text);
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2.4rem, 5vw, 4.6rem) clamp(2rem, 7vw, 5.5rem);
  position: relative;
  width: 100%;
}

.title-bookend {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 9%, transparent 94%, rgba(0, 0, 0, 0.28)),
    radial-gradient(circle at 78% 25%, rgba(137, 87, 44, 0.11), transparent 24rem),
    linear-gradient(145deg, #202220, #111716 58%, #191612);
  border: 1px solid #62503d;
  box-shadow:
    inset 9px 0 0 #17120e,
    inset 11px 0 rgba(176, 112, 53, 0.24),
    inset 0 0 0 3px rgba(247, 234, 210, 0.035),
    inset 0 -22px 44px rgba(0, 0, 0, 0.3),
    0 3px 0 #3a2a1c,
    0 30px 80px rgba(0, 0, 0, 0.52);
  min-height: clamp(29rem, 62vh, 38rem);
  max-width: 920px;
  padding-left: clamp(3rem, 9vw, 7rem);
}

.title-bookend::before {
  border: 1px solid rgba(202, 139, 76, 0.38);
  border-left: 3px solid #a66d37;
  content: "";
  inset: clamp(1.1rem, 2.4vw, 1.8rem);
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.title-bookend::after {
  background: linear-gradient(90deg, #bd8044 0 2.5rem, rgba(189, 128, 68, 0.22) 2.5rem 100%);
  bottom: clamp(2.8rem, 6vw, 4.8rem);
  content: "";
  height: 1px;
  left: clamp(3rem, 9vw, 7rem);
  position: absolute;
  width: min(42%, 18rem);
}

.title-bookend .chapter-context,
.chapter-intro .chapter-context { color: #e6a75a; }

.title-bookend .product-masthead {
  font-family: Georgia, serif;
  font-size: clamp(3.6rem, 11vw, 7.4rem);
  line-height: 0.86;
  margin: 0 0 0.7rem;
  max-width: 9ch;
  overflow-wrap: normal;
}

.title-bookend .title-chapter-context {
  color: #d3b17c;
  margin-bottom: clamp(1.1rem, 2vw, 1.7rem);
}

.title-bookend > p:not([class]) {
  color: #d3c6b1;
  font-size: clamp(1rem, 0.94rem + 0.25vw, 1.12rem);
  line-height: 1.65;
  max-width: 34rem;
}

.chapter-intro {
  background:
    radial-gradient(circle at 18% 8%, rgba(230, 167, 90, 0.09), transparent 19rem),
    linear-gradient(115deg, #1c1d1b, #101515 52%, #1b1814);
  border: 1px solid #55483b;
  box-shadow:
    inset 0 0 0 1px rgba(247, 234, 210, 0.035),
    inset 0 0 55px rgba(0, 0, 0, 0.44),
    0 28px 75px rgba(0, 0, 0, 0.48);
  max-width: 920px;
  padding-left: clamp(2.2rem, 7vw, 5.4rem);
}

.chapter-intro::before,
.chapter-intro::after {
  content: "";
  pointer-events: none;
  position: absolute;
}

.chapter-intro::before {
  border-block: 1px solid rgba(202, 139, 76, 0.32);
  height: calc(100% - clamp(2rem, 5vw, 3.5rem));
  inset: clamp(1rem, 2.5vw, 1.75rem) clamp(1rem, 2.5vw, 1.75rem) auto;
  z-index: -1;
}

.chapter-intro::after {
  border-left: 1px solid #b2763f;
  border-top: 1px solid #b2763f;
  height: 1rem;
  left: clamp(1rem, 2.5vw, 1.75rem);
  top: clamp(1rem, 2.5vw, 1.75rem);
  width: 1rem;
}

.chapter-intro > p:not([class]) {
  color: #d6c9b4;
  line-height: 1.55;
  margin: 0.55rem 0;
  max-width: 42rem;
}

.briefing-procedure {
  border-left: 2px solid rgba(230, 167, 90, 0.62);
  color: #e4d5bd;
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.04rem);
  line-height: 1.55;
  margin: 1.1rem 0 0;
  max-width: 42rem;
  padding-left: 0.85rem;
}

.title-screen.title-bookend > button.primary,
.title-screen.chapter-intro > button.primary {
  background: linear-gradient(180deg, #2e3935, #18221f) !important;
  border: 1px solid #b8793e;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(247, 234, 210, 0.05), 0 5px 18px rgba(0, 0, 0, 0.35);
  color: #fff5e4;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 1.35rem;
  min-height: 3.15rem;
  padding: 0.8rem 1.35rem;
}

.title-screen.title-bookend > button.primary:hover,
.title-screen.chapter-intro > button.primary:hover {
  background: linear-gradient(180deg, #3a4842, #202d29) !important;
  border-color: #e6a75a;
  color: #fff5e4;
}

.title-screen.title-bookend > button.primary:focus-visible,
.title-screen.chapter-intro > button.primary:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
}

.shell:has(> .title-bookend),
.shell:has(> .chapter-intro) {
  align-content: center;
  min-height: 100vh;
}

@media (max-width: 560px) {
  .title-bookend,
  .chapter-intro {
    padding: 2.5rem 1.65rem 2.25rem;
  }

  .title-bookend {
    min-height: min(35rem, calc(100vh - 2rem));
    padding-left: 2.35rem;
  }

  .title-bookend::after {
    bottom: 2.4rem;
    left: 2.35rem;
  }

  .chapter-intro {
    background:
      radial-gradient(circle at 18% 8%, rgba(230, 167, 90, 0.09), transparent 16rem),
      linear-gradient(145deg, #1c1d1b, #101515 58%, #1b1814);
  }

  .chapter-intro > p:not([class]),
  .briefing-procedure { font-size: 0.95rem; }

  .title-bookend .product-masthead {
    font-size: clamp(2.7rem, 13vw, 3.5rem);
    letter-spacing: -0.02em;
    max-width: 100%;
  }

}

.hero h1 {
  font-family: Georgia, serif;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.9;
  margin: 0.25rem 0 1rem;
  max-width: 10ch;
}

.narrative-screen .product-name {
  font-family: Georgia, serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1;
  margin: 0 0 0.55rem;
}

.narrative-screen .chapter-context {
  color: var(--color-accent);
  font-size: clamp(0.82rem, 0.78rem + 0.2vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.09em;
  margin: 0;
  text-transform: uppercase;
}

.narrative-screen h1 {
  font-size: clamp(2.35rem, 5vw, 3.8rem);
  line-height: 1.02;
  max-width: 14ch;
}

.chapter-intro h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
.onboarding-chapter-title h1 {
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 0.94;
  max-width: 14ch;
}

.onboarding-protocol h1 {
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  line-height: 0.98;
  max-width: 20ch;
}

.onboarding-world h1 {
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  line-height: 1;
  max-width: 24ch;
}

.title-bookend h1.product-masthead { max-width: 9ch; }
.results-screen h1 { font-size: clamp(2.25rem, 4.75vw, 3.6rem); max-width: 16ch; }
.restoration-report-screen .chapter-context {
  color: var(--color-muted);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
  text-transform: none;
}

.inference-screen h1 {
  font-size: clamp(2.25rem, 3.8vw, 3.15rem);
  line-height: 1.02;
  margin: 0.45rem 0 1rem;
  max-width: 18ch;
}

.inference-screen .field-report {
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0 0 1.15rem;
}

.inference-screen .scenario {
  font-size: clamp(1.05rem, 1rem + 0.25vw, 1.18rem);
  line-height: 1.5;
  margin: 0 0 1.35rem;
  max-width: 44rem;
}

.inference-screen .glossophage-choices button { font-size: 1rem; }
.inference-screen .inference-feedback { font-size: 0.98rem; line-height: 1.45; }
.result-summary strong { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
.results-screen > .primary { font-size: clamp(1rem, 0.96rem + 0.2vw, 1.1rem); font-weight: 700; }

@media (max-width: 560px) {
  .onboarding-chapter-title h1 {
    font-size: clamp(2.25rem, 11vw, 3.15rem);
    max-width: 100%;
  }

  .onboarding-protocol h1 {
    font-size: clamp(1.9rem, 9vw, 2.65rem);
    line-height: 1;
    max-width: 100%;
  }

  .onboarding-world h1 {
    font-size: clamp(1.8rem, 8vw, 2.35rem);
    line-height: 1;
    max-width: 100%;
  }

  .inference-screen h1 {
    font-size: clamp(2rem, 9vw, 2.65rem);
    line-height: 1.04;
    max-width: 100%;
  }
}

.eyebrow,
.field {
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.stats span,
.phase-card,
.challenge,
.assembly,
.answer-reveal {
  border: 1px solid rgba(230, 167, 90, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.85rem 1rem;
}

.workbench {
  display: grid;
  gap: 1rem;
}

.challenge h3 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 0.3rem 0;
}

.assembly,
.choices {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-height: 4.5rem;
}

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

.chip,
.choice,
.actions button,
.title-screen button {
  background: var(--color-text);
  color: #20130d;
  padding: 0.75rem 1rem;
}

.chip.selected { background: var(--color-accent); }
.chip.connector { background: #60564a; color: var(--color-text); cursor: default; }

.choice {
  border-radius: 18px;
  display: grid;
  gap: 0.2rem;
  min-width: 9rem;
  text-align: left;
}

.choice span {
  color: #60472d;
  font-size: 0.85rem;
}

.primary { background: var(--color-primary) !important; }
.feedback { color: #f7d18e; font-weight: 700; }
.answer-reveal { color: var(--color-text); }

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
  clip: rect(0 0 0 0);
}

@media (min-width: 760px) {
  .shell { grid-template-columns: 0.85fr 1.15fr; align-items: start; }
  .hero:not(.title-screen) { position: sticky; top: 1rem; }
}

/* Compact active-game shell. Title/results retain the larger hero composition. */
.game-shell {
  --corrupt-alpha: 0;
  border: 1px solid rgba(230, 167, 90, 0.2);
  border-radius: 28px;
  box-shadow: var(--shadow-panel);
  display: grid;
  gap: 0.8rem;
  overflow: hidden;
  padding: clamp(0.75rem, 1.4vw, 1.1rem);
  position: relative;
}

.game-shell::before {
  background:
    radial-gradient(circle at 0 0, rgba(9, 3, 12, var(--corrupt-alpha)), transparent 20rem),
    radial-gradient(circle at 100% 100%, rgba(0, 0, 0, calc(var(--corrupt-alpha) * 0.8)), transparent 18rem);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 180ms ease;
  z-index: 0;
}

.game-shell > * { position: relative; z-index: 1; }
.corruption-0 { --corrupt-alpha: 0; }
.corruption-1 { --corrupt-alpha: 0.08; }
.corruption-2 { --corrupt-alpha: 0.14; }
.corruption-3 { --corrupt-alpha: 0.2; }
.corruption-4 { --corrupt-alpha: 0.28; }
.corruption-5 { --corrupt-alpha: 0.36; }
.corruption-6 { --corrupt-alpha: 0.44; }

.compact-hud {
  align-items: stretch;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(9rem, 1.2fr) repeat(7, minmax(5.4rem, 1fr));
}

.brand-lockup,
.hud-stat {
  border: 1px solid rgba(230, 167, 90, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  min-height: 3.2rem;
  padding: 0.55rem 0.7rem;
}

.brand-lockup { align-items: center; display: flex; gap: 0.6rem; }
.brand-mark {
  border: 1px solid rgba(79, 209, 179, 0.65);
  border-radius: 50%;
  color: var(--color-primary);
  display: inline-grid;
  font-size: 0.78rem;
  font-weight: 900;
  height: 2rem;
  place-items: center;
  width: 2rem;
}

.hud-stat { display: grid; gap: 0.12rem; }
.hud-stat span { color: var(--color-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.hud-stat strong { font-size: 1rem; }
.corruption-meter { border-color: rgba(55, 25, 62, 0.95); box-shadow: inset 0 0 0 1px rgba(230, 167, 90, var(--corrupt-alpha)); }

.game-shell .workbench { gap: 0.7rem; padding: 0.9rem; }
.game-shell .challenge {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.48fr);
  padding: 0.9rem 1rem;
}

.challenge h2 { font-size: clamp(1.55rem, 3vw, 2.45rem); line-height: 1.05; margin: 0.2rem 0; overflow-wrap: anywhere; text-wrap: balance; }
.challenge p { margin: 0.25rem 0; }
.challenge-support { color: var(--color-muted); font-size: clamp(0.95rem, 0.9rem + 0.18vw, 1.03rem); line-height: 1.45; }
.phase-brief { border-left: 3px solid var(--color-accent); color: var(--color-muted); display: grid; gap: 0.35rem; padding-left: 0.8rem; }
.phase-brief strong { color: var(--color-text); }
.game-shell .assembly { min-height: 3.7rem; padding: 0.65rem 0.75rem; }
.game-shell .choices { gap: 0.55rem; }
.game-shell .choice { min-width: 8.2rem; padding: 0.65rem 0.8rem; }
.game-shell .actions { margin-top: 0.25rem; }
.game-shell .feedback { margin: 0.15rem 0 0; }

.outcome-banner {
  align-items: center;
  border: 2px solid var(--color-accent);
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.7rem 0.9rem;
}
.outcome-banner.correct { background: rgba(230, 167, 90, 0.18); box-shadow: 0 0 28px rgba(79, 209, 179, 0.16); }
.outcome-banner.incorrect { background: linear-gradient(90deg, rgba(19, 7, 26, 0.86), rgba(255, 255, 255, 0.05)); border-color: #3a173f; }
.outcome-banner.timeout { background: repeating-linear-gradient(135deg, rgba(230, 167, 90, 0.14) 0 10px, rgba(20, 13, 10, 0.55) 10px 20px); border-style: dashed; }
.outcome-correct .workbench { border-color: rgba(79, 209, 179, 0.65); }
.outcome-incorrect .workbench { border-color: rgba(58, 23, 63, 0.95); }
.outcome-timeout .workbench { border-color: rgba(230, 167, 90, 0.75); }

/* Keep the sealed-round review dense enough to retain the complete HUD at desktop sizes. */
.round-sealed .phase-brief { display: none; }
.round-sealed .challenge { grid-template-columns: 1fr; padding-block: 0.65rem; }
.round-sealed .challenge h2 { font-size: 1.55rem; }
.round-sealed .assembly { min-height: 3.2rem; }
.round-sealed .choices { min-height: 0; }
.round-sealed .choice { padding-block: 0.5rem; }

.round-result {
  align-items: stretch;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(15rem, 1.1fr) minmax(17rem, 1fr) auto;
}
.round-result .outcome-banner { grid-column: 1 / 2; grid-row: 1 / 3; }
.round-result .answer-reveal { align-content: center; display: grid; grid-column: 2 / 3; grid-row: 1 / 2; padding: 0.55rem 0.75rem; }
.round-result .result-feedback { color: #f7d18e; font-weight: 700; grid-column: 2 / 3; grid-row: 2 / 3; margin: 0; }
.round-result .sealed-note { color: var(--color-muted); grid-column: 1 / 3; margin: 0; }
.round-result .sealed-note strong { color: var(--color-text); }
.round-result #continue { align-self: center; grid-column: 3; grid-row: 1 / 4; min-height: 2.75rem; padding-inline: 1.1rem; width: fit-content; }

/* One-shot outcome cues settle into the static outcome styling above. */
.outcome-correct .assembly { animation: restoration-pulse 600ms ease-out both; border-color: rgba(79, 209, 179, 0.72); }
.outcome-correct .corruption-meter { animation: corruption-recedes 600ms ease-out both; }
.outcome-incorrect .assembly .selected { position: relative; z-index: 2; }
/* Foundations A: the instrument slips out of registration, rather than growing ink. */
.outcome-incorrect [data-cabinet="foundations-a"] .assembly .selected { animation: apparatus-slip 620ms ease-out both; }
.outcome-incorrect [data-cabinet="foundations-a"]::after {
  animation: rail-misregister 620ms ease-out both;
  border-top: 1px solid rgba(230, 167, 90, .5);
  border-bottom: 1px solid rgba(18, 10, 22, .72);
  content: "";
  inset: 50% .8rem auto;
  pointer-events: none;
  position: absolute;
}
/* Foundations B leaves a restrained, counterfeit alignment around the assembly. */
.outcome-incorrect [data-cabinet="foundations-b"] .assembly { box-shadow: 3px 2px 0 rgba(40, 20, 48, .34), -1px -1px 0 rgba(80, 46, 87, .22); }
.outcome-incorrect [data-cabinet="foundations-b"] .assembly .selected::after { animation: counterfeit-trace 720ms ease-out both; border: 1px solid rgba(65, 33, 75, .62); content: ""; inset: -3px 2px 2px -3px; opacity: .24; pointer-events: none; position: absolute; }
/* Only Pulse receives the jagged encroachment. */
.outcome-incorrect [data-cabinet="pulse"] .assembly .selected { animation: fragment-spoil 720ms ease-out both; background: #35213b; color: #f7d18e; }
.outcome-incorrect [data-cabinet="pulse"]::after {
  animation: ink-encroachment 760ms ease-out both;
  background: #130719;
  clip-path: polygon(0 4%, 37% 10%, 55% 18%, 82% 24%, 58% 30%, 96% 39%, 64% 45%, 88% 53%, 52% 59%, 76% 69%, 43% 75%, 63% 84%, 31% 89%, 0 97%);
  content: "";
  height: 24%;
  left: 0;
  opacity: 0.34;
  pointer-events: none;
  position: absolute;
  top: 34%;
  transform-origin: left center;
  width: 68%;
  z-index: 2;
}
.outcome-incorrect [data-cabinet="pulse"] .assembly { isolation: isolate; position: relative; }
.outcome-incorrect [data-cabinet="pulse"] .assembly::after {
  animation: ink-branch 760ms ease-out both;
  background: #08040c;
  clip-path: polygon(100% 0, 100% 100%, 72% 92%, 53% 77%, 22% 70%, 48% 60%, 4% 49%, 43% 41%, 15% 25%, 64% 31%, 77% 12%);
  content: "";
  inset: -0.35rem -0.35rem -0.35rem 38%;
  opacity: 0.28;
  pointer-events: none;
  position: absolute;
  transform-origin: right center;
  z-index: 1;
}
.outcome-incorrect [data-cabinet] { position: relative; }
.outcome-incorrect [data-cabinet="pulse"] { position: relative; }
.outcome-incorrect [data-cabinet="pulse"]::before { animation: pulse-eyes 760ms ease-out both; background: linear-gradient(105deg, transparent 45%, rgba(74, 39, 79, .85) 47% 49%, transparent 51%), linear-gradient(75deg, transparent 54%, rgba(92, 57, 76, .72) 56% 57%, transparent 59%); content: ""; height: 1.1rem; left: 25%; opacity: 0; pointer-events: none; position: absolute; top: 48%; transform: skewX(-14deg); width: 4.8rem; z-index: 3; }
.outcome-incorrect .corruption-meter { animation: corruption-surges 720ms ease-out both; }
.outcome-timeout [data-timer] { animation: timer-failure 500ms ease-out both; color: var(--color-accent); text-decoration: line-through; text-decoration-thickness: 2px; }
.outcome-timeout .workbench { animation: archive-failure 600ms ease-out both; }

@keyframes restoration-pulse {
  45% { border-color: var(--color-primary); box-shadow: 0 0 24px rgba(79, 209, 179, 0.5), inset 0 0 18px rgba(230, 167, 90, 0.18); }
}
@keyframes corruption-recedes {
  45% { border-color: var(--color-primary); box-shadow: 0 0 18px rgba(79, 209, 179, 0.6); transform: scale(1.035); }
}
@keyframes fragment-spoil {
  0% { filter: none; transform: scale(1); }
  48% { background: #140b18; color: #bdaea0; filter: grayscale(0.85) brightness(0.58); transform: scale(0.91) skewX(-4deg); }
  100% { filter: saturate(0.55) brightness(0.78); transform: scale(0.97) skewX(-1deg); }
}
@keyframes apparatus-slip { 0% { transform: none; } 28% { transform: translateX(-3px) skewX(-2deg); } 54% { transform: translate(3px, 1px) skewX(1deg); } 100% { transform: translateX(1px); } }
@keyframes rail-misregister { 0% { opacity: 0; transform: translateX(-3px); } 40% { opacity: .8; transform: translateX(4px); } 100% { opacity: .22; transform: translateX(1px); } }
@keyframes counterfeit-trace { 0% { opacity: 0; transform: translate(-4px, 2px); } 48% { opacity: .62; transform: translate(2px, -1px); } 100% { opacity: .24; transform: translate(-1px, 1px); } }
@keyframes ink-encroachment {
  0% { opacity: 0; transform: scaleX(0.06); }
  52% { opacity: 0.9; transform: scaleX(1); }
  100% { opacity: 0.34; transform: scaleX(0.42); }
}
@keyframes ink-branch {
  0% { opacity: 0; transform: scaleX(0.08); }
  52% { opacity: 0.82; transform: scaleX(1); }
  100% { opacity: 0.28; transform: scaleX(0.38); }
}
@keyframes pulse-eyes { 0%, 39%, 72%, 100% { opacity: 0; } 48%, 65% { opacity: .82; } }
@keyframes corruption-surges {
  48% { border-color: #8d4b91; box-shadow: 0 0 20px rgba(82, 28, 91, 0.85), inset 0 0 12px rgba(8, 4, 12, 0.9); transform: scale(1.045); }
}
@keyframes timer-failure {
  35% { color: #100d0a; background: var(--color-accent); outline: 3px solid var(--color-accent); }
  55% { transform: translateY(2px); }
}
@keyframes archive-failure {
  40% { filter: brightness(0.52) saturate(0.55); }
}

@media (min-width: 760px) {
  .shell:has(.game-shell) { grid-template-columns: 1fr; max-width: 1280px; gap: 0; }
  .hero:not(.title-screen) { position: static; }
}

@media (max-width: 980px) {
  .compact-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-lockup { grid-column: 1 / -1; }
  .game-shell .challenge { grid-template-columns: 1fr; }
  .round-result { grid-template-columns: 1fr; }
  .round-result .outcome-banner,
  .round-result .answer-reveal,
  .round-result .result-feedback,
  .round-result .sealed-note,
  .round-result #continue { grid-column: 1; grid-row: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .game-shell::before { transition: none; }
  .outcome-correct .assembly,
  .outcome-correct .corruption-meter,
  .outcome-incorrect .assembly .selected,
  .outcome-incorrect .assembly .selected::after,
  .outcome-incorrect .assembly::after,
  .outcome-incorrect .workbench::after,
  .outcome-incorrect .workbench::before,
  .outcome-incorrect [data-cabinet="foundations-a"]::after,
  .outcome-incorrect [data-cabinet="pulse"]::after,
  .outcome-incorrect [data-cabinet="pulse"]::before,
  .outcome-incorrect .corruption-meter,
  .outcome-timeout [data-timer],
  .outcome-timeout .workbench { animation: none; }
}

/* Chapter One breach: a single attacked restoration instrument. */
.breach-ready-screen,
.breach-failed-screen,
.chapter-result-screen {
  background: linear-gradient(145deg, #242624, #101515 58%, #1b1516);
  border-color: #65513d;
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px rgba(247, 234, 210, 0.025), inset 0 -22px 50px rgba(0, 0, 0, 0.42), var(--shadow-panel);
  max-width: 920px;
  min-width: 0;
  width: 100%;
}
.breach-entry-rail,
.failure-seals {
  background: #0b1010;
  border: 1px solid #58534a;
  box-shadow: inset 0 5px 18px #000;
  display: grid;
  gap: clamp(0.4rem, 1.5vw, 0.8rem);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 1.4rem 0;
  padding: 1rem;
}
.breach-entry-rail span { aspect-ratio: 1.55; background: #171b1a; border: 1px solid #736657; box-shadow: inset 0 0 0 3px #0c0f0e; }
.breach-shell { background: linear-gradient(160deg, #202321, #0a0f10 55%, #1a1019); border-radius: 6px; }
.breach-shell::after { background: linear-gradient(105deg, rgba(8, 3, 11, calc(var(--corrupt-alpha) * 1.5)), transparent 54%); content: ""; inset: 0; pointer-events: none; position: absolute; }
.breach-shell > * { z-index: 1; }
.seal-rail {
  background: linear-gradient(#343633, #171b19 45%, #0c1010 46%, #282824);
  border: 1px solid #777064;
  box-shadow: inset 0 4px 12px #090b0b, inset 0 -2px rgba(247,234,210,.08);
  display: grid;
  gap: clamp(.35rem, 1vw, .7rem);
  grid-template-columns: repeat(5, 1fr);
  padding: .75rem;
  position: relative;
}
.seal-rail::before { border-block: 1px solid rgba(230,167,90,.25); content: ""; inset: 50% .5rem auto; position: absolute; }
.corruption-vein { background: #180a1d; clip-path: polygon(0 38%, 24% 44%, 39% 17%, 58% 46%, 79% 33%, 100% 51%, 100% 72%, 78% 58%, 59% 70%, 40% 43%, 22% 68%, 0 59%); inset: 0; opacity: calc(.22 + var(--corrupt-alpha)); position: absolute; }
.seal-socket { align-items: center; background: #121615; border: 1px solid #595750; box-shadow: inset 0 5px 12px #050707; display: grid; min-height: 3.8rem; padding: .45rem; position: relative; text-align: center; }
.seal-socket span { color: #a99d8c; font: 700 1.1rem Georgia, serif; }
.seal-socket strong { color: #a99d8c; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }
.seal-socket.active { border-color: #e6a75a; }
.seal-socket.restored { background: radial-gradient(circle, rgba(230,167,90,.32), #171814 72%); border-color: #d59b52; box-shadow: inset 0 0 15px rgba(230,167,90,.22), 0 0 12px rgba(230,167,90,.16); }
.seal-socket.restored span, .seal-socket.restored strong { color: #f7d18e; }
.seal-socket.stained { background: #190f1d; border-color: #693c70; }
.seal-socket.power-failure { border-style: dashed; filter: grayscale(1); }
.failure-seals span { border: 1px solid #5a5149; display: grid; gap: .25rem; min-width: 0; overflow-wrap: anywhere; padding: .65rem .35rem; text-align: center; text-transform: capitalize; }
.failure-seals span b { font: 700 1.25rem Georgia, serif; }
.failure-seals .restored { border-color: #d59b52; color: #f7d18e; }
.failure-seals .stained { background: #1b0e20; border-color: #693c70; }
.failure-seals .power-failure { border-style: dashed; color: var(--color-muted); }
.ending-copy { border-left: 2px solid #d59b52; margin: 1.4rem 0; padding-left: 1rem; }
.ending-copy p { line-height: 1.5; }
.chapter-summary { display: grid; gap: .65rem; grid-template-columns: repeat(2, 1fr); margin: 1.3rem 0; }
.chapter-summary span { background: rgba(255,255,255,.045); border: 1px solid #5b544b; display: grid; padding: .8rem; }
.chapter-summary b { color: #f7d18e; font: 700 1.5rem Georgia, serif; }

@media (max-width: 560px) {
  .breach-ready-screen, .breach-failed-screen, .chapter-result-screen { padding: 1.25rem; }
  .failure-seals { gap: .25rem; padding: .55rem; }
  .failure-seals span { font-size: .68rem; line-height: 1.15; padding: .5rem .15rem; }
  .seal-rail { gap: .2rem; padding: .45rem; }
  .seal-socket { min-height: 3.1rem; padding: .25rem; }
  .seal-socket strong { font-size: .52rem; }
  .chapter-summary { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .breach-shell *, .chapter-result-screen * { animation: none !important; transition: none !important; }
}

/* Chapter cabinet: compact enough for a complete prompt at standard laptop height. */
.cabinet-shell {
  grid-column: 1 / -1;
  width: 100%;
  border: 1px solid #51483e; border-radius: 10px;
  background: linear-gradient(145deg, #252827, #111716 58%, #24211d);
  box-shadow: inset 0 0 0 2px rgba(247,234,210,.045), inset 0 -12px 30px rgba(0,0,0,.24), var(--shadow-panel);
  display: grid; gap: .85rem; padding: clamp(.9rem, 2vw, 1.4rem);
}
.cabinet-header {
  align-items: center; display: flex; justify-content: space-between; gap: 1rem; min-width: 0;
  background: linear-gradient(180deg, rgba(247,234,210,.07), rgba(0,0,0,.13));
  border: 1px solid #4f4b43; border-radius: 3px;
  box-shadow: inset 0 1px rgba(247,234,210,.08), 0 2px 5px rgba(0,0,0,.28);
  padding: .7rem .85rem;
}
.cabinet-header > div { min-width: 0; }
.cabinet-header h1 { font: 700 clamp(1.65rem, 2.5vw, 2.15rem)/1 Georgia, serif; margin: .12rem 0 0; }
.maker-mark { color: var(--color-muted); font-size: .68rem; font-weight: 800; letter-spacing: .12em; margin: 0 0 .18rem; text-transform: uppercase; }
.maker-mark span { color: var(--color-primary); }
.cabinet-header .eyebrow { margin: 0; }
.cabinet-count { border-left: 1px solid rgba(79,209,179,.4); display: grid; padding: .3rem .25rem .3rem 1rem; }
.cabinet-count span { color: var(--color-muted); font-size: .75rem; text-transform: uppercase; }
.cabinet-grid { display: grid; gap: .85rem; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); min-width: 0; }
.recall-panel, .fragment-sockets {
  background: rgba(4,9,9,.46); border: 1px solid #45433d; border-radius: 5px; min-width: 0; padding: 1rem;
  box-shadow: inset 0 3px 12px rgba(0,0,0,.58), inset 0 0 0 1px rgba(247,234,210,.025);
}
.recall-panel { align-content: center; display: grid; min-height: 25rem; }
.direction-label { color: var(--color-accent); font-size: clamp(.8rem, .76rem + .15vw, .88rem); font-weight: 700; letter-spacing: .08em; margin: 0; text-transform: uppercase; }
.recall-panel h2 { font: 700 clamp(2.25rem, 4.75vw, 3.6rem)/1 Georgia, serif; margin: .6rem 0 1.2rem; max-width: 100%; overflow-wrap: anywhere; }
.recall-panel h2.meaning-prompt { font-size: clamp(1.65rem, 3vw, 2.5rem); line-height: 1.15; text-wrap: balance; }
.recall-panel h2.complete-prompt { font-size: clamp(1.9rem, 3.75vw, 3rem); line-height: 1.08; text-wrap: balance; }
.recall-panel .feedback { font-size: clamp(.95rem, .92rem + .12vw, 1rem); line-height: 1.45; }
.assistance-clue { border-left: 3px solid var(--color-accent); color: var(--color-muted); margin: -.4rem 0 1rem; padding-left: .75rem; }
.recall-choices { display: grid; gap: .65rem; grid-template-columns: repeat(2, 1fr); }
.recall-choices button { background: var(--color-text); color: #20130d; min-height: 3.2rem; padding: .75rem; }
.recall-choices button.revealed-answer { border: 3px double #20130d; font-weight: 900; }
.answer-marker { display: block; font-size: .68rem; letter-spacing: .08em; margin-top: .2rem; text-transform: uppercase; }
.recall-panel > .primary { justify-self: start; min-height: 2.8rem; padding: .7rem 1.1rem; }
.fragment-sockets { display: grid; gap: .6rem; }
.fragment-socket {
  align-items: center; background: linear-gradient(180deg, rgba(247,234,210,.055), rgba(0,0,0,.12));
  border: 1px solid #4b4a44; border-radius: 2px; display: grid; gap: .45rem; grid-template-columns: 1fr auto;
  padding: .7rem .8rem; box-shadow: inset 0 2px 5px rgba(0,0,0,.48), 0 1px rgba(247,234,210,.035);
}
.fragment-socket div:first-child { display: grid; }
.fragment-socket span, .fragment-socket b { color: var(--color-muted); font-size: .8rem; }
.fragment-socket b { grid-column: 1 / -1; }
.stability-marks { display: flex; gap: .25rem; }
.stability-marks span { color: #746b60; font-size: 1rem; }
.stability-marks .filled { color: var(--color-accent); }
.fragment-socket.claimed { background: rgba(79,209,179,.12); border: 2px solid var(--color-primary); box-shadow: inset 0 2px 8px rgba(0,0,0,.42), inset 0 0 18px rgba(79,209,179,.12); }
.fragment-socket.tarnished { background: repeating-linear-gradient(135deg, rgba(58,23,63,.35) 0 7px, transparent 7px 14px); border-style: solid; }
.fragment-socket.newly-restored { animation: fragment-restored 650ms ease-out both; }
.fragment-socket.newly-disturbed { animation: seam-frays 520ms ease-out both; }
.fragment-socket.newly-restored .stability-marks .filled { animation: mark-kindles 520ms ease-out both; }
.fragment-socket.claimed b, .fragment-socket.claimed span { color: var(--color-text); }
.recall-incorrect { border-color: #8d4b91; }
.recall-correct { border-color: var(--color-primary); }
.recall-correct::after, .recall-incorrect::after { content: ""; pointer-events: none; position: absolute; }
.recall-panel { overflow: hidden; position: relative; }
.recall-panel.recall-transition-out { opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity 160ms ease-out, transform 200ms ease-out; }
.recall-correct::after { animation: restoration-spark 600ms ease-out both; background: radial-gradient(circle, #fff 0 8%, var(--color-primary) 10% 28%, transparent 30%); height: 4rem; right: 8%; top: 12%; width: 4rem; }
.recall-incorrect::after { animation: dark-ripple 520ms ease-out both; border: 3px solid #8d4b91; border-radius: 50%; height: 8rem; left: 42%; top: 30%; width: 8rem; }
@keyframes fragment-restored { 45% { box-shadow: 0 0 24px rgba(79,209,179,.45); transform: scale(1.02); } }
@keyframes mark-kindles { 40% { filter: brightness(1.8); text-shadow: 0 0 14px var(--color-primary); transform: scale(1.35); } }
@keyframes restoration-spark { from { opacity: 0; transform: translate(-8rem, 5rem) scale(.2); } 45% { opacity: 1; } to { opacity: 0; transform: translate(0) scale(1); } }
@keyframes dark-ripple { from { opacity: .8; transform: scale(.1); } to { opacity: 0; transform: scale(2.8) rotate(12deg); } }
@keyframes seam-frays { 35% { filter: brightness(.45); transform: translateX(-3px) skewX(-2deg); } 55% { transform: translateX(3px); } }
@media (max-width: 760px) { .cabinet-grid { grid-template-columns: 1fr; } .cabinet-header { align-items: stretch; flex-direction: column; } .recall-panel { min-height: auto; } }
@media (max-width: 420px) { .recall-choices { grid-template-columns: 1fr; } .recall-panel h2.fragment-prompt { font-size: clamp(2.25rem, 14vw, 3.4rem); } }
@media (prefers-reduced-motion: reduce) { .fragment-socket.newly-restored, .fragment-socket.newly-disturbed, .fragment-socket.newly-restored .stability-marks .filled, .recall-correct::after, .recall-incorrect::after { animation: none; } .recall-panel.recall-transition-out { transition: none; } }


/* Glossophage judgement encounter: corruption in the seams, not a creature or health bar. */
.glossophage-shell { overflow: hidden; position: relative; }
.glossophage-presence { inset: .75rem; pointer-events: none; position: absolute; z-index: 0; }
.glossophage-presence span { background: radial-gradient(circle, rgba(42, 25, 49, .7), transparent 62%); border: 1px solid rgba(58, 42, 62, .45); filter: saturate(.8); position: absolute; }
.glossophage-presence span:nth-child(1) { inset: 0 72% 18% 0; }
.glossophage-presence span:nth-child(2) { inset: 64% 8% 0 46%; }
.glossophage-presence span:nth-child(3) { inset: 8% 0 55% 68%; }
.glossophage-shell.pressure-5 .glossophage-presence { opacity: .95; }
.glossophage-shell.pressure-4 .glossophage-presence { opacity: .78; }
.glossophage-shell.pressure-3 .glossophage-presence { opacity: .62; }
.glossophage-shell.pressure-2 .glossophage-presence { opacity: .45; }
.glossophage-shell.pressure-1 .glossophage-presence { opacity: .28; }
.glossophage-shell.pressure-0 .glossophage-presence { opacity: .12; }
.glossophage-shell.pressure-press .glossophage-presence { animation: presence-press 680ms ease-out both; }
.glossophage-eye { background: rgba(70, 40, 76, .84); border-radius: 80% 18% 75% 20%; box-shadow: 0 0 7px rgba(150, 98, 69, .16); height: .24rem; opacity: 0; position: absolute; transform: skewX(-18deg); width: 1.2rem; }
.glossophage-eye-left { left: 13%; top: 31%; }
.glossophage-eye-right { right: 12%; top: 23%; transform: skewX(13deg) rotate(5deg); width: .9rem; }
.glossophage-shell.pressure-press .glossophage-eye { animation: glossophage-eyes 680ms ease-out both; }
.glossophage-shell:has(.answer-correct) .glossophage-presence { animation: presence-recoil 560ms ease-out both; }
.encounter-instrument { position: relative; z-index: 1; }
.glossophage-workbench { position: relative; z-index: 1; }
.glossophage-workbench::before { background: linear-gradient(90deg, rgba(18, 10, 22, .75), transparent 18% 82%, rgba(18, 10, 22, .75)); content: ''; inset: 0; pointer-events: none; position: absolute; }
.glossophage-challenge h2 { font-size: clamp(2rem, 5vw, 4.5rem); }
.glossophage-choices { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); position: relative; z-index: 1; }
.glossophage-choice { background: #151817; border: 1px solid #5f574d; color: var(--color-text); min-height: 3.25rem; padding: .65rem .85rem; text-align: left; width: 100%; }
.glossophage-choice strong { color: #f2e6ce; display: block; font: 700 1.45rem Georgia, serif; }
.glossophage-choice span { color: var(--color-muted); display: block; font-size: .85rem; margin-top: .45rem; }
.glossophage-choice.correct-choice { border-color: #d59b52; box-shadow: inset 0 0 18px rgba(230,167,90,.18); }
.glossophage-choice.locked-choice { opacity: .62; }
.glossophage-workbench.answer-correct { box-shadow: inset 0 0 0 1px rgba(230,167,90,.22); }
.glossophage-workbench.answer-incorrect { box-shadow: inset 0 0 0 1px rgba(96,54,104,.36); }
@keyframes presence-press { 0% { transform: scale(1); } 45% { transform: scale(1.045); } 100% { transform: scale(1.012); } }
@keyframes presence-recoil { 0% { filter: none; transform: scale(1); } 45% { filter: brightness(.72); transform: scale(.972); } 100% { filter: none; transform: scale(1); } }
@keyframes glossophage-eyes { 0%, 26%, 72%, 100% { opacity: 0; } 42%, 62% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  .glossophage-shell *, .glossophage-presence { animation: none !important; transition: none !important; transform: none !important; }
  .outcome-incorrect [data-cabinet="foundations-a"]::after { opacity: .35; }
}
@media (max-width: 700px) { .glossophage-choices { grid-template-columns: 1fr; } }
.glossophage-transcript { display:grid; gap:.35rem; margin:.75rem 0; padding:.7rem; border-left:3px solid currentColor; background:rgba(0,0,0,.08); }
.inference-feedback { margin-top:1rem; padding:1rem; border:1px solid currentColor; }

/* Chapter One consistency system: the opening folio remains intentionally exceptional. */
:root {
  --chapter-card-max: 52rem;
  --chapter-card-padding: clamp(1.4rem, 3.5vw, 2.75rem);
  --narrative-card-heading-size: clamp(2rem, 4vw, 3.25rem);
  --stage-heading-size: clamp(1.65rem, 2.5vw, 2.15rem);
  --task-prompt-size: clamp(1.65rem, 3.25vw, 2.5rem);
}

.chapter-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-inline: auto;
  max-width: var(--chapter-card-max);
  min-height: min(34rem, calc(100vh - 4rem));
  padding: var(--chapter-card-padding);
  width: 100%;
}

.chapter-card .product-name {
  font-family: Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1;
  margin: 0 0 .65rem;
}

.chapter-card .chapter-context,
.cabinet-header .eyebrow,
.direction-label,
.field-report,
.eyebrow,
.field {
  color: var(--color-accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.35;
  text-transform: uppercase;
}

.chapter-card h1 {
  font-family: Georgia, serif;
  font-size: var(--narrative-card-heading-size);
  line-height: 1.04;
  margin: .65rem 0 1rem;
  max-width: 19ch;
  text-wrap: balance;
}

.cabinet-header h1.stage-heading {
  font-family: Georgia, serif;
  font-size: var(--stage-heading-size);
  line-height: 1.08;
  margin: .45rem 0 0;
  max-width: 22ch;
  text-wrap: balance;
}

.chapter-card.restoration-report-screen .chapter-context {
  color: var(--color-muted);
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: .75rem;
  text-transform: none;
}

.chapter-card > p:not([class]),
.chapter-card .glossophage-outcome,
.chapter-card .ending-copy {
  line-height: 1.55;
  max-width: 44rem;
}

.chapter-card > .primary:last-child,
.chapter-card > .breach-entry-rail + .primary {
  margin-top: auto;
  align-self: flex-start;
}

.active-prompt {
  border-left: 3px solid var(--color-accent);
  color: var(--color-text);
  font-family: Georgia, serif;
  font-size: var(--task-prompt-size) !important;
  font-weight: 700;
  line-height: 1.12 !important;
  margin: .75rem 0 1rem !important;
  max-width: 28ch;
  padding: .15rem 0 .15rem .85rem;
  text-wrap: balance;
}

/* Gameplay families reserve a consistent content frame and result space. */
.gameplay-card,
.cabinet-shell,
.game-shell {
  margin-inline: auto;
  width: min(100%, 68rem);
}

.recall-panel {
  gap: .7rem;
  grid-template-rows: auto auto auto minmax(7.25rem, auto) minmax(3rem, auto);
  padding: clamp(1rem, 2.25vw, 1.5rem);
}

.recall-panel .active-prompt { margin-block: .15rem .35rem !important; }
.recall-panel .feedback { align-self: end; margin: 0; min-height: 2.9rem; }
.recall-panel > .primary { margin-top: 0; }

.game-shell .workbench { gap: .85rem; padding: clamp(1rem, 2vw, 1.35rem); }
.game-shell .challenge { gap: 1rem; min-height: 11rem; }
.game-shell .challenge .active-prompt { margin-block: .45rem .7rem !important; }
.round-sealed .challenge h2.active-prompt { font-size: var(--task-prompt-size) !important; }

.inference-screen {
  display: grid;
  grid-template-rows: auto auto auto minmax(7rem, auto) minmax(8.5rem, auto) minmax(10rem, auto);
  gap: .75rem;
  max-width: 56rem;
  min-height: min(38rem, calc(100vh - 4rem));
}
.inference-screen .active-prompt { margin: 0 !important; }
.inference-screen .field-report { color: var(--color-muted); margin: 0; }
.inference-screen .scenario { align-self: start; margin: 0; }
.inference-screen .glossophage-choices { align-self: start; }
.inference-feedback { align-self: stretch; margin: 0; min-height: 9.5rem; }

/* Late-game transitions fit a standard desktop viewport without changing mobile flow. */
@media (min-width: 761px) {
  .inference-screen {
    gap: .6rem;
    grid-template-rows: auto auto auto auto auto auto;
    min-height: 0;
  }

  .inference-screen .inference-feedback {
    min-height: 0;
    padding: .8rem 1rem;
  }

  .inference-screen .inference-feedback p { margin: .4rem 0; }

  .breach-ready-screen {
    gap: .55rem;
    min-height: 0;
    padding-block: clamp(1.35rem, 2.5vw, 2rem);
  }

  .breach-ready-screen .product-name,
  .breach-ready-screen > p,
  .breach-ready-screen .glossophage-transcript,
  .breach-ready-screen .breach-entry-rail { margin: 0; }

  .breach-ready-screen h1 { margin: .25rem 0 .35rem; }
  .breach-ready-screen .breach-entry-rail { margin-top: .2rem; }
  .breach-ready-screen > .primary { margin-top: .15rem; }
}

.glossophage-challenge h2.active-prompt { font-size: var(--task-prompt-size) !important; }
.glossophage-transcript { color: var(--color-muted); font-size: .9rem; line-height: 1.4; }
.glossophage-workbench { grid-template-rows: auto auto minmax(3rem, auto); }
.glossophage-workbench .feedback { margin: 0; min-height: 3rem; }

@media (max-width: 760px) {
  .chapter-card { min-height: auto; }
  .inference-screen { grid-template-rows: auto auto auto auto auto minmax(9rem, auto); min-height: auto; }
  .recall-panel { grid-template-rows: auto auto auto auto minmax(3rem, auto); }
  .game-shell .challenge { min-height: auto; }
  .glossophage-workbench { grid-template-rows: auto auto minmax(3rem, auto); }
}
/* Cabinet completion has no choices or feedback row; keep its action compact. */
.cabinet-complete-panel {
  align-content: start;
  grid-template-rows: auto auto auto auto;
}

.cabinet-complete-panel > .primary {
  align-self: start;
  justify-self: start;
  min-height: 2.8rem;
  padding: .7rem 1.1rem;
}
