/* ============================================
   CHECK-IN ROULETTE — Public & Society
   Colors from team template
============================================ */

:root {
  /* Template palette */
  --green: #58EB81;
  --pink: #FF9BFC;
  --purple: #A187FF;
  --teal: #2BEBCB;
  --sand: #E5C574;
  --yellow: #FFF347;

  --ink: #0A0A0F;
  --ink-soft: #1a1a24;
  --ink-line: #2a2a38;
  --paper: #F5F3EE;
  --paper-dim: #D9D6CE;

  --shadow-sharp: 6px 6px 0 var(--ink);
  --shadow-sharp-lg: 10px 10px 0 var(--ink);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
  min-height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================
   BACKGROUND ATMOSPHERE
============================================ */

.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.08;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: float 20s ease-in-out infinite;
}
.blob-1 { width: 500px; height: 500px; background: var(--purple); top: -150px; left: -100px; }
.blob-2 { width: 400px; height: 400px; background: var(--teal); bottom: -100px; right: -80px; animation-delay: -7s; }
.blob-3 { width: 350px; height: 350px; background: var(--pink); top: 40%; right: 20%; animation-delay: -14s; opacity: 0.2; }

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-30px) scale(1.08); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ============================================
   TOP BAR
============================================ */

.top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--ink-line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 10px; height: 10px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.3); }
}

.team-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--ink-line);
  border-radius: 100px;
  color: var(--paper-dim);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 100px;
  gap: 2px;
}

.lang-btn {
  padding: 5px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--paper-dim);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.lang-btn:hover {
  color: var(--paper);
}

.lang-btn.active {
  background: var(--yellow);
  color: var(--ink);
}

/* ============================================
   STAGE (main content area)
============================================ */

.stage {
  position: relative;
  z-index: 10;
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px;
}

.screen {
  display: none;
  animation: screenIn 0.5s var(--ease) both;
}

.screen.active {
  display: block;
}

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

/* ============================================
   INTRO SCREEN
============================================ */

.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: center;
  min-height: 70vh;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 24px;
}

.headline {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.headline em {
  font-style: italic;
  color: var(--yellow);
  font-weight: 400;
}

.headline-accent {
  display: inline-block;
  background: linear-gradient(120deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lede {
  font-size: 19px;
  color: var(--paper-dim);
  max-width: 480px;
  margin-bottom: 40px;
  line-height: 1.5;
}

/* ============================================
   ELMO
============================================ */

.elmo-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.elmo {
  width: 240px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(255, 50, 50, 0.35)) drop-shadow(0 0 20px rgba(255, 100, 0, 0.2));
  animation: elmoBounce 3s ease-in-out infinite;
  z-index: 2;
}

@keyframes elmoBounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

.elmo-ground {
  width: 200px;
  height: 20px;
  background: radial-gradient(ellipse, rgba(255,50,50,0.2), transparent 70%);
  margin-top: -10px;
  animation: groundPulse 3s ease-in-out infinite;
}

@keyframes groundPulse {
  0%, 100% { transform: scaleX(1); opacity: 0.4; }
  50% { transform: scaleX(0.8); opacity: 0.6; }
}

.elmo-speech-bubble {
  position: absolute;
  top: 0;
  left: -30px;
  background: var(--paper);
  color: var(--ink);
  padding: 18px 22px;
  border-radius: 20px;
  max-width: 260px;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: var(--shadow-sharp);
  border: 2px solid var(--ink);
  z-index: 3;
  animation: bubbleIn 0.6s var(--ease-back) 0.3s both;
}

.elmo-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  right: 60px;
  width: 24px;
  height: 24px;
  background: var(--paper);
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}

@keyframes bubbleIn {
  from { opacity: 0; transform: scale(0.5) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================
   BUTTONS
============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  font-size: 16px;
  border: 2px solid var(--ink);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: var(--shadow-sharp);
}

.btn-primary:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
  background: var(--green);
}

.btn-primary:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--ink-line);
}

.btn-ghost:hover {
  border-color: var(--paper);
  background: var(--ink-soft);
}

.btn-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--ink-line);
  color: var(--paper-dim);
  border-radius: 100px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  transition: all 0.2s var(--ease);
}

.btn-shuffle:hover {
  border-color: var(--yellow);
  color: var(--yellow);
  transform: rotate(-3deg);
}

/* ============================================
   SCREEN HEADER
============================================ */

.screen-header {
  text-align: center;
  margin-bottom: 48px;
}

.step-indicator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.step {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--paper-dim);
  transition: all 0.3s var(--ease);
}

.step.active {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow);
  transform: scale(1.1);
}

.step.done {
  background: var(--green);
  color: var(--ink);
  border-color: var(--green);
}

.step-line {
  width: 40px; height: 2px;
  background: var(--ink-line);
  transition: background 0.3s var(--ease);
}

.step-line.done {
  background: var(--green);
}

.screen-title {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.screen-sub {
  color: var(--paper-dim);
  font-size: 17px;
  max-width: 520px;
  margin: 0 auto;
}

/* ============================================
   PARTICIPANTS GRID
============================================ */

.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.participant-card {
  position: relative;
  padding: 28px 20px;
  background: var(--ink-soft);
  border: 2px solid var(--ink-line);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  text-align: center;
  overflow: hidden;
}

.participant-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-color);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  z-index: 0;
}

.participant-card:hover {
  transform: translateY(-4px);
  border-color: var(--paper-dim);
}

.participant-card.selected {
  border-color: var(--ink);
  transform: translateY(-4px);
  box-shadow: var(--shadow-sharp);
}

.participant-card.selected::before {
  opacity: 1;
}

.participant-card.selected .participant-avatar,
.participant-card.selected .participant-name {
  color: var(--ink);
  position: relative;
  z-index: 1;
}

.participant-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--card-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 24px;
  color: var(--ink);
  margin: 0 auto 12px;
  position: relative;
  z-index: 1;
  border: 2px solid var(--ink);
}

.participant-card.selected .participant-avatar {
  background: var(--ink);
  color: var(--card-color);
}

.participant-name {
  font-weight: 600;
  font-size: 17px;
  position: relative;
  z-index: 1;
}

.participant-check {
  position: absolute;
  top: 10px; right: 10px;
  width: 24px; height: 24px;
  background: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.25s var(--ease-back);
  z-index: 2;
}

.participant-card.selected .participant-check {
  opacity: 1;
  transform: scale(1);
}

.participant-check svg {
  width: 14px; height: 14px;
  stroke: var(--paper);
}

/* ============================================
   ACTION ROW
============================================ */

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-line);
}

.action-row.center {
  justify-content: center;
}

.selection-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--paper-dim);
  letter-spacing: 0.05em;
}

/* ============================================
   QUESTION CARD
============================================ */

.question-card {
  position: relative;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border: 2px solid var(--ink);
  border-radius: 28px;
  padding: 40px 32px;
  text-align: center;
  margin-bottom: 40px;
  box-shadow: var(--shadow-sharp-lg);
  overflow: hidden;
}

.question-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: var(--yellow);
  border-radius: 50%;
  opacity: 0.3;
  filter: blur(40px);
}

.question-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ink);
  opacity: 0.7;
  margin-bottom: 16px;
  position: relative;
}

.question-text {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 42px);
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  position: relative;
}

.question-card .btn-shuffle {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.question-card .btn-shuffle:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

/* ============================================
   ANSWERS LIST
============================================ */

.answers-list {
  display: grid;
  gap: 12px;
}

.answer-row {
  display: grid;
  grid-template-columns: 60px 1fr 140px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 16px;
  transition: all 0.2s var(--ease);
}

.answer-row:focus-within {
  border-color: var(--yellow);
  background: var(--ink);
}

.answer-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 18px;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.answer-name {
  font-weight: 600;
  font-size: 17px;
}

.answer-input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  text-align: center;
  transition: all 0.2s var(--ease);
  -moz-appearance: textfield;
}

.answer-input::-webkit-outer-spin-button,
.answer-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.answer-input:focus {
  outline: none;
  border-color: var(--yellow);
  background: var(--ink-soft);
}

/* ============================================
   REVEAL / RANKING
============================================ */

.reveal-question {
  text-align: center;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--paper-dim);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.reveal-question::before { content: '"'; }
.reveal-question::after { content: '"'; }

.ranking {
  list-style: none;
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  counter-reset: rank;
}

.rank-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--ink-soft);
  border: 2px solid var(--ink-line);
  border-radius: 20px;
  opacity: 0;
  transform: translateX(-20px);
  animation: rankIn 0.5s var(--ease-back) forwards;
  transition: all 0.2s var(--ease);
}

.rank-item:hover {
  transform: translateX(4px);
}

@keyframes rankIn {
  to { opacity: 1; transform: translateX(0); }
}

.rank-item.first {
  background: linear-gradient(135deg, var(--yellow), var(--green));
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: var(--shadow-sharp);
}

.rank-number {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--paper-dim);
}

.rank-item.first .rank-number {
  color: var(--ink);
}

.rank-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.01em;
}

.rank-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  padding: 6px 12px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 100px;
  border: 1px solid var(--ink-line);
}

.rank-item.first .rank-value {
  background: var(--ink);
  color: var(--yellow);
  border-color: var(--ink);
}

.rank-tied {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--paper-dim);
  display: block;
  margin-top: 4px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rank-item.first .rank-tied {
  color: var(--ink);
  opacity: 0.6;
}

/* ============================================
   FLOATING ELMO
============================================ */

.elmo-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 90px;
  height: 90px;
  cursor: pointer;
  z-index: 50;
  animation: floatElmo 4s ease-in-out infinite;
}

@keyframes floatElmo {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

.elmo-floating img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(255,50,50,0.5)) drop-shadow(0 0 8px rgba(255,100,0,0.3));
  transition: transform 0.2s var(--ease);
}

.elmo-floating:hover img {
  transform: scale(1.1);
}

.elmo-floating-bubble {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 12px;
  background: var(--paper);
  color: var(--ink);
  padding: 14px 18px;
  border-radius: 16px;
  min-width: 220px;
  max-width: 280px;
  font-size: 14px;
  line-height: 1.4;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sharp);
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
  transition: all 0.25s var(--ease-back);
}

.elmo-floating-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.elmo-floating-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 28px;
  width: 20px;
  height: 20px;
  background: var(--paper);
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}

/* ============================================
   FOOTER
============================================ */

.foot {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--paper-dim);
  border-top: 1px solid var(--ink-line);
  opacity: 0.6;
}

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 860px) {
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .elmo-wrap { order: -1; }
  .elmo { width: 180px; }
  .elmo-speech-bubble {
    position: relative;
    left: 0;
    margin: 0 auto 16px;
  }
  .stage { padding: 32px 20px; }
  .answer-row {
    grid-template-columns: 44px 1fr 110px;
    gap: 12px;
    padding: 12px 14px;
  }
  .action-row {
    flex-wrap: wrap;
    justify-content: center;
  }
  .selection-count { order: -1; width: 100%; text-align: center; }
  .rank-item {
    grid-template-columns: 60px 1fr auto;
    gap: 12px;
    padding: 16px;
  }
  .rank-number { font-size: 40px; }
  .rank-name { font-size: 20px; }
  .elmo-floating { width: 70px; height: 70px; bottom: 16px; right: 16px; }
}

@media (max-width: 480px) {
  .top-bar { padding: 16px 20px; }
  .brand-name { display: none; }
  .team-tag { display: none; }
  .participants-grid { grid-template-columns: repeat(2, 1fr); }
  .question-card { padding: 28px 20px; }
}
