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

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #e5e5e5;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --accent: #1a1a1a;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --excited: #7c3aed;
  --excited-bg: #f3e8ff;
  --meh-color: #6b7280;
  --meh-bg: #f3f4f6;
  --green: #059669;
  --green-bg: #ecfdf5;
  --orange: #ea580c;
  --orange-bg: #fff7ed;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Confetti ── */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ── Webinar Banner ── */
.webinar-banner {
  background: #1a1a1a;
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.webinar-banner a { color: #fff; text-decoration: none; }
.webinar-banner a:hover { text-decoration: underline; }
.webinar-banner strong { color: #fff; }

/* ── Live vote counter ── */
.live-counter {
  text-align: center;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.live-counter strong {
  color: var(--text);
  font-weight: 700;
}

/* ── Container ── */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 48px 20px 40px;
}

/* ── Header ── */
.header { text-align: center; margin-bottom: 40px; }
.header h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 6px;
}
.subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ── Phase 1: Single trend card ── */
.phase1-card-area {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.trend-card-single {
  width: 100%;
  max-width: 440px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 32px;
  background: rgba(124, 58, 237, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(124, 58, 237, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.04);
  animation: fadeIn 0.25s ease;
}

.trend-name-large {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: var(--text);
}

/* ── Vote buttons (Phase 1) ── */
.vote-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.vote-btn {
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s ease;
}
.vote-btn:hover {
  border-color: #ccc;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.vote-btn:active {
  transform: translateY(0) scale(0.98);
}
.vote-btn.excited {
  background: var(--excited);
  color: #fff;
  border-color: var(--excited);
}
.vote-btn.excited:hover { opacity: 0.9; }
.vote-btn.meh {
  background: var(--meh-bg);
  border-color: #d1d5db;
  color: var(--meh-color);
}
.vote-btn.skip {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

/* ── Progress bar ── */
.progress-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.progress-text {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.progress-bar {
  width: 200px;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--excited), #a78bfa);
  border-radius: 3px;
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Global rankings during voting ── */
.voting-global-rankings {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.voting-rankings-heading {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

/* ── Phase 2: Pick grid ── */
.pick-prompt {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
  color: var(--text);
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.pick-card {
  padding: 24px 20px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.35;
  transition: all 0.15s ease;
  animation: fadeIn 0.2s ease;
}
.pick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--excited);
}
.pick-card:active {
  transform: translateY(0) scale(0.97);
}
.pick-card.selected {
  background: var(--excited-bg);
  border-color: var(--excited);
  transform: scale(1.02);
}

/* ── Section headings ── */
.section-heading {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 40px;
  margin-bottom: 16px;
}
.section-heading:first-child { margin-top: 0; }

/* ── Results: Top Picks ── */
.top-pick-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  animation: fadeIn 0.3s ease;
}
.top-pick-item.rank-1 {
  background: var(--excited-bg);
  border-left: 4px solid var(--excited);
}
.top-pick-item.rank-2 {
  background: var(--green-bg);
  border-left: 4px solid var(--green);
}
.top-pick-item.rank-3 {
  background: var(--orange-bg);
  border-left: 4px solid var(--orange);
}

.top-pick-rank {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 36px;
}
.rank-1 .top-pick-rank { color: var(--excited); }
.rank-2 .top-pick-rank { color: var(--green); }
.rank-3 .top-pick-rank { color: var(--orange); }

.top-pick-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

/* ── Also excited pills ── */
.also-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.also-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--excited-bg);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  color: var(--excited);
}

/* ── Contrarian callout ── */
.contrarian-callout {
  margin: 32px 0 16px;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}
.contrarian-callout strong { color: var(--text); }
.contrarian-callout.contrarian-style {
  background: #fef3c7;
  border: 1px solid #fbbf24;
}
.contrarian-callout.aligned-style {
  background: var(--green-bg);
  border: 1px solid rgba(5, 150, 105, 0.3);
}
.contrarian-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: block;
}
.contrarian-label.contrarian-color { color: #b45309; }
.contrarian-label.aligned-color { color: var(--green); }

/* ── Global rankings leaderboard ── */
.global-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.global-row:last-child { border-bottom: none; }
.global-row.user-pick {
  background: var(--excited-bg);
  border-radius: var(--radius-sm);
  border-bottom: none;
  margin-bottom: 2px;
}
.global-rank {
  font-weight: 700;
  color: var(--text-muted);
  min-width: 24px;
  text-align: right;
}
.global-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}
.global-detail {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.global-detail .global-stat-value { font-weight: 600; color: var(--text-secondary); }
.user-check {
  color: var(--excited);
  font-weight: 700;
  font-size: 16px;
}

/* Compact global row for voting screen */
.global-row-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}
.global-row-compact:last-child { border-bottom: none; }
.global-row-compact .global-rank {
  font-size: 12px;
  min-width: 20px;
}
.global-row-compact .global-name {
  font-size: 13px;
}
.global-row-compact .global-detail {
  font-size: 11px;
}

/* ── Actions ── */
.actions-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 36px;
  flex-wrap: wrap;
}
.share-btn, .download-btn {
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s ease;
}
.share-btn:hover, .download-btn:hover {
  border-color: #ccc;
  box-shadow: var(--shadow-sm);
}
.download-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.download-btn:hover { opacity: 0.9; }

/* ── Vote Again card ── */
.vote-again-card {
  margin-top: 36px;
  padding: 24px;
  background: #f9fafb;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.vote-again-copy {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.vote-again-btn {
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.vote-again-btn:hover { opacity: 0.85; }

/* ── Resume prompt ── */
.resume-prompt {
  text-align: center;
  padding: 32px;
  animation: fadeIn 0.3s ease;
}
.resume-prompt p {
  font-size: 16px;
  margin-bottom: 20px;
  color: var(--text-secondary);
}
.resume-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ── Skeptic ── */
.skeptic-message {
  text-align: center;
  padding: 32px 20px;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 32px 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-secondary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Scorecard offscreen ── */
.scorecard-offscreen {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1200px;
  height: 627px;
  font-family: 'Inter', -apple-system, sans-serif;
  z-index: -1;
}

.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Mobile ── */
@media (max-width: 560px) {
  .container { padding: 28px 16px 32px; }
  .header h1 { font-size: 24px; }
  .trend-card-single { min-height: 120px; padding: 28px 24px; }
  .trend-name-large { font-size: 19px; }
  .vote-buttons { gap: 8px; }
  .vote-btn { padding: 10px 20px; font-size: 14px; }
  .pick-grid { grid-template-columns: 1fr; }
  .pick-card { padding: 20px 16px; }
  .top-pick-item { padding: 12px 16px; gap: 12px; }
  .top-pick-rank { font-size: 22px; }
  .top-pick-name { font-size: 15px; }
  .global-detail { font-size: 11px; }
  .live-counter { font-size: 13px; }
}
