/* [ACW-005] Feature: Audience view — Styles */
/* [ACW-013] Feature: POLL + ALARM + REVEAL screens */
/* Color tokens come from /css/tokens.css */

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-system);
  background: #ffffff;
  color: #0f1115;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior: contain;
}
body { display: flex; flex-direction: column; }

.conn {
  position: fixed;
  top: calc(8px + var(--safe-top));
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
  background: rgba(255,255,255,0.85);
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px 10px;
  z-index: 10;
  backdrop-filter: blur(6px);
}
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.conn[data-state="open"]   .dot { background: #16a34a; }
.conn[data-state="closed"] .dot { background: #dc2626; }
.conn[data-state="open"]   .label::before { content: "Live"; }
.conn[data-state="closed"] .label::before { content: "Disconnected"; }
.conn[data-state="connecting"] .label::before { content: "Connecting…"; }
.conn .label { font-size: 0; }
.conn .label::before { font-size: 12px; }

#stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, var(--safe-top)) 22px max(24px, var(--safe-bottom));
}

.screen { display: none; width: 100%; max-width: 580px; }
body[data-view="WAITING"]      .screen-waiting,
body[data-view="NAME_CAPTURE"] .screen-namecapture,
body[data-view="POLL"]         .screen-poll,
body[data-view="SCENARIO"]     .screen-scenario,
body[data-view="ALARM"]        .screen-alarm,
body[data-view="REVEAL"]       .screen-reveal,
body[data-view="TAKEAWAY"]     .screen-takeaway { display: block; }

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
}

/* WAITING -------------------------------------------------------------------- */
.hero { text-align: center; }
.hero h1 {
  font-size: clamp(36px, 9vw, 56px);
  line-height: 1.05;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.lede { font-size: clamp(17px, 4vw, 19px); color: #6b7280; margin: 0; line-height: 1.5; }

/* NAME_CAPTURE --------------------------------------------------------------- */
/* [ACW-047] First-name input with submit + skip. After submit, swap to a
 *           "Thanks, X" card; after skip, swap to a quiet "Skipped" card. */
.namecapture .kicker {
  letter-spacing: 0.18em;
  font-weight: 700;
  color: #1A1A1A;
}
.namecapture h2 {
  font-size: clamp(28px, 7vw, 36px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 6px;
}
.namecapture-sub {
  font-size: 14px;
  color: #6B7280;
  line-height: 1.5;
  margin: 0 0 22px;
}
.namecapture-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
}
.namecapture-input {
  height: 56px;
  padding: 0 16px;
  border: 1.5px solid #DADCE0;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: #1A1A1A;
  background: #FFFFFF;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.namecapture-input:focus {
  border-color: var(--color-presenter-accent);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}
.namecapture-submit {
  height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--color-presenter-accent);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.07s ease, opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.namecapture-submit:active { transform: scale(0.98); }
.namecapture-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.namecapture-skip {
  background: transparent;
  border: 0;
  color: #6B7280;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px 4px;
  -webkit-tap-highlight-color: transparent;
}
.namecapture-skip:active { color: #4B5563; }

.namecapture-thanks,
.namecapture-skipped {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-controller-notes-secondary);
}
.namecapture-thanks .check {
  display: inline-flex;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-controller-success);
  color: #fff;
  align-items: center; justify-content: center;
  font-size: 12px;
}
.namecapture-thanks strong { color: #1A1A1A; font-weight: 700; }
.namecapture-thanks .muted,
.namecapture-skipped .muted { color: #6B7280; font-size: 13px; }

body.has-name .namecapture-form,
body.has-name .namecapture-skip,
body.has-name .namecapture-skipped { display: none; }
body.has-name .namecapture-thanks { display: flex; }

body.skipped-name .namecapture-thanks { display: none; }
body.skipped-name .namecapture-skipped { display: flex; }

/* POLL ----------------------------------------------------------------------- */
.poll h2 {
  font-size: clamp(22px, 5.5vw, 30px);
  margin: 0 0 22px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.options { display: flex; flex-direction: column; gap: 10px; }
.opt-btn {
  appearance: none;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #0f1115;
  font: 600 16px/1.3 var(--font-system);
  text-align: left;
  padding: 16px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}
.opt-btn:active { transform: scale(0.99); }
.opt-btn .opt-id {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.opt-btn[data-selected="true"] {
  border-color: var(--color-controller-primary);
  background: #eff6ff;
}
.opt-btn[data-selected="true"] .opt-id {
  background: var(--color-controller-primary);
  color: #fff;
}
.opt-btn[data-selected="true"]::after {
  content: "✓";
  margin-left: auto;
  color: var(--color-controller-primary);
  font-size: 22px;
  font-weight: 700;
}
.opt-btn[disabled]:not([data-selected="true"]) { opacity: 0.55; }
.poll-thanks {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-controller-success);
  text-align: center;
}
.poll-thanks .check {
  display: inline-flex;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-controller-success);
  color: #fff;
  align-items: center; justify-content: center;
  font-size: 12px;
}
body.has-vote .poll-thanks { display: flex; }

/* SCENARIO ------------------------------------------------------------------- */
/* [ACW-040] Sequential sensitive-data scenarios. Heavier visual weight than
 *           the icebreaker poll — these are real ethical micro-decisions. */
.scenario .kicker {
  letter-spacing: 0.18em;
  font-weight: 700;
  color: #1A1A1A;
}
.scenario .kicker span#scenarioNumber { color: var(--color-presenter-accent); }

.scenario-prompt {
  font-size: clamp(16px, 4.4vw, 19px);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #1A1A1A;
  margin: 0 0 14px;
}

.scenario-text {
  font-size: clamp(20px, 5.4vw, 28px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: #1A1A1A;
  margin: 0 0 26px;
  padding: 18px 20px;
  border-left: 4px solid var(--color-presenter-accent);
  background: #F8FAFC;
  border-radius: 0 12px 12px 0;
}

.scenario-options {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.sc-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 1.5px solid #E5E7EB;
  background: #FFFFFF;
  color: #1A1A1A;
  border-radius: 14px;
  padding: 22px 22px;
  font-family: inherit;
  font-size: clamp(17px, 4.6vw, 20px);
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.07s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-height: 64px;
}
.sc-btn .sc-label { display: inline-block; }
.sc-btn:active { transform: scale(0.99); }
.sc-yes:hover, .sc-yes:focus { border-color: var(--color-presenter-accent-good); }
.sc-no:hover,  .sc-no:focus  { border-color: var(--color-presenter-accent-error); }

.sc-btn[data-selected="true"] {
  background: #F8FAFC;
}
.sc-btn[data-selected="true"]::after {
  content: '✓';
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
  color: #FFFFFF;
}
.sc-yes[data-selected="true"] {
  border-color: var(--color-presenter-accent-good);
  background: rgba(52, 211, 153, 0.06);
}
.sc-yes[data-selected="true"]::after {
  background: #16A34A;
}
.sc-no[data-selected="true"] {
  border-color: var(--color-presenter-accent-error);
  background: rgba(248, 113, 113, 0.06);
}
.sc-no[data-selected="true"]::after {
  background: #DC2626;
}
body.has-scenario-vote .sc-btn:not([data-selected="true"]) { opacity: 0.45; }

.scenario-thanks {
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-controller-notes-secondary);
  text-align: left;
}
.scenario-thanks .check {
  display: inline-flex;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-controller-success);
  color: #fff;
  align-items: center; justify-content: center;
  font-size: 12px;
}
.scenario-thanks strong { color: #1A1A1A; font-weight: 700; }
.scenario-thanks .muted { color: #6B7280; font-size: 13px; }
body.has-scenario-vote .scenario-thanks { display: flex; }

/* TAKEAWAY ------------------------------------------------------------------- */
/* [ACW-045] Six action items pushed to the phone at workshop close. */
.takeaway .kicker {
  letter-spacing: 0.18em;
  font-weight: 700;
  color: #1A1A1A;
}
.takeaway h2 {
  font-size: clamp(24px, 6vw, 32px);
  letter-spacing: -0.018em;
  line-height: 1.15;
  margin: 0 0 22px;
}
.takeaway-section { margin-bottom: 22px; }
.takeaway-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-presenter-accent);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid #E5E7EB;
}
.takeaway-section-label.cyber { color: #16A34A; }
.takeaway-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ta-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 12px;
  align-items: baseline;
  background: #F8FAFC;
  border: 1px solid #ECEEF1;
  border-radius: 12px;
  padding: 14px 16px;
}
.ta-item.ai { border-left: 4px solid var(--color-presenter-accent); }
.ta-item.cyber { border-left: 4px solid #16A34A; }
.ta-item .num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  grid-row: 1 / span 2;
  text-align: right;
  color: var(--color-presenter-accent);
}
.ta-item.cyber .num { color: #16A34A; }
.ta-item .head {
  font-size: 16px;
  font-weight: 600;
  color: #1A1A1A;
  letter-spacing: -0.005em;
  line-height: 1.25;
  margin-bottom: 4px;
}
.ta-item .body {
  font-size: 14px;
  font-weight: 400;
  color: #4B5563;
  line-height: 1.45;
}
.takeaway-foot {
  font-size: 14px;
  color: #6B7280;
  line-height: 1.5;
  padding: 14px 16px;
  background: #EEF4FF;
  border: 1px solid #C7D6F5;
  border-radius: 10px;
  margin-top: 4px;
}
.takeaway-foot strong { color: var(--color-presenter-accent); font-weight: 700; }

/* ALARM ---------------------------------------------------------------------- */
body[data-view="ALARM"] {
  background: var(--color-alarm-bg);
  color: var(--color-alarm-text);
}
body[data-view="ALARM"] #conn {
  background: rgba(0,0,0,0.4);
  color: #ffffffcc;
  border-color: rgba(255,255,255,0.18);
}
body[data-view="ALARM"] #stage {
  align-items: flex-start;
  padding: max(28px, calc(28px + var(--safe-top))) 22px max(80px, var(--safe-bottom));
}
.alarm-shell { width: 100%; max-width: 560px; position: relative; min-height: 100dvh; }
.alarm-headline {
  font-size: clamp(24px, 6.4vw, 36px);
  line-height: 1.1;
  margin: 0 0 24px;
  font-weight: 900;
  letter-spacing: 0.005em;
  text-shadow: 0 1px 0 rgba(0,0,0,0.12);
}
.alarm-body {
  font-size: clamp(16px, 4.4vw, 19px);
  line-height: 1.5;
}
.alarm-body p { margin: 0 0 14px; }
.alarm-body ul {
  margin: 8px 0 18px;
  padding-left: 22px;
  list-style: '•  ';
}
.alarm-body ul li { margin: 4px 0; }
.alarm-body .eta { margin-top: 18px; }
.alarm-body .eta strong {
  display: inline-block;
  background: rgba(0,0,0,0.32);
  padding: 2px 10px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 1.1em;
  letter-spacing: 0.02em;
  animation: alarmCountPulse 1s ease-in-out infinite;
}
@keyframes alarmCountPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.65; }
}
.alarm-progress {
  height: 10px;
  background: rgba(0,0,0,0.28);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 18px;
}
.alarm-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-alarm-text);
  transition: width 0.6s linear;
}
.alarm-warn {
  font-weight: 700;
  margin-top: 10px;
}
.alarm-badge {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.25);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 0.01em;
}
.alarm-badge .badge-shield { font-size: 14px; }
.alarm-session {
  margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 11px;
  opacity: 0.78;
  letter-spacing: 0.02em;
}
.alarm-tell {
  position: fixed;
  bottom: max(8px, var(--safe-bottom));
  right: 10px;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.32);
  letter-spacing: 0.04em;
  pointer-events: none;
  user-select: none;
}

/* REVEAL --------------------------------------------------------------------- */
body[data-view="REVEAL"] {
  background: var(--color-reveal-bg);
  color: var(--color-reveal-text);
}
.reveal { text-align: center; }
.reveal-icon {
  font-size: 56px;
  margin-bottom: 8px;
  line-height: 1;
}
.reveal h1 {
  font-size: clamp(40px, 11vw, 64px);
  margin: 0 0 12px;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--color-reveal-text);
}
.reveal-sub {
  font-size: clamp(16px, 4.2vw, 18px);
  color: var(--color-reveal-muted);
  margin: 0 0 28px;
  line-height: 1.5;
}
.reveal-body {
  text-align: left;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 18px;
  margin-bottom: 22px;
  font-size: 16px;
  line-height: 1.55;
}
.reveal-body p { margin: 0 0 10px; }
.reveal-body p:last-child { margin-bottom: 0; }
.reveal-pull {
  font-size: 18px;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
  margin: 12px 0 !important;
}
.reveal-foot {
  font-size: 14px;
  color: var(--color-reveal-muted);
  margin: 0;
}
.reveal-foot .lookup { display: block; margin-top: 4px; color: #374151; font-weight: 600; }
