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

:root {
  --bg: #ffffff;
  --surface-muted: #f6f7f9;
  --text-primary: #14171c;
  --text-secondary: #5b636e;
  --text-muted: #8b93a0;
  --border-hairline: #eef0f3;
  --border-light: #f2f3f6;
  --border-input: #e2e5ea;
  --border-checkbox: #cfd4dc;
  --accent: #2563eb;
  --accent-tint: #eaf1ff;
  --live: #16a34a;
  --danger: #dc2626;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Sticky header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 14px 24px 18px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 480px;
  margin: 0 auto;
}

.header-left .venue-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.header-left .venue-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 4px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22,163,74,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

.live-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--live);
}

/* ── Hero headcount ── */
.hero-headcount {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-top: 24px;
}

.hero-number {
  font-size: 64px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.hero-caption {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* ── Section header ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-hairline);
  margin-bottom: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.section-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ── Filter dropdown ── */
.filter-menu {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-menu.open {
  display: flex;
}

.filter-pill {
  padding: 6px 14px;
  border: 1px solid var(--border-input);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg);
  color: var(--text-muted);
  transition: all 0.15s;
}

.filter-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

/* ── Player list ── */
.player-list {
  list-style: none;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-light);
}

.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f2f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

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

.player-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.player-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.badge-seeking {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-tint);
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}

.player-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.player-time {
  text-align: right;
  flex-shrink: 0;
}

.player-checkin-time {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.player-time-left {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

.empty-state a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

/* ── Status messages ── */
.status {
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}

.status.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  display: block;
}

.status.success {
  background: #f0fdf4;
  color: var(--live);
  border: 1px solid #bbf7d0;
  display: block;
}

.status.info {
  background: var(--accent-tint);
  color: var(--accent);
  border: 1px solid #bfdbfe;
  display: block;
}

/* ── Dashboard bottom link ── */
.bottom-link {
  display: block;
  text-align: center;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 20px 0 32px;
}

/* ===========================
   CHECK-IN PAGE
   =========================== */

.checkin-body {
  padding-top: 16px;
  padding-bottom: 40px;
}

/* Geofence note */
.geo-note {
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 22px;
  line-height: 1.4;
}

.geo-note.geo-error {
  background: #fef2f2;
  color: var(--danger);
}

/* Form field */
.field {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 9px;
}

.field-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border-input);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
  background: var(--bg);
}

.field-input:focus {
  border-color: var(--accent);
}

.field-input:disabled {
  background: var(--surface-muted);
  color: var(--text-muted);
}

/* Anonymous checkbox */
.anon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.anon-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-checkbox);
  border-radius: 5px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  background: var(--bg);
}

.anon-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.anon-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.anon-label {
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Chip group */
.chip-group {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.chip-group input[type="radio"],
.chip-group input[type="checkbox"] {
  display: none;
}

.chip {
  flex: 1;
  text-align: center;
  padding: 11px 0;
  border-radius: 10px;
  border: 1px solid var(--border-input);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
}

.chip-group input:checked + .chip {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-color: var(--accent);
}

/* Toggle switch (seeking partner) */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.toggle-label {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-checkbox);
  border-radius: 999px;
  transition: background 0.18s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s;
}

.toggle-track input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-track input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* Submit button */
.btn-submit {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  transition: opacity 0.15s;
}

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

.btn-checkout {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--danger);
  color: #fff;
  font-family: inherit;
  margin-top: 16px;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

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

/* Checked-in confirmation */
.checked-in-view {
  text-align: center;
  padding: 32px 0 0;
}

.checked-in-view .confirm-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.checked-in-view h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.checked-in-view p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.checked-in-view .expires-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ── Responsive ── */
@media (max-width: 360px) {
  .chip {
    font-size: 12.5px;
    padding: 10px 0;
  }
}
