/* Cast design tokens — mirrors apps/web/src/lib/cast/design-tokens.ts */
:root {
  --cast-bg: #0B0D10;
  --cast-surface: #15181D;
  --cast-surface-elev: #1E2229;
  --cast-text: #F2F5F8;
  --cast-text-muted: #A6B0BA;
  --cast-text-subtle: #6B7680;
  --cast-accent-ai: #7CC4FF;
  --cast-accent-social: #FF7A90;
  --cast-accent-alert: #FFB84D;
  --cast-accent-success: #5DD39E;
  --cast-hairline: rgba(255,255,255,0.08);
}

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

html, body {
  background: var(--cast-bg);
  color: var(--cast-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace; }

/* TV stage: 1920×1080, scaled to viewport */
.stage {
  width: 1920px;
  height: 1080px;
  position: relative;
  overflow: hidden;
  transform-origin: top left;
  background: var(--cast-bg);
}
.stage-wrap {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 16px;
}

/* Safe-area inset for TV overscan */
.safe { position: absolute; inset: 48px; }

/* Header */
.header {
  position: absolute; top: 48px; left: 48px; right: 48px;
  display: flex; align-items: center; justify-content: space-between;
  height: 80px;
}
.meeting-title {
  font-size: 40px; line-height: 48px; font-weight: 600; letter-spacing: -0.01em;
}
.meeting-meta {
  font-size: 24px; line-height: 32px; color: var(--cast-text-muted);
  display: flex; align-items: center; gap: 16px;
}
.rec-badge {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--cast-accent-alert); font-weight: 500;
}
.rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cast-accent-alert);
  box-shadow: 0 0 12px var(--cast-accent-alert);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* Respect user motion preferences — pulse animations loop infinitely, which can
   trigger vestibular discomfort. Reduce to a static state when requested. */
@media (prefers-reduced-motion: reduce) {
  .rec-dot,
  .participant-tile.raised {
    animation: none;
  }
}

/* Wordmark */
.wordmark {
  position: absolute; bottom: 24px; right: 48px;
  font-size: 20px; font-weight: 500; letter-spacing: 0.08em;
  color: var(--cast-text-subtle); text-transform: uppercase;
  opacity: 0.6;
}

/* Avatar */
.avatar-idle {
  background: radial-gradient(circle at 40% 35%, #2a3340 0%, #1a1e25 55%, #0f1216 100%);
  border: 1px solid var(--cast-hairline);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--cast-text-subtle);
  font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em;
  overflow: hidden;
  position: relative;
}
.avatar-idle::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 45% 40%, rgba(124,196,255,0.08) 0%, transparent 50%);
}
.avatar-face {
  width: 72%; height: 72%; border-radius: 50%;
  background: linear-gradient(135deg, #3a4252 0%, #252a33 100%);
  position: relative;
}
.avatar-face::before {
  content: ''; position: absolute; top: 38%; left: 28%;
  width: 8%; height: 3%; background: #0a0c0f; border-radius: 50%;
}
.avatar-face::after {
  content: ''; position: absolute; top: 38%; right: 28%;
  width: 8%; height: 3%; background: #0a0c0f; border-radius: 50%;
}

/* QR */
.qr-badge {
  background: var(--cast-surface);
  border: 1px solid var(--cast-hairline);
  border-radius: 12px;
  padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.qr-code {
  width: 180px; height: 180px;
  background-image:
    linear-gradient(90deg, #000 50%, transparent 50%),
    linear-gradient(0deg, #000 50%, transparent 50%);
  background-size: 10px 10px, 10px 10px;
  background-color: #fff;
  border-radius: 4px;
  position: relative;
}
.qr-code::before, .qr-code::after {
  content: ''; position: absolute; width: 42px; height: 42px;
  border: 10px solid #000; background: #fff;
}
.qr-code::before { top: 0; left: 0; }
.qr-code::after { top: 0; right: 0; }
.qr-label {
  font-size: 14px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--cast-text);
}

/* Participant tiles */
.participant-tile {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600;
  color: #fff; border: 2px solid var(--cast-hairline);
  flex-shrink: 0;
}
.participant-tile.host { border-color: var(--cast-accent-alert); }
.participant-tile.raised {
  box-shadow: 0 0 0 3px var(--cast-accent-alert), 0 0 20px rgba(255,184,77,0.3);
  animation: pulse 1.6s ease-in-out infinite;
}

/* Chat now panel */
.chat-row {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--cast-hairline);
}
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.chat-body { flex: 1; min-width: 0; }
.chat-author {
  font-size: 18px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--cast-text-muted);
}
.chat-text {
  font-size: 28px; line-height: 36px; color: var(--cast-text);
  margin-top: 4px;
}
.chat-reaction {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 20px; margin-left: 8px;
}

/* Decision pulse card */
.pulse-card {
  position: absolute; top: 160px; left: 50%;
  transform: translateX(-50%);
  width: 640px; min-height: 96px;
  background: rgba(21,24,29,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--cast-hairline);
  border-radius: 12px;
  padding: 20px 28px;
  display: flex; flex-direction: column; justify-content: center;
}
.pulse-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--cast-accent-ai);
  border-radius: 12px 12px 0 0;
}
.pulse-label {
  font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cast-accent-ai); font-weight: 500;
  margin-bottom: 6px;
}
.pulse-text { font-size: 44px; line-height: 52px; font-weight: 600; letter-spacing: -0.01em; }

/* Status cluster */
.status-cluster {
  position: absolute; bottom: 64px; right: 48px;
  display: flex; gap: 16px; align-items: center;
  font-size: 18px; color: var(--cast-text-muted);
  background: var(--cast-surface); border: 1px solid var(--cast-hairline);
  border-radius: 999px; padding: 8px 16px;
}

/* Floating reactions */
.reaction-float {
  position: absolute; font-size: 56px;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

/* Section headers */
.section-label {
  font-size: 18px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cast-text-muted); font-weight: 500;
  margin-bottom: 16px;
}

/* Lists */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  font-size: 28px; line-height: 36px;
}
.list-row .marker { flex-shrink: 0; }
.list-row.decision .marker { color: var(--cast-accent-success); }
.list-row.question .marker { color: var(--cast-accent-ai); }
.list-row.action .marker { color: var(--cast-accent-ai); }
.list-row .assignee {
  color: var(--cast-text-muted); flex-shrink: 0;
}
.list-row .text { color: var(--cast-text); }
