:root {
  --bg-deep: #2e1065;
  --bg-mid: #5b21b6;
  --bg-warm: #9d174d;
  --surface: #fffafc;
  --surface-soft: #fdf4ff;
  --surface-tint: #f8eef8;
  --ink: #2b1436;
  --muted: #7a6685;
  --line: #eee2f0;
  --primary: #7c3aed;
  --primary-deep: #5b21b6;
  --pink: #db2777;
  --rose: #fb7185;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --danger: #e11d48;
  --danger-soft: #ffe4e6;
  --amber: #f59e0b;
  --shadow-sm: 0 6px 18px rgba(43, 20, 54, 0.08);
  --shadow-md: 0 18px 45px rgba(43, 20, 54, 0.16);
  --shadow-lg: 0 28px 70px rgba(20, 8, 30, 0.28);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
h4,
p,
span,
button,
textarea {
  overflow-wrap: break-word;
}

.btn,
.player-join-btn,
.option-btn,
.score-btn,
.lang-btn {
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(12px, 3vw, 28px);
  padding-top: max(clamp(12px, 3vw, 28px), env(safe-area-inset-top));
  padding-bottom: max(clamp(12px, 3vw, 28px), env(safe-area-inset-bottom));
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(251, 113, 133, 0.38), transparent 34rem),
    radial-gradient(circle at 100% 8%, rgba(251, 191, 36, 0.25), transparent 30rem),
    radial-gradient(circle at 50% 110%, rgba(168, 85, 247, 0.32), transparent 32rem),
    linear-gradient(155deg, var(--bg-deep) 0%, var(--bg-mid) 48%, var(--bg-warm) 100%);
  background-color: var(--bg-deep);
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: drift 18s ease-in-out infinite alternate;
}

.bg-glow-one {
  width: 320px;
  height: 320px;
  top: -90px;
  left: -110px;
  background: var(--rose);
}

.bg-glow-two {
  width: 280px;
  height: 280px;
  right: -100px;
  bottom: -90px;
  background: #a855f7;
  animation-delay: -8s;
}

#app {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 6px;
  padding: 0 4px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
}

.language-icon {
  padding: 0 4px;
  font-size: 0.85rem;
  line-height: 1;
}

.lang-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.lang-btn.active {
  background: #fff;
  color: var(--primary-deep);
}

.lang-btn:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}

.connection-banner {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(43, 20, 54, 0.94);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  transform: translateX(-50%);
}

.connection-banner::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  animation: pulse 1.2s ease-in-out infinite;
}

body.is-offline .btn,
body.is-offline .player-join-btn,
body.is-offline .option-btn,
body.is-offline .score-btn {
  pointer-events: none;
  opacity: 0.55;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 6px 0 36px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: screen-in 0.35s ease both;
}

/* ---------- Shared headings ---------- */

.hero {
  padding: 18px 8px 26px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 7vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-shadow: 0 4px 24px rgba(20, 8, 30, 0.35);
}

.subtitle {
  max-width: 34rem;
  margin: 12px auto 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.02rem;
  line-height: 1.5;
}

.screen-heading {
  margin: 8px 0 20px;
  text-align: center;
}

.screen-heading h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: -0.025em;
}

/* ---------- Lobby ---------- */

.couple-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.couple-group {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.couple-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.couple-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.couple-group-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.couple-group-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.couple-tag {
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.couple-one .couple-tag {
  background: #e0f2fe;
  color: #0369a1;
}

.couple-two .couple-tag {
  background: #fce7f3;
  color: #be185d;
}

.role-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.player-join-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  padding: 20px 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.player-join-btn:not(:disabled):hover {
  transform: translateY(-3px);
  border-color: #d8b4fe;
  box-shadow: var(--shadow-sm);
}

.player-join-btn:not(:disabled):active {
  transform: translateY(0) scale(0.98);
}

.player-join-btn:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 3px;
}

.player-join-btn:disabled {
  cursor: default;
}

.player-join-btn.taken {
  border-color: #e9d5ff;
  background: #faf5ff;
  opacity: 0.8;
}

.player-join-btn.mine {
  border-color: #86efac;
  background: #f0fdf4;
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(134, 239, 172, 0.25), var(--shadow-sm);
}

.player-join-btn.locked {
  opacity: 0.55;
}

.player-join-btn .player-name {
  font-size: 1.05rem;
}

.player-name {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.player-subtitle {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.role-status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.player-join-btn.mine .role-status {
  background: var(--success-soft);
  color: #15803d;
}

.player-join-btn.taken .role-status {
  background: #f3e8ff;
  color: #7e22ce;
}

/* ---------- Avatars ---------- */

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.12), 0 6px 14px rgba(43, 20, 54, 0.15);
}

.avatar-joshua {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.avatar-helene {
  background: linear-gradient(135deg, #f472b6, #db2777);
}

.avatar-jeffrey {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.avatar-eilene {
  background: linear-gradient(135deg, #a855f7, #6d28d9);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 0.9rem;
}

.avatar-xs {
  width: 26px;
  height: 26px;
  font-size: 0.7rem;
}

/* ---------- Lobby player list ---------- */

.players-waiting {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.count-pill {
  padding: 5px 10px;
  border-radius: 999px;
  background: #f3e8ff;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
}

#playersList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  animation: pop-in 0.25s ease both;
}

.player-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.player-item .player-name {
  font-size: 0.95rem;
}

.player-couple {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.player-ready {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--success-soft);
  color: #15803d;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.player-ready.host {
  background: #fef3c7;
  color: #92400e;
}

.empty-state {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.status-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.status-line-light {
  color: rgba(255, 255, 255, 0.82);
}

/* ---------- Buttons ---------- */

.btn {
  width: 100%;
  min-height: 50px;
  padding: 15px 18px;
  border: 0;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn:not(:disabled):hover {
  filter: brightness(1.04);
  box-shadow: var(--shadow-sm);
}

.btn:not(:disabled):active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--pink));
  color: #fff;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
}

.btn-success {
  background: linear-gradient(135deg, #16a34a, #84cc16);
  color: #fff;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.25);
}

.btn-secondary {
  border: 2px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

/* ---------- Host controls ---------- */

#hostControls {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.host-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.host-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.host-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.host-panel-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.host-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3e8ff;
  color: var(--primary);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#answersReceived {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.host-answer-prompt {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.host-answer-prompt.is-ready {
  border: 1px solid #fed7aa;
  background: #fef3c7;
  color: #92400e;
}

.answers-count {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.answer-received-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.answer-received {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.host-players-online {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.host-players-online h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.host-player-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
}

.host-player-status.online {
  margin-bottom: 4px;
  background: rgba(22, 163, 74, 0.07);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.player-info {
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---------- Question screen ---------- */

.game-topbar {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.progress-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 800;
}

.score-chip-label,
.score-chip-unit {
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
}

.score-chip strong {
  font-size: 1.1rem;
  line-height: 1;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f3e8ff;
}

.progress-fill {
  width: 4%;
  min-width: 4%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--pink));
  transition: width 0.45s ease;
}

.turn-banner {
  margin: 0 0 14px;
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.turn-banner.is-your-turn {
  border-color: #fed7aa;
  background: linear-gradient(135deg, #fef3c7, #ffedd5);
  color: #9a3412;
}

.turn-banner.is-waiting {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.question-card {
  margin-bottom: 16px;
  padding: clamp(20px, 5vw, 30px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.question-kicker {
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.question-couple {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.question-people {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.question-pair {
  white-space: nowrap;
}

.pair-arrow {
  margin: 0 4px;
  color: var(--muted);
}

.pair-separator {
  margin: 0 6px;
  color: var(--muted);
}

.received-about {
  margin-left: 2px;
  color: var(--muted);
  font-weight: 600;
}

.person-answering {
  color: var(--primary);
  font-weight: 800;
}

.person-about {
  color: var(--pink);
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.question-card h2 {
  margin: 0 0 22px;
  color: var(--ink);
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.answer-hint {
  margin: -10px 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.potential-answers {
  margin: 4px 0 16px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.potential-answers h4 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 0.9rem;
}

.potential-answers p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}

.potential-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.potential-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.potential-key {
  display: inline-grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #f3e8ff;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.option-btn:not(:disabled):not(.selected):hover {
  border-color: #d8b4fe;
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.option-btn:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

.option-btn.selected {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  color: #fff;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.3);
}

.option-btn.selected::after {
  content: '✓';
  margin-left: auto;
  font-size: 1.05rem;
  font-weight: 800;
}

.option-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.option-key {
  display: inline-grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #f3e8ff;
  color: var(--primary);
  font-weight: 800;
}

.option-btn.selected .option-key {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.option-text {
  flex: 1;
}

.free-answer {
  margin-bottom: 16px;
}

.free-answer textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.45;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.free-answer textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.free-answer textarea:disabled {
  background: var(--surface-soft);
}

.waiting-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  text-align: center;
}

.waiting-message p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.waiting-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  margin-top: 2px;
}

.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c4b5fd;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

/* ---------- Reveal screen ---------- */

.reveal-question-card {
  margin-bottom: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.reveal-question {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}

#answersDisplay {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-item {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: pop-in 0.3s ease both;
}

.answer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.answer-copy {
  display: flex;
  flex-direction: column;
}

.answer-player {
  color: var(--ink);
  font-weight: 800;
}

.answer-couple {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.answer-text {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.score-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.score-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, outline-color 0.15s ease;
}

.score-btn:hover {
  filter: brightness(0.97);
}

.score-btn:active {
  transform: scale(0.98);
}

.score-btn:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

.score-btn.correct {
  border-color: #bbf7d0;
  background: var(--success-soft);
  color: #15803d;
}

.score-btn.incorrect {
  border-color: #fecdd3;
  background: var(--danger-soft);
  color: #be123c;
}

.score-btn.chosen {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

/* ---------- Results screen ---------- */

.results-hero {
  padding: 18px 0 22px;
  text-align: center;
}

#resultsScreen .container {
  position: relative;
  z-index: 1;
}

.trophy {
  display: block;
  margin-bottom: 4px;
  font-size: clamp(3rem, 12vw, 4.5rem);
  line-height: 1;
  animation: trophy-bounce 1.6s ease-in-out infinite;
}

.results-hero h1 {
  margin: 8px 0 6px;
}

.winner-banner {
  max-width: 34rem;
  margin: 0 auto;
  color: #fef3c7;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
}

.scoreboard-card {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.scoreboard-card h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1.1rem;
  text-align: center;
}

#finalScores {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.score-item.winner {
  border: 1px solid #fed7aa;
  background: linear-gradient(135deg, #fef3c7, #ffedd5);
}

.score-rank {
  flex: 0 0 auto;
  width: 1.6rem;
  font-size: 1.3rem;
  text-align: center;
}

.score-main {
  flex: 1;
  min-width: 0;
}

.score-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.score-name {
  color: var(--ink);
  font-weight: 800;
}

.score-value {
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}

.score-bar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadcff;
}

.score-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--pink));
  transition: width 0.6s ease;
}

.score-item.winner .score-bar {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

/* ---------- Confetti ---------- */

.confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.confetti i {
  position: absolute;
  top: -12vh;
  width: 9px;
  height: 16px;
  border-radius: 2px;
  opacity: 0.9;
  animation: confetti-fall 3.2s linear infinite;
}

.confetti i:nth-child(1) { left: 5%; background: var(--rose); animation-delay: 0s; }
.confetti i:nth-child(2) { left: 13%; background: #fbbf24; animation-delay: 0.6s; animation-duration: 3.8s; }
.confetti i:nth-child(3) { left: 21%; background: #38bdf8; animation-delay: 1.4s; }
.confetti i:nth-child(4) { left: 29%; background: #a855f7; animation-delay: 0.2s; animation-duration: 4.1s; }
.confetti i:nth-child(5) { left: 37%; background: #34d399; animation-delay: 1.9s; }
.confetti i:nth-child(6) { left: 45%; background: #fb7185; animation-delay: 0.9s; animation-duration: 3.5s; }
.confetti i:nth-child(7) { left: 53%; background: #fbbf24; animation-delay: 2.4s; }
.confetti i:nth-child(8) { left: 61%; background: #38bdf8; animation-delay: 0.4s; animation-duration: 4.4s; }
.confetti i:nth-child(9) { left: 69%; background: #a855f7; animation-delay: 1.2s; }
.confetti i:nth-child(10) { left: 77%; background: #34d399; animation-delay: 2.1s; animation-duration: 3.7s; }
.confetti i:nth-child(11) { left: 85%; background: #fb7185; animation-delay: 0.1s; }
.confetti i:nth-child(12) { left: 93%; background: #fbbf24; animation-delay: 1.7s; animation-duration: 4.2s; }
.confetti i:nth-child(13) { left: 9%; background: #a855f7; animation-delay: 2.8s; }
.confetti i:nth-child(14) { left: 49%; background: #34d399; animation-delay: 3.1s; animation-duration: 3.9s; }

/* ---------- Motion ---------- */

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bounce {
  0%,
  80%,
  100% {
    opacity: 0.5;
    transform: scale(0.6);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(24px, 18px, 0) scale(1.08);
  }
}

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

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -10vh, 0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--confetti-drift, 24px), 110vh, 0) rotate(720deg);
    opacity: 0.8;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .bg-glow {
    display: none;
  }
}

@media (max-width: 560px) {
  .couple-picker {
    grid-template-columns: 1fr;
  }

  .container {
    padding-bottom: 24px;
  }
}

@media (max-width: 360px) {
  .role-buttons {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  .lang-btn:not(.active):hover {
    background: transparent;
  }

  .player-join-btn:not(:disabled):hover {
    transform: none;
    border-color: var(--line);
    box-shadow: none;
  }

  .option-btn:not(:disabled):not(.selected):hover {
    transform: none;
    border-color: var(--line);
    background: #fff;
  }

  .score-btn:hover {
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
