/*
 * Picket 18 · shared Bridge-standard story components.
 *
 * Values mirror the Bridge shell in tour/src/style.css (welcome card, panel,
 * primary button, chapter trail). Every Picket 18 page loads this file, so
 * scenes that do not load the Bridge stylesheet (radio room, stand-in
 * stations) still present the same card, type scale and colour tokens.
 */
.p18-card,
.picket18-trail,
.p18-toast {
  --p18-ink: #f3f1e8;
  --p18-muted: #b8c4bd;
  --p18-accent: #d7bb87;
  --p18-border: rgba(241, 239, 226, .2);
  --p18-panel: rgba(20, 38, 37, .96);
}

/* Welcome / chapter card — Bridge `.welcome` */
.p18-card {
  position: fixed;
  z-index: 12;
  left: 7vw;
  top: 50%;
  transform: translateY(-44%);
  width: min(540px, calc(100vw - 32px));
  padding: 38px 42px 34px;
  border: 1px solid var(--p18-border);
  border-radius: 8px;
  background: rgba(13, 30, 29, .94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--p18-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  text-align: left;
  transition: opacity .55s, transform .55s;
}
.p18-card.is-hidden { opacity: 0; transform: translateY(-40%); pointer-events: none; }
/* The bottom-left task panel waits until the chapter card is closed, in every
   scene, so the two never overlap. */
body:has(.p18-card:not(.is-hidden)) :is(.station-approach, .mission-guide, .bridge-story-orders) { visibility: hidden; }
.p18-card-rule { width: 42px; height: 2px; margin-bottom: 24px; background: var(--p18-accent); }
.p18-card .eyebrow {
  display: block;
  margin: 0 0 24px;
  color: var(--p18-accent);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2.6px;
  line-height: 1.3;
  text-transform: uppercase;
}
.p18-card h1 {
  margin: 0 0 28px;
  color: var(--p18-ink);
  font: 400 clamp(48px, 5.5vw, 76px)/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: -.02em;
  text-shadow: none;
}
.p18-card h1 span {
  display: block;
  margin-top: 17px;
  font-size: clamp(19px, 2vw, 27px);
  letter-spacing: .035em;
}
.p18-card-copy {
  margin: 0 0 31px;
  color: #d3d8ca;
  font-size: 14px;
  letter-spacing: .25px;
  line-height: 1.9;
  white-space: pre-line;
}
.p18-primary {
  display: flex;
  min-width: 210px;
  align-items: center;
  justify-content: space-between;
  gap: 38px;
  padding: 16px 23px;
  border: 1px solid var(--p18-accent);
  border-radius: 3px;
  background: var(--p18-accent);
  color: #1c3532;
  cursor: pointer;
  font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: .35px;
  transition: background .2s, transform .2s;
}
.p18-primary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.p18-primary:not(:disabled):hover { background: #ebd3a7; transform: translateY(-1px); }
.p18-primary:disabled { cursor: wait; opacity: .6; }
.p18-primary:focus-visible { outline: 2px solid var(--p18-accent); outline-offset: 4px; }
.p18-card-note { margin: 18px 0 0; color: #aebfb6; font-size: 11px; letter-spacing: .2px; }

/* Five-chapter trail — Bridge `.chapter-trail` with a done state */
.picket18-trail {
  position: fixed;
  z-index: 3;
  top: 92px;
  left: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 68px);
  color: #a4b0a5;
  font-size: 8px;
  letter-spacing: 1px;
  pointer-events: none;
}
.picket18-trail span[aria-current="step"] { color: #e1c58e; }
.picket18-trail span[data-done="true"] { color: #8e9c92; text-decoration: line-through; text-decoration-color: rgba(215, 187, 135, .45); }
.picket18-trail i { color: #60756a; font-style: normal; }

/* Transient status — Bridge `#toast` */
.p18-toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 130px;
  max-width: min(90vw, 600px);
  padding: 12px 20px;
  border-radius: 4px;
  background: #e2c899;
  box-shadow: 0 6px 25px #0003;
  color: #19342e;
  font: 12px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

@media (max-width: 720px) {
  .p18-card { left: 16px; right: 16px; width: auto; top: 46%; padding: 28px 24px 26px; }
  .p18-card-copy { font-size: 13px; }
  .picket18-trail { top: 110px; left: 17px; gap: 5px; font-size: 7px; }
  .p18-toast { bottom: 165px; }
}
@media (max-width: 520px) {
  .picket18-trail { top: 142px; }
}
@media (prefers-reduced-motion: reduce) {
  .p18-card, .p18-primary { transition: none; }
}

/* No chapter trail: listing the next rooms would spoil the route's surprises.
   The left mission guide is the only wayfinding. (2026-11-04) */
.chapter-trail, .picket18-trail { display: none !important; }

/* "Stay at your post" — centred line when the visitor tries to walk off the
   scan's capture point (engine room, radio room). Bridge panel styling. */
.p18-stay-notice {
  position: fixed;
  z-index: 31;
  left: 50%;
  top: 50%;
  width: max-content;
  max-width: min(86vw, 460px);
  padding: 18px 26px 17px;
  border: 1px solid rgba(215, 187, 135, .42);
  border-radius: 6px;
  background: rgba(14, 31, 30, .9);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
  backdrop-filter: blur(14px);
  color: #f3f1e8;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -42%);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.p18-stay-notice.is-visible { opacity: 1; transform: translate(-50%, -50%); }
.p18-stay-eyebrow {
  margin: 0 0 8px;
  color: #d7bb87;
  font: 600 9px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}
.p18-stay-text {
  margin: 0;
  font: 400 17px/1.45 Georgia, "Times New Roman", serif;
}
@media (prefers-reduced-motion: reduce) {
  .p18-stay-notice { transition: none; transform: translate(-50%, -50%); }
}

/* ---------- Settings live inside ? (no toggles in the top bar) ---------- */
.advanced-settings .quality-label { justify-content: space-between; width: 100%; height: auto; min-height: 38px; margin: 6px 0 10px; padding: 0 11px; box-sizing: border-box; }
.advanced-settings .quality-label .tool-label { display: inline; font-size: 11px; }
.advanced-settings .quality-label select { max-width: none; }
.help-dialog .advanced-settings { border-top: 1px solid rgba(232, 202, 151, .22); margin: 18px 0 22px; padding-top: 14px; }
.help-dialog .advanced-settings > summary { cursor: pointer; color: var(--p18-accent, #d9b77d); font-size: 11px; letter-spacing: .6px; padding: 4px 0; }
.help-dialog .advanced-settings .settings-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.help-dialog .advanced-settings .tool-button { justify-content: flex-start; gap: 8px; width: 100%; min-height: 38px; font-size: 11px; }
.help-dialog .advanced-settings .tool-button .tool-label { display: inline; }
.help-dialog .advanced-settings .tool-button { flex-direction: row; align-items: center; height: auto; padding: 8px 12px; }
.help-dialog .advanced-settings .tool-button svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; }
.help-dialog .advanced-settings .settings-actions .tool-button { justify-content: flex-start; width: 100%; border: 1px solid rgba(241, 239, 226, .2); border-radius: 6px; background: rgba(15, 34, 34, .64); color: inherit; }

/* ---------- Passage button: the only way out of a room (global rule 8) ---------- */
.p18-passage { position: fixed; z-index: 7; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; gap: 9px; width: min(330px, calc(100vw - 40px)); padding: 23px 28px; border: 1px solid #e6ca94; border-radius: 7px; background: rgba(20, 38, 37, .97); color: #f1d8a4; font: inherit; text-align: center; box-shadow: 0 12px 50px #0008, 0 0 0 5px #d7bb871a; backdrop-filter: blur(12px); cursor: pointer; }
.p18-passage[hidden] { display: none; }
.p18-passage strong { font-size: 16px; font-weight: 600; }
.p18-passage small { color: #b8c4bd; font-size: 10px; letter-spacing: .4px; }
.p18-passage:hover { background: #263c32; border-color: #ffe1a7; }
