:root {
  --bg: #f5f5f7;
  --bg-alt: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.84);
  --surface-soft: rgba(255, 255, 255, 0.56);
  --stroke: rgba(255, 255, 255, 0.65);
  --stroke-soft: rgba(255, 255, 255, 0.4);
  --ink: #1f2937;
  --ink-soft: #5f6b7a;
  --ink-faint: #8c97a8;
  --blue: #0a84ff;
  --blue-soft: rgba(10, 132, 255, 0.12);
  --green: #34c759;
  --orange: #ff9f0a;
  --red: #ff6b6b;
  --shadow-lg: 0 24px 60px rgba(31, 41, 55, 0.12);
  --shadow-md: 0 18px 40px rgba(31, 41, 55, 0.08);
  --shadow-sm: 0 10px 26px rgba(31, 41, 55, 0.06);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --space-6: 32px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", sans-serif;
}

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

html {
  background: var(--bg);
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(139, 198, 255, 0.18), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(255, 214, 153, 0.18), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(189, 220, 255, 0.14), transparent 22%),
    linear-gradient(180deg, #fbfbfc 0%, #f3f4f7 100%);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.7;
  pointer-events: none;
}

.ambient-one {
  top: -90px;
  left: -60px;
  width: 220px;
  height: 220px;
  background: rgba(10, 132, 255, 0.12);
}

.ambient-two {
  top: 220px;
  right: -60px;
  width: 180px;
  height: 180px;
  background: rgba(255, 176, 102, 0.14);
}

.ambient-three {
  bottom: -60px;
  left: 24%;
  width: 220px;
  height: 160px;
  background: rgba(141, 197, 255, 0.1);
}

.glass-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.58));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
}

.gate-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: 20;
  background: rgba(245, 245, 247, 0.66);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.gate-card {
  width: min(100%, 380px);
  padding: var(--space-6);
  text-align: center;
}

.gate-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-4);
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72));
  color: var(--blue);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), var(--shadow-sm);
}

.gate-card h1,
.app-title,
h2 {
  letter-spacing: -0.04em;
}

.gate-card h1 {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.gate-card p {
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: var(--space-5);
}

.btn-primary,
.btn-ghost,
.status-chip,
.location-pill,
.suggestion-action,
.match-close {
  appearance: none;
  border: none;
  font: inherit;
  cursor: pointer;
  transition: transform 240ms ease, box-shadow 240ms ease, background-color 240ms ease, opacity 240ms ease;
}

.btn-primary {
  width: 100%;
  padding: 16px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.96), rgba(0, 122, 255, 0.92));
  color: white;
  font-weight: 700;
  box-shadow: 0 18px 30px rgba(10, 132, 255, 0.22);
}

.btn-ghost {
  width: 100%;
  margin-top: 12px;
  padding: 14px 20px;
  border-radius: 18px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--stroke-soft);
}

.btn-primary:hover,
.btn-ghost:hover,
.status-chip:hover,
.location-pill:hover,
.suggestion-action:hover,
.match-close:hover {
  transform: scale(1.02);
}

.btn-primary:active,
.btn-ghost:active,
.status-chip:active,
.location-pill:active,
.suggestion-action:active,
.match-close:active {
  transform: scale(0.985);
}

.app-container {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 16px 20px;
}

.app-header,
.card-chrome,
.hero-grid,
.group-progress,
.eta-strip,
.status-grid,
.suggestion-top,
.suggestion-meta-row,
.member-slot,
.match-member {
  display: flex;
}

.app-header,
.card-chrome,
.suggestion-top,
.suggestion-meta-row {
  justify-content: space-between;
  align-items: center;
}

.app-header {
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

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

.app-label,
.section-label,
.meta-label,
.member-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-label,
.section-label,
.meta-label {
  color: var(--ink-faint);
}

.app-title {
  font-size: clamp(2rem, 8vw, 2.8rem);
  line-height: 0.96;
}

.app-subtitle,
.hero-meta,
.status-note,
.suggestions-meta,
.member-eta,
.empty-state,
.match-instruction,
.app-footer a {
  color: var(--ink-soft);
}

.app-subtitle {
  max-width: 26ch;
  line-height: 1.45;
}

.location-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.location-pill.off {
  color: var(--red);
}

.screen-stack {
  display: grid;
  gap: var(--space-4);
}

.hero-card,
.status-card,
.suggestions-card {
  padding: var(--space-5);
}

.hero-card {
  display: grid;
  gap: var(--space-4);
}

.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.confidence-high {
  color: #237b43;
  background: rgba(52, 199, 89, 0.16);
}

.confidence-medium {
  color: #a56600;
  background: rgba(255, 159, 10, 0.14);
}

.confidence-low {
  color: #b34545;
  background: rgba(255, 107, 107, 0.14);
}

.hero-grid {
  gap: var(--space-4);
}

.hero-grid > * {
  flex: 1;
}

.hero-kicker {
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.group-progress {
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

#group-progress-text {
  font-size: 2.8rem;
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.group-progress-copy {
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.hero-meta {
  max-width: 30ch;
  line-height: 1.45;
}

.countdown-shell {
  display: grid;
  place-items: center;
}

.countdown-ring {
  width: 132px;
  height: 132px;
  padding: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.68)),
    linear-gradient(180deg, rgba(10, 132, 255, 0.18), rgba(10, 132, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), var(--shadow-md);
}

.countdown-label {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

#countdown-value {
  font-size: 1.95rem;
  letter-spacing: -0.05em;
}

.eta-strip {
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.46));
  border: 1px solid var(--stroke-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.eta-value {
  margin-top: 6px;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.eta-value strong {
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.eta-distance {
  text-align: right;
}

.group-members,
.status-grid,
.suggestion-list {
  display: grid;
}

.group-members {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.member-slot {
  flex-direction: column;
  gap: 8px;
  min-height: 128px;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.5));
  border: 1px solid var(--stroke-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.member-slot-self {
  background: linear-gradient(180deg, rgba(237, 246, 255, 0.92), rgba(255, 255, 255, 0.56));
}

.member-slot.is-empty {
  opacity: 0.78;
}

.member-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.status-card h2,
.suggestions-card h2 {
  margin-top: 4px;
  font-size: 1.45rem;
}

.status-note {
  font-size: 0.88rem;
  text-align: right;
}

.status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.status-chip {
  padding: 16px 14px;
  border-radius: 18px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.54));
  border: 1px solid var(--stroke-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  font-weight: 600;
}

.status-chip.is-active {
  color: var(--blue);
  background: linear-gradient(180deg, rgba(237, 246, 255, 0.96), rgba(225, 241, 255, 0.68));
  border-color: rgba(10, 132, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 12px 22px rgba(10, 132, 255, 0.12);
}

.suggestions-card {
  display: grid;
  gap: var(--space-4);
}

.suggestions-meta {
  font-size: 0.92rem;
  max-width: 20ch;
  text-align: right;
}

.suggestion-list {
  gap: var(--space-3);
}

.suggestion-card {
  padding: 18px 18px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.54));
  border: 1px solid var(--stroke-soft);
  box-shadow: var(--shadow-sm);
}

.suggestion-card:nth-child(2) {
  transform: scale(0.985);
}

.suggestion-card:nth-child(3) {
  transform: scale(0.97);
}

.suggestion-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.suggestion-quality {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.quality-high {
  color: #237b43;
  background: rgba(52, 199, 89, 0.14);
}

.quality-medium {
  color: #a56600;
  background: rgba(255, 159, 10, 0.14);
}

.quality-low {
  color: #b34545;
  background: rgba(255, 107, 107, 0.14);
}

.suggestion-meta-row {
  margin-top: 16px;
  gap: var(--space-3);
}

.suggestion-stat {
  flex: 1;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.48);
}

.suggestion-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
}

.suggestion-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.suggestion-action {
  flex: 1;
  padding: 13px 14px;
  border-radius: 16px;
  font-size: 0.94rem;
  font-weight: 600;
}

.suggestion-action.primary {
  color: white;
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.94), rgba(0, 122, 255, 0.88));
  box-shadow: 0 14px 26px rgba(10, 132, 255, 0.18);
}

.suggestion-action.secondary {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--stroke-soft);
}

.empty-state {
  padding: 26px 12px 10px;
  text-align: center;
  line-height: 1.5;
}

.empty-icon {
  margin-bottom: 10px;
  font-size: 1.6rem;
  color: var(--ink-faint);
  letter-spacing: 0.24em;
}

.match-status {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: rgba(245, 245, 247, 0.5);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.match-card {
  width: min(100%, 400px);
  padding: var(--space-6);
}

.match-label {
  margin-bottom: 16px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.match-member {
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 0;
  border-bottom: 1px solid rgba(140, 151, 168, 0.18);
}

.match-price {
  margin-top: 18px;
  color: var(--blue);
  font-weight: 600;
}

.match-instruction {
  margin-top: 8px;
  line-height: 1.5;
}

.match-close {
  margin-top: 22px;
}

.app-footer {
  padding: 20px 0 12px;
  text-align: center;
}

.app-footer a {
  text-decoration: none;
}

@media (max-width: 420px) {
  .hero-card,
  .status-card,
  .suggestions-card,
  .gate-card,
  .match-card {
    padding: 20px;
  }

  .app-container {
    padding-inline: 12px;
  }

  .hero-grid,
  .card-chrome,
  .app-header,
  .suggestion-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .countdown-shell {
    width: 100%;
    justify-content: flex-start;
  }

  .eta-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .eta-distance,
  .status-note,
  .suggestions-meta {
    text-align: left;
  }

  .group-members {
    grid-template-columns: 1fr;
  }
}
