/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Palette — warm rose & mauve */
  --bg: #FDF8F5;
  --bg-warm: #FAF0EB;
  --surface: #FFFFFF;
  --surface-hover: #FFF7F3;
  --rose-50: #FFF1F2;
  --rose-100: #FFE4E6;
  --rose-200: #FECDD3;
  --rose-300: #FDA4AF;
  --rose-400: #FB7185;
  --rose-500: #E8527A;
  --rose-600: #BE123C;
  --mauve-50: #F5F0F7;
  --mauve-100: #EDE5F2;
  --mauve-200: #DBC9E6;
  --mauve-300: #C4A6D4;
  --mauve-400: #A87ABF;
  --mauve-500: #8B5CA8;
  --cream: #FDF8F5;
  --text: #2D1F2B;
  --text-secondary: #7A6878;
  --text-muted: #B5A3B1;
  --border: #F0E4EC;
  --border-subtle: #F7EFF4;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(139, 92, 168, 0.06);
  --shadow-md: 0 4px 16px rgba(139, 92, 168, 0.08);
  --shadow-lg: 0 8px 32px rgba(139, 92, 168, 0.12);
  --shadow-glow: 0 4px 24px rgba(232, 82, 122, 0.2);

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Outfit', -apple-system, sans-serif;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

input, select {
  font-family: var(--font-body);
  font-size: 16px; /* Prevents iOS auto-zoom on focus */
  border: none;
  outline: none;
  background: none;
}

/* Focus states for keyboard navigation */
button:focus-visible,
a:focus-visible,
.round-card:focus-visible {
  outline: 2px solid var(--rose-500);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

img {
  display: block;
  max-width: 100%;
}

/* ===== APP SHELL ===== */
#app {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  overflow: hidden;
}

main {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

/* ===== AMBIENT BACKGROUND ===== */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
  width: 300px;
  height: 300px;
  background: var(--rose-200);
  top: -60px;
  right: -80px;
  animation-delay: 0s;
}

.blob-2 {
  width: 250px;
  height: 250px;
  background: var(--mauve-200);
  bottom: 20%;
  left: -60px;
  animation-delay: -7s;
}

.blob-3 {
  width: 200px;
  height: 200px;
  background: var(--rose-100);
  bottom: -40px;
  right: 20%;
  animation-delay: -14s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ===== SCREENS ===== */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 20px 40px;
  padding-top: env(safe-area-inset-top);
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  z-index: 1;
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.screen.slide-out {
  opacity: 0;
  transform: translateX(-40px);
}

/* ===== TOP BAR ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
  padding-bottom: 24px;
}

.top-bar-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 100%);
  position: absolute;
  left: 20px;
  right: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--rose-500);
  animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { transform: rotate(0deg) scale(1); opacity: 1; }
  50% { transform: rotate(15deg) scale(1.1); opacity: 0.8; }
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid var(--rose-200);
  transition: transform 0.2s var(--ease-spring);
}

.avatar-btn:active { transform: scale(0.92); }

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text);
  transition: background 0.2s, transform 0.2s var(--ease-spring);
}

.back-btn:hover { background: var(--rose-50); }
.back-btn:active { transform: scale(0.9); }

.back-btn-light { color: white; }
.back-btn-light:hover { background: rgba(255,255,255,0.15); }

.top-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

/* ===== HOME HERO ===== */
.home-hero {
  text-align: center;
  padding: 32px 0 40px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 12px;
}

.hero-title em {
  font-style: italic;
  color: var(--rose-500);
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--rose-500), var(--mauve-500));
  color: white;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.3s;
  letter-spacing: -0.01em;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-primary:active { transform: scale(0.96); }

.btn-primary:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-glow {
  box-shadow: var(--shadow-glow);
}

.btn-icon {
  font-size: 1.2em;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  transition: transform 0.2s var(--ease-spring), background 0.2s;
}

.btn-secondary:hover { background: var(--surface-hover); }
.btn-secondary:active { transform: scale(0.96); }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.badge-count {
  background: var(--rose-100);
  color: var(--rose-500);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* ===== ROUNDS LIST (HOME) ===== */
.rounds-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.round-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  animation: cardIn 0.5s var(--ease-out) backwards;
  touch-action: pan-y;
}

.round-card-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring);
  position: relative;
  z-index: 1;
}

.round-card.swiping .round-card-content {
  transition: none;
}

.round-delete-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: #EF4444;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  z-index: 0;
}

.round-card.removing {
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  max-height: 0;
  opacity: 0;
  margin-top: -12px;
  overflow: hidden;
}

.round-card:nth-child(1) { animation-delay: 0.05s; }
.round-card:nth-child(2) { animation-delay: 0.1s; }
.round-card:nth-child(3) { animation-delay: 0.15s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
}

.round-card:hover {
  box-shadow: var(--shadow-md);
}

.round-card-content:active { transform: scale(0.98); }

.round-thumb-stack {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.round-thumb-stack img {
  position: absolute;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--surface);
}

.round-thumb-stack img:nth-child(1) { top: 0; left: 0; z-index: 2; }
.round-thumb-stack img:nth-child(2) { top: 6px; left: 10px; z-index: 1; transform: rotate(4deg); }

.round-info {
  flex: 1;
  min-width: 0;
}

.round-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.round-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.round-status.live {
  background: #ECFDF5;
  color: #059669;
}

.round-status.closed {
  background: var(--mauve-50);
  color: var(--mauve-500);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot.live {
  background: #059669;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== CREATE ROUND ===== */
.create-body {
  padding-top: 8px;
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}

.step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s;
}

.step span {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  transition: background 0.3s, color 0.3s;
}

.step.active {
  color: var(--rose-500);
}

.step.active span {
  background: linear-gradient(135deg, var(--rose-500), var(--mauve-500));
  color: white;
}

.step.done span {
  background: var(--rose-100);
  color: var(--rose-500);
}

.step-line {
  width: 32px;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  border-radius: 1px;
}

.create-step {
  display: none;
  animation: fadeUp 0.4s var(--ease-out);
}

.create-step.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.step-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* Upload zone */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease-spring);
}

.upload-zone:hover {
  border-color: var(--rose-300);
  background: var(--rose-50);
}

.upload-zone:active { transform: scale(0.98); }

.upload-zone.drag-over {
  border-color: var(--rose-400);
  background: var(--rose-50);
  transform: scale(1.01);
}

.upload-icon {
  color: var(--rose-300);
  margin-bottom: 12px;
}

.upload-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Photo preview grid */
.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.photo-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: scaleIn 0.3s var(--ease-spring) backwards;
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
  transition: transform 0.2s var(--ease-spring);
}

.photo-remove-btn:active { transform: scale(0.85); }

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
}

/* Step actions */
.step-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  padding-bottom: 20px;
}

/* ===== FRIENDS LIST ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.search-bar:focus-within { border-color: var(--rose-300); }

.search-bar svg { color: var(--text-muted); flex-shrink: 0; }

.search-bar input {
  flex: 1;
  font-size: 1rem;
  color: var(--text);
}

.search-bar input::placeholder { color: var(--text-muted); }

.selected-friends {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  min-height: 0;
}

.selected-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 6px;
  background: var(--rose-50);
  border: 1.5px solid var(--rose-200);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--rose-600);
  animation: scaleIn 0.25s var(--ease-spring);
}

.selected-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.selected-chip .chip-remove {
  font-size: 0.7rem;
  opacity: 0.6;
  cursor: pointer;
  padding: 2px;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}

.friend-row:hover { background: var(--rose-50); }
.friend-row:active { background: var(--rose-100); }

.friend-row.selected { background: var(--rose-50); }

.friend-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
}

.friend-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.friend-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-spring);
  font-size: 0.7rem;
  color: transparent;
}

.friend-row.selected .friend-check {
  background: linear-gradient(135deg, var(--rose-500), var(--mauve-500));
  border-color: transparent;
  color: white;
}

/* ===== LAUNCH PREVIEW ===== */
.launch-preview {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
}

.launch-photos {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.launch-photos::-webkit-scrollbar { display: none; }

.launch-photos img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.launch-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 0;
}

.launch-stat {
  text-align: center;
}

.launch-stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--rose-500);
}

.launch-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.launch-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.launch-friends-preview {
  display: flex;
  justify-content: center;
  gap: -8px;
  padding-top: 8px;
}

.launch-friends-preview img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface);
  margin-left: -8px;
}

.launch-friends-preview img:first-child { margin-left: 0; }

/* ===== VOTING SCREEN ===== */
#screen-vote {
  padding: 0;
  background: #0F0B12;
}

.vote-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.vote-progress-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

.vote-progress-bar {
  width: 120px;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: hidden;
}

.vote-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose-400), var(--mauve-400));
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
}

.vote-card-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 20px;
  min-height: 65vh;
}

.vote-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  touch-action: pan-y;
  transition: transform 0.15s ease-out;
  cursor: grab;
}

.vote-card:active { cursor: grabbing; }

.vote-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vote-overlay-badge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0) rotate(-15deg);
  font-size: 1.2rem;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border-width: 4px;
  border-style: solid;
  opacity: 0;
  transition: transform 0.2s var(--ease-spring), opacity 0.2s;
  pointer-events: none;
}

.vote-yes {
  right: 20px;
  color: #E8527A;
  border-color: #E8527A;
  background: rgba(232, 82, 122, 0.15);
  backdrop-filter: blur(8px);
}

.vote-nope {
  left: 20px;
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.vote-card.swiping-right .vote-yes {
  opacity: 1;
  transform: translateY(-50%) scale(1) rotate(-15deg);
}

.vote-card.swiping-left .vote-nope {
  opacity: 1;
  transform: translateY(-50%) scale(1) rotate(15deg);
}

.vote-card.swipe-right-exit {
  transform: translateX(150%) rotate(20deg) !important;
  transition: transform 0.4s var(--ease-out) !important;
}

.vote-card.swipe-left-exit {
  transform: translateX(-150%) rotate(-20deg) !important;
  transition: transform 0.4s var(--ease-out) !important;
}

/* Vote action buttons */
.vote-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px 24px calc(48px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 5;
}

.vote-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

.vote-btn:active { transform: scale(0.88); }

.vote-btn-skip {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
}

.vote-btn-skip:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
}

.vote-btn-love {
  background: linear-gradient(135deg, var(--rose-500), #D44A7A);
  color: white;
  box-shadow: 0 4px 20px rgba(232, 82, 122, 0.4);
}

.vote-btn-love:hover { transform: scale(1.05); }

.vote-btn-emoji {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: transform 0.2s var(--ease-spring);
}

.vote-btn-emoji:active { transform: scale(0.88); }

/* Emoji picker */
.emoji-picker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0 20px 48px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s var(--ease-out);
}

.emoji-picker.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.emoji-picker-inner {
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  background: rgba(30, 20, 35, 0.9);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,0.08);
}

.emoji-option {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: transform 0.2s var(--ease-spring), background 0.15s;
}

.emoji-option:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.2);
}

.emoji-option:active { transform: scale(0.9); }

/* Floating emoji animations */
.vote-hint {
  position: absolute;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 30;
  white-space: nowrap;
  animation: hintFade 3.5s ease-out forwards;
}

@keyframes hintFade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

.floating-emojis {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 40;
}

.floating-emoji {
  position: absolute;
  font-size: 2rem;
  animation: floatUp 1.2s var(--ease-out) forwards;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translateY(-200px) scale(1.5) rotate(20deg); }
}

/* ===== VOTE DONE ===== */
#screen-vote-done {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.vote-done-content {
  text-align: center;
  padding: 40px 20px;
  animation: fadeUp 0.5s var(--ease-out);
}

.vote-done-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-500), var(--mauve-500));
  color: white;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s var(--ease-spring) 0.1s backwards;
}

.vote-done-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.vote-done-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 32px;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== RESULTS SCREEN ===== */
.results-body {
  padding-top: 8px;
}

.winner-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  text-align: center;
  animation: fadeUp 0.5s var(--ease-out);
}

.winner-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #FFF8E1, #FFF0D4);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: #B8860B;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.winner-crown {
  font-size: 1.1rem;
  animation: crownBounce 2s ease-in-out infinite;
}

@keyframes crownBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.winner-photo-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}

.winner-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.winner-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  border: 3px solid rgba(232, 82, 122, 0.2);
  pointer-events: none;
}

.winner-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.winner-votes {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rose-500);
}

.winner-reactions {
  display: flex;
  gap: 4px;
}

.winner-reactions span {
  font-size: 1.1rem;
}

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.result-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: fadeUp 0.4s var(--ease-out) backwards;
}

.result-item:nth-child(1) { animation-delay: 0.05s; }
.result-item:nth-child(2) { animation-delay: 0.1s; }
.result-item:nth-child(3) { animation-delay: 0.15s; }
.result-item:nth-child(4) { animation-delay: 0.2s; }

.result-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.result-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.result-votes {
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.result-reactions {
  display: flex;
  gap: 2px;
  font-size: 0.85rem;
}

.result-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-item.winner .result-rank {
  background: linear-gradient(135deg, var(--rose-500), var(--mauve-500));
}

/* Voters list */
.voters-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 20px;
}

.voter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.voter-row img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.voter-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.voter-picks {
  display: flex;
  gap: 4px;
}

.voter-pick-thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid var(--rose-200);
}

/* ===== ROUND DETAIL (CREATOR VIEW) ===== */
.detail-body {
  padding-top: 8px;
}

.detail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #ECFDF5;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  color: #059669;
  margin-bottom: 24px;
  width: fit-content;
}

.detail-tally {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.tally-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tally-photo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.tally-info { flex: 1; }

.tally-votes {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rose-500);
}

.tally-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tally-bar {
  height: 4px;
  background: var(--rose-100);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.tally-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose-400), var(--mauve-400));
  border-radius: 2px;
  transition: width 0.6s var(--ease-out);
}

/* Participation list */
.participation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.participant-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.participant-row img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.participant-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.participant-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.participant-status.voted {
  background: var(--rose-50);
  color: var(--rose-500);
}

.participant-status.pending {
  background: var(--mauve-50);
  color: var(--text-muted);
}

.detail-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ===== LOADING PLACEHOLDER ===== */
.loading-placeholder {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: all 0.3s var(--ease-out);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== HEART BURST ANIMATION ===== */
.heart-burst {
  position: fixed;
  pointer-events: none;
  z-index: 60;
}

.heart-particle {
  position: absolute;
  font-size: 1.2rem;
  animation: heartPop 0.8s var(--ease-out) forwards;
}

@keyframes heartPop {
  0% { opacity: 1; transform: translate(0, 0) scale(0.5); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1.2); }
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  #app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 60px rgba(139, 92, 168, 0.06);
  }
}

/* ===== CONFETTI ===== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 55;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  animation: confettiFall 4s ease-in forwards;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(-20px) rotate(0deg) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg) scale(0.6); }
}

/* ===== LOADING SCREEN ===== */
#screen-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-content {
  text-align: center;
  animation: fadeUp 0.5s var(--ease-out);
}

.loading-logo {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
  animation: sparkle 1.5s ease-in-out infinite;
}

.loading-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

/* ===== AUTH SCREEN ===== */
#screen-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  margin: 0 -20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.auth-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 18% 12%, rgba(254, 205, 211, 0.75) 0%, rgba(254, 205, 211, 0) 70%),
    radial-gradient(55% 40% at 88% 18%, rgba(219, 201, 230, 0.7) 0%, rgba(219, 201, 230, 0) 72%),
    radial-gradient(70% 60% at 50% 100%, rgba(255, 228, 230, 0.85) 0%, rgba(255, 228, 230, 0) 75%),
    linear-gradient(180deg, var(--bg-warm) 0%, var(--bg) 55%, #FBEFE8 100%);
}

.auth-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.18 0 0 0 0 0.12 0 0 0 0 0.17 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.11;
  mix-blend-mode: multiply;
}

.auth-container {
  width: 100%;
  max-width: 360px;
  text-align: center;
  padding: 28px 0 24px;
  position: relative;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-logo .logo-icon {
  font-size: 1.5rem;
  color: var(--rose-500);
  filter: drop-shadow(0 2px 8px rgba(232, 82, 122, 0.35));
}
.auth-logo .logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.auth-step {
  display: none;
  animation: fadeUp 0.5s var(--ease-out);
}

.auth-step.active { display: block; }

/* Hero polaroid stack */
.auth-hero {
  position: relative;
  width: 100%;
  height: 168px;
  margin: 8px 0 22px;
  pointer-events: none;
}

.auth-polaroid {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 116px;
  padding: 8px 8px 22px;
  background: #FFFDFB;
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(45, 31, 43, 0.04),
    0 10px 28px rgba(139, 92, 168, 0.18),
    0 2px 6px rgba(45, 31, 43, 0.06);
  transform-origin: center center;
}

.auth-polaroid__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--rose-200), var(--mauve-200));
  position: relative;
  overflow: hidden;
}

.auth-polaroid__img::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(255,255,255,0.25), transparent 60%);
}

.auth-polaroid__img--a {
  background: linear-gradient(140deg, #FDA4AF 0%, #E8527A 60%, #8B5CA8 100%);
}
.auth-polaroid__img--b {
  background: linear-gradient(150deg, #FAF0EB 0%, #FDA4AF 50%, #C4A6D4 100%);
}
.auth-polaroid__img--c {
  background: linear-gradient(160deg, #FFE4E6 0%, #E8527A 55%, #BE123C 100%);
}

.auth-polaroid__chip {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FFFDFB;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: var(--rose-500);
  box-shadow: 0 4px 14px rgba(232, 82, 122, 0.25), 0 1px 0 rgba(0,0,0,0.04);
  font-family: var(--font-display);
}

.auth-polaroid__chip--heart { color: #E8527A; font-size: 0.95rem; }
.auth-polaroid__chip--check { color: var(--mauve-500); font-weight: 700; }

.auth-polaroid--back {
  transform: translate(-50%, -50%) rotate(-11deg) translateX(-58px) translateY(6px);
  animation: polaroid-float-a 7s var(--ease-out) infinite;
}
.auth-polaroid--mid {
  transform: translate(-50%, -50%) rotate(4deg) translateY(-8px);
  z-index: 2;
  animation: polaroid-float-b 8s var(--ease-out) infinite;
}
.auth-polaroid--front {
  transform: translate(-50%, -50%) rotate(-3deg) translateX(58px) translateY(4px);
  z-index: 1;
  animation: polaroid-float-c 9s var(--ease-out) infinite;
}

@keyframes polaroid-float-a {
  0%, 100% { transform: translate(-50%, -50%) rotate(-11deg) translateX(-58px) translateY(6px); }
  50%      { transform: translate(-50%, -50%) rotate(-12.5deg) translateX(-60px) translateY(2px); }
}
@keyframes polaroid-float-b {
  0%, 100% { transform: translate(-50%, -50%) rotate(4deg) translateY(-8px); }
  50%      { transform: translate(-50%, -50%) rotate(3deg) translateY(-13px); }
}
@keyframes polaroid-float-c {
  0%, 100% { transform: translate(-50%, -50%) rotate(-3deg) translateX(58px) translateY(4px); }
  50%      { transform: translate(-50%, -50%) rotate(-1.5deg) translateX(60px) translateY(0); }
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.08;
  margin: 0 auto 12px;
  letter-spacing: -0.025em;
  color: var(--text);
  max-width: 11ch;
}

.auth-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--rose-500);
  background: linear-gradient(90deg, var(--rose-500), var(--mauve-500));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 0 auto 20px;
  line-height: 1.55;
  max-width: 30ch;
}

.auth-features {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex-wrap: nowrap;
}

.auth-feature {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 253, 251, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.auth-feature__num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-500), var(--mauve-500));
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.auth-feature--sep {
  padding: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.phone-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 20px;
  height: 52px;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s;
}

.phone-input-wrap:focus-within { border-color: var(--rose-300); }

#auth-step-phone .phone-input-wrap {
  height: 58px;
  box-shadow: 0 6px 22px rgba(139, 92, 168, 0.08), inset 0 1px 0 rgba(255,255,255,0.6);
}
#auth-step-phone .phone-input-wrap:focus-within {
  border-color: var(--rose-400);
  box-shadow:
    0 8px 28px rgba(232, 82, 122, 0.14),
    0 0 0 4px rgba(232, 82, 122, 0.1),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

.phone-prefix {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 8px;
  flex-shrink: 0;
}

.country-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 8px 0 0;
  margin-right: 4px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  padding-right: 16px;
}

.phone-input-wrap input {
  flex: 1;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.phone-input-wrap input::placeholder { color: var(--text-muted); }

.auth-text-input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 20px;
  height: 52px;
  font-size: 1.05rem;
  color: var(--text);
  text-align: center;
  transition: border-color 0.2s;
  margin-bottom: 16px;
}

.auth-text-input:focus { border-color: var(--rose-300); }
.auth-text-input::placeholder { color: var(--text-muted); }

.auth-btn {
  width: 100%;
  margin-bottom: 16px;
}

.auth-legal {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 260px;
  margin: 4px auto 0;
  letter-spacing: 0.01em;
}

.auth-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 280px;
  margin: -4px auto 10px;
  font-weight: 500;
}

#screen-auth .btn-glow {
  animation: glow-breathe 3.6s ease-in-out infinite;
}

@keyframes glow-breathe {
  0%, 100% { box-shadow: 0 4px 24px rgba(232, 82, 122, 0.22); }
  50%      { box-shadow: 0 8px 36px rgba(232, 82, 122, 0.42); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-polaroid--back,
  .auth-polaroid--mid,
  .auth-polaroid--front { animation: none; }
  #screen-auth .btn-glow { animation: none; }
}

.auth-link {
  color: var(--rose-500);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
  transition: opacity 0.2s;
}

.auth-link:hover { opacity: 0.7; }

/* Onboarding friends step */
.onboard-search-result {
  min-height: 0;
  transition: all 0.3s;
}

.onboard-search-result .search-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  margin-bottom: 12px;
  animation: slideUp 0.3s ease;
}

.onboard-search-result .search-result-card img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.onboard-search-result .search-result-card .result-info {
  flex: 1;
}

.onboard-search-result .search-result-card .result-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.onboard-search-result .search-result-card .result-phone {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.onboard-search-result .not-found {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.onboard-added-friends {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.onboard-added-friends .added-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--rose-50);
  border: 1px solid var(--rose-200);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rose-600);
  animation: slideUp 0.3s ease;
}

.onboard-added-friends .added-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.btn-add-friend-sm {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--rose-500);
  color: white;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-friend-sm:hover { background: var(--rose-600); }
.btn-add-friend-sm:disabled {
  background: var(--border);
  cursor: default;
}

.btn-sent {
  background: var(--border) !important;
  color: var(--text-muted) !important;
  cursor: default !important;
}

.btn-add-new-friend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: none;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--rose-500);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-new-friend:hover {
  border-color: var(--rose-300);
  background: var(--rose-50);
}

.inline-add-friend {
  margin-top: 12px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
}

.sent-status {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--rose-50);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.btn-invite-sms {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--rose-500);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-invite-sms:hover {
  background: var(--rose-600);
  transform: scale(1.02);
}

.invite-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

.btn-invite-copy {
  display: inline-block;
  padding: 10px 24px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-invite-copy:hover {
  border-color: var(--rose-300);
  background: var(--rose-50);
}

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* OTP inputs */
.otp-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.otp-digit {
  width: 46px;
  height: 56px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: var(--rose-500);
}

.otp-digit:focus {
  border-color: var(--rose-400);
  box-shadow: 0 0 0 3px rgba(232, 82, 122, 0.1);
  outline: none;
}

.otp-dash {
  width: 12px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ===== TOP BAR ACTIONS ===== */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-spring);
}

.icon-btn:hover {
  background: var(--rose-50);
  color: var(--rose-500);
}

.icon-btn:active { transform: scale(0.9); }

.friend-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--rose-500);
  border-radius: 50%;
  border: 2px solid var(--bg);
  animation: pulse-badge 2s ease infinite;
}

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

/* ===== FRIENDS SCREEN ===== */
.friends-body {
  padding-top: 8px;
}

.add-friend-section {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.add-friend-section .step-title {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.add-friend-section .step-desc {
  margin-bottom: 16px;
}

.add-friend-section .btn-primary {
  width: 100%;
}

.search-result {
  margin-top: 16px;
  padding: 14px;
  background: var(--rose-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.3s var(--ease-out);
}

.search-result img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.search-result-info {
  flex: 1;
}

.search-result-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-status {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-result .btn-primary {
  padding: 8px 16px;
  font-size: 0.85rem;
  width: auto;
}

/* Pending request accept/decline */
.friend-action-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: transform 0.2s var(--ease-spring);
}

.friend-action-btn:active { transform: scale(0.92); }

.friend-action-btn.accept {
  background: linear-gradient(135deg, var(--rose-500), var(--mauve-500));
  color: white;
}

.friend-action-btn.decline {
  background: var(--border);
  color: var(--text-muted);
}

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.6;
}

.empty-state-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}

/* ===== HOME FOOTER ===== */
.home-footer {
  text-align: center;
  padding: 32px 0 16px;
}

/* ===== LOADING SPINNER ===== */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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