/* ============================================================
   Dynamic N Survey App — Global layout only
   Interaction-specific styles live in css/interactions/
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:         #00c9b1;
  --teal-dark:    #00b5a0;
  --navy:         #0d1b35;
  --white:        #ffffff;
  --overlay-bg:   rgba(5, 10, 24, 0.85);
  --glass-bg:     rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.10);
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --radius:       12px;
  --transition:   0.35s ease;
}

html, body {
  height: 100%; width: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--navy);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ── Background layers ──────────────────────────────────────── */

.bg-layer {
  position: fixed; inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transition: opacity 0.8s ease;
  z-index: 0;
  pointer-events: none;
  transform-origin: center 40%;
}

#bg-front { z-index: 1; }
#bg-back  { z-index: 0; opacity: 0; }

@keyframes kenburns-a {
  0%   { transform: scale(1.00) translate(0%,   -1%);   }
  25%  { transform: scale(1.07) translate(-1.5%,-2%);   }
  50%  { transform: scale(1.05) translate(1%,   -2.5%); }
  75%  { transform: scale(1.07) translate(-1%,  -1.5%); }
  100% { transform: scale(1.00) translate(0%,   -1%);   }
}
@keyframes kenburns-b {
  0%   { transform: scale(1.05) translate(1%,   -1.5%); }
  25%  { transform: scale(1.00) translate(0%,   -1%);   }
  50%  { transform: scale(1.07) translate(-1%,  -2%);   }
  75%  { transform: scale(1.04) translate(1.5%, -1.5%); }
  100% { transform: scale(1.05) translate(1%,   -1.5%); }
}

.kenburns-a { animation: kenburns-a 20s ease-in-out infinite; }
.kenburns-b { animation: kenburns-b 20s ease-in-out infinite; }

/* Vignette — top 40% clear, heavy black at bottom */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.00) 0%,
    rgba(0,0,0,0.00) 40%,
    rgba(0,0,0,0.35) 58%,
    rgba(0,0,0,0.75) 72%,
    rgba(0,0,0,0.93) 85%,
    rgba(0,0,0,0.97) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* ── Progress bar ───────────────────────────────────────────── */

#progress-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.12);
  z-index: 30;
}
#progress-fill {
  height: 100%; background: var(--teal);
  transition: width 0.6s ease; width: 0%;
}

/* ── Controls (mute + back) ─────────────────────────────────── */

.ctrl-btn {
  position: fixed; top: 14px;
  z-index: 30;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
  transition: background 0.2s;
}
.ctrl-btn:hover { background: rgba(255,255,255,0.22); }
#btn-mute   { right: 62px; }
#btn-back   { left: 16px; display: none; }

.lang-picker {
  position: fixed; top: 14px; right: 16px;
  z-index: 30;
  background: rgba(13,27,53,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.9);
  border-radius: 10px;
  height: 38px; padding: 0 10px;
  font-size: 13px; font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s;
  min-width: 110px;
}
.lang-picker:hover { background: rgba(255,255,255,0.18); }
.lang-picker option { background: #0d1b35; color: white; }

/* ── Main stage ─────────────────────────────────────────────── */

.stage {
  position: fixed; inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px 14px;
  gap: 0;
  pointer-events: none;
}
.stage.active { display: flex; }
.stage > * { pointer-events: auto; }
.stage-spacer { flex: 1; }

/* ── Question bar — pinned to top ───────────────────────────── */

.caption-bar {
  width: 100%; max-width: 860px;
  background: var(--overlay-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 10px 16px 9px;
}
.stage-label {
  font-size: 9px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--teal); margin-bottom: 3px; opacity: 0.85;
}
.question-text {
  font-size: 15px; font-weight: 600;
  line-height: 1.5; color: var(--white);
  min-height: 1.4em;
}

/* Caption header row — label on the left, replay (↺) control on the right,
   sitting at the top of the question card next to the question. */
.caption-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.cap-btn {
  flex-shrink: 0;
  display: none; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  color: rgba(255,255,255,0.85);
  font-size: 15px; cursor: pointer;
  transition: background 0.2s;
}
.cap-btn:hover { background: rgba(255,255,255,0.20); }

/* Answer hint — coaches how to answer; collapsed by default, animates open
   (slide + fade + a one-shot glow) once narration finishes and choices appear. */
.answer-hint {
  position: relative;
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(0, 201, 177, 0.12);
  border: 1px solid rgba(0, 201, 177, 0.35);
  border-radius: 10px;
  color: rgba(255,255,255,0.92);
  font-size: 13px; line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  max-height: 0;
  padding: 0 12px;
  margin-bottom: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease,
              transform 0.4s cubic-bezier(0.22,1,0.36,1),
              max-height 0.4s ease,
              padding 0.4s ease,
              margin 0.4s ease;
}
.answer-hint.show {
  opacity: 1;
  transform: translateY(0);
  max-height: 140px;
  padding: 9px 12px;
  margin-bottom: 8px;
  pointer-events: auto;
  animation: answerHintGlow 2s ease-out 1;
}
@keyframes answerHintGlow {
  0%   { box-shadow: 0 0 0 0 rgba(0,201,177,0.50); }
  40%  { box-shadow: 0 0 16px 2px rgba(0,201,177,0.60); }
  100% { box-shadow: 0 0 0 0 rgba(0,201,177,0.00); }
}

/* One-shot light shimmer sweeping across the strip on reveal */
.answer-hint.show::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 10px;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.20) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: answerHintShimmer 1.1s ease-out 0.15s 1;
  pointer-events: none;
}
@keyframes answerHintShimmer {
  from { background-position: 180% 0; }
  to   { background-position: -100% 0; }
}

/* Bulb: pops in, then gently breathes/glows while visible */
.answer-hint-icon {
  font-size: 15px; line-height: 1.4; flex-shrink: 0;
  transform-origin: center;
}
.answer-hint.show .answer-hint-icon {
  animation: bulbPop 0.5s cubic-bezier(0.34,1.56,0.64,1) 1,
             bulbBreathe 2.8s ease-in-out 0.6s infinite;
}
@keyframes bulbPop {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes bulbBreathe {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 0px rgba(255,210,90,0)); }
  50%      { transform: scale(1.14); filter: drop-shadow(0 0 7px rgba(255,210,90,0.85)); }
}
.answer-hint-text { flex: 1; }

/* ── Input panel — pinned to bottom ────────────────────────── */

.interaction-panel-wrap {
  width: 100%; max-width: 860px;
  background: var(--overlay-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  position: relative; z-index: 11;
  overflow: hidden;
}
.interaction-panel-wrap:has(.gs-sticky-board),
.interaction-panel-wrap:has(.lineup-wrap) {
  overflow: visible;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.interaction-panel-wrap.interaction-hidden {
  opacity: 0; transform: translateY(16px); pointer-events: none;
}
.interaction-panel-wrap.interaction-reveal {
  opacity: 1; transform: translateY(0);
}
.interaction-area {
  padding: 10px 14px 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 55vh;
}
/* Drag rank — panel snaps right below question, takes all remaining height */
#stage-survey.drag-rank-mode { gap: 8px; }
#stage-survey.drag-rank-mode .stage-spacer { display: none; }
#stage-survey.drag-rank-mode .interaction-panel-wrap { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
#stage-survey.drag-rank-mode .interaction-area { max-height: none; flex: 1; min-height: 0; overflow-y: auto; }
.interaction-area:has(.gs-sticky-board) {
  overflow-x: visible;
  overflow-y: auto;
}
.interaction-area:has(.ninja-wrap),
.interaction-area:has(.fish-wrap),
.interaction-area:has(.collect-wrap),
.interaction-area:has(.lineup-wrap) {
  overflow: visible;
  max-height: none;
  padding-bottom: 0;
}

/* Controls row — speak + next buttons */
.controls-row {
  display: flex; align-items: center;
  justify-content: flex-end; gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.btn-voice {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 10px;
  color: rgba(255,255,255,0.85);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.btn-voice:hover { background: rgba(255,255,255,0.18); }
.btn-voice.listening {
  background: rgba(239,68,68,0.25);
  border-color: rgba(239,68,68,0.5);
  color: #fca5a5;
  animation: pulse 1.5s ease-in-out infinite;
}

.btn-next {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px;
  background: var(--teal); border: none;
  border-radius: 10px; color: #fff;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
  box-shadow: 0 4px 16px rgba(0,201,177,0.30);
}
.btn-next:hover:not(:disabled) { background: var(--teal-dark); transform: translateY(-1px); }
.btn-next:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn-next { touch-action: manipulation; }

/* ── Tap-to-begin overlay ───────────────────────────────────── */

#begin-overlay {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(13,27,53,0.65) 0%,
    rgba(0,0,0,0.5) 50%,
    rgba(13,27,53,0.75) 100%
  );
}
.begin-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; text-align: center; padding: 0 24px;
  animation: begin-enter 0.8s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes begin-enter {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.begin-brand {
  font-size: 13px; font-weight: 800; letter-spacing: 4px;
  text-transform: uppercase; color: rgba(255,255,255,0.45);
}
.begin-brand span { color: var(--teal); }
.begin-headline {
  font-size: clamp(28px, 6vw, 48px); font-weight: 800;
  color: white; line-height: 1.2;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.begin-sub {
  font-size: 15px; color: rgba(255,255,255,0.55);
  font-weight: 400; letter-spacing: 0.3px;
}
.begin-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 40px; margin-top: 8px;
  background: var(--teal);
  border: none; border-radius: 100px;
  color: white; font-size: 18px; font-weight: 800;
  cursor: pointer; letter-spacing: 0.3px;
  box-shadow: 0 0 40px rgba(0,201,177,0.5), 0 8px 24px rgba(0,0,0,0.3);
  animation: btn-glow 2s ease-in-out infinite;
  transition: transform 0.2s, box-shadow 0.2s;
}
.begin-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 60px rgba(0,201,177,0.7), 0 12px 32px rgba(0,0,0,0.4);
}
.begin-btn:active  { transform: scale(0.98); }
.begin-btn:disabled {
  opacity: 0.85; cursor: default;
  animation: none;
  box-shadow: 0 0 20px rgba(0,201,177,0.3), 0 4px 12px rgba(0,0,0,0.2);
}
.begin-btn-arrow {
  font-size: 22px; transition: transform 0.2s;
}
.begin-btn:hover .begin-btn-arrow { transform: translateX(4px); }
@keyframes btn-glow {
  0%, 100% { box-shadow: 0 0 40px rgba(0,201,177,0.5), 0 8px 24px rgba(0,0,0,0.3); }
  50%       { box-shadow: 0 0 60px rgba(0,201,177,0.75), 0 8px 24px rgba(0,0,0,0.3); }
}

/* ── Shared background for screener + intake + complete screens ─ */

#stage-screener,
#stage-intake,
#stage-geo,
#stage-complete {
  background-image: url('/background.png');
  background-size: cover;
  background-position: center;
}
#stage-screener::before,
#stage-intake::before,
#stage-geo::before,
#stage-complete::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    135deg,
    rgba(13,27,53,0.70) 0%,
    rgba(0,0,0,0.55) 50%,
    rgba(13,27,53,0.80) 100%
  );
  pointer-events: none;
  z-index: 0;
}
#stage-screener > *,
#stage-intake > *,
#stage-geo > *,
#stage-complete > * { position: relative; z-index: 1; }

/* ── Location gate ──────────────────────────────────────────── */
#stage-geo { justify-content: center; align-items: center; }
.geo-card {
  background: var(--overlay-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px; padding: 36px 32px;
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.geo-icon  { font-size: 40px; }
.geo-title { font-size: 20px; font-weight: 700; color: var(--white); }
.geo-sub   { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.5; }
.geo-error { font-size: 12px; color: #ff8a8a; line-height: 1.45; }
.geo-error:empty { display: none; }
.geo-btn   { width: 100%; justify-content: center; padding: 13px; font-size: 15px; margin-top: 4px; }

/* ── Screener screen ────────────────────────────────────────── */

#stage-screener {
  justify-content: center; align-items: center;
  padding: 48px 24px;
}
.screener-card {
  width: 100%; max-width: 560px;
  display: flex; flex-direction: column; gap: 32px;
  animation: screener-enter 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes screener-enter {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screener-header { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.screener-label {
  font-size: 10px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--teal);
}
.screener-title {
  font-size: 22px; font-weight: 700; color: var(--white);
  line-height: 1.45;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.screener-options { display: flex; flex-direction: column; gap: 10px; }
.screener-option {
  padding: 16px 20px;
  border-radius: 14px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  color: white; font-size: 15px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
  animation: screener-option-in 0.4s cubic-bezier(0.22,1,0.36,1) both;
}
.screener-option:nth-child(1) { animation-delay: 0.05s; }
.screener-option:nth-child(2) { animation-delay: 0.10s; }
.screener-option:nth-child(3) { animation-delay: 0.15s; }
.screener-option:nth-child(4) { animation-delay: 0.20s; }
.screener-option:nth-child(5) { animation-delay: 0.25s; }
.screener-option:nth-child(6) { animation-delay: 0.30s; }
@keyframes screener-option-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.screener-option:hover {
  background: rgba(0,201,177,0.12);
  border-color: rgba(0,201,177,0.5);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.screener-option.date-input-wrap {
  background: rgba(255,255,255,0.04);
  border-style: dashed;
  display: flex; flex-direction: column; gap: 10px;
}

/* ── Intake screen ──────────────────────────────────────────── */

#stage-intake { justify-content: center; align-items: center; }
.intake-card {
  background: var(--overlay-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px; padding: 28px 28px;
  width: 100%; max-width: 400px;
  max-height: calc(100vh - 64px);     /* never taller than the viewport */
  display: flex; flex-direction: column; gap: 18px;
  overflow: hidden;                    /* card stays fixed; fields scroll */
}
.intake-header { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.intake-label { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--teal); opacity: 0.85; }
.intake-title  { font-size: 20px; font-weight: 700; color: var(--white); line-height: 1.3; }
.intake-sub    { font-size: 13px; color: rgba(255,255,255,0.5); line-height: 1.5; }

.intake-progress { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.intake-section-title { font-size: 14px; font-weight: 700; color: var(--white); }
.intake-progress-row { display: flex; align-items: center; gap: 10px; }
.intake-dots { display: flex; gap: 6px; }
.intake-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.22); transition: background 0.2s; }
.intake-dot.active { background: var(--teal); }
.intake-step-label { font-size: 11px; color: rgba(255,255,255,0.5); }

.intake-fields { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding-right: 4px; }
.intake-fields.slide { animation: intakeSlide 0.28s cubic-bezier(0.22,1,0.36,1); }
@keyframes intakeSlide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

.intake-field-group { display: flex; flex-direction: column; gap: 8px; }
.intake-field-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.intake-options { display: flex; flex-wrap: wrap; gap: 8px; }
.intake-option {
  padding: 8px 16px; border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; user-select: none;
}
.intake-option:hover { border-color: rgba(0,201,177,0.5); background: rgba(0,201,177,0.08); }
.intake-option.selected { background: rgba(0,201,177,0.2); border-color: var(--teal); color: var(--white); font-weight: 600; }

.intake-footer { flex: 0 0 auto; display: flex; gap: 10px; align-items: center; }
.intake-back {
  flex: 0 0 auto; padding: 13px 16px; border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.18s;
}
.intake-back:hover { border-color: rgba(255,255,255,0.4); color: var(--white); }
.intake-btn { flex: 1 1 auto; justify-content: center; padding: 13px; font-size: 15px; }

/* ── Complete screen ────────────────────────────────────────── */

#stage-complete { justify-content: center; align-items: center; overflow-y: auto; padding: 48px 16px; }
.complete-card {
  background: var(--overlay-bg); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px; padding: 36px 32px;
  text-align: center; max-width: 420px; width: 100%;
  display: flex; flex-direction: column; gap: 24px;
  animation: begin-enter 0.6s cubic-bezier(0.22,1,0.36,1) both;
}
/* Coins */
.complete-coins-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.complete-coin-icon { font-size: 48px; animation: coin-spin 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.3s both; }
@keyframes coin-spin {
  from { transform: scale(0) rotateY(180deg); opacity: 0; }
  to   { transform: scale(1) rotateY(0deg);   opacity: 1; }
}
.complete-coins-count {
  font-size: 56px; font-weight: 900; color: var(--teal);
  line-height: 1; text-shadow: 0 0 30px rgba(0,201,177,0.5);
}
.complete-coins-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.4); }
/* Thanks */
.complete-thanks { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.complete-emoji { font-size: 36px; }
.complete-card h2 { font-size: 22px; font-weight: 700; color: white; }
.complete-card p  { font-size: 14px; color: rgba(255,255,255,0.6); line-height: 1.6; }
/* Contact form */
.complete-contact { display: flex; flex-direction: column; gap: 10px; }
.complete-contact-label { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.5; }
.complete-input {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px; color: white;
  font-size: 14px; font-family: var(--font);
  outline: none; transition: border-color 0.15s;
}
.complete-input::placeholder { color: rgba(255,255,255,0.3); }
.complete-input:focus { border-color: rgba(0,201,177,0.5); }
.complete-claim-btn {
  width: 100%; padding: 14px;
  background: var(--teal); border: none; border-radius: 12px;
  color: white; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
  box-shadow: 0 4px 16px rgba(0,201,177,0.3);
}
.complete-claim-btn:hover:not(:disabled) { background: var(--teal-dark); transform: translateY(-1px); }
.complete-claim-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.complete-skip-btn {
  background: none; border: none; color: rgba(255,255,255,0.35);
  font-size: 12px; cursor: pointer; padding: 4px;
  transition: color 0.15s;
}
.complete-skip-btn:hover { color: rgba(255,255,255,0.6); }
.complete-contact-note { font-size: 12px; color: rgba(239,68,68,0.8); min-height: 16px; }
.complete-claimed { font-size: 14px; color: var(--teal); font-weight: 600; padding: 8px 0; }

/* ── Transcript area ────────────────────────────────────────── */

.transcript-area {
  min-height: 60px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px; padding: 12px 14px;
  font-size: 14px; color: rgba(255,255,255,0.9);
  line-height: 1.6; margin-bottom: 8px;
}
.transcript-area.placeholder { color: rgba(255,255,255,0.28); font-style: italic; }

.text-input-field {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 10px 14px; color: white;
  font-size: 14px; font-family: var(--font);
  resize: none; outline: none; transition: border-color 0.15s;
  position: relative; z-index: 12; pointer-events: auto;
}
.text-input-field::placeholder { color: rgba(255,255,255,0.28); }
.text-input-field:focus { border-color: rgba(0,201,177,0.5); }

/* ── Keyword popup stack ────────────────────────────────────── */

#popup-stack {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 25; display: flex;
  flex-direction: row; flex-wrap: wrap;
  justify-content: center; gap: 12px;
  max-width: 90vw; pointer-events: none;
}
.kw-popup {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: rgba(5,10,24,0.92); backdrop-filter: blur(20px);
  border: 1.5px solid rgba(0,201,177,0.4);
  border-radius: 18px; padding: 12px 14px;
  pointer-events: auto;
  opacity: 0; transform: translateY(-20px) scale(0.85);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,201,177,0.15);
}
.kw-popup.visible { opacity: 1; transform: translateY(0) scale(1); }
.kw-popup img { width: 172px; height: 172px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.kw-popup .kw-label { font-size: 13px; font-weight: 700; color: white; line-height: 1.3; text-align: center; }
.kw-popup .kw-dismiss {
  position: absolute; top: 6px; right: 6px;
  background: rgba(255,255,255,0.15); border: none;
  color: white; font-size: 11px; line-height: 1;
  width: 20px; height: 20px; border-radius: 50%;
  cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.kw-popup .kw-dismiss:hover { background: rgba(255,255,255,0.3); }
.kw-popup { position: relative; }

/* ── Error message ──────────────────────────────────────────── */

.error-msg { color: #ff6b6b; font-size: 12px; margin-top: 6px; display: none; }
.error-msg.visible { display: block; }

/* ── Initial survey loading overlay ─────────────────────────── */
#survey-loading {
  position: fixed; inset: 0; z-index: 40;
  display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: rgba(8, 14, 30, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#survey-loading.show { display: flex; }
.survey-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--teal);
  animation: survey-spin 0.8s linear infinite;
}
@keyframes survey-spin { to { transform: rotate(360deg); } }
.survey-loading-text {
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.85);
}


/* ── Category bridge interstitial ──────────────────────────── */
/* Shown between scenes when the next scene belongs to a different category.
   Plays the storyline bridge voiceover + shows the time-jump label. */

/* Film-cut blackout — brief fade-to-black between scenes */
#scene-blackout {
  position: fixed; inset: 0;
  background: #000;
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}

#bridge-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(0,80,100,0.93) 0%, rgba(5,10,24,0.97) 65%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  overflow: hidden;
}
#bridge-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
#bridge-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 9998;
  pointer-events: none;
  display: none;
}

.bridge-card {
  position: relative; z-index: 1;
  max-width: 540px;
  width: 100%;
  text-align: center;
  color: var(--white);
  padding: 40px 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: bridgeIn 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bridgeIn {
  from { opacity: 0; transform: scale(0.88) translateY(24px); }
  to   { opacity: 1; transform: scale(1.0)  translateY(0); }
}

.bridge-jump {
  font-size: 20px;
  font-style: italic;
  font-weight: 300;
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.bridge-jump::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--teal);
  margin: 12px auto 0;
  opacity: 0.7;
}
.bridge-jump:empty { display: none; }

.bridge-text {
  font-size: 19px;
  line-height: 1.65;
  color: rgba(255,255,255,0.88);
  font-style: italic;
  margin-bottom: 32px;
}

.bridge-skip {
  background: var(--teal);
  color: var(--white);
  border: none;
  padding: 10px 28px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.2s ease, transform 0.1s ease;
}
.bridge-skip:hover  { opacity: 0.9; }
.bridge-skip:active { transform: scale(0.98); }

@media (max-width: 640px) {
  .bridge-card { padding: 28px 20px; }
  .bridge-text { font-size: 17px; }
  .bridge-jump { font-size: 18px; }
}

/* ── Pre-survey character intro (establishing shot + narration) ───────────── */
.intro-overlay {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  background: #05060f;
  overflow: hidden;
}
.intro-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.intro-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #05060f;
  transform: scale(1.05);
  animation: introKenBurns 12s ease-out forwards;
}
.intro-bg:not(.has-image) {
  background-image: radial-gradient(ellipse at 50% 35%, rgba(0,80,100,0.55) 0%, rgba(5,10,24,1) 70%);
  animation: none;
}
@keyframes introKenBurns {
  from { transform: scale(1.12); }
  to   { transform: scale(1.0); }
}
.intro-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    rgba(5,6,15,0.96) 0%, rgba(5,6,15,0.7) 35%, rgba(5,6,15,0.15) 70%, rgba(5,6,15,0.05) 100%);
}
.intro-card {
  position: relative; z-index: 1;
  max-width: 620px;
  width: 100%;
  text-align: center;
  color: var(--white);
  padding: 0 12px 32px;
  animation: bridgeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.intro-narration {
  font-size: 20px;
  line-height: 1.7;
  color: rgba(255,255,255,0.95);
  margin-bottom: 28px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.7);
}
.intro-begin {
  background: var(--teal);
  color: var(--white);
  border: none;
  padding: 13px 40px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  transition: opacity 0.2s ease, transform 0.1s ease;
}
.intro-begin:hover  { opacity: 0.92; }
.intro-begin:active { transform: scale(0.98); }

@media (max-width: 640px) {
  .intro-narration { font-size: 17px; }
  .intro-card { padding-bottom: 24px; }
}
