:root {
  --bg: #1a1a2e;
  --card: #252542;
  --accent: #e94560;
  --accent-green: #4ade80;
  --text-muted: #a0a0b8;
  --text-dim: #6b6b8a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #fff;
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(26,26,46,0.88), rgba(26,26,46,0.94)),
    url('darts-x-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 12px;
}

.logo { font-size: 22px; font-weight: 700; }

nav { display: flex; gap: 8px; flex-wrap: wrap; }

.navbtn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.navbtn.active, .navbtn:hover { background: var(--card); color: #fff; }
.hidden { display: none !important; }

main { max-width: 900px; margin: 0 auto; padding: 24px; }

.view { display: none; }
.view.active { display: block; }

.hero { text-align: center; padding: 60px 16px 40px; }
.hero h1 { font-size: 40px; margin-bottom: 12px; }
.subtitle { color: var(--text-muted); font-size: 17px; max-width: 560px; margin: 0 auto 32px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn-primary, .btn-secondary, .btn-subscribe, .btn-logout {
  padding: 14px 28px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--card); color: #fff; }
.btn-subscribe { background: var(--accent-green); color: #0f2919; }
.btn-logout { background: transparent; color: var(--accent); }
.full { width: 100%; margin-top: 12px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.feature-card { background: rgba(37,37,66,0.85); border-radius: 14px; padding: 24px; text-align: center; backdrop-filter: blur(4px); }
.feature-icon { font-size: 32px; margin-bottom: 8px; }
.feature-card h3 { margin: 8px 0; }
.feature-card p { color: var(--text-muted); font-size: 14px; }

.explainer { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1;
  background: var(--card);
  border: none;
  color: var(--text-muted);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.tab.active { background: var(--accent); color: #fff; }

.location-pickers { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
select {
  background: var(--card);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  flex: 1;
  min-width: 180px;
}

.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th {
  text-align: left;
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  padding: 8px 12px;
}
.leaderboard-table td {
  background: var(--card);
  padding: 14px 12px;
}
.leaderboard-table tr td:first-child { border-radius: 10px 0 0 10px; color: var(--text-muted); font-weight: 700; }
.leaderboard-table tr td:last-child { border-radius: 0 10px 10px 0; color: var(--accent-green); font-weight: 700; }
.leaderboard-table tr { margin-bottom: 8px; }
.leaderboard-table tbody tr { display: table-row; }
.leaderboard-table tbody { display: table-row-group; }
.empty-row { text-align: center; color: var(--text-dim); border-radius: 10px; }

.auth-card {
  max-width: 380px;
  margin: 40px auto;
  background: rgba(37,37,66,0.9);
  padding: 32px;
  border-radius: 16px;
  text-align: center;
  backdrop-filter: blur(4px);
}
.auth-card input, .auth-card select {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: none;
  background: #1a1a2e;
  color: #fff;
  font-size: 15px;
}
.switch-link { color: var(--text-muted); font-size: 14px; margin-top: 16px; }
.switch-link a { color: var(--accent); cursor: pointer; text-decoration: underline; }
.error-text { color: var(--accent); font-size: 13px; min-height: 18px; }

.avatar {
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--accent);
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
}
.profile-email { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }

footer { text-align: center; padding: 32px; color: var(--text-dim); font-size: 13px; }
footer a { color: var(--text-muted); }

.pub-qr-image {
  width: 220px;
  height: 220px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin: 16px auto;
  display: block;
}

.auth-card.wide { max-width: 480px; }
.scan-label { color: #a0a0b8; font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
.qr-reader { width: 100%; border-radius: 12px; overflow: hidden; }
.success-text { color: var(--accent-green); font-size: 14px; min-height: 18px; }

.leg-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.leg-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg); border: none; color: var(--text-muted);
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.leg-btn.active { background: var(--accent); color: #fff; }
.pub-name-heading { color: var(--accent-green); font-size: 18px; margin-bottom: 4px; }
