/* THE GOD TERMINAL — popup scenes 35–37: trail cam, spot the unicorn, unicorn lure (the unicorn set).
 * Interactive: tap the action (FLAG, a horse, CAPTURE), or the scene's own cursor or reticle does it
 * after a few seconds. Shared pieces use the sc8- prefix (head with a status tag and a big readout,
 * a framed instrument, a status foot with the action, stamps, the scene cursor); everything else is
 * .sc-<name>-*. Palette tokens throughout, except the imagery itself (night vision, dusk prairie,
 * moonlight) and the rainbow, which is css/unicorn.css's --uni-* set. */

@keyframes sc8-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes sc8-blink { 50% { opacity: 0.2; } }
@keyframes sc8-ready {
  0%, 100% { box-shadow: 0 0 0 1px var(--uni-1), 0 0 14px -2px var(--uni-1), 0 0 26px -8px var(--uni-5); }
  50% { box-shadow: 0 0 0 2px var(--uni-3), 0 0 24px 0 var(--uni-6), 0 0 40px -6px var(--uni-4); }
}
@keyframes sc8-flow { to { background-position: -200% 0; } }

/* ───────── shared ───────── */
.sc8-root {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  container-type: inline-size;
}

.sc8-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 2.6rem;
  animation: sc8-rise 260ms ease-out both;
}
.sc8-tag {
  --tag: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  margin-bottom: 0.2rem;
  padding: 0.3rem 0.7rem 0.3rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--tag) 55%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--tag) 12%, transparent);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: color-mix(in srgb, var(--tag) 35%, var(--text-bright));
  transition: border-color 200ms, background-color 200ms, color 200ms;
}
.sc8-tag i {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--tag);
  box-shadow: 0 0 10px var(--tag);
  animation: sc8-blink 700ms steps(1) infinite;
}
.sc8-tag.is-steady i { animation: none; }
.sc8-tag span { overflow: hidden; text-overflow: ellipsis; }
.sc8-tag.is-magic {
  border-color: transparent;
  background:
    linear-gradient(color-mix(in srgb, var(--panel-strong) 88%, transparent), color-mix(in srgb, var(--panel-strong) 88%, transparent)) padding-box,
    linear-gradient(90deg, var(--uni-rainbow)) border-box;
  color: #fff;
}
.sc8-tag.is-magic i { background: linear-gradient(135deg, var(--uni-1), var(--uni-5)); box-shadow: 0 0 10px var(--uni-1); animation: none; }

.sc8-readout { display: flex; align-items: baseline; gap: 0.55rem; min-width: 0; }
.sc8-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--dim);
}
.sc8-big {
  min-width: 3ch;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: 0.02em;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text-bright);
  text-shadow: var(--text-glow);
  transform-origin: 100% 70%;
}

/* The instrument: a dark framed viewport with lit HUD corner brackets. */
.sc8-view {
  --hb: 13px;
  --hc: color-mix(in srgb, var(--line-bright) 85%, transparent);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: color-mix(in srgb, var(--bg) 82%, #000);
  box-shadow: inset 0 0 calc(34px * var(--glow-k)) calc(-14px * var(--glow-k)) var(--glow), inset 0 0 0 1px rgba(0, 0, 0, 0.5);
  animation: sc8-rise 280ms 60ms ease-out both;
  touch-action: manipulation;
}
.sc8-view > canvas { display: block; width: 100%; height: 100%; }
.sc8-view::after {
  content: '';
  position: absolute;
  inset: 5px;
  z-index: 6;
  pointer-events: none;
  background:
    linear-gradient(var(--hc), var(--hc)) left top / var(--hb) 1.5px,
    linear-gradient(var(--hc), var(--hc)) left top / 1.5px var(--hb),
    linear-gradient(var(--hc), var(--hc)) right top / var(--hb) 1.5px,
    linear-gradient(var(--hc), var(--hc)) right top / 1.5px var(--hb),
    linear-gradient(var(--hc), var(--hc)) left bottom / var(--hb) 1.5px,
    linear-gradient(var(--hc), var(--hc)) left bottom / 1.5px var(--hb),
    linear-gradient(var(--hc), var(--hc)) right bottom / var(--hb) 1.5px,
    linear-gradient(var(--hc), var(--hc)) right bottom / 1.5px var(--hb);
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 calc(4px * var(--glow-k)) var(--glow));
}

/* A small identification chip in the instrument's top-left corner. */
.sc8-chip {
  --chip: var(--accent);
  position: absolute;
  left: 0.7rem;
  top: 0.65rem;
  z-index: 3;
  max-width: calc(100% - 1.4rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.2rem 0.6rem;
  border-left: 3px solid var(--chip);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.66);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  pointer-events: none;
}
.sc8-chip.is-bad { --chip: var(--bad); color: color-mix(in srgb, var(--bad) 40%, #fff); }

.sc8-foot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  animation: sc8-rise 260ms 120ms ease-out both;
}
/* Status lines carry the punchlines, so they wrap to a second line rather than truncate. */
.sc8-status {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.3;
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-bright);
  text-shadow: var(--text-glow);
}
.sc8-status::before { content: '›'; margin-right: 0.55em; color: var(--accent); }
.sc8-status.is-good { color: color-mix(in srgb, var(--good) 45%, var(--text-bright)); }
.sc8-status.is-bad { color: color-mix(in srgb, var(--bad) 45%, var(--text-bright)); }
.sc8-status.is-warn { color: color-mix(in srgb, var(--warn) 45%, var(--text-bright)); }

/* The scene's action button. Ready = a rainbow halo that breathes: "now's the moment". */
.sc8-act {
  flex: none;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.35rem 1.05rem 0.35rem 0.85rem;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-bright);
}
.sc8-act-ico { display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; flex: none; }
.sc8-act-ico svg { width: 100%; height: 100%; display: block; }
.sc8-act.is-ready {
  border-color: transparent;
  color: #fff;
  background:
    linear-gradient(color-mix(in srgb, var(--panel-strong) 82%, transparent), color-mix(in srgb, var(--panel-strong) 82%, transparent)) padding-box,
    linear-gradient(90deg, var(--uni-rainbow), var(--uni-1)) border-box;
  background-size: 100% 100%, 200% 100%;
  animation: sc8-ready 1.1s ease-in-out infinite, sc8-flow 2.2s linear infinite;
}
.sc8-act.is-done { opacity: 0.55; pointer-events: none; }

/* The scene's own pointer (automatic choices). */
.sc8-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 20;
  width: 1.7rem;
  height: 1.7rem;
  margin: -0.15rem 0 0 -0.35rem;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 6px color-mix(in srgb, var(--glow) 70%, transparent));
  transform-origin: 20% 10%;
}
.sc8-cursor svg { display: block; width: 100%; height: 100%; }

/* Stamps. */
.sc8-stamp {
  --stamp: var(--good);
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  max-width: calc(100% - 1.5rem);
  padding: 0.45rem 1.2rem 0.6rem;
  border: 2px solid var(--stamp);
  border-radius: 6px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--stamp) 16%, transparent), transparent 70%),
    color-mix(in srgb, var(--bg) 84%, transparent);
  box-shadow: 0 0 calc(30px * var(--glow-k)) -6px var(--stamp), inset 0 0 calc(22px * var(--glow-k)) -8px var(--stamp), 0 10px 30px -10px rgba(0, 0, 0, 0.9);
  text-align: center;
  white-space: nowrap;
  translate: -50% -50%;
  opacity: 0;
  pointer-events: none;
}
.sc8-stamp b {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  line-height: 0.85;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--stamp) 55%, #fff);
  text-shadow: 0 0 calc(14px * var(--glow-k)) var(--stamp), 0 0 2px var(--stamp);
}
.sc8-stamp span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-bright);
}
.sc8-stamp.is-miss { --stamp: var(--warn); }
.sc8-stamp.is-note { --stamp: var(--bad); }
.sc8-stamp.is-find {
  border-color: transparent;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--uni-6) 26%, transparent), transparent 75%) padding-box,
    linear-gradient(color-mix(in srgb, var(--bg) 86%, transparent), color-mix(in srgb, var(--bg) 86%, transparent)) padding-box,
    linear-gradient(90deg, var(--uni-rainbow)) border-box;
  box-shadow: 0 0 34px -6px var(--uni-1), 0 0 50px -12px var(--uni-5), 0 10px 30px -10px rgba(0, 0, 0, 0.9);
}
.sc8-stamp.is-find b {
  background: linear-gradient(90deg, var(--uni-rainbow), var(--uni-1)) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--uni-1) 60%, transparent));
  animation: sc8-flow 2.4s linear infinite;
}

/* ENHANCE. */
.sc8-word {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  font-family: var(--font-display);
  font-size: 4.25rem;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 0 calc(18px * var(--glow-k)) var(--warn), 0 0 3px var(--warn), 0 3px 0 rgba(0, 0, 0, 0.6);
  translate: -50% -50%;
  pointer-events: none;
}

@container (max-width: 400px) {
  .sc8-head { min-height: 2.2rem; }
  .sc8-tag { font-size: 0.75rem; letter-spacing: 0.1em; padding-inline: 0.5rem 0.55rem; }
  .sc8-label { display: none; }
  .sc8-stamp { padding: 0.35rem 0.7rem 0.45rem; }
  .sc8-stamp b { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 800; line-height: 1.1; letter-spacing: 0.06em; }
  .sc8-stamp span { font-size: 0.75rem; letter-spacing: 0.08em; white-space: normal; }
  .sc8-status { font-size: 0.875rem; letter-spacing: 0.05em; }
  .sc8-act { padding-inline: 0.7rem 0.8rem; font-size: 0.9375rem; letter-spacing: 0.08em; }
  .sc8-word { font-size: 3rem; }
  .sc8-chip { font-size: 0.75rem; letter-spacing: 0.08em; }
}

html[data-reduced-motion="on"] .sc8-tag i { animation: none; }
html[data-reduced-motion="on"] .sc8-act.is-ready { animation: none; box-shadow: 0 0 0 2px var(--uni-3), 0 0 18px -2px var(--uni-1); }
html[data-reduced-motion="on"] .sc8-stamp.is-find b { animation: none; }

/* ───────── 35 · Trail Cam Review ───────── */
.sc-trail-cam-view { aspect-ratio: 1.5; }
.sc-trail-cam-stamp { top: auto; bottom: 16%; translate: -50% 0; }
@container (max-width: 400px) {
  .sc-trail-cam-view { aspect-ratio: 1.3; }
}

/* ───────── 36 · Spot the Unicorn ───────── */
.sc-spot-unicorn-view { aspect-ratio: 1.9; cursor: crosshair; }
.sc-spot-unicorn-stamp { top: 0.6rem; translate: -50% 0; }
@container (max-width: 400px) {
  .sc-spot-unicorn-view { aspect-ratio: 1.3; }
}

/* ───────── 37 · Unicorn Lure ───────── */
.sc-unicorn-lure-meter {
  --meter-color: var(--uni-1);
  --meter-h: 0.75rem;
  --meter-radius: 99px;
  margin-top: -0.2rem;
  animation: sc8-rise 260ms 40ms ease-out both;
}
.sc-unicorn-lure-meter .fx-meter-fill { background: linear-gradient(90deg, var(--uni-6), var(--uni-5), var(--uni-4), var(--uni-3), var(--uni-2), var(--uni-1)); }
.sc-unicorn-lure-pct { min-width: 4ch; }
.sc-unicorn-lure-view { aspect-ratio: 1.7; }
.sc-unicorn-lure-foot { flex-wrap: wrap; row-gap: 0.55rem; }
.sc-unicorn-lure-foot .sc8-status { flex: 1 1 100%; }
.sc-unicorn-lure-acts { display: flex; justify-content: flex-end; gap: 0.5rem; margin-left: auto; }
.sc-unicorn-lure-baits { display: flex; gap: 0.5rem; }
.sc-unicorn-lure-bait {
  min-height: 2.75rem;
  padding: 0.3rem 0.85rem 0.3rem 0.65rem;
  gap: 0.45rem;
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-bright);
}
.sc-unicorn-lure-ico { font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; font-size: 1.2rem; line-height: 1; }
.sc-unicorn-lure-photo {
  position: absolute;
  left: 4%;
  top: 7%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  width: 50%;
  padding: 3.5% 3.5% 0;
  border-radius: 3px;
  background: linear-gradient(160deg, #fbf9f2, #e9e4d6);
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
}
.sc-unicorn-lure-photo canvas { display: block; width: 100%; height: auto; background: #000; }
.sc-unicorn-lure-cap {
  padding: 0.3rem 0 0.4rem;
  font-size: 0.875rem;
  font-style: italic;
  font-weight: 700;
  text-align: center;
  color: #3a3550;
}
.sc-unicorn-lure-stamp { top: 8%; left: 76%; translate: -50% 0; }
@container (max-width: 400px) {
  .sc-unicorn-lure-view { aspect-ratio: 1.3; }
  .sc-unicorn-lure-acts { flex: 1 1 100%; justify-content: stretch; }
  .sc-unicorn-lure-baits { flex: 1; }
  .sc-unicorn-lure-bait { flex: 1; padding-inline: 0.4rem; font-size: 0.8125rem; letter-spacing: 0.02em; }
  .sc-unicorn-lure-capture { flex: 1; }
  .sc-unicorn-lure-photo { width: 58%; }
  .sc-unicorn-lure-stamp { top: auto; bottom: 6%; left: 50%; }
}
