/* ---------------- the researcher ----------------
   Styles for host/researcher.js. Notes: host/README.md */
/* The researcher's panel is drawn inside the prototype's frame, not over the window.
   #survey covers everything — nothing behind it can be clicked — but paints nothing;
   #survey-fit is the clear band above the characters, positioned by script. */
#survey { position: fixed; inset: 0; z-index: 20; background: transparent; }
#survey[hidden] { display: none; }
/* Above the dialogue box's full-screen layer (21) only while the researcher's choices
   are up: the question keeps that box up over them, and at 20 it would swallow every
   click meant for a choice. The rest of the time #survey is hidden. */
#survey:not([hidden]) { z-index: 22; }
/* The researcher's question over the open programme (researcher.js confirmJump): above
   the booklet (28) and her lines over it (29). */
#survey.survey-over:not([hidden]) { z-index: 30; }

#survey-fit {
  position: absolute;
  display: flex; flex-direction: column; justify-content: center;
  /* Never a scroll box: the panel grows to fit every answer (layout sets a min-height,
     not a height), and the answers slide past its sides on the way in and out. */
  overflow: visible;
  /* Typography scales with the frame, so the proportions the designer sees in
     Figma survive being played in a window of any size. */
  --sv-scale: 1;
  --sv-ink: #efe7d6; --sv-dim: #8e8676; --sv-line: #3a352c; --sv-accent: #d8a657;
}

/* The researcher's question and response are in the dialogue box (askQuestion /
   sayReaction); this panel is only the choices, shown once the question has typed out
   and gone the instant one is picked. */
.survey-panel {
  width: 100%; color: var(--sv-ink); outline: 0;
  /* Same solid backing as .dlg-box (dialogue.css): with the tv-scene now drawn
     behind it, a transparent panel let the TVs show through the options. */
  background: #000;
  padding: calc(18px * var(--sv-scale));
  box-sizing: border-box;
}
.survey-options { display: flex; flex-direction: column; gap: calc(8px * var(--sv-scale)); }
/* Each answer starts invisible and off to the left, and slides in once .sv-show lands
   (researcher.js's showChoices). Picking one (.sv-picked) takes the rest away at once and
   sends that one off to the right — the eye goes where the answer goes, to the tubes. */
.survey-options button {
  width: 100%; padding: calc(12px * var(--sv-scale)) calc(15px * var(--sv-scale));
  text-align: left; cursor: pointer;
  font-family: inherit; font-size: calc(14px * var(--sv-scale));
  color: var(--sv-ink); background: transparent;
  border: 1px solid var(--sv-line); border-radius: 2px;
  opacity: 0; transform: translateX(calc(-1em * var(--sv-slide, 2)));
  transition: border-color .12s, background .12s, color .12s,
              opacity var(--sv-fade-ms, .5s) ease-out var(--sv-fade-delay, 0s),
              transform var(--sv-fade-ms, .5s) ease-out var(--sv-fade-delay, 0s);
}
.survey-options.sv-show button { opacity: 1; transform: none; }
.survey-options.sv-picked { pointer-events: none; }
/* The panel's backing goes with the rest, at the click, and the picked answer carries its
   own away with it — so nothing is left behind on the left to snap off when it finishes
   and pull the eye back. */
.survey-panel:has(.sv-picked) { background: transparent; }
.survey-options.sv-picked button:not(.sv-chosen) { visibility: hidden; }
.survey-options.sv-picked button.sv-chosen {
  background: #000;
  opacity: 0; transform: translateX(calc(1em * var(--sv-slide, 2)));
  /* Moving early and fading late, so the motion reads before it is gone. */
  transition: opacity var(--sv-exit-ms, .5s) ease-in, transform var(--sv-exit-ms, .5s) ease-out;
}
.survey-options button:hover,
.survey-options button:focus-visible {
  border-color: var(--sv-accent); color: var(--sv-accent);
  background: rgba(216, 166, 87, .06); outline: 0;
}
/* Researcher.preview(): the panel as the researcher will draw it, plus the band it is
   fitted to — dashed and faintly filled, to show the room around the centred text. */
#survey.survey-preview #survey-fit {
  outline: 1px dashed var(--sv-accent);
  background: rgba(216, 166, 87, .05);
}

/* ---------- the nav button ----------
   The way from one frame to the next (researcher.js's navButton). Its own full-window
   layer like #survey and #dialogue, so nothing but the button can be clicked while it is
   up. Placeholder look — the dialogue box's black and white — until the real buttons
   arrive; positioned by its centre. */
#scene-nav { position: fixed; inset: 0; z-index: 22; user-select: none; }
#scene-nav[hidden] { display: none; }
.nav-btn {
  --nav-scale: 1;
  position: absolute; transform: translate(-50%, -50%);
  padding: calc(8px * var(--nav-scale)) calc(16px * var(--nav-scale));
  font-family: inherit; font-size: calc(15px * var(--nav-scale)); letter-spacing: .12em;
  color: #fff; background: #000; border: 1px solid #fff;
  cursor: pointer;
}
.nav-btn:hover, .nav-btn:focus-visible { color: #000; background: #fff; outline: 0; }
/* A drawn arrow: just the picture, kept crisp, lifting to white on hover — the art is a
   light grey, so brightening it is the same "lit" the text button gets by inverting. */
.nav-btn.nav-art, .nav-btn.nav-art:hover, .nav-btn.nav-art:focus, .nav-btn.nav-art:focus-visible {
  padding: 0; background: none; border: 0; line-height: 0;
  outline: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.nav-btn.nav-art img {
  width: var(--nav-art-w, 64px); height: auto;
  image-rendering: pixelated; user-select: none;
}
/* Hover only. The button is focused the moment it appears (so Enter takes it), and a
   focus highlight read as the arrow starting lit, then dimming on any tap elsewhere. */
.nav-btn.nav-art:hover img { filter: brightness(1.35); }
