/* === Dev Environment Banner === */
#env-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #f59e0b;
  color: #000;
  text-align: center;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
#env-banner ~ .screen { padding-top: 28px; }

/* === Invite Banner === */
.invite-banner {
  text-align: center;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.invite-line {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--text);
}
.invite-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.invite-count {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 6px;
}

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

:root {
  --primary: #ff6b35;
  --primary-dark: #e55a2b;
  --primary-light: #ff8c5e;
  --primary-bg: #fff7f3;
  --green: #22c55e;
  --green-dark: #16a34a;
  --red: #ef4444;
  --red-dark: #dc2626;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
  --shadow-xl: 0 20px 40px -4px rgba(0,0,0,0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

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

/* === Screens === */
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

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

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 48px;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--text);
  color: white;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: #000;
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-xs);
}

.btn-primary:disabled {
  background: var(--border);
  color: var(--text-tertiary);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: 12px;
  width: 100%;
  min-height: 50px;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 14px;
  background: var(--text);
  color: white;
  min-height: 44px;
  border-radius: var(--radius-xs);
}

.btn-sm:hover {
  background: #000;
}

/* === Landing === */
.landing-container {
  text-align: center;
  max-width: 420px;
  width: 100%;
  margin-top: 3vh;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 40px);
  min-height: calc(100dvh - 40px);
}

.logo-icon {
  font-size: 44px;
  display: block;
  margin-bottom: 2px;
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

.tagline {
  color: var(--text-secondary);
  margin-top: 2px;
  font-size: 14px;
  letter-spacing: -0.01em;
}

/* How it works */
.how-it-works {
  margin-top: 20px;
  text-align: left;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border-light);
}

.how-it-works h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  text-align: center;
  font-weight: 600;
}

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

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

.step-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.step-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.step-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.step-text span {
  font-size: 11px;
  color: var(--text-secondary);
}

.landing-actions {
  margin-top: 20px;
}

.name-input-landing {
  margin-bottom: 16px;
}

.name-input-landing label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.name-input-landing input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--bg);
  transition: border-color 0.2s;
}

.name-input-landing input:focus {
  outline: none;
  border-color: var(--primary);
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.join-hint {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 6px;
}

.app-footer {
  margin-top: auto;
  padding-top: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.6;
  text-align: center;
}

/* === Join Code Input === */
.join-code-box {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.join-code-box input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 16px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  min-height: 48px;
}

.join-code-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.join-code-box .btn {
  flex-shrink: 0;
  padding: 12px 20px;
}

/* === Logo Mark (Landing) === */
.logo-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

/* === Screen Header (all inner screens) === */
.screen-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.screen-brand-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  cursor: pointer;
}

.brand-icon {
  flex-shrink: 0;
  border-radius: 5px;
}

.header-code {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.header-code:empty {
  display: none;
}

.header-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}

.header-share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

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

/* === Lobby === */
.lobby-container {
  max-width: 500px;
  width: 100%;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 40px);
  min-height: calc(100dvh - 40px);
}

.lobby-container h2 {
  font-size: 22px;
  margin-bottom: 14px;
}

/* Session code display */
.session-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--primary-bg);
  border: 1px solid rgba(255, 107, 53, 0.15);
  border-radius: var(--radius);
  padding: 16px 16px;
  margin-bottom: 12px;
  text-align: center;
}

.session-code-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.session-code {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.session-code-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.share-link-box {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.share-link-box label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.link-copy {
  display: flex;
  gap: 8px;
}

.link-copy input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 13px;
  background: var(--bg);
  min-width: 0;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.btn-share-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

.share-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform 0.15s;
}

.share-icon-copy { background: var(--primary); }
.share-icon-wa { background: #25d366; }
.share-icon-sms { background: #2196f3; }
.share-icon-more { background: #78909c; }

.share-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: inherit;
}

.participants-box {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.participants-box h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

#participant-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
}

#participant-list li {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

#participant-list li:last-child {
  border-bottom: none;
}

.participant-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.host-badge {
  background: var(--text);
  color: white;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-left: auto;
  text-transform: uppercase;
}

.you-badge {
  color: var(--primary);
  font-weight: 600;
  font-size: 12px;
}

.dc-badge {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}

.host-controls {
  margin-top: 8px;
}

.start-hint {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.host-controls #btn-start-session {
  width: 100%;
  margin-bottom: 12px;
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 700;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255, 107, 53, 0); }
}

.host-settings {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.guest-waiting {
  text-align: center;
  padding: 24px;
}

.hidden {
  display: none !important;
}

/* === Spinner === */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 16px auto;
}

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

/* === Preferences === */
.preferences-container {
  max-width: 600px;
  width: 100%;
  margin-top: 12px;
  padding-bottom: 40px;
}

.preferences-container h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group > label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.hint {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 13px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 16px;
  background: var(--surface);
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.datetime-row {
  display: flex;
  gap: 12px;
}

.datetime-row input {
  flex: 1;
}

/* Cuisine grid */
.cuisine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.cuisine-chip {
  padding: 12px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background: var(--surface);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cuisine-chip:hover {
  border-color: var(--text-tertiary);
}

.cuisine-chip:active {
  transform: scale(0.96);
}

.cuisine-chip.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 600;
}

/* City search with autocomplete */
.city-search-box {
  position: relative;
  margin-bottom: 10px;
}

.city-search-box input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 15px;
  min-height: 48px;
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.city-search-box input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.city-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  max-height: 220px;
  overflow-y: auto;
}

.city-suggestions.visible {
  display: block;
}

.city-suggestion {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.city-suggestion:last-child {
  border-bottom: none;
}

.city-suggestion:hover,
.city-suggestion:active {
  background: var(--primary-bg);
}

.city-suggestion-icon {
  color: var(--text-tertiary);
  font-size: 16px;
  flex-shrink: 0;
}

.city-suggestion-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.city-suggestion-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.city-suggestion-detail {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Map section — hidden until location is set */
.map-section {
  transition: opacity 0.3s ease, max-height 0.4s ease;
}

/* Map */
.pref-map {
  width: 100%;
  height: 350px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

/* map loading overlay removed — map renders immediately with tiles */

.radius-control {
  margin-top: 12px;
}

.radius-control label {
  font-size: 14px;
  color: var(--text-secondary);
}

.radius-control input[type="range"] {
  width: 100%;
  margin-top: 6px;
  accent-color: var(--primary);
  height: 6px;
}

/* === Waiting === */
.waiting-container {
  max-width: 500px;
  width: 100%;
  margin-top: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 40px);
  min-height: calc(100dvh - 40px);
}

.waiting-container h2 {
  margin-bottom: 24px;
}

.progress-list {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}

.progress-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.progress-item:last-child {
  border-bottom: none;
}

.progress-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.progress-check.done {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

/* === Swipe === */
.swipe-container {
  max-width: 420px;
  width: 100%;
  margin-top: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.swipe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 4px;
  gap: 12px;
}

/* .swipe-brand replaced by .screen-brand-inline */

.green { color: var(--green); font-weight: 700; }
.red { color: var(--red); font-weight: 700; }

.card-stack {
  position: relative;
  width: 100%;
  height: 420px;
  margin-bottom: 12px;
}

.swipe-card {
  width: 100%;
  height: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  position: relative;
  border: 1px solid var(--border-light);
  -webkit-overflow-scrolling: touch;
}

.swipe-card.swipe-left {
  transform: translateX(-120%) rotate(-15deg);
  opacity: 0;
}

.swipe-card.swipe-right {
  transform: translateX(120%) rotate(15deg);
  opacity: 0;
}

.card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  position: relative;
  overflow: hidden;
}

.card-emoji-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 28px;
  background: rgba(255,255,255,0.9);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-info {
  padding: 16px 20px 20px;
  text-align: left;
}

.card-info h3 {
  font-size: 19px;
  margin-bottom: 6px;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
}

.card-rating {
  color: #f59e0b;
  font-weight: 600;
}

.card-rating-count {
  color: var(--text-secondary);
}

.card-price {
  color: var(--green-dark);
  font-weight: 600;
}

.card-open-badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.card-open-badge.open {
  background: #dcfce7;
  color: var(--green-dark);
}

.card-open-badge.closed {
  background: #fee2e2;
  color: var(--red-dark);
}

.card-cuisine {
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.card-address {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 4px;
  line-height: 1.4;
}

.card-hours {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 4px;
}

.card-phone {
  font-size: 14px;
  margin-bottom: 4px;
}

.card-phone a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.card-phone a:hover {
  text-decoration: underline;
}

.card-distance {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.card-links {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.card-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg);
}

.card-link:active {
  transform: scale(0.95);
}

.card-link-maps {
  color: var(--green-dark);
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.card-link-reviews {
  color: #b45309;
  border-color: #fed7aa;
  background: #fffbeb;
}

.card-link-website {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.swipe-progress {
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.progress-bar-track {
  width: 100%;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.swipe-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: var(--safe-bottom);
  width: 100%;
}

.btn-swipe {
  flex: 1;
  max-width: 160px;
  height: 56px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-size: 28px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: var(--shadow);
}

.btn-swipe:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-xs);
}

.btn-swipe-yes {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.btn-swipe-yes:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  box-shadow: var(--shadow-md);
}

.btn-swipe-no {
  background: var(--surface);
  border-color: var(--border);
  color: var(--red);
}

.btn-swipe-no:hover {
  background: #fef2f2;
  border-color: var(--red);
  box-shadow: var(--shadow-md);
}

.no-more-cards {
  padding: 40px 20px;
  color: var(--text-secondary);
}

/* === Waiting for Others === */
.waiting-area {
  padding: 20px 0;
  text-align: center;
}

.waiting-area h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.waiting-participants {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.waiting-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.waiting-person-name {
  font-size: 13px;
  font-weight: 600;
  min-width: 70px;
  text-align: left;
}

.waiting-person-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.waiting-person-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.waiting-person-bar-fill.done {
  background: var(--green);
}

.waiting-person-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  min-width: 50px;
  text-align: right;
}

.waiting-person-status.done {
  color: var(--green);
}

.btn-end-early {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

/* === Results === */
.results-container {
  max-width: 700px;
  width: 100%;
  margin-top: 12px;
  padding-bottom: 40px;
}

.results-container h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

.results-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.results-map {
  width: 100%;
  height: 350px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}

.results-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), opacity 0.2s;
}

.result-card:has(input:not(:checked)) {
  opacity: 0.45;
}

/* Checkbox toggle for results */
.result-check {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  padding-top: 6px;
}

.result-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.result-checkmark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.result-check input:checked ~ .result-checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.result-check input:checked ~ .result-checkmark::after {
  content: '';
  display: block;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.result-card:first-child {
  border-color: var(--primary-light);
  background: var(--primary-bg);
}

.result-rank {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--text);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.result-card:first-child .result-rank {
  background: var(--primary);
}

.result-details h3 {
  font-size: 17px;
  margin-bottom: 6px;
  line-height: 1.3;
}

.result-details p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 3px;
  line-height: 1.4;
}

.result-votes {
  color: var(--green) !important;
  font-weight: 600;
  margin-top: 4px !important;
}

.no-match-notice {
  text-align: center;
  padding: 16px 20px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.no-match-notice p {
  font-size: 14px;
  color: #92400e;
  line-height: 1.5;
}

/* === Toast === */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: auto;
  transform: none;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: 320px;
  max-width: 90vw;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  animation: toastIn 0.3s ease forwards, toastOut 0.3s ease 2.7s forwards;
  text-align: left;
  pointer-events: auto;
  box-shadow: var(--shadow-xl);
}

.toast.error {
  background: var(--red);
}

.toast.warning {
  background: #e67e22;
}

.toast.success {
  background: var(--green-dark);
}

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

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

/* === Mobile Responsive === */
@media (max-width: 600px) {
  .toast-container {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(16px + var(--safe-bottom));
    width: 90%;
  }
  .toast { text-align: center; }

  .screen {
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-bottom));
  }

  .landing-container {
    margin-top: 2vh;
  }

  .logo-icon {
    font-size: 40px;
  }

  .logo h1 {
    font-size: 26px;
  }

  .tagline {
    font-size: 13px;
  }

  .how-it-works {
    padding: 12px 14px;
    margin-top: 16px;
  }

  .step-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .pref-map {
    height: 280px;
  }

  .results-map {
    height: 260px;
  }

  .cuisine-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .cuisine-chip {
    padding: 12px 8px;
    font-size: 13px;
  }

  .card-image {
    height: 180px;
  }

  .card-info {
    padding: 14px 16px 16px;
  }

  .card-info h3 {
    font-size: 17px;
  }

  .card-stack {
    height: 390px;
  }

  .btn-swipe {
    height: 52px;
  }

  .swipe-buttons {
    gap: 12px;
  }

  .result-card {
    padding: 16px;
    gap: 12px;
  }

  .result-rank {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .result-details h3 {
    font-size: 15px;
  }

  .lobby-container {
    margin-top: 8px;
  }

  .lobby-container h2,
  .preferences-container h2,
  .results-container h2 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .session-code-box {
    padding: 12px 14px;
  }

  .session-code {
    font-size: 32px;
  }

  .share-icon-circle {
    width: 40px;
    height: 40px;
  }

  .share-buttons {
    gap: 14px;
  }
}

@media (max-width: 380px) {
  .cuisine-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .datetime-row {
    flex-direction: column;
    gap: 10px;
  }

  .landing-container {
    margin-top: 3vh;
  }

  .btn-large {
    font-size: 16px;
    padding: 14px 24px;
  }
}

/* === Activity Feed === */
.activity-feed {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
  width: 100%;
}

.activity-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.activity-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.activity-indicator.active {
  background: var(--primary);
  animation: pulse 1.5s infinite;
}

.activity-indicator.done {
  background: var(--green);
}

.activity-indicator.waiting {
  background: var(--border);
}

.activity-status {
  color: var(--text-secondary);
  font-size: 11px;
}

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

/* === Vote Timer === */
.vote-timer {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.5px;
  padding: 2px 8px;
}

.vote-timer.timer-urgent {
  color: var(--primary);
  animation: pulse 1s infinite;
}

/* === Timer Control (Lobby) === */
.timer-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.timer-control label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.timer-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: var(--bg);
  min-height: 40px;
  appearance: auto;
}

/* === Anonymous Toggle === */
.anonymous-control {
  margin-bottom: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.toggle-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-label input:checked ~ .toggle-switch {
  background: var(--primary);
}

.toggle-label input:checked ~ .toggle-switch::after {
  transform: translateX(20px);
}

.control-hint {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* === Results Summary === */
.results-summary {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.results-summary p {
  margin: 0;
}

.non-voters {
  color: var(--red);
  font-weight: 500;
}

.result-voter-names {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  margin-top: 2px;
}

/* === Star Ratings === */
.card-rating {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.card-rating .star {
  font-size: 14px;
  line-height: 1;
}

.card-rating .star.full {
  color: #f59e0b;
}

.card-rating .star.half {
  color: #f59e0b;
  opacity: 0.6;
}

.card-rating .star.empty {
  color: #d1d5db;
}

.rating-num {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-left: 4px;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: #f3f4f6;
  color: var(--text-secondary);
}

/* === View Results / Share Results Buttons === */
.btn-view-results {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  padding: 14px 24px;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: all 0.2s;
}

.btn-view-results:hover {
  background: var(--primary);
  color: white;
}

.btn-share-results {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  padding: 12px 24px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: all 0.2s;
}

.btn-share-results:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* === Match Alert Overlay === */
.match-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: matchFadeIn 0.3s ease;
}

.match-alert-overlay.match-alert-fade {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.match-alert {
  text-align: center;
  padding: 32px 40px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: matchPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 300px;
}

.match-alert-emoji {
  font-size: 48px;
  margin-bottom: 8px;
  animation: matchBounce 0.6s ease 0.3s both;
}

.match-alert-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.match-alert-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.match-alert-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

@keyframes matchFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes matchPop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes matchBounce {
  0% { transform: scale(0.3); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* === Landscape phone adjustments === */
@media (max-height: 500px) and (orientation: landscape) {
  .landing-container {
    margin-top: 2vh;
  }

  .how-it-works {
    margin-top: 16px;
  }

  .steps {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  .step {
    flex: 1 1 45%;
  }
}
