@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg:            #EAF8FF;
  --surface:       #FFFFFF;
  --primary:       #FF6B9A;
  --primary-soft:  #FFE4F0;
  --blue:          #7DD3FC;
  --blue-soft:     #E0F4FF;
  --yellow:        #FFDE68;
  --yellow-soft:   #FFF9DB;
  --ink:           #0F172A;
  --ink-2:         #475569;
  --ink-muted:     #94A3B8;
  --border:        #E2E8F0;
  --shadow:        0 4px 20px rgba(125, 211, 252, 0.25);
  --shadow-card:   0 8px 32px rgba(125, 211, 252, 0.3);
  --font-display:  'Fredoka', sans-serif;
  --font-ui:       'Inter', sans-serif;
  --radius-card:   28px;
  --radius-panel:  16px;
  --radius-chip:   12px;
  --radius-pill:   100px;
}

[hidden] {
  display: none !important;
}

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

html {
  height: 100%;
  font-size: 16px;
}

body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 200ms ease, color 200ms ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 4vw, 1.8rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 500; }

p { color: var(--ink-2); line-height: 1.6; }

button { cursor: pointer; font-family: var(--font-ui); border: none; background: none; }

a { color: var(--primary); text-decoration: none; }

.page-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transition: background 200ms ease;
  padding-bottom: 64px; /* space for bottom nav */
}

.app-card {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 0 24px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 800px) {
  .app-card { padding: 24px 0 24px; }
}

.screen-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  animation: fade-up 360ms ease;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.hero-badge,
.progress-pill,
.card-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid rgba(139, 94, 122, 0.14);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.88rem;
}

.hero-badge.soft {
  background: rgba(249, 243, 255, 0.92);
}


.hero-copy,
.results-copy,
.support-copy,
.meaning-copy,
.card-hint,
.notice-panel {
  color: var(--ink-2);
  line-height: 1.55;
}

.hero-copy {
  margin-top: 16px;
  font-size: 1.03rem;
}

.notice-panel,
.setup-panel,
.idea-panel,
.room-card,
.status-card,
.results-panel {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(108, 93, 127, 0.08);
}

.notice-panel {
  margin-top: 24px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(255, 238, 205, 0.88), rgba(238, 223, 242, 0.9));
}

.setup-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 251, 0.88));
}

.panel-header {
  display: grid;
  gap: 6px;
}

.setup-note {
  font-size: 0.92rem;
  color: var(--ink-2);
}

/* --- Text inputs --- */
.text-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.text-field span {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
}
.text-field input {
  height: 52px;
  padding: 0 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-panel);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.text-field input::placeholder { color: var(--ink-muted); }
.text-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 154, 0.15);
}

.text-field input[name="roomCode"] {
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

/* --- Checkbox --- */
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
  margin-top: 2px;
  cursor: pointer;
}
.checkbox-field span { font-family: var(--font-ui); font-size: 0.9rem; font-weight: 500; color: var(--ink); }
.checkbox-field small { font-size: 0.78rem; color: var(--ink-muted); display: block; margin-top: 2px; }

.segment-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.segment-options .segment-card {
  min-width: 0;
}

.setup-note-inline {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-2);
  margin-left: 4px;
}

.style-filter-row {
  display: flex;
  align-items: center;
}

.style-filter-toggle::after {
  content: " ▾";
  font-size: 0.75em;
}

.style-filter-toggle[aria-expanded="true"]::after {
  content: " ▴";
}

.style-filter-panel {
  margin-top: 10px;
}

.style-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* --- Gender segmented control --- */
.segmented-group > p {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.segment-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-panel);
  cursor: pointer;
  transition: all 140ms ease;
  text-align: center;
}
.segment-card input { display: none; }
.segment-card span { font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.segment-card small { font-size: 0.68rem; color: var(--ink-muted); margin-top: 4px; line-height: 1.3; }
.segment-card:has(input:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.segment-card:has(input:checked) span { color: var(--primary); }

.style-chip {
  position: relative;
  display: inline-flex;
}

.style-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.style-chip span {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.style-chip small {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--ink-2);
  line-height: 1.3;
}

.style-chip input:checked + span {
  border-color: rgba(204, 137, 179, 0.34);
  box-shadow: 0 0 0 4px rgba(244, 214, 232, 0.42);
  background: linear-gradient(135deg, rgba(255, 230, 186, 0.72), rgba(238, 223, 242, 0.9));
}

.style-chip span:hover {
  transform: translateY(-1px);
}

.idea-panel,
.room-card,
.status-card,
.results-panel {
  background: var(--surface);
}

.idea-panel {
  margin-top: 18px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 242, 214, 0.82), rgba(220, 235, 255, 0.82));
}

.idea-panel strong {
  display: block;
  margin-bottom: 6px;
}

.setup-review {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 251, 0.9));
}

/* Home screen resume nudge — strip panel look, just a subtle text row */
#setup-review {
  margin-top: 12px;
  padding: 0;
  border: none;
  background: none;
  border-radius: 0;
}

.setup-review-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.setup-review-toggle {
  flex-shrink: 0;
  margin-top: 2px;
}

.setup-review-content {
  display: grid;
  gap: 10px;
}

.setup-review-actions {
  display: flex;
  justify-content: flex-start;
}

/* --- Buttons --- */
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0 24px;
  height: 54px;
  background: linear-gradient(135deg, var(--primary), #FF9DC8);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(255, 107, 154, 0.35);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255, 107, 154, 0.45); }
.primary-button:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(255, 107, 154, 0.3); }
.primary-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  height: 46px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.secondary-button:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.secondary-button:active { transform: translateY(0); }

.ghost-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  height: 46px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  transition: color 140ms ease, border-color 140ms ease;
}
.ghost-button:hover { color: var(--ink); border-color: var(--ink-muted); }

.link-button {
  background: none;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
  transition: color 140ms ease;
}
.link-button:hover { color: var(--ink-2); }

.nav-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 140ms ease, border-color 140ms ease;
}
.nav-back:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.top-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.support-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}

.support-actions {
  display: grid;
  gap: 6px;
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.room-card,
.status-card {
  margin-top: 24px;
  padding: 20px;
}

.status-card.compact {
  margin-top: 22px;
}

.room-label {
  color: var(--ink-2);
  font-size: 0.92rem;
}

.room-tip {
  margin-top: 12px;
}

.source-note {
  margin-top: 10px;
}

.invite-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qr-panel {
  margin-top: 16px;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
}

.qr-panel canvas {
  width: min(180px, 100%);
  height: auto;
  border-radius: 16px;
  background: white;
  padding: 10px;
}

#qr-status {
  text-align: center;
}

.room-code {
  margin: 10px 0 18px;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1;
  letter-spacing: 0.18em;
  font-weight: 800;
  color: var(--ink);
}

.player-list {
  display: grid;
  gap: 10px;
}

.player-pill {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(250, 244, 248, 0.88));
  font-weight: 700;
}

.player-pill small {
  color: var(--ink-2);
}

.deck-shell {
  position: relative;
  min-height: 430px;
  margin-top: 34px;
}

.card-shadow,
.name-card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}

.shadow-back,
.shadow-front {
  border: 1px solid rgba(98, 74, 104, 0.06);
  background: rgba(255, 255, 255, 0.62);
}

.shadow-back {
  transform: translateY(14px) scale(0.95);
}

.shadow-front {
  transform: translateY(7px) scale(0.98);
}

.name-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 219, 233, 0.7), transparent 24%),
    radial-gradient(circle at 78% 20%, rgba(216, 241, 232, 0.7), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 251, 0.95));
  border: 1px solid var(--border);
  box-shadow: 0 18px 34px rgba(163, 120, 148, 0.14);
  touch-action: none;
  user-select: none;
  transform-origin: center bottom;
  transition: transform 180ms ease, opacity 180ms ease;
}

.swipe-indicator {
  position: absolute;
  top: 22px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
}

.swipe-indicator-left {
  left: 22px;
  color: #5b6881;
  background: rgba(220, 235, 255, 0.95);
  transform: rotate(-10deg);
}

.swipe-indicator-right {
  right: 22px;
  color: #6f4560;
  background: rgba(255, 226, 236, 0.95);
  transform: rotate(10deg);
}

.name-card[data-drag-direction="left"] .swipe-indicator-left,
.name-card[data-drag-direction="right"] .swipe-indicator-right {
  opacity: 1;
}

#name-label {
  font-size: clamp(3rem, 11vw, 4.3rem);
  line-height: 0.94;
}

.meaning-copy {
  max-width: 18ch;
  font-size: 1.02rem;
}

.pronunciation-copy,
.match-pronunciation {
  color: var(--ink-2);
  font-size: 0.94rem;
  line-height: 1.45;
}

.card-hint {
  font-size: 0.92rem;
}

.action-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: auto;
  padding-top: 28px;
}

/* Swipe choice buttons */
.choice-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.choice-button:hover { transform: scale(1.08); }
.choice-button:active { transform: scale(0.95); }
.choice-button.nope { color: #64748B; }
.choice-button.nope:hover { background: #F1F5F9; border-color: #94A3B8; }
.choice-button.like { background: linear-gradient(135deg, var(--primary), #FF9DC8); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgba(255,107,154,0.4); }
.choice-button.like:hover { box-shadow: 0 6px 24px rgba(255,107,154,0.5); }

.results-panel {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding: 18px;
  min-height: 280px;
}

.results-section {
  margin-top: 22px;
}

.results-section-head {
  display: grid;
  gap: 4px;
}

.shortlist-summary {
  margin-top: 20px;
}

.shortlist-summary-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 240, 186, 0.78), rgba(216, 241, 232, 0.8));
  border: 1px solid var(--border);
}

.shortlist-summary-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.02rem;
}

.shortlist-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

/* --- Match cards (results list items) --- */
.match-card,
.empty-state {
  border-radius: 20px;
  padding: 16px 18px;
}

.match-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-panel);
  transition: border-color 140ms ease;
}
.match-card:hover { border-color: var(--primary); }
.match-card .match-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.match-card .match-detail { font-size: 0.78rem; color: var(--ink-muted); margin-top: 2px; }
.match-card .match-icon { font-size: 1.4rem; flex-shrink: 0; }
.match-card.is-shortlisted { background: var(--yellow-soft); border-color: var(--yellow); }

.match-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pill-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.pill-button.primary {
  background: linear-gradient(135deg, rgba(255, 228, 236, 0.9), rgba(255, 238, 205, 0.92));
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.72);
  min-height: 180px;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
}

.empty-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

/* --- Toast message --- */
.app-message {
  position: fixed;
  bottom: calc(64px + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  z-index: 200;
  white-space: nowrap;
}

.app-message-spinner {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: spinner-rotate 0.7s linear infinite;
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

.is-dragging {
  transition: none;
}

.swipe-right {
  transform: translateX(140%) rotate(18deg) !important;
  opacity: 0;
}

.swipe-left {
  transform: translateX(-140%) rotate(-18deg) !important;
  opacity: 0;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html.dark {
  --bg:            #0F172A;
  --surface:       #1E2938;
  --primary:       #FF669C;
  --primary-soft:  #3D1525;
  --blue:          #7DD3FC;
  --blue-soft:     #0F2744;
  --yellow:        #FFDE68;
  --yellow-soft:   #2D2008;
  --ink:           #F8FAFC;
  --ink-2:         #94A3B8;
  --ink-muted:     #475569;
  --border:        #334155;
  --shadow:        0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-card:   0 8px 32px rgba(0, 0, 0, 0.5);
}


html.dark .player-pill {
  background: linear-gradient(135deg, rgba(35, 26, 46, 0.96), rgba(40, 30, 54, 0.88));
}

html.dark .match-card {
  background: linear-gradient(135deg, rgba(35, 26, 46, 0.96), rgba(40, 28, 50, 0.88));
}

html.dark .match-card.is-shortlisted {
  background: linear-gradient(135deg, rgba(70, 55, 20, 0.5), rgba(20, 40, 80, 0.5));
}

html.dark .shortlist-summary-card {
  background: linear-gradient(135deg, rgba(70, 55, 20, 0.5), rgba(30, 60, 50, 0.6));
}

html.dark .secondary-button.strong {
  background: linear-gradient(135deg, rgba(20, 40, 80, 0.7), rgba(20, 60, 50, 0.7));
}

html.dark .text-field input {
  background: var(--surface);
  color: var(--ink);
}

html.dark .empty-state {
  background: rgba(30, 22, 40, 0.72);
}

html.dark .shadow-back,
html.dark .shadow-front {
  background: rgba(20, 15, 28, 0.5);
}

html.dark .segment-card {
  background: linear-gradient(180deg, rgba(35, 26, 46, 0.96), rgba(40, 30, 50, 0.9));
}

html.dark .hero-badge {
  background: rgba(40, 30, 54, 0.88);
  border-color: rgba(200, 170, 210, 0.14);
}

html.dark .hero-badge.soft {
  background: rgba(45, 32, 60, 0.92);
}

html.dark .progress-pill,
html.dark .card-label {
  background: rgba(40, 30, 54, 0.88);
  border-color: rgba(200, 170, 210, 0.14);
}

/* Hardcoded-light buttons need explicit dark overrides */
html.dark .choice-button.nope {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(50, 38, 64, 0.96), rgba(42, 52, 82, 0.92));
  border: 1px solid rgba(200, 170, 210, 0.18);
}

html.dark .pill-button.primary {
  background: linear-gradient(135deg, rgba(90, 40, 65, 0.7), rgba(50, 40, 80, 0.7));
}

html.dark .style-chip input:checked + span {
  background: linear-gradient(135deg, rgba(80, 55, 20, 0.6), rgba(55, 38, 80, 0.7));
}

html.dark .share-card { border-color: var(--border); }
html.dark .share-avatar-a { background: linear-gradient(135deg, #a86088, #c0876a); }
html.dark .share-avatar-b { background: linear-gradient(135deg, #4a8aaa, #5aaf80); }

/* ── Home screen ── */
.home-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-top: 8px;
}

.home-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.home-title {
  margin-top: 4px;
  font-size: clamp(2.8rem, 6vw, 3.8rem);
  line-height: 0.96;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.home-name-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 20px 0;
  min-height: 0;
  overflow: hidden;
}

.home-preview-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
}

.home-preview-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 6px;
}

.home-preview-chip {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.85rem;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.home-cta-primary,
.home-cta-secondary {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.home-cta-primary:active,
.home-cta-secondary:active {
  transform: scale(0.98);
}

.home-cta-primary:hover {
  box-shadow: 0 6px 24px rgba(216, 141, 176, 0.5);
}

.home-cta-secondary:hover {
  border-color: var(--primary);
}

.home-cta-primary {
  background: linear-gradient(135deg, #d88db0 0%, #f0b7a0 100%);
  border: none;
  box-shadow: 0 4px 20px rgba(216, 141, 176, 0.35);
}

.home-cta-secondary {
  background: var(--surface);
  border: 2px solid var(--primary-soft);
}

.home-cta-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.home-cta-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.home-cta-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: white;
  line-height: 1.2;
}

.home-cta-secondary .home-cta-title {
  color: var(--ink);
}

.home-cta-sub {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
}

.home-cta-secondary .home-cta-sub {
  color: var(--ink-2);
}

.home-cta-arrow {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.home-cta-secondary .home-cta-arrow {
  color: var(--border);
}

.home-trust {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 4px;
}

.home-avatars {
  display: flex;
}

.home-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid white;
  display: inline-block;
}

.home-avatar + .home-avatar {
  margin-left: -7px;
}

.home-avatar-a { background: linear-gradient(135deg, #f9a8d4, #e879f9); }
.home-avatar-b { background: linear-gradient(135deg, #86efac, #22d3ee); }
.home-avatar-c { background: linear-gradient(135deg, #fbbf24, #f87171); }

.home-trust-text {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 500;
}

.home-resume-btn {
  font-size: 0.9rem;
  padding: 8px 0;
  color: var(--primary);
}

/* Suppress old setup-grid layout that's no longer used */
.setup-grid { display: none; }

/* ── Sheets ── */
.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(69, 56, 74, 0.3);
  z-index: 50;
  border-radius: var(--radius-xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 0 24px 32px;
  z-index: 51;
  transform: translateY(100%);
  transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 88%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 14px auto 20px;
}

.sheet-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

.sheet-title {
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  margin-bottom: 4px;
}

/* ── Theme toggle ───────────────────────────────────────────── */

.theme-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 50;
  transition: background 140ms ease, border-color 140ms ease;
  box-shadow: var(--shadow);
}
.theme-toggle:hover { background: var(--primary-soft); border-color: var(--primary); }

/* ── Results tabs ───────────────────────────────────────────── */

.results-tabs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.results-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.results-tab:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.results-tab[aria-selected="true"] {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 228, 236, 0.9), rgba(255, 238, 205, 0.92));
  border-color: rgba(204, 137, 179, 0.3);
}

html.dark .results-tab[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(90, 40, 65, 0.6), rgba(60, 45, 85, 0.7));
  border-color: rgba(196, 144, 168, 0.3);
  color: var(--ink);
}

.results-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 800;
}

/* ── Results share card ── */
.share-card {
  background: var(--surface);
  border: 2px solid var(--primary-soft);
  border-radius: var(--radius-lg);
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 4px;
}

.share-card-partners {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-card-avatars {
  display: flex;
}

.share-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  display: inline-block;
}

.share-avatar + .share-avatar {
  margin-left: -8px;
}

.share-avatar-a { background: linear-gradient(135deg, #d88db0, #f0b7a0); }
.share-avatar-b { background: linear-gradient(135deg, #7eb8d4, #86efac); }

.share-card-names-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.share-card-names-text strong {
  font-size: 0.95rem;
  color: var(--ink);
}

.share-match-count {
  font-size: 0.82rem;
  color: var(--ink-2);
}

.share-name-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-name-chip {
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary);
}

/* Matches tab badge (mirrors shortlist badge) */
#matches-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 4px;
}

/* ── Match reveal overlay ───────────────────────────────────── */

.match-reveal {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: min(340px, calc(100% - 32px));
  background: rgba(24, 14, 36, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 16px;
  animation: match-reveal-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes match-reveal-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.match-reveal-inner {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.match-reveal-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 800;
  color: rgba(255, 200, 220, 0.82);
  margin: 0;
}

.match-reveal strong {
  font-size: 1.1rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-reveal-detail {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  line-height: 1.4;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-reveal-dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 180ms ease;
}

.match-reveal-dismiss:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Confetti ───────────────────────────────────────────────── */

.confetti-dot {
  position: absolute;
  top: 0;
  border-radius: 3px;
  animation: confetti-fall linear forwards;
  z-index: 55;
  pointer-events: none;
}

@keyframes confetti-fall {
  0%   { transform: translateY(-10px) rotate(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(800px) rotate(720deg); opacity: 0; }
}

/* ── Partner presence ───────────────────────────────────────── */

.partner-presence {
  font-size: 0.86rem;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.partner-presence::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: presence-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

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

/* ── Play another round ─────────────────────────────────────── */

.another-round-row {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

.another-round-row .secondary-button {
  width: 100%;
  max-width: 280px;
}

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

/* ── Swipe screen layout ── */
.swipe-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 16px;
  min-height: 0;
}

.swipe-col-name {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.swipe-col-action {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.swipe-action-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.swipe-support {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.keyboard-hint {
  display: none;
  font-size: 0.8rem;
  color: var(--ink-2);
  opacity: 0.6;
  letter-spacing: 0.02em;
}

@media (min-width: 800px) {
  .swipe-layout {
    flex-direction: row;
    align-items: stretch;
    gap: 32px;
  }

  .swipe-col-name {
    flex: 1.2;
    display: flex;
    flex-direction: column;
  }

  .swipe-col-name .deck-shell {
    flex: 1;
  }

  .swipe-col-action {
    flex: 1;
    justify-content: center;
  }

  .swipe-action-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .keyboard-hint {
    display: block;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }

  /* On desktop, action-row buttons stack vertically */
  .action-row {
    flex-direction: column;
    gap: 10px;
  }

  .choice-button {
    width: 100%;
    border-radius: var(--radius-md);
    height: 56px;
    font-size: 1rem;
    font-weight: 800;
  }
}

@media (max-width: 540px) {
  .app-card {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    padding: 24px 18px env(safe-area-inset-bottom, 28px);
  }

  .screen {
    min-height: 0;
  }

  .segment-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .invite-actions {
    grid-template-columns: 1fr;
  }

  .top-row,
  .support-row {
    flex-direction: column;
    align-items: start;
  }

  .deck-shell {
    min-height: 0;
    flex: 1;
  }

  .choice-button {
    width: 88px;
    height: 88px;
  }

  .app-message {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }
}

/* ── History screen ── */
.history-session {
  margin-bottom: 20px;
}

.history-session-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.history-name-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}

.dark .history-chip {
  background: rgba(255, 255, 255, 0.07);
}

.history-chip-match {
  background: rgba(46, 213, 115, 0.12);
  border-color: rgba(46, 213, 115, 0.4);
  color: #1a7a45;
}

.dark .history-chip-match {
  color: #2ed573;
}

.history-chip-match-badge {
  font-size: 0.72rem;
  opacity: 0.8;
}

.history-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 16px;
}

.history-actions .secondary-button {
  flex: 1;
}

/* --- Vibe chips --- */

.vibe-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vibe-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vibe-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.vibe-count-label {
  font-size: 12px;
  color: var(--ink-2);
  transition: color 0.15s;
}

.vibe-count-label.has-selection {
  color: var(--primary);
  font-weight: 500;
}

/* --- Chips --- */
.vibe-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-chip);
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 140ms ease;
  user-select: none;
}
.vibe-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.vibe-chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,154,0.3);
}

.vibe-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  position: relative;
  transition: opacity 140ms ease;
}

.nav-tab-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.nav-tab-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: filter 140ms ease;
}

.nav-tab-label {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 140ms ease;
}

/* Active state */
.nav-tab-active .nav-tab-icon {
  background: linear-gradient(135deg, var(--primary), #FF9DC8);
  box-shadow: 0 3px 10px rgba(255, 107, 154, 0.4);
}
.nav-tab-active .nav-tab-label { color: var(--primary); font-weight: 600; }

/* Locked/disabled state */
.nav-tab-locked,
.nav-tab:disabled {
  cursor: not-allowed;
  pointer-events: none;
}
.nav-tab-locked .nav-tab-icon img,
.nav-tab:disabled .nav-tab-icon img {
  filter: grayscale(1) opacity(0.35);
}
.nav-tab-locked .nav-tab-label,
.nav-tab:disabled .nav-tab-label {
  opacity: 0.35;
}

/* --- Home screen --- */
.screen {
  display: none;
  flex-direction: column;
  gap: 24px;
  padding: 24px 20px;
  min-height: 100%;
  animation: fade-up 300ms ease both;
}
.screen.screen-active { display: flex; }

.home-screen {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 32px;
}

.home-hero { text-align: center; }

.home-pill {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.home-title {
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 12px;
}

.home-tagline {
  font-size: 1rem;
  color: var(--ink-2);
  max-width: 28ch;
  margin: 0 auto;
  line-height: 1.5;
}

.home-preview { }

.home-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.home-preview-chip {
  display: inline-block;
  padding: 6px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-chip);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-trust {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.config-notice {
  background: var(--yellow-soft);
  border: 1px solid var(--yellow);
  border-radius: var(--radius-panel);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--ink-2);
}

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

/* --- Wizard screens --- */
.wizard {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 16px;
  min-height: 100%;
}

.wizard-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-steps {
  display: flex;
  gap: 6px;
  margin-left: auto;
  margin-right: auto;
}

.wizard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 200ms ease, width 200ms ease;
}

.wizard-dot-active {
  width: 20px;
  border-radius: 4px;
  background: var(--primary);
}

.wizard-form { flex: 1; }

.wizard-step {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wizard-step h2 { margin-bottom: -8px; }
.wizard-step > p { color: var(--ink-2); font-size: 0.95rem; margin-top: -8px; }

/* --- Match Reveal Overlay --- */
.match-reveal-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #0F172A 0%, #1a1040 100%);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: match-reveal-in 350ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.match-reveal-overlay[hidden] { display: none; }

.match-reveal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 32px 24px;
  max-width: 320px;
}

.match-reveal-star {
  width: 140px;
  height: 140px;
  animation: match-star-bounce 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 100ms both;
  filter: drop-shadow(0 8px 24px rgba(255, 222, 104, 0.5));
}

.match-reveal-eyebrow {
  color: var(--yellow);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.match-reveal-name {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.match-reveal-detail {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.match-reveal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.match-reveal-actions .ghost-button {
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
}
.match-reveal-actions .ghost-button:hover {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

@keyframes match-reveal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes match-star-bounce {
  from { transform: scale(0.3) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* --- Lobby --- */
.screen-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.invite-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}

.room-code-display {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--primary);
  text-align: center;
  padding: 8px 0;
}

.invite-actions { display: flex; gap: 10px; }

.qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.qr-panel canvas { border-radius: 8px; }

.status-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.player-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-chip);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.player-pill span { font-weight: 500; color: var(--ink); }
.player-pill small { font-size: 0.75rem; color: var(--ink-muted); }

/* --- Swipe screen --- */
.swipe-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.swipe-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.swipe-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.progress-pill {
  margin-left: auto;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.deck-shell {
  position: relative;
  flex: 1;
  min-height: 360px;
}

.card-shadow {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1.5px solid var(--border);
}
.shadow-back  { transform: translate(6px, 10px) rotate(2deg); opacity: 0.5; }
.shadow-front { transform: translate(3px, 5px) rotate(1deg); opacity: 0.7; }

.name-card {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #EAF8FF 0%, #FFFFFF 60%);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  touch-action: none;
  user-select: none;
  cursor: grab;
  transition: box-shadow 140ms ease;
}
html.dark .name-card { background: linear-gradient(160deg, #1E2938 0%, #0F172A 60%); }
.name-card:active { cursor: grabbing; }

.name-card-illustration {
  margin-bottom: 8px;
}
.name-card-illustration img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(125, 211, 252, 0.4));
}

.name-card .card-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
}

.name-card h3 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.name-card .pronunciation-copy {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.name-card .meaning-copy {
  font-size: 0.85rem;
  color: var(--ink-2);
  max-width: 24ch;
  line-height: 1.4;
}

.swipe-indicator {
  position: absolute;
  top: 20px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-chip);
  border: 2.5px solid;
  opacity: 0;
  transition: opacity 80ms ease;
  pointer-events: none;
}
.swipe-indicator-left { left: 20px; color: #64748B; border-color: #64748B; transform: rotate(-15deg); }
.swipe-indicator-right { right: 20px; color: var(--primary); border-color: var(--primary); transform: rotate(15deg); }

.swipe-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.swipe-support {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.partner-presence {
  font-size: 0.78rem;
  color: var(--ink-muted);
  text-align: center;
}

.keyboard-hint {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

@media (min-width: 800px) {
  .keyboard-hint { display: block; }
}
@media (max-width: 799px) {
  .keyboard-hint { display: none; }
}

/* --- Results screen --- */
.results-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: var(--radius-pill);
  padding: 4px;
}

.results-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: none;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: all 140ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.results-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.results-tab-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.results-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.results-section h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--ink); }

.results-panel { display: flex; flex-direction: column; gap: 8px; }

.share-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}

.share-card-partners {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-card-partners strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.share-match-count { font-size: 0.8rem; color: var(--ink-muted); }

.share-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.share-avatar-a { background: linear-gradient(135deg, var(--primary), #FF9DC8); }
.share-avatar-b { background: linear-gradient(135deg, var(--blue), #93C5FD); margin-left: -10px; border: 2px solid var(--surface); }

.share-card-avatars { display: flex; }

.share-name-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.share-name-chip {
  display: inline-block;
  padding: 6px 14px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-chip);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
}

.share-actions { display: flex; gap: 10px; }

.another-round-row { padding-top: 8px; }

/* --- Waiting screen --- */
.waiting-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.waiting-hero h2 { margin-top: 4px; }

/* --- History screen --- */
.history-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.history-session {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 16px;
  margin-bottom: 12px;
}
.history-session-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.history-name-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.history-chip {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-chip);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
}
