:root {
  color-scheme: light;
  --ink: #19242b;
  --muted: #5c6970;
  --paper: #fbf7ef;
  --paper-strong: #fffdf7;
  --mist: #e6edf0;
  --line: #cfd8d7;
  --teal: #1f685b;
  --teal-dark: #17493f;
  --brass: #b46f2a;
  --brass-dark: #7d4a1c;
  --coral: #b95248;
  --plum: #54415f;
  --blue: #356b86;
  --shadow: 0 18px 60px rgba(25, 36, 43, 0.13);
  --soft-shadow: 0 10px 28px rgba(25, 36, 43, 0.1);
  --radius: 8px;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

/* Author display rules (e.g. display: grid) silently defeat the UA's
   [hidden] { display: none } — this guard makes the hidden attribute
   always win. Without it, layers like .cold-open stay mounted over the
   whole view and swallow every click. */
[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(230, 237, 240, 0.75), rgba(251, 247, 239, 0) 36rem),
    var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

/* Shown only when JavaScript is off. */
.noscript-note {
  max-width: 32rem;
  margin: 4rem auto 0;
  padding: 1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  text-align: center;
}

/* Masthead: a letterpress nameplate, not an app header. The double hairline
   under it is the printer's rule the whole shell hangs from. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 3vw, 2rem) 0.8rem;
  border-bottom: 1px solid rgba(25, 36, 43, 0.55);
  box-shadow: 0 3px 0 -1px rgba(25, 36, 43, 0.25);
  background: rgba(251, 247, 239, 0.96);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.brand-seal {
  width: 2.7rem;
  height: 2.7rem;
  flex: none;
  filter: drop-shadow(0 2px 3px rgba(25, 36, 43, 0.25));
}

.brand-seal svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.brand p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-family: var(--display);
  font-style: italic;
  font-size: 0.8rem;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.6rem, 2vw, 1.4rem);
}

/* Quiet small-caps wayfinding, underlined on hover like an index entry. */
.nav-link {
  padding: 0.35rem 0.1rem;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  border-bottom-color: rgba(180, 111, 42, 0.7);
}

.nav-link:focus-visible {
  outline: 3px solid rgba(180, 111, 42, 0.35);
  outline-offset: 2px;
}

.button,
.ghost-button,
.role-tab,
.catalog-card,
.source-link,
.hint-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.button {
  min-height: 2.55rem;
  padding: 0 1rem;
  border-color: var(--teal-dark);
  background: var(--teal);
  color: #fffdf7;
  font-weight: 800;
}

.button:hover,
.ghost-button:hover,
.role-tab:hover,
.catalog-card:hover,
.source-link:hover,
.hint-button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.ghost-button:focus-visible,
.role-tab:focus-visible,
.catalog-card:focus-visible,
.source-link:focus-visible,
.hint-button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(180, 111, 42, 0.35);
  outline-offset: 2px;
}

/* Interactive pieces on paper panels and the dark stage share one visible
   keyboard-focus treatment: a brass ring that reads on both grounds. */
.hud-button:focus-visible,
.hud-chip:focus-visible,
.hud-chip-close:focus-visible,
.overlay-close:focus-visible,
.letter-row:focus-visible,
.journal-tab:focus-visible,
.epilogue-slot:focus-visible,
.epilogue-glyph:focus-visible,
.role-card:focus-visible,
.margin-skip:focus-visible,
.difficulty-option:focus-visible,
.cold-open-skip:focus-visible {
  outline: 3px solid rgba(200, 163, 90, 0.65);
  outline-offset: 2px;
}

/* Small controls keep their engraved size but grow an invisible touch halo
   to a ~40px hit area. Purely a hit-target: no layout, no visuals. */
.overlay-close,
.hud-chip-close,
.hud-button,
.journal-tab,
.role-tab-confirm-button,
.difficulty-option,
.cold-open-skip,
.overlay-panel .margin-skip,
.handshake-send,
.ghost-button,
.hint-button {
  position: relative;
}

.overlay-close::after,
.hud-chip-close::after,
.hud-button::after,
.journal-tab::after,
.role-tab-confirm-button::after,
.difficulty-option::after,
.cold-open-skip::after,
.overlay-panel .margin-skip::after,
.handshake-send::after,
.ghost-button::after,
.hint-button::after {
  content: "";
  position: absolute;
  inset: -6px 0;
}

.overlay-close::after {
  inset: -6px;
}

.hud-chip-close::after {
  inset: -10px;
}

.role-tab-confirm-button::after,
.cold-open-skip::after,
.overlay-panel .margin-skip::after {
  inset: -10px 0;
}

.journal-tab::after {
  inset: -8px 0;
}

.difficulty-option::after,
.ghost-button::after,
.hint-button::after {
  inset: -2px 0;
}

.ghost-button,
.hint-button {
  min-height: 2.45rem;
  padding: 0 0.9rem;
  border-color: rgba(25, 36, 43, 0.14);
  background: rgba(255, 253, 247, 0.8);
  color: var(--ink);
  font-weight: 750;
}

.screen {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 2.6vw, 2rem);
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: start;
}

.catalog-rail {
  display: grid;
  gap: 0.75rem;
}

.section-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Chapter cards read as franked envelopes: laid paper, a hairline frame
   inside the cut edge, a postage stamp in the corner. */
.catalog-card {
  position: relative;
  width: 100%;
  min-height: 7.25rem;
  padding: 1rem 4.4rem 0.9rem 1.1rem;
  border-color: rgba(25, 36, 43, 0.22);
  border-radius: 3px;
  background:
    repeating-linear-gradient(0deg, rgba(25, 36, 43, 0.016) 0 1px, transparent 1px 4px),
    var(--paper-strong);
  box-shadow: inset 0 0 0 4px var(--paper-strong), inset 0 0 0 5px rgba(25, 36, 43, 0.14);
  text-align: left;
}

.catalog-card.is-active {
  border-color: rgba(125, 74, 28, 0.75);
  box-shadow:
    inset 0 0 0 4px var(--paper-strong),
    inset 0 0 0 5px rgba(180, 111, 42, 0.55),
    var(--soft-shadow);
}

.catalog-card .card-title {
  display: block;
  margin: 0;
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 700;
}

.catalog-card p {
  margin: 0.45rem 0 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.card-stamp {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 3rem;
  transform: rotate(2.5deg);
}

.catalog-card:nth-child(odd) .card-stamp {
  transform: rotate(-2deg);
}

.card-stamp svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 1px 2px rgba(25, 36, 43, 0.22));
}

/* The frank line: duration and weight in small caps, a wax seal once the
   chapter's ceremony is done. */
.card-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.card-seal {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #8f3b32;
}

.card-seal svg {
  width: 1.35rem;
  height: 1.35rem;
}

.card-rubber {
  display: inline-block;
  padding: 0.14rem 0.45rem;
  border: 2px solid rgba(84, 65, 95, 0.5);
  border-radius: 3px;
  color: rgba(84, 65, 95, 0.85);
  transform: rotate(-1.5deg);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.pill {
  display: inline-flex;
  min-height: 1.5rem;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border: 1px solid rgba(25, 36, 43, 0.12);
  border-radius: 999px;
  background: rgba(230, 237, 240, 0.8);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.pill.ready {
  border-color: rgba(31, 104, 91, 0.35);
  background: rgba(31, 104, 91, 0.12);
  color: var(--teal-dark);
}

.pill.design {
  border-color: rgba(84, 65, 95, 0.32);
  background: rgba(84, 65, 95, 0.12);
  color: var(--plum);
}

.feature {
  overflow: hidden;
  border: 1px solid rgba(25, 36, 43, 0.12);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

/* The featured room is a painted vignette in the same vector grammar as the
   in-room scenes; the copy sits on a dark wash pinned to its lower edge. */
.feature-media {
  position: relative;
  min-height: clamp(19rem, 44vw, 31rem);
  background: linear-gradient(145deg, #dce8e3, #f5eee0 48%, #cbdde2);
}

/* On wide screens the band is a zero-height shell; the art fills the media
   box behind the copy. On phones the band becomes a real block in flow. */
.feature-band {
  display: contents;
}

.feature-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.feature-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(25, 36, 43, 0) 38%, rgba(16, 24, 30, 0.55) 62%, rgba(16, 24, 30, 0.88));
  pointer-events: none;
}

.feature-copy {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
  padding: clamp(1rem, 3.4vw, 2rem);
  color: #fffdf7;
}

.feature-deck {
  margin: 0;
  color: rgba(255, 253, 247, 0.82);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.feature-deck::after {
  content: "";
  display: block;
  width: 3.2rem;
  height: 2px;
  margin-top: 0.55rem;
  background: rgba(200, 163, 90, 0.85);
}

.feature h2,
.feature h3,
.research h2 {
  margin: 0;
  letter-spacing: 0;
}

/* The blueprint page heads in the same letterpress face as everything else. */
.research h2 {
  font-family: var(--display);
  font-weight: 700;
}

.feature h2 {
  max-width: 18ch;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
  text-shadow: 0 2px 14px rgba(16, 24, 30, 0.55);
}

.feature-copy p {
  text-shadow: 0 1px 8px rgba(16, 24, 30, 0.5);
}

.feature p {
  max-width: 62ch;
  margin: 0;
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  line-height: 1.55;
}

.feature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.feature-actions .ghost-button {
  border-color: rgba(255, 253, 247, 0.55);
  background: rgba(255, 253, 247, 0.1);
  color: #fffdf7;
}

.feature-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
  gap: 1px;
  background: rgba(25, 36, 43, 0.11);
}

/* The brief reads as a page torn from the expedition journal: faint ruled
   lines, entries hung from small-caps marginalia, no boxes. */
.brief-panel {
  min-height: 18rem;
  padding: clamp(1.1rem, 2.2vw, 1.6rem) clamp(1.1rem, 2.4vw, 1.8rem);
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(53, 107, 134, 0.1) 27px 28px),
    var(--paper-strong);
}

.brief-panel h3,
.room-card h3 {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-dark);
}

.brief-panel h3::after {
  content: "";
  display: block;
  width: 2.6rem;
  height: 2px;
  margin-top: 0.5rem;
  background: rgba(180, 111, 42, 0.55);
}

.brief-grid {
  display: grid;
  gap: 0.9rem;
}

.principle-item,
.source-link,
.relay-item,
.room-card {
  border: 1px solid rgba(25, 36, 43, 0.1);
  border-radius: var(--radius);
  background: rgba(230, 237, 240, 0.36);
}

.principle-item {
  padding: 0.8rem;
}

.brief-item {
  padding: 0 0 0.9rem 0.9rem;
  border-left: 2px solid rgba(180, 111, 42, 0.35);
  border-bottom: 1px dashed rgba(25, 36, 43, 0.12);
}

.brief-grid > .brief-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.brief-item strong,
.principle-item strong {
  display: block;
  margin-bottom: 0.35rem;
}

.brief-item strong {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brief-item span,
.principle-item span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.brief-item span {
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.97rem;
  line-height: 1.55;
}

/* The role picker lives only in the stage HUD (see .stage-hud .role-picker);
   full labels swap for short ones on narrow stages. */
.role-label-short {
  display: none;
}

.pairing-feedback {
  margin: -0.25rem 0 0;
  padding: 0.65rem;
  border-radius: var(--radius);
  background: rgba(230, 237, 240, 0.58);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.pairing-feedback.success {
  border: 1px solid rgba(31, 104, 91, 0.35);
  background: rgba(31, 104, 91, 0.1);
  color: var(--teal-dark);
}

.pairing-feedback.error {
  border: 1px solid rgba(185, 82, 72, 0.34);
  background: rgba(185, 82, 72, 0.09);
  color: #7f342e;
}

.artifact {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(25, 36, 43, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(251, 247, 239, 0.7), rgba(230, 237, 240, 0.7)),
    #fffdf7;
}

.feedback {
  min-height: 2.8rem;
  margin: 0.2rem 0 0;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: rgba(230, 237, 240, 0.58);
  color: var(--muted);
  line-height: 1.45;
}

.feedback.success {
  border: 1px solid rgba(31, 104, 91, 0.35);
  background: rgba(31, 104, 91, 0.12);
  color: var(--teal-dark);
}

.feedback.error {
  border: 1px solid rgba(185, 82, 72, 0.34);
  background: rgba(185, 82, 72, 0.1);
  color: #7f342e;
}

.hint-stack {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.hint {
  padding: 0.75rem;
  border: 1px solid rgba(180, 111, 42, 0.24);
  border-radius: var(--radius);
  background: rgba(180, 111, 42, 0.08);
  color: #60401f;
  line-height: 1.45;
}

.research {
  padding: clamp(1rem, 2vw, 1.35rem);
}

.relay-list {
  display: grid;
  gap: 0.6rem;
}

.relay-item {
  padding: 0.75rem;
}

.relay-item strong {
  display: block;
  margin-bottom: 0.32rem;
}

.relay-item span {
  color: var(--muted);
  line-height: 1.45;
}

.postcard-cell,
.leaf-cell {
  display: grid;
  gap: 0.42rem;
  align-content: start;
  min-height: 5rem;
  padding: 0.6rem;
  border: 1px solid rgba(25, 36, 43, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.75);
}

.flag-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.25;
}

.morse-grid,
.wheel-grid {
  display: grid;
  gap: 0.55rem;
}

.morse-tape {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.morse-tape span,
.morse-grid span,
.wheel-grid span {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(25, 36, 43, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.8);
  font-weight: 850;
}

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

.postcard-row {
  display: grid;
  gap: 0.7rem;
}

.postcard-row {
  grid-template-columns: repeat(4, minmax(4rem, 1fr));
}

.stamp-symbol {
  position: relative;
  width: 3rem;
  height: 3rem;
  border: 2px solid rgba(25, 36, 43, 0.18);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 253, 247, 0.92) 0 34%, transparent 35%),
    repeating-linear-gradient(45deg, rgba(25, 36, 43, 0.06) 0 2px, transparent 2px 6px),
    rgba(180, 111, 42, 0.18);
}

.stamp-symbol::before,
.stamp-symbol::after {
  position: absolute;
  content: "";
  inset: 0.78rem;
}

.stamp-symbol.keyhole::before {
  border-radius: 50% 50% 42% 42%;
  background: var(--plum);
}

.stamp-symbol.keyhole::after {
  top: 1.55rem;
  right: 1.25rem;
  left: 1.25rem;
  border-radius: 999px;
  background: var(--plum);
}

.stamp-symbol.lantern::before {
  border: 3px solid var(--brass-dark);
  border-top-width: 0.45rem;
  border-radius: 45% 45% 30% 30%;
}

.stamp-symbol.lantern::after {
  top: 0.42rem;
  right: 1.02rem;
  bottom: 2.15rem;
  left: 1.02rem;
  border: 2px solid var(--brass-dark);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.stamp-symbol.wave::before {
  inset: 1.1rem 0.45rem;
  border-top: 0.35rem solid var(--blue);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.stamp-symbol.wave::after {
  inset: 1.45rem 0.45rem 0.8rem;
  border-top: 0.35rem solid var(--teal);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.stamp-symbol.star::before {
  clip-path: polygon(50% 0, 61% 34%, 98% 34%, 68% 55%, 79% 91%, 50% 69%, 21% 91%, 32% 55%, 2% 34%, 39% 34%);
  background: var(--coral);
}

.postcard-cell {
  min-height: 7.2rem;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.9), rgba(230, 237, 240, 0.48)),
    var(--paper-strong);
  cursor: default;
}

.postcard-cell {
  border-style: dashed;
}

.archive-note {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem;
  border: 1px solid rgba(25, 36, 43, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.82);
}

.archive-note strong {
  color: var(--teal-dark);
}

.archive-note span {
  color: var(--muted);
  line-height: 1.45;
}

.leaf-specimens {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.leaf-cell {
  min-height: 7rem;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.88), rgba(230, 237, 240, 0.38)),
    var(--paper-strong);
  cursor: default;
}

.leaf-shape {
  width: 3.25rem;
  height: 3.25rem;
  border: 2px solid rgba(25, 36, 43, 0.12);
  background: rgba(31, 104, 91, 0.18);
}

.leaf-shape.fan {
  border-radius: 80% 18% 80% 18%;
  background:
    linear-gradient(45deg, transparent 0 48%, rgba(31, 104, 91, 0.48) 49% 51%, transparent 52%),
    rgba(31, 104, 91, 0.2);
}

.leaf-shape.oval {
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 0 47%, rgba(31, 104, 91, 0.5) 48% 52%, transparent 53%),
    rgba(31, 104, 91, 0.18);
}

.leaf-shape.split {
  clip-path: polygon(50% 0, 96% 24%, 68% 35%, 96% 56%, 65% 58%, 78% 100%, 50% 74%, 22% 100%, 35% 58%, 4% 56%, 32% 35%, 4% 24%);
  background: rgba(31, 104, 91, 0.32);
}

.leaf-shape.dotted {
  border-radius: 1.5rem 0.4rem 1.5rem 0.4rem;
  background:
    radial-gradient(circle at 35% 32%, var(--teal) 0 0.15rem, transparent 0.18rem),
    radial-gradient(circle at 58% 52%, var(--teal) 0 0.15rem, transparent 0.18rem),
    radial-gradient(circle at 42% 70%, var(--teal) 0 0.15rem, transparent 0.18rem),
    rgba(31, 104, 91, 0.16);
}

.clock-bloom.violet {
  border-color: rgba(84, 65, 95, 0.34);
}

.clock-bloom.iris {
  border-color: rgba(53, 107, 134, 0.34);
}

.clock-bloom.narcissus {
  border-color: rgba(180, 111, 42, 0.34);
}

.clock-bloom.elder {
  border-color: rgba(31, 104, 91, 0.34);
}

.flower-clock {
  position: relative;
  display: grid;
  min-height: 19rem;
  place-items: center;
  border: 1px solid rgba(25, 36, 43, 0.1);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 253, 247, 0.94) 0 30%, transparent 31%),
    repeating-conic-gradient(from 0deg, rgba(25, 36, 43, 0.08) 0 2deg, transparent 2deg 30deg),
    rgba(230, 237, 240, 0.42);
}

.clock-marker,
.clock-bloom {
  position: absolute;
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(25, 36, 43, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.9);
  font-size: 0.78rem;
  font-weight: 850;
}

.clock-marker {
  top: 0.8rem;
  color: var(--brass-dark);
}

.clock-bloom.violet {
  top: 3.8rem;
  right: 2.2rem;
}

.clock-bloom.iris {
  right: 0.8rem;
  bottom: 6rem;
}

.clock-bloom.narcissus {
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.clock-bloom.elder {
  bottom: 6rem;
  left: 0.8rem;
}

@media (hover: hover) and (pointer: fine) {
  .artifact .postcard-cell:hover,
  .artifact .archive-note:hover,
  .artifact .leaf-cell:hover {
    border-color: rgba(180, 111, 42, 0.35);
    box-shadow: 0 8px 20px rgba(25, 36, 43, 0.08);
  }
}

.research {
  margin-top: 1rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid rgba(25, 36, 43, 0.12);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: var(--soft-shadow);
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.source-link {
  display: block;
  padding: 0.8rem;
  text-decoration: none;
}

.source-link strong {
  display: block;
  margin-bottom: 0.35rem;
}

.source-link span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.future-rooms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.room-card {
  padding: 1rem;
}

.room-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.room-card .meta-row {
  margin-bottom: 0.8rem;
}

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

@media (max-width: 980px) {
  .catalog-layout,
  .feature-body,
  .research-grid,
  .source-grid,
  .future-rooms {
    grid-template-columns: 1fr;
  }

  /* Narrow screens: the featured room leads, chapters stack beneath it. */
  .catalog-layout > .feature {
    order: -1;
  }

  .catalog-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions > * {
    flex: 1 1 auto;
  }

  .postcard-row,
  .leaf-specimens,
  .morse-grid,
  .wheel-grid {
    grid-template-columns: 1fr;
  }

  /* Phones: normal stacking flow — the vignette becomes a vista band that
     fades into an ink panel, and the copy simply follows it in flow, so
     legibility never depends on the art and nothing is offset by hand. */
  .feature-media {
    min-height: 0;
    overflow: hidden;
    background: #16232a;
  }

  .feature-band {
    display: block;
    position: relative;
    height: 17rem;
  }

  .feature-art {
    inset: 0 auto auto 50%;
    width: auto;
    height: 100%;
    transform: translateX(-50%);
  }

  .theme-lighthouse .feature-art {
    inset: 0 0 auto auto;
    transform: none;
  }

  /* The fade lives on the band itself and always matches its height. */
  .feature-band::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(22, 35, 42, 0) 52%, #16232a);
    pointer-events: none;
  }

  .feature-media::after {
    content: none;
  }

  .feature-copy {
    position: static;
  }

  .feature h2 {
    font-size: 2.35rem;
  }
}

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

/* =========================================================
   Game stage: canvas scene, HUD, and inspection overlays
   ========================================================= */

body.in-game {
  overflow: hidden;
  background: #0b111c;
}

.stage-view {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #0b111c;
}

.stage-canvas-wrap {
  position: absolute;
  inset: 0;
}

.stage-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.hud-top,
.hud-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
}

.hud-bottom {
  align-items: flex-end;
}

.hud-title {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(6px);
  color: rgba(240, 235, 220, 0.92);
}

.hud-title strong {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.hud-title span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 217, 138, 0.85);
}

.hud-cluster {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}

.hud-lamps {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.35rem;
}

.hud-lamp {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(240, 235, 220, 0.18);
  box-shadow: inset 0 0 0 1px rgba(240, 235, 220, 0.16);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.hud-lamp.is-lit {
  background: #8ce1a5;
  box-shadow: 0 0 10px rgba(140, 225, 165, 0.75);
}

.hud-button {
  padding: 0.36rem 0.7rem;
  border: 1px solid rgba(240, 235, 220, 0.22);
  border-radius: 8px;
  background: rgba(240, 235, 220, 0.06);
  color: rgba(240, 235, 220, 0.88);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hud-button:hover:not(:disabled) {
  background: rgba(255, 217, 138, 0.16);
  border-color: rgba(255, 217, 138, 0.5);
}

.hud-button:disabled {
  opacity: 0.4;
}

.hud-button.is-active {
  background: rgba(255, 217, 138, 0.22);
  border-color: rgba(255, 217, 138, 0.65);
  color: #ffe9b8;
}

.stage-hud .role-picker {
  display: flex;
  flex: none;
  gap: 0.2rem;
  padding: 0.16rem;
  border: 1px solid rgba(240, 235, 220, 0.16);
  border-radius: 9px;
  background: rgba(240, 235, 220, 0.05);
}

.stage-hud .role-tab {
  min-height: 2.5rem;
  min-width: 0;
  padding: 0.28rem 0.6rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: rgba(240, 235, 220, 0.62);
  font-weight: 850;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-hud .role-tab.is-active {
  background: rgba(255, 217, 138, 0.2);
  color: #ffe9b8;
}

/* On narrower stages the role tabs drop to their short labels so the HUD
   cluster keeps to one line. */
@media (max-width: 1000px) {
  .stage-hud .role-label-full {
    display: none;
  }

  .stage-hud .role-label-short {
    display: inline;
  }
}

.hud-tray {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 14px;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}

.hud-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px dashed rgba(240, 235, 220, 0.28);
  border-radius: 12px;
  background: rgba(240, 235, 220, 0.04);
}

.hud-slot.is-filled {
  border-style: solid;
  border-color: rgba(255, 217, 138, 0.55);
  box-shadow: 0 0 14px rgba(255, 217, 138, 0.18);
}

.hud-slot-glyph {
  width: 22px;
  height: 26px;
  border-radius: 5px 5px 10px 10px;
  border: 2px solid rgba(240, 235, 220, 0.24);
  border-top-width: 6px;
  opacity: 0.65;
}

.hud-chip {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
}

.hud-chip canvas {
  display: block;
}

.hud-chip.is-pinned {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(240, 235, 220, 0.2);
  border-radius: 12px;
  background: rgba(240, 235, 220, 0.05);
}

.hud-chip.is-pinned::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9973f;
}

.hud-chip-close {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(240, 235, 220, 0.3);
  border-radius: 50%;
  background: rgba(8, 12, 20, 0.85);
  color: rgba(240, 235, 220, 0.85);
  font-size: 0.72rem;
  line-height: 1;
}

/* One-time in-world notice when the browser refuses to save (private
   windows, full disks). Sits above everything, fades itself out in JS. */
.hud-notice {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  z-index: 90;
  max-width: min(30rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.6rem 1.1rem;
  border: 1px solid rgba(200, 163, 90, 0.5);
  border-radius: 10px;
  background: rgba(30, 24, 15, 0.95);
  color: #e8d9ac;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.85rem;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.hud-keys {
  display: flex;
  gap: 0.28rem;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: rgba(8, 12, 20, 0.4);
  opacity: 0.75;
}

.keycap {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(240, 235, 220, 0.3);
  border-bottom-width: 3px;
  border-radius: 6px;
  color: rgba(240, 235, 220, 0.75);
  font-size: 0.66rem;
  font-weight: 700;
}

.keycap.key-e {
  margin-left: 0.45rem;
  border-color: rgba(255, 217, 138, 0.6);
  color: #ffe9b8;
}

.hud-keys .key-divider {
  align-self: center;
  color: rgba(240, 235, 220, 0.4);
  font-size: 0.62rem;
}

.keycap.key-arrows {
  width: auto;
  padding: 0 0.32rem;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.keycap.key-space {
  width: 64px;
  margin-left: 0.45rem;
}

/* Bar glyph instead of the word SPACE — keycaps whisper, they don't label. */
.keycap.key-space::after {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.75;
}

/* --------------------------------------------- inspection overlays */

.stage-scrim {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(5, 8, 14, 0.55);
  backdrop-filter: blur(3px);
}

.stage-scrim[hidden] {
  display: none;
}

.overlay-panel {
  position: relative;
  width: min(30rem, 92vw);
  max-height: min(82vh, 44rem);
  overflow-y: auto;
  padding: 1.4rem 1.5rem 1.5rem;
  border-radius: 12px;
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(2, 5, 10, 0.65);
  animation: overlay-rise 0.22s ease-out;
}

@keyframes overlay-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.paper-panel {
  border-top: 6px solid var(--teal);
}

.device-panel {
  border-top: 6px solid var(--brass);
}

.overlay-panel h3 {
  margin: 0.1rem 0 0.9rem;
  font-size: 1.2rem;
}

.overlay-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.overlay-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.overlay-close:hover {
  background: var(--mist);
  color: var(--ink);
}

.overlay-artifact {
  margin-bottom: 0.9rem;
}

.overlay-clue {
  margin: 0.2rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.overlay-actions {
  display: flex;
  gap: 0.5rem;
}

.overlay-actions .hud-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 0.8rem;
}

/* Take carries a pocket glyph, Pin a corkboard pin — same stroke as the
   keycap art, so the two verbs read apart at a glance. */
.overlay-actions .hud-button svg {
  display: block;
  flex: none;
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

.overlay-actions .hud-button:hover:not(:disabled) {
  background: var(--mist);
  border-color: var(--line);
}

.overlay-actions .hud-button.is-active {
  background: rgba(180, 111, 42, 0.12);
  border-color: var(--brass);
  color: var(--brass-dark);
}

.device-readout {
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: #1d242e;
  color: #ffd98a;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
}

.escape-note {
  margin-top: 0.6rem;
}

.journal-panel .relay-list {
  margin-top: 0.4rem;
}

@media (max-width: 720px) {
  .hud-top,
  .hud-bottom {
    padding: 0.6rem;
  }

  .hud-cluster {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hud-keys {
    display: none;
  }
}

/* Keyboard legends mean nothing to a touch player, whatever the width. */
@media (pointer: coarse) {
  .hud-keys {
    display: none;
  }
}

/* ---------------------------------------------------------- mechanisms */

.device-stage {
  margin: 0.35rem 0 0.2rem;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  background: rgba(16, 22, 30, 0.06);
}

.device-stage canvas {
  display: block;
  width: 100%;
}

/* The watch is set on a brass plate: engraved small caps, the chosen watch
   filled in gold. */
.difficulty-picker {
  display: inline-flex;
  width: fit-content;
  margin: 0.9rem 0 0.2rem;
  padding: 0.24rem;
  gap: 0.24rem;
  border-radius: 4px;
  background: rgba(16, 22, 30, 0.5);
  border: 1px solid rgba(200, 163, 90, 0.45);
}

.difficulty-option {
  display: grid;
  gap: 0.16rem;
  justify-items: center;
  border: 0;
  padding: 0.42rem 0.8rem 0.36rem;
  border-radius: 3px;
  background: transparent;
  color: rgba(255, 253, 247, 0.75);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.difficulty-option.is-active {
  background: #c8a35a;
  color: #241f14;
}

/* The watch name leads; the plain word sits under it like a caption
   engraved in smaller type on the same plate. */
.difficulty-plain {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(255, 253, 247, 0.55);
}

.difficulty-option.is-active .difficulty-plain {
  color: rgba(36, 31, 20, 0.88);
}

/* One line about the chosen watch, letterpress-quiet under the plate. */
.feature-copy .difficulty-note {
  margin: -0.35rem 0 0.1rem;
  color: #fffdf7;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}


/* morse alphabet + coast station page */

.alphabet-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.3rem;
}

.alphabet-grid span {
  font-size: 0.72rem;
  padding: 0.24rem 0.3rem;
}

.station-page {
  margin-top: 0.65rem;
  border: 1px solid rgba(25, 36, 43, 0.14);
  border-radius: var(--radius);
  overflow: hidden;
}

.station-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr;
  padding: 0.42rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 800;
  border-top: 1px solid rgba(25, 36, 43, 0.1);
  background: rgba(255, 253, 247, 0.75);
}

.station-row.station-head {
  border-top: 0;
  background: rgba(25, 36, 43, 0.85);
  color: #f4efe2;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

/* engraved plate + approach chart */

.engraved-plate {
  display: grid;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid rgba(120, 92, 40, 0.5);
  background: linear-gradient(160deg, #c8a35a, #a37f3c);
  color: #3a2c12;
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.45);
}

.engraved-plate strong {
  font-size: 1.05rem;
  letter-spacing: 0.13em;
}

.engraved-plate span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  opacity: 0.75;
}

.approach-chart {
  position: relative;
  height: 13rem;
  border-radius: var(--radius);
  border: 1px solid rgba(25, 36, 43, 0.2);
  background: linear-gradient(180deg, #16283b, #0f1c2b);
  overflow: hidden;
}

.approach-chart .reef {
  position: absolute;
  background: repeating-linear-gradient(
    45deg,
    rgba(220, 200, 160, 0.5) 0 3px,
    transparent 3px 9px
  );
  border: 1px solid rgba(220, 200, 160, 0.4);
  border-radius: 46% 54% 58% 42% / 52% 48% 52% 48%;
}

.approach-chart .reef-a {
  width: 42%;
  height: 52%;
  left: -6%;
  top: 30%;
}

.approach-chart .reef-b {
  width: 46%;
  height: 56%;
  right: -8%;
  top: 26%;
}

.approach-chart .channel-lane {
  position: absolute;
  left: 47%;
  top: 6%;
  width: 12%;
  height: 88%;
  transform: skewX(-7deg);
  background: linear-gradient(180deg, rgba(140, 190, 220, 0.16), rgba(140, 190, 220, 0.03));
  border-left: 1px dashed rgba(160, 205, 230, 0.4);
  border-right: 1px dashed rgba(160, 205, 230, 0.4);
}

.approach-chart .bearing {
  position: absolute;
  color: rgba(220, 233, 240, 0.6);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.approach-chart .bearing-clear {
  color: #ffeec2;
  font-size: 0.95rem;
  text-shadow: 0 0 9px rgba(255, 238, 194, 0.5);
}

.approach-chart .chart-mark {
  position: absolute;
  color: rgba(220, 233, 240, 0.45);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

/* ───────────────────────────────────────────────────────────────
   redesign 2026-07 — postcard society + conservatory clock visuals
   ─────────────────────────────────────────────────────────────── */

/* pinned / chalked / etched note lines under artifacts */

.pinned-slip,
.chalk-note,
.clock-legend {
  margin-top: 0.65rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(25, 36, 43, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.85);
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 760;
  text-align: center;
  letter-spacing: 0.03em;
}

.chalk-note {
  border-style: dashed;
}

/* drawn district map: countable ring marks, no digits */

.drawn-map {
  position: relative;
  height: 15rem;
  border-radius: var(--radius);
  border: 1px solid rgba(25, 36, 43, 0.16);
  background:
    repeating-linear-gradient(0deg, rgba(53, 107, 134, 0.05) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(53, 107, 134, 0.05) 0 1px, transparent 1px 22px),
    rgba(255, 253, 247, 0.92);
  overflow: hidden;
}

.map-district {
  position: absolute;
  border: 1.5px dashed rgba(25, 36, 43, 0.28);
}

.map-district .md-name {
  position: absolute;
  top: 0.3rem;
  left: 0.5rem;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.md-arcade {
  top: 5%;
  left: 4%;
  width: 42%;
  height: 44%;
  border-radius: 42% 58% 50% 50% / 55% 45% 55% 45%;
  background: rgba(84, 65, 95, 0.08);
}

.md-observatory {
  top: 6%;
  right: 4%;
  width: 44%;
  height: 48%;
  border-radius: 55% 45% 48% 52% / 45% 55% 45% 55%;
  background: rgba(180, 111, 42, 0.08);
}

.md-harbor {
  bottom: 5%;
  left: 4%;
  right: 4%;
  height: 32%;
  border-radius: 14px 14px 40% 40%;
  background: rgba(53, 107, 134, 0.1);
}

.map-coast {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 39%;
  border-top: 2px dashed rgba(53, 107, 134, 0.4);
}

.ring-mark {
  position: absolute;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid rgba(84, 65, 95, 0.62);
  border-radius: 50%;
}

.ring-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: rgba(84, 65, 95, 0.55);
}

.map-rose {
  position: absolute;
  top: 26%;
  left: 30%;
  width: 2.4rem;
  height: 2.4rem;
}

.map-rose::before,
.map-rose::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  background: rgba(185, 82, 72, 0.75);
}

.map-rose::after {
  transform: rotate(45deg) scale(0.62);
  background: rgba(180, 111, 42, 0.8);
}

.map-rose i {
  position: absolute;
  inset: 42%;
  border-radius: 50%;
  background: #fffdf7;
  border: 1px solid rgba(25, 36, 43, 0.3);
}

/* black-edged delivery postcard */

.delivery-card {
  display: grid;
  gap: 0.6rem;
  min-height: 11rem;
  align-content: center;
  text-align: center;
  padding: 1.2rem;
  border: 4px solid #22262e;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.97), rgba(230, 237, 240, 0.6));
  box-shadow: inset 0 0 0 3px rgba(255, 253, 247, 0.95), inset 0 0 0 5px #22262e;
}

.delivery-card strong {
  font-size: 1.02rem;
  line-height: 1.75;
  letter-spacing: 0.05em;
}

/* gardener's bed plan: six staked beds off the mist line */

.bed-plan {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.bed-cell {
  display: grid;
  gap: 0.4rem;
  justify-items: center;
  align-content: start;
  min-height: 7rem;
  padding: 0.6rem;
  border: 1px solid rgba(25, 36, 43, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(0deg, rgba(122, 90, 58, 0.2) 0 30%, transparent 30%),
    rgba(255, 253, 247, 0.82);
}

.bed-stake {
  width: 0.3rem;
  height: 0.95rem;
  border-radius: 2px;
  background: var(--brass-dark);
  opacity: 0.7;
}

.leaf-shape.rose {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fffdf7 0 0.32rem, transparent 0.36rem),
    repeating-conic-gradient(from 0deg, rgba(185, 82, 72, 0.55) 0 30deg, rgba(185, 82, 72, 0.28) 30deg 60deg);
}

.leaf-shape.fern {
  clip-path: polygon(50% 0, 74% 100%, 26% 100%);
  background: repeating-linear-gradient(
    180deg,
    rgba(31, 104, 91, 0.52) 0 3px,
    rgba(31, 104, 91, 0.16) 3px 7px
  );
}

/* compact engraved plate (bench pump) */

.engraved-plate.plate-compact {
  margin-top: 0.65rem;
  padding: 0.8rem 0.9rem;
}

.engraved-plate.plate-compact strong {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
}

/* flower clock face: blooms pinned at clock positions */

.flower-clock.bloom-face .clock-bloom {
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
}

/* engraved tea tray with rim compass marks */

.tea-tray {
  position: relative;
  height: 12rem;
  border-radius: 16px;
  border: 1px solid rgba(120, 92, 40, 0.5);
  background: linear-gradient(160deg, #c8a35a, #a37f3c);
  box-shadow:
    inset 0 0 0 8px rgba(58, 44, 18, 0.14),
    inset 0 0 0 9px rgba(255, 240, 200, 0.35);
  margin-bottom: 0.65rem;
}

.tray-etch {
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  border: 2px solid rgba(58, 44, 18, 0.24);
  box-shadow: inset 0 0 0 6px rgba(255, 240, 200, 0.16);
}

/* --- Generic dark SVG artifact card (cam rack, watch bill, steelyard…) --- */

.svg-card {
  padding: 0.55rem;
  border: 1px solid rgba(25, 36, 43, 0.12);
  border-radius: var(--radius);
  background: rgba(24, 30, 38, 0.92);
  color: rgba(247, 238, 214, 0.85);
}

.svg-card svg {
  display: block;
  width: 100%;
  height: auto;
}

.svg-card.paper-card {
  background: var(--mist);
  color: var(--ink);
}

.svg-card + .engraved-plate,
.engraved-plate + .svg-card {
  margin-top: 0.65rem;
}

.station-row svg {
  color: currentColor;
}

/* ==========================================================================
   Pass 4 — story layer, twists, ceremony, scrapbook, epilogue, room skins
   ========================================================================== */

/* ------------------------------------------------------------- cold open */

.cold-open {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(4, 7, 12, 0.42);
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.cold-open.is-done {
  opacity: 0;
  pointer-events: none;
}

.cold-open-card {
  max-width: 34rem;
  padding: 2rem;
  text-align: center;
}

.cold-open-line {
  margin: 0.6rem 0;
  color: rgba(247, 238, 214, 0.92);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-style: italic;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 18px rgba(4, 7, 12, 0.8);
  opacity: 0;
  animation: cold-open-line 4.4s ease both;
}

@keyframes cold-open-line {
  0% { opacity: 0; transform: translateY(8px); }
  12% { opacity: 1; transform: none; }
  82% { opacity: 1; }
  100% { opacity: 0.85; }
}

.cold-open-skip {
  position: fixed;
  right: 1.4rem;
  bottom: 1.2rem;
  padding: 0.3rem 0.5rem;
  border: 0;
  background: none;
  color: rgba(247, 238, 214, 0.72);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ------------------------------------------------------ interlude panels */

.interlude-panel {
  border-top-color: var(--plum);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(84, 65, 95, 0.1), transparent 60%),
    var(--paper-strong);
}

.interlude-panel .overlay-kicker {
  color: var(--plum);
}

.interlude-subtitle {
  margin: -0.5rem 0 0.9rem;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.92rem;
}

.interlude-panel .device-readout {
  background: rgba(84, 65, 95, 0.1);
  color: var(--plum);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.92rem;
}

.hud-lamp.is-toy {
  border-radius: 2px;
  transform: rotate(45deg) scale(0.82);
  opacity: 0.75;
}

/* --------------------------------------------------------- reversal chip */

.reversal-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.55rem 0 0.2rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(84, 65, 95, 0.4);
  border-radius: 999px;
  background: rgba(84, 65, 95, 0.1);
  color: var(--plum);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reversal-arrows svg {
  display: block;
  width: 22px;
  height: 13px;
}

/* ------------------------------------------------------- twist: blackout */

.twist-blackout {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: none;
}

.blackout-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: var(--radius);
}

/* --------------------------------------------------------- twist: redact */

.redact-bar {
  display: inline-block;
  padding: 0 0.1em;
  color: #10151b;
  background: #10151b;
  border-radius: 2px;
  letter-spacing: -0.08em;
  line-height: 1.1;
  user-select: none;
}

.censor-stamp {
  position: absolute;
  top: 1.1rem;
  right: 2.9rem;
  padding: 0.24rem 0.7rem;
  border: 2.5px solid rgba(176, 82, 72, 0.75);
  border-radius: 4px;
  color: rgba(176, 82, 72, 0.85);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  transform: rotate(-8deg);
  box-shadow: inset 0 0 10px rgba(176, 82, 72, 0.14);
  pointer-events: none;
}

.twist-redact .device-readout {
  text-transform: uppercase;
}

/* ------------------------------------------------------- twist: overgrow */

.twist-overgrow {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.vine-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.vine-layer path {
  fill: none;
  stroke: #3f5a35;
  stroke-width: 1.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: vine-grow linear forwards;
}

@keyframes vine-grow {
  to { stroke-dashoffset: 0; }
}

.vine-leaf {
  fill: #4c6b3f;
  opacity: 0;
  animation: leaf-unfurl 3.2s ease forwards;
}

@keyframes leaf-unfurl {
  from { opacity: 0; }
  to { opacity: 0.92; }
}

.overgrow-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 100% at 50% 110%, rgba(31, 46, 26, 0.95), rgba(31, 46, 26, 0.55) 55%, transparent 80%);
  opacity: 0;
  animation: overgrow-shade 26s ease forwards;
  animation-delay: 19s;
}

@keyframes overgrow-shade {
  to { opacity: 0.94; }
}

/* -------------------------------------------------------------- letters */

.journal-tabs {
  display: inline-flex;
  margin: 0.5rem 0 0.9rem;
  padding: 0.2rem;
  gap: 0.2rem;
  border-radius: 999px;
  background: rgba(25, 36, 43, 0.07);
}

.journal-tab {
  border: 0;
  padding: 0.32rem 0.9rem;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.journal-tab.is-active {
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(25, 36, 43, 0.18);
}

.letter-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.letter-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
}

.letter-row.is-unlocked:hover {
  background: var(--mist);
}

.letter-row.is-sealed {
  color: var(--muted);
  border-style: dashed;
  cursor: default;
}

.letter-row.is-sealed.is-mine {
  opacity: 0.65;
}

.letter-envelope {
  flex: none;
  width: 40px;
  color: var(--brass-dark);
}

.letter-row.is-sealed .letter-envelope {
  color: var(--coral);
}

.letter-envelope svg {
  display: block;
  width: 100%;
  height: auto;
}

.letter-note {
  font-family: Georgia, "Times New Roman", serif;
}

.letter-page {
  background:
    repeating-linear-gradient(0deg, transparent 0 1.62rem, rgba(25, 36, 43, 0.055) 1.62rem calc(1.62rem + 1px)),
    var(--paper-strong);
  border-top: 6px solid var(--coral);
}

.letter-page h3,
.letter-page h2 {
  font-family: Georgia, "Times New Roman", serif;
}

.letter-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.98rem;
  line-height: 1.62rem;
  color: var(--ink);
}

.letter-body p {
  margin: 0 0 1.62rem;
}

.letter-aloud {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.wax-seal {
  position: absolute;
  top: 1rem;
  right: 3rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #d3766c, var(--coral) 58%, #8f3d35);
  box-shadow: 0 2px 8px rgba(143, 61, 53, 0.4), inset 0 0 0 4px rgba(143, 61, 53, 0.5);
}

.wax-seal::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1.6px solid rgba(255, 240, 230, 0.5);
}

.wax-seal.is-large {
  /* relative, not static: the ::after is absolutely positioned and must
     resolve against the seal itself, not the overlay panel (a static seal
     let the ::after stretch invisibly over the seal input + submit). */
  position: relative;
  display: block;
  width: 52px;
  height: 52px;
  margin: 0.4rem auto 0.8rem;
}

.wax-seal.is-large::after {
  inset: 13px;
}

/* --------------------------------------------------------- token prompts */

.token-panel {
  border-top-color: var(--plum);
}

.token-form {
  display: flex;
  gap: 0.5rem;
  margin: 0.6rem 0 0.4rem;
}

.seal-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.04em;
}

.seal-input:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}

/* -------------------------------------------------------------- ceremony */

.ceremony-panel {
  text-align: center;
  border-top-color: var(--coral);
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(185, 82, 72, 0.08), transparent 70%),
    var(--paper-strong);
}

.seal-instruction {
  margin: 0.7rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.seal-phrase {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.ceremony-panel .token-form {
  justify-content: center;
}

.ceremony-panel .seal-input {
  max-width: 15rem;
  text-align: center;
  text-transform: uppercase;
}

.is-shaking {
  animation: seal-shake 0.5s ease;
}

@keyframes seal-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.seal-call {
  margin: 0.7rem 0 0.2rem;
}

.hud-seal {
  border-color: rgba(255, 217, 138, 0.6);
  color: #ffd98a;
}

.hud-audio svg {
  display: block;
  width: 17px;
  height: 17px;
}

/* Lean in: the steam-cup glyph rides beside the label at HUD line weight. */
.hud-listen {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.hud-listen svg {
  display: block;
  width: 15px;
  height: 15px;
}

.hud-audio.is-muted {
  opacity: 0.6;
}

/* -------------------------------------------------------------- keepsakes */

.keepsake-panel {
  text-align: center;
  border-top-color: var(--brass);
}

.keepsake-plate {
  margin: 0.4rem auto 0.7rem;
  max-width: 21rem;
}

.keepsake-plate svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.keepsake-panel .overlay-actions {
  justify-content: center;
}

/* --------------------------------------------------------------- debrief */

.debrief-panel {
  border-top-color: var(--teal);
}

/* The night's numbers as one engraved line between hairline rules —
   a ledger entry, not a dashboard. */
.debrief-ledger {
  margin: 0.6rem 0 0.9rem;
  padding: 0.55rem 0.2rem;
  border-top: 1px solid rgba(25, 36, 43, 0.25);
  border-bottom: 1px solid rgba(25, 36, 43, 0.25);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-align: center;
}

.debrief-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.debrief-card {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(31, 104, 91, 0.3);
  background: rgba(31, 104, 91, 0.06);
  color: var(--teal-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.95rem;
}

/* -------------------------------------------------------------- glyph card */

.glyph-card-panel {
  text-align: center;
}

.glyph-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin: 0.8rem auto;
  padding: 1rem 1.3rem;
  width: fit-content;
  border-radius: 10px;
  background: #2c2318;
  color: #e8d9ac;
  box-shadow: inset 0 0 0 1px rgba(200, 163, 90, 0.4), var(--soft-shadow);
}

.meta-glyph,
.meta-numeral {
  display: inline-block;
  width: 52px;
  height: 52px;
}

.meta-glyph svg,
.meta-numeral svg {
  display: block;
  width: 100%;
  height: 100%;
}

.meta-glyph.is-large,
.glyph-card .meta-numeral {
  width: 72px;
  height: 72px;
}

.glyph-card .meta-numeral {
  opacity: 0.8;
}

/* The card's door position, struck low in the corner like the silversmith's
   hallmark on the keepsake plates: a small pressed cartouche, brass on wood. */
.glyph-hallmark {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 5px;
  color: rgba(200, 163, 90, 0.7);
  background: rgba(24, 16, 9, 0.4);
  box-shadow:
    inset 0 0 0 1px rgba(200, 163, 90, 0.4),
    inset 0 1.5px 3px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 233, 189, 0.07);
}

.glyph-card .glyph-hallmark .meta-numeral {
  width: 12px;
  height: 12px;
  opacity: 1;
}

.meta-glyph.is-silhouette {
  opacity: 0.5;
}

/* --------------------------------------------------------------- catalog */

.teaser-note {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  opacity: 0.85;
}

.teaser-kicker {
  display: block;
  font-family: inherit;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brass-dark);
  margin-bottom: 0.25rem;
}

/* Inside the featured hero the kicker sits on the dark wash: gold, not brass. */
.feature-copy .teaser-kicker {
  color: #ffd98a;
}

.catalog-card.is-teaser {
  position: relative;
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(180, 111, 42, 0.05) 10px 20px),
    var(--paper-strong);
  border-style: dashed;
}

.catalog-card.is-teaser .card-title {
  opacity: 0.85;
}

.catalog-card.is-teaser p {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

/* The postmark cancels the corner stamp on chapters that haven't arrived. */
.teaser-postmark {
  position: absolute;
  top: 2.6rem;
  right: 2.3rem;
  z-index: 1;
  width: 26px;
  height: 26px;
  border: 1.6px solid rgba(143, 59, 50, 0.6);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4.4px rgba(143, 59, 50, 0.35);
  transform: rotate(-12deg);
}

.teaser-postmark::after {
  content: "";
  position: absolute;
  top: 10px;
  left: -8px;
  width: 40px;
  height: 5px;
  border-top: 1.4px solid rgba(143, 59, 50, 0.4);
  border-bottom: 1.4px solid rgba(143, 59, 50, 0.4);
  transform: rotate(-4deg);
}

/* Chapter markers: the story order, stated quietly at the top of each card. */

.chapter-kicker {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chapter-kicker.is-up-next {
  color: var(--teal-dark);
}

.up-next-pill {
  padding-bottom: 0.1rem;
  border-bottom: 1px solid rgba(31, 104, 91, 0.45);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--teal);
}

/* Out-of-order confirmation: a gentle note in the room detail pane. */

.order-confirm {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 0.65rem;
  padding: clamp(1.1rem, 2.6vw, 1.8rem) clamp(1rem, 3.4vw, 2rem);
  padding-right: 3.4rem;
  border-bottom: 1px solid rgba(25, 36, 43, 0.1);
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(180, 111, 42, 0.05) 10px 20px),
    var(--paper-strong);
}

.order-confirm .order-confirm-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(180, 111, 42, 0.9);
}

.order-confirm .order-confirm-body {
  max-width: 48ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.04rem;
  line-height: 1.6;
  color: var(--ink);
}

.order-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.15rem;
}

.epilogue-door-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(200, 163, 90, 0.5);
  background: #211a12;
  box-shadow: inset 0 0 0 4px #211a12, inset 0 0 0 5px rgba(200, 163, 90, 0.35);
  color: #e8d9ac;
}

.epilogue-door-card .card-title {
  color: #e8d9ac;
}

.epilogue-door-card p {
  color: rgba(232, 217, 172, 0.7);
}

.door-art {
  flex: none;
  width: 44px;
}

.door-art svg {
  display: block;
  width: 100%;
  height: auto;
}

/* -------------------------------------------------------------- scrapbook */

.scrapbook-screen {
  padding-bottom: 4rem;
}

.scrapbook {
  max-width: 62rem;
  margin: 2.4rem auto 0;
  padding: 0 1.4rem;
}

.scrapbook h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  margin: 0.2rem 0 1.4rem;
}

.scrapbook-room {
  margin-bottom: 1.6rem;
  padding: 1.3rem 1.4rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-strong);
  box-shadow: var(--soft-shadow);
}

.scrapbook-room h3 {
  margin: 0 0 0.8rem;
  font-family: Georgia, "Times New Roman", serif;
}

.scrapbook-keepsakes {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.scrapbook-keepsake {
  margin: 0;
  width: min(19rem, 100%);
}

.scrapbook-keepsake figcaption {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  text-align: center;
}

.scrapbook-empty {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.9rem;
}

/* An empty page keeps its photo corners mounted, waiting. */
.scrapbook-slot {
  display: grid;
  place-items: center;
  gap: 0.1rem;
  width: min(24rem, 100%);
  padding: 1.5rem 1rem 1.2rem;
  border: 1px dashed rgba(108, 74, 47, 0.4);
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(108, 74, 47, 0.32) 12px, transparent 12.5px) left 4px top 4px / 26px 26px no-repeat,
    linear-gradient(225deg, rgba(108, 74, 47, 0.32) 12px, transparent 12.5px) right 4px top 4px / 26px 26px no-repeat,
    linear-gradient(45deg, rgba(108, 74, 47, 0.32) 12px, transparent 12.5px) left 4px bottom 4px / 26px 26px no-repeat,
    linear-gradient(315deg, rgba(108, 74, 47, 0.32) 12px, transparent 12.5px) right 4px bottom 4px / 26px 26px no-repeat,
    #f3ecda;
}

.scrapbook-slot .scrapbook-empty {
  margin: 0;
}

.slot-fern {
  width: 7.5rem;
  height: auto;
  opacity: 0.85;
}

.scrapbook-title-award {
  margin: 0.7rem 0 0.2rem;
  color: var(--brass-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
}

.scrapbook-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.scrapbook-stat {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.scrapbook-letters {
  margin-top: 0.8rem;
}

.scrapbook-tokens {
  margin: 1.8rem 0;
}

.token-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.token-chip {
  display: inline-flex;
  flex-direction: column;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(180, 111, 42, 0.45);
  border-radius: var(--radius);
  background: rgba(180, 111, 42, 0.07);
  font-family: Georgia, "Times New Roman", serif;
}

.token-chip em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.glyph-album {
  margin: 1.8rem 0;
  padding: 1.3rem 1.4rem;
  border-radius: 12px;
  background: #211a12;
  color: #e8d9ac;
}

.glyph-album h3 {
  margin: 0 0 0.9rem;
  font-family: Georgia, "Times New Roman", serif;
}

.glyph-album .overlay-clue {
  color: rgba(232, 217, 172, 0.6);
}

.glyph-album-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.glyph-album-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.glyph-card.is-mini {
  margin: 0;
  padding: 0.5rem 0.6rem;
  gap: 0.45rem;
  background: #2c2318;
}

.glyph-card.is-mini .meta-glyph,
.glyph-card.is-mini .meta-numeral {
  width: 34px;
  height: 34px;
}

.glyph-card.is-partner,
.glyph-card.is-unfound {
  opacity: 0.55;
}

.glyph-album-label {
  color: rgba(232, 217, 172, 0.75);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scrapbook-door .catalog-card {
  width: min(24rem, 100%);
}

.scrapbook-final {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

/* Colophon: the one quiet door to the design notes, set like a printer's
   line at the foot of the book. */
.scrapbook-colophon {
  margin: 2.6rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(25, 36, 43, 0.16);
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.86rem;
  text-align: center;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brass-dark);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover {
  color: var(--brass);
}

.link-button:focus-visible {
  outline: 3px solid rgba(180, 111, 42, 0.35);
  outline-offset: 2px;
}

.scrapbook-screen .stage-scrim {
  position: fixed;
  z-index: 40;
}

/* --------------------------------------------------------------- epilogue */

.epilogue-screen {
  display: grid;
  place-items: center;
  padding: 3rem 1.4rem 4rem;
}

.epilogue-door {
  width: min(36rem, 100%);
  padding: 2rem 2rem 1.7rem;
  border-radius: 16px;
  background: #211a12;
  color: #e8d9ac;
  box-shadow: var(--shadow);
  text-align: center;
}

.epilogue-door h2 {
  margin: 0.2rem 0 0.4rem;
  font-family: Georgia, "Times New Roman", serif;
}

.epilogue-door .overlay-clue {
  color: rgba(232, 217, 172, 0.65);
}

.epilogue-slots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.1rem 0;
}

.epilogue-slot {
  width: 58px;
  height: 58px;
  padding: 6px;
  border: 1.6px solid rgba(200, 163, 90, 0.6);
  border-radius: 10px;
  background: #2c2318;
  color: #e8d9ac;
}

.epilogue-slot.is-empty {
  color: rgba(232, 217, 172, 0.3);
  border-style: dashed;
}

.epilogue-slot.is-selected {
  border-color: #ffd98a;
  background: rgba(255, 217, 138, 0.14);
  box-shadow: 0 0 0 2px rgba(255, 217, 138, 0.25);
}

.epilogue-slot .meta-glyph,
.epilogue-slot .meta-numeral {
  width: 100%;
  height: 100%;
}

.epilogue-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0 auto 1.2rem;
  max-width: 26rem;
}

.epilogue-glyph {
  aspect-ratio: 1;
  padding: 7px;
  border: 1px solid rgba(200, 163, 90, 0.3);
  border-radius: 10px;
  background: rgba(200, 163, 90, 0.06);
  color: #e8d9ac;
}

.epilogue-glyph:hover {
  background: rgba(200, 163, 90, 0.16);
}

.epilogue-glyph .meta-glyph {
  width: 100%;
  height: 100%;
}

.epilogue-actions {
  justify-content: center;
}

.epilogue-letter {
  position: relative;
  width: min(38rem, 100%);
  padding: 2rem 2.2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.epilogue-letter h2 {
  font-family: Georgia, "Times New Roman", serif;
}

/* -------------------------------------------------------- room skins
   Three genuinely different panel materials: brass on dark wood for the
   lighthouse, a kraft index card with a perforated stamp edge for the
   society, a botanical specimen plate on glass for the conservatory. */

/* lighthouse: brass plate on dark wood */

.stage-scrim.theme-lighthouse .overlay-panel {
  background:
    linear-gradient(180deg, rgba(255, 224, 170, 0.05), transparent 3.2rem),
    linear-gradient(180deg, #3d2c1c, #33251a);
  color: #f0e6cf;
  border-top: 0;
  border: 1px solid rgba(200, 163, 90, 0.55);
  box-shadow:
    inset 0 0 0 5px rgba(24, 16, 9, 0.65),
    inset 0 0 0 6px rgba(200, 163, 90, 0.35),
    0 30px 90px rgba(2, 5, 10, 0.7);
}

.stage-scrim.theme-lighthouse .overlay-panel h3 {
  color: #ffe9bd;
}

.stage-scrim.theme-lighthouse .overlay-kicker {
  color: #c8a35a;
}

.stage-scrim.theme-lighthouse .overlay-clue,
.stage-scrim.theme-lighthouse .letter-body {
  color: rgba(240, 230, 207, 0.82);
}

.stage-scrim.theme-lighthouse .overlay-close {
  border-color: rgba(200, 163, 90, 0.45);
  color: rgba(240, 230, 207, 0.7);
}

.stage-scrim.theme-lighthouse .overlay-close:hover {
  background: rgba(200, 163, 90, 0.18);
  color: #ffe9bd;
}

.stage-scrim.theme-lighthouse .overlay-actions .hud-button,
.stage-scrim.theme-lighthouse .journal-tab {
  border-color: rgba(200, 163, 90, 0.4);
  color: rgba(240, 230, 207, 0.85);
}

.stage-scrim.theme-lighthouse .journal-tab.is-active {
  background: rgba(200, 163, 90, 0.22);
  color: #ffe9bd;
  box-shadow: none;
}

.stage-scrim.theme-lighthouse .letter-row {
  border-color: rgba(200, 163, 90, 0.3);
  color: rgba(240, 230, 207, 0.9);
}

.stage-scrim.theme-lighthouse .letter-row.is-unlocked:hover {
  background: rgba(200, 163, 90, 0.12);
}

.stage-scrim.theme-lighthouse .letter-row.is-sealed {
  color: rgba(240, 230, 207, 0.55);
}

.stage-scrim.theme-lighthouse .hint,
.stage-scrim.theme-lighthouse .relay-item span {
  color: rgba(240, 230, 207, 0.75);
}

.stage-scrim.theme-lighthouse .relay-item strong {
  color: #ffe9bd;
}

.stage-scrim.theme-lighthouse .seal-input {
  background: rgba(24, 16, 9, 0.5);
  border-color: rgba(200, 163, 90, 0.4);
  color: #ffe9bd;
}

.stage-scrim.theme-lighthouse .debrief-ledger {
  border-color: rgba(200, 163, 90, 0.35);
  color: #f0e6cf;
}

.stage-scrim.theme-lighthouse .debrief-card {
  border-color: rgba(200, 163, 90, 0.3);
  background: rgba(200, 163, 90, 0.08);
  color: rgba(240, 230, 207, 0.88);
}

.stage-scrim.theme-lighthouse .seal-instruction {
  color: rgba(240, 230, 207, 0.55);
}

.stage-scrim.theme-lighthouse .seal-phrase {
  color: #ffe9bd;
}

.stage-scrim.theme-lighthouse .device-readout {
  background: rgba(24, 16, 9, 0.55);
}

.stage-scrim.theme-lighthouse .letter-page {
  background:
    repeating-linear-gradient(0deg, transparent 0 1.62rem, rgba(255, 233, 189, 0.05) 1.62rem calc(1.62rem + 1px)),
    linear-gradient(180deg, #3d2c1c, #33251a);
}

/* postcard: kraft index card with perforated stamp edge */

.stage-scrim.theme-postcard .overlay-panel {
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.5), transparent 4rem),
    #e3d3b4;
  color: #3a3025;
  border-top: 0;
  border: 1px solid rgba(58, 48, 37, 0.25);
  border-radius: 6px;
  box-shadow:
    0 1px 0 rgba(255, 253, 247, 0.6) inset,
    0 30px 90px rgba(2, 5, 10, 0.6);
  /* perforated stamp edge */
  mask:
    radial-gradient(6px at 6px 50%, transparent 98%, black) -6px 0 / 12px 24px repeat-y,
    linear-gradient(black, black) 6px 0 / calc(100% - 6px) 100% no-repeat;
  -webkit-mask:
    radial-gradient(6px at 6px 50%, transparent 98%, black) -6px 0 / 12px 24px repeat-y,
    linear-gradient(black, black) 6px 0 / calc(100% - 6px) 100% no-repeat;
  padding-left: 1.9rem;
}

.stage-scrim.theme-postcard .overlay-kicker {
  color: #6b4413;
}

.stage-scrim.theme-postcard .overlay-panel h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: #2f2619;
}

.stage-scrim.theme-postcard .overlay-clue,
.stage-scrim.theme-postcard .letter-body {
  color: rgba(58, 48, 37, 0.8);
}

.stage-scrim.theme-postcard .device-readout {
  background: rgba(58, 48, 37, 0.85);
  color: #ffe9bd;
}

.stage-scrim.theme-postcard .overlay-close {
  border-color: rgba(58, 48, 37, 0.3);
  color: #3a3025;
}

.stage-scrim.theme-postcard .letter-row {
  border-color: rgba(58, 48, 37, 0.3);
  background: rgba(255, 253, 247, 0.4);
}

.stage-scrim.theme-postcard .journal-tab.is-active {
  background: rgba(255, 253, 247, 0.9);
}

.stage-scrim.theme-postcard .seal-input {
  background: rgba(255, 253, 247, 0.75);
  border-color: rgba(58, 48, 37, 0.3);
}

.stage-scrim.theme-postcard .debrief-ledger {
  border-color: rgba(58, 48, 37, 0.3);
  color: #2f2619;
}

.stage-scrim.theme-postcard .letter-page {
  background:
    repeating-linear-gradient(0deg, transparent 0 1.62rem, rgba(58, 48, 37, 0.08) 1.62rem calc(1.62rem + 1px)),
    #ece0c8;
}

/* conservatory: botanical specimen plate on glass */

.stage-scrim.theme-conservatory {
  backdrop-filter: blur(6px) saturate(1.1);
}

.stage-scrim.theme-conservatory .overlay-panel {
  background:
    linear-gradient(160deg, rgba(233, 244, 235, 0.94), rgba(214, 232, 219, 0.9)),
    rgba(233, 244, 235, 0.92);
  color: #23372b;
  border-top: 0;
  border: 1px solid rgba(76, 107, 63, 0.35);
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    inset 0 0 26px rgba(140, 190, 220, 0.12),
    0 30px 90px rgba(2, 5, 10, 0.55);
}

.stage-scrim.theme-conservatory .overlay-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(76, 107, 63, 0.3);
  border-radius: 9px;
  pointer-events: none;
}

.stage-scrim.theme-conservatory .overlay-kicker {
  color: #4c6b3f;
}

.stage-scrim.theme-conservatory .overlay-panel h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: #23372b;
}

.stage-scrim.theme-conservatory .overlay-clue,
.stage-scrim.theme-conservatory .letter-body {
  color: rgba(35, 55, 43, 0.82);
}

.stage-scrim.theme-conservatory .device-readout {
  background: rgba(35, 55, 43, 0.88);
  color: #d9ecc9;
}

.stage-scrim.theme-conservatory .overlay-close {
  border-color: rgba(76, 107, 63, 0.35);
  color: rgba(35, 55, 43, 0.6);
}

.stage-scrim.theme-conservatory .letter-row {
  border-color: rgba(76, 107, 63, 0.35);
  background: rgba(255, 255, 255, 0.35);
}

.stage-scrim.theme-conservatory .journal-tab.is-active {
  background: rgba(255, 255, 255, 0.85);
}

.stage-scrim.theme-conservatory .seal-input {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(76, 107, 63, 0.35);
}

.stage-scrim.theme-conservatory .debrief-ledger {
  border-color: rgba(76, 107, 63, 0.35);
  color: #23372b;
}

.stage-scrim.theme-conservatory .letter-page {
  background:
    repeating-linear-gradient(0deg, transparent 0 1.62rem, rgba(76, 107, 63, 0.09) 1.62rem calc(1.62rem + 1px)),
    linear-gradient(160deg, rgba(240, 248, 240, 0.96), rgba(222, 238, 226, 0.94));
}

@media (prefers-reduced-motion: reduce) {
  .cold-open-line,
  .vine-layer path,
  .vine-leaf {
    animation-duration: 0.01s;
    animation-delay: 0s;
  }

  /* The 26s creeping shade would collapse to an instant near-opaque cover
     under the global 1ms clamp, hiding the clue. Motion goes; the clue and a
     light static tint of the garden stay. */
  .overgrow-shade {
    animation: none;
    opacity: 0.25;
  }

  .vine-layer {
    opacity: 0.4;
  }
}

/* -------------------------------------------------------- role handshake */

.handshake-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
}

.role-handshake {
  width: min(46rem, 100%);
  display: grid;
  gap: 0.9rem;
  justify-items: center;
  text-align: center;
}

.role-handshake h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  color: var(--ink);
}

.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  margin-top: 0.4rem;
}

@media (max-width: 40rem) {
  .role-cards {
    grid-template-columns: 1fr;
  }
}

.role-card {
  display: grid;
  gap: 0.85rem;
  justify-items: center;
  align-content: center;
  min-height: 11.5rem;
  padding: 2rem 1.4rem;
  border: 1px solid rgba(25, 36, 43, 0.14);
  border-radius: 10px;
  background: var(--paper-strong);
  box-shadow: var(--soft-shadow);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.role-card:hover,
.role-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(180, 111, 42, 0.6);
  box-shadow: var(--shadow);
}

.role-card-art {
  width: 5.6rem;
  height: 5.6rem;
}

.role-card-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.role-card-rule {
  width: 2.6rem;
  height: 2px;
  background: var(--brass);
  opacity: 0.7;
}

.role-card-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--ink);
}

/* The vignette: this desk lit, the partner's dark with its chair pulled out,
   a dashed call-thread arcing between them. The image carries the premise;
   one caption beneath the dark desk says the rest in the letter's voice. */
.handshake-tableau {
  width: min(38rem, 100%);
  display: grid;
  gap: 0.1rem;
  margin-top: 0.2rem;
}

.handshake-desks {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 0.1rem;
}

.handshake-desk {
  display: block;
  width: 100%;
  height: auto;
}

.handshake-thread {
  width: 6.2rem;
  height: auto;
  align-self: start;
  margin-top: 1.1rem;
}

.handshake-caption {
  justify-self: end;
  width: min(19.5rem, 100%);
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 720px) {
  .handshake-desks {
    grid-template-columns: minmax(0, 19rem);
    justify-content: center;
  }

  .handshake-thread {
    width: 3.2rem;
    align-self: center;
    margin: -0.5rem auto;
    transform: rotate(90deg);
  }

  .handshake-caption {
    justify-self: center;
  }
}

/* "Send them the address" — handwriting in the margin, not a button. */
.handshake-send-line {
  margin: -0.3rem 0 0;
}

.handshake-send {
  padding: 0.24rem 0.5rem;
  border: 0;
  background: none;
  color: var(--brass-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.94rem;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}

.handshake-send:hover {
  color: var(--brass);
}

.handshake-send:focus-visible {
  outline: 3px solid rgba(180, 111, 42, 0.35);
  outline-offset: 2px;
}

.handshake-send.is-copied {
  color: var(--teal-dark);
  text-decoration: none;
}

.handshake-address {
  width: min(24rem, 100%);
}

.handshake-address .seal-input {
  width: 100%;
  font-size: 0.85rem;
  text-align: center;
}

.handshake-difficulty {
  margin: 0;
  color: var(--brass-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.handshake-back {
  margin-top: 0.5rem;
}

/* ------------------------------------------------------------ relay chip */

.relay-chip {
  margin: 0.85rem 0 0.25rem;
  padding: 0.75rem 0.95rem 0.8rem;
  border: 1px solid rgba(180, 111, 42, 0.5);
  border-left: 4px solid var(--brass);
  border-radius: 6px;
  background: rgba(180, 111, 42, 0.1);
}

.relay-chip-kicker {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.relay-chip-text {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* Hard mode: the relay payload without the "say it aloud" framing. */
.relay-chip-text.relay-line {
  margin: 0.85rem 0 0.25rem;
}

.stage-scrim.theme-lighthouse .relay-chip {
  border-color: rgba(200, 163, 90, 0.5);
  border-left-color: #c8a35a;
  background: rgba(200, 163, 90, 0.12);
}

.stage-scrim.theme-lighthouse .relay-chip-kicker {
  color: #c8a35a;
}

/* -------------------------------------------- two-step HUD confirmations */

.hud-button.is-armed {
  background: rgba(185, 82, 72, 0.32);
  border-color: rgba(255, 158, 143, 0.75);
  color: #ffd9d2;
}

.hud-button.is-armed:hover:not(:disabled) {
  background: rgba(185, 82, 72, 0.45);
  border-color: rgba(255, 158, 143, 0.9);
}

.role-tab-confirm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0.28rem 0.18rem 0.6rem;
  border: 1px solid rgba(255, 158, 143, 0.5);
  border-radius: 7px;
  background: rgba(185, 82, 72, 0.24);
  color: #ffd9d2;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.role-tab-confirm-button {
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(240, 235, 220, 0.35);
  border-radius: 6px;
  background: rgba(240, 235, 220, 0.08);
  color: rgba(240, 235, 220, 0.9);
  font-size: 0.68rem;
  font-weight: 700;
}

.role-tab-confirm-button:hover {
  background: rgba(240, 235, 220, 0.18);
}

.role-tab-confirm-button.is-yes {
  background: rgba(255, 217, 138, 0.2);
  border-color: rgba(255, 217, 138, 0.6);
  color: #ffe9b8;
}

.role-tab-confirm-button.is-yes:hover {
  background: rgba(255, 217, 138, 0.32);
}

/* --------------------------------------------------------- interlude note */

.note-panel {
  width: min(24rem, 92vw);
  border-top-color: var(--plum);
}

.note-panel .overlay-kicker {
  color: var(--plum);
}

.note-line {
  margin: 0.9rem 0 0.3rem;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.55;
}

/* --------------------------------------------------------- letter ordinals */

.letter-ordinal {
  margin-left: auto;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
  white-space: nowrap;
}

.letter-ordinal-line {
  margin: 0.55rem 0 0;
  color: var(--brass-dark);
}

.letter-ordinal-line .letter-ordinal {
  margin-left: 0;
  opacity: 0.85;
}

.stage-scrim.theme-lighthouse .letter-ordinal-line {
  color: #c8a35a;
}

/* ----------------------------------------------------------- token warning */

.token-warning {
  margin: 0.2rem 0 0.5rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--coral);
  border-radius: 0 6px 6px 0;
  background: rgba(185, 82, 72, 0.09);
  color: var(--coral);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------- listening view */

/* Deliberately the same dim lamp-lit card in every room: putting the phone
   down looks the same everywhere. The 3-class selectors outrank the per-room
   overlay skins, which come earlier in the file at equal specificity. */

.stage-scrim .overlay-panel.listen-panel {
  width: min(26rem, 92vw);
  padding: 2.4rem 2.1rem 1.9rem;
  text-align: center;
  border: 1px solid rgba(240, 235, 220, 0.16);
  border-radius: 12px;
  background: radial-gradient(130% 95% at 50% 0%, #232b35, #151b22 72%);
  color: rgba(240, 235, 220, 0.88);
  box-shadow: 0 30px 90px rgba(2, 5, 10, 0.8);
  -webkit-mask: none;
  mask: none;
}

.stage-scrim .listen-panel .overlay-kicker {
  color: rgba(240, 235, 220, 0.42);
}

.stage-scrim .listen-panel .overlay-close {
  border-color: rgba(240, 235, 220, 0.2);
  color: rgba(240, 235, 220, 0.5);
}

.stage-scrim .listen-panel .overlay-close:hover {
  background: rgba(240, 235, 220, 0.1);
  color: rgba(240, 235, 220, 0.85);
}

.listen-line {
  margin: 1.7rem 0 1.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.14rem;
  line-height: 1.75;
}

.listen-tally {
  margin: 0 0 1.4rem;
  color: rgba(240, 235, 220, 0.88);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.listen-actions {
  justify-content: center;
}

.stage-scrim .listen-panel .overlay-actions .hud-button {
  border-color: rgba(240, 235, 220, 0.25);
  background: transparent;
  color: rgba(240, 235, 220, 0.8);
}

.stage-scrim .listen-panel .overlay-actions .hud-button:hover:not(:disabled) {
  background: rgba(240, 235, 220, 0.1);
  border-color: rgba(240, 235, 220, 0.4);
}

/* ------------------------------------------------------------ margin lines */

.margin-panel {
  width: min(26rem, 92vw);
  border-top-color: var(--brass);
}

.margin-panel h3 {
  font-family: Georgia, "Times New Roman", serif;
}

/* The quiet skip: text, not a button shape. Inherits the panel ink so every
   room skin keeps it legible. */
.overlay-panel .margin-skip {
  display: block;
  margin: 0.7rem auto 0;
  padding: 0.2rem 0.4rem;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.55;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.78rem;
  text-decoration: underline dotted;
  cursor: pointer;
}

.overlay-panel .margin-skip:hover {
  opacity: 0.85;
}

/* Marginalia: a newer hand at the edge of the page. A single ruled margin
   line down the left; the note leans slightly, in a different ink. */

.stage-scrim .overlay-panel.marginalia-panel {
  width: min(24rem, 92vw);
  padding-left: 3.4rem;
}

/* Outranks the conservatory skin's inset-frame ::before so the margin rule
   survives in every room; pointer-events stays off and the parent overlay
   panel is position: relative, so the rule can never cover a control. */
.stage-scrim .overlay-panel.marginalia-panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2.3rem;
  width: 1px;
  background: rgba(185, 82, 72, 0.4);
  pointer-events: none;
}

.marginalia-intro {
  margin: 0.9rem 0 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.marginalia-line {
  margin: 0.3rem 0 0.9rem;
  transform: rotate(-1.4deg);
  color: #2a3f8f;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.6;
}

.stage-scrim.theme-lighthouse .marginalia-intro {
  color: rgba(240, 230, 207, 0.55);
}

.stage-scrim.theme-lighthouse .marginalia-line {
  color: #9db4e8;
}

/* --------------------------------------------------- keepsake spread */

.keepsake-spread-block {
  margin-bottom: 1rem;
}

.keepsake-spread {
  display: flex;
  align-items: stretch;
  gap: 0.3rem;
  max-width: 40rem;
}

.keepsake-spread .keepsake-plate {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  margin: 0;
}

/* Placeholder frame for a half of the spread that has not been earned yet. */
.keepsake-spread .keepsake-gap {
  flex: 1 1 0;
  min-width: 0;
  border: 1.6px dashed rgba(200, 163, 90, 0.35);
  border-radius: 10px;
  background: rgba(44, 35, 24, 0.4);
}

.spread-caption {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.8rem;
}

.spread-note {
  margin: 0.15rem 0 0;
  color: var(--brass-dark);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.spread-margin {
  margin: 0.55rem 0 0;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(185, 82, 72, 0.4);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.5;
}

.spread-margin.is-heard {
  color: var(--muted);
}
