/* Game to Trailer: page-specific pieces on top of house-style.css */

/* Stage: trailer underneath, the original game on top while G is held */
.stage { background: #000; }
.stage .layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.stage .game-layer { opacity: 0; transition: opacity 0.18s; }
.stage.show-game .game-layer { opacity: 1; }
.stage.playing .stage-play { opacity: 0; pointer-events: none; }
.stage-play { transition: opacity 0.2s; }
.stage video.layer { cursor: pointer; }

/* Thin progress line at the bottom of the stage */
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); }

/* Sound tool shows waves or a cross */
#sound .cross { display: none; }
#sound[aria-pressed='true'] .cross { display: inline; }
#sound[aria-pressed='true'] .wave { display: none; }

/* Rail rows are buttons */
#rail .rail-item { color: var(--ink); }
#rail .rail-item:last-child { border-bottom: 1px solid var(--rule); }
/* a frame from each trailer instead of a colour swatch */
#rail .thumb { margin-left: auto; width: 64px; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--rule); opacity: 0.75; transition: opacity 0.2s, border-color 0.2s; }
#rail .rail-item:hover .thumb, #rail .rail-item.selected .thumb { opacity: 1; }
#rail .rail-item.selected .thumb { border-color: var(--accent); }

/* Card facts */
.card .count { margin: 0 0 10px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 14px 0 0; font-size: 12px; line-height: 1.5; }
.facts dt { color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 2px; }
.facts dd { margin: 0; color: var(--ink); }

/* Shots drawer */
#shots-lede { margin-bottom: 18px; }
.shot-list { list-style: none; margin: 0; padding: 0; }
.shot {
  display: grid; grid-template-columns: 40px 220px minmax(0, 1fr); gap: 18px; align-items: start;
  padding: 18px 0; border-top: 1px solid var(--rule);
}
.shot:last-child { border-bottom: 1px solid var(--rule); }
.shot .n { font-size: 10px; color: var(--accent); font-variant-numeric: tabular-nums; padding-top: 3px; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border: 1px solid var(--rule); }
.shot h4 { margin: 0 0 6px; font: 400 24px / 1.05 'Instrument Serif', serif; }
.shot .meta { margin: 0; font-size: 11px; color: var(--muted); }
.shot .prompt-excerpt { max-width: none; }

@media (max-width: 800px) {
  /* no filled primary in this row, so an odd last action takes the full width */
  .action-row > .action:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .shot { grid-template-columns: 28px minmax(0, 1fr); }
  .shot img { grid-column: 2; }
  .shot > div { grid-column: 2; }
}

/* keep the stage badge on the video: the stage column must not stretch to the rail height */
.stage-layout { align-items: start; }

/* the stage badge sits below the video, not over it */
.stage-badge {
  position: static; max-width: 100%; margin: 10px 0 0; padding: 0;
  border: 0; border-radius: 0; background: none; backdrop-filter: none;
  font-size: 12px; color: var(--muted);
}

/* Shot rows: image prompt and video prompt */
.prompt-label { margin: 12px 0 0; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.prompt-label span { margin-left: 8px; letter-spacing: 0; text-transform: none; color: var(--muted); font-size: 11px; }
.shot .prompt-excerpt { margin-top: 6px; }

/* How dialog: references and prompts */
.how-refs { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.how-refs-lede { margin: 10px 0 16px; max-width: 820px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.game-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.game-tabs button {
  min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px;
  font: 500 13px / 1 var(--mono); color: var(--muted);
}
.game-tabs button[aria-selected='true'] { border-color: var(--accent); color: var(--ink); }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.ref { margin: 0; }
.ref img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--rule); background: #000; }
.ref figcaption { margin-top: 8px; }
.ref strong { display: block; font-weight: 500; font-size: 14px; color: var(--ink); }
.ref small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.ref details { margin-top: 6px; font-size: 12px; color: var(--muted); }
.ref summary { cursor: pointer; color: var(--accent); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
#how-shots .shot { grid-template-columns: 40px 260px minmax(0, 1fr); }
@media (max-width: 800px) {
  #how-shots .shot { grid-template-columns: 28px minmax(0, 1fr); }
}

/* Trailer / Original game: two glass buttons in one group */
.view-toggle {
  display: inline-flex; gap: 2px; padding: 2px;
  border: 1px solid var(--glass-line); border-radius: 5px;
  background: var(--glass); backdrop-filter: blur(10px);
}
.view-toggle button { min-height: 32px; padding: 0 12px; border-radius: 3px; font-size: 11px; color: var(--ink); white-space: nowrap; }
.view-toggle button[aria-pressed='true'] { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

/* Footer: the shared runtime mounts its tool links in [data-exploration-controls] */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 48px;
  padding: 22px 4.2%; border-top: 1px solid var(--rule); background: var(--exploration-footer-bg);
  font: 400 12px / 1.4 var(--mono); color: var(--muted);
}
.foot-id { letter-spacing: 0.1em; text-transform: uppercase; }
.foot-link { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.foot-link:hover { color: var(--accent); }
.foot [data-exploration-controls] { flex: 1 1 320px; display: flex; justify-content: flex-end; }
