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

:root {
  --bg-primary:     #0d0f14;
  --bg-secondary:   #141720;
  --bg-card:        #1a1e2a;
  --bg-card-hover:  #1f2435;
  --border:         #272c3d;

  --text-primary:   #e8eaf0;
  --text-secondary: #8b91a8;
  --text-muted:     #5a6080;

  --accent:         #5b8af7;
  --accent-glow:    rgba(91, 138, 247, 0.15);

  --gold:   #FFD700;
  --silver: #C0C0C0;
  --bronze: #CD7F32;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --radius: 8px;
  --radius-lg: 12px;
}

html {
  height: 100%;
}

body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   Layout
   ======================================== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 40px 0;
}

.section--dark {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ========================================
   Site Nav
   ======================================== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  z-index: 50;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nav-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(91, 138, 247, 0.3);
  border-radius: 4px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.nav-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 16px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-tab--active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border);
}

.nav-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: peek-pulse 1.8s ease-in-out infinite;
}

/* ========================================
   Pages
   ======================================== */
.page {
  position: fixed;
  top: 52px; left: 0; right: 0; bottom: 0;
}

.page--hidden {
  display: none;
}

.page-content {
  height: 100%;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

/* ========================================
   Sparkle Canvas
   ======================================== */
#sparkle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Shared keyframe used by .nav-live-dot */
@keyframes peek-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.75); }
}

/* ========================================
   Leaderboard face section
   ======================================== */
.section--lb {
  background: var(--bg-secondary);
  min-height: 100%;
  padding: 32px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 12px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ========================================
   Hero
   ======================================== */
.hero {
  background: var(--bg-primary);
  padding: 96px 0 48px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(91, 138, 247, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(91, 138, 247, 0.3);
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #e8eaf0 0%, #8b91a8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.hero-sep {
  color: var(--text-muted);
}

.hero-intro {
  max-width: 600px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ========================================
   Agenda / Timeline
   ======================================== */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 72px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  gap: 32px;
  padding: 0 0 32px 0;
  position: relative;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-time {
  flex-shrink: 0;
  width: 56px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  padding-top: 3px;
  text-align: right;
}

.timeline-content {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  position: relative;
  margin-left: 16px;
}

.timeline-content::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}

.timeline-content strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.timeline-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ========================================
   Leaderboard
   ======================================== */
.leaderboard-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: -28px; /* pulls subtitle up against section-title's bottom margin */
  margin-bottom: 28px;
}

.leaderboard-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leaderboard-table thead {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.leaderboard-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.leaderboard-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}

.leaderboard-table tbody tr {
  background: var(--bg-card);
  transition: background 0.15s ease;
}

.leaderboard-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.col-rank {
  width: 48px;
  text-align: center;
}

.col-name {
  width: auto;
}

.col-tokens {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.col-total {
  font-weight: 600;
  color: var(--text-primary);
}

/* Rank badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

/* Top 3 row highlights */
.rank-1 td {
  background: rgba(255, 215, 0, 0.05);
}
.rank-1 td:first-child .rank-badge {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}
.rank-1 .participant-name {
  color: var(--gold);
}
.rank-1:hover td {
  background: rgba(255, 215, 0, 0.08);
}

.rank-2 td {
  background: rgba(192, 192, 192, 0.04);
}
.rank-2 td:first-child .rank-badge {
  background: rgba(192, 192, 192, 0.12);
  color: var(--silver);
  box-shadow: 0 0 12px rgba(192, 192, 192, 0.15);
}
.rank-2 .participant-name {
  color: var(--silver);
}
.rank-2:hover td {
  background: rgba(192, 192, 192, 0.07);
}

.rank-3 td {
  background: rgba(205, 127, 50, 0.05);
}
.rank-3 td:first-child .rank-badge {
  background: rgba(205, 127, 50, 0.12);
  color: var(--bronze);
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.15);
}
.rank-3 .participant-name {
  color: var(--bronze);
}
.rank-3:hover td {
  background: rgba(205, 127, 50, 0.08);
}

/* Loading / error states */
.leaderboard-loading td,
.leaderboard-error td,
.leaderboard-empty td {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.leaderboard-error td {
  color: #e05c6a;
}

.leaderboard-updated {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ========================================
   Leaderboard Reveal
   ======================================== */

#lb-confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.lb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  background: var(--bg-secondary);
}

.lb-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   Spinner
   ======================================== */

.lb-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(91, 138, 247, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: lb-spin 0.8s linear infinite;
}

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

.lb-loading-label {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* ========================================
   List Cascade Overlay + Rank Row
   ======================================== */

.lb-list-overlay {
  justify-content: flex-end;
  align-items: center;
  padding: 0 24px 28px;
  gap: 0;
  overflow: hidden;
}

/* Constrained inner column — matches final table width */
.lb-list-inner {
  width: 100%;
  max-width: 640px;
}

.lb-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lb-list-header-rank  { width: 28px; text-align: right; flex-shrink: 0; }
.lb-list-header-name  { flex: 1; }
.lb-list-header-cost  { text-align: right; }

.lb-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lb-rank-row:last-child { border-bottom: none; }

.lb-rank-row--revealed {
  opacity: 1;
  transform: translateY(0);
}

.lb-rank-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.lb-rank-name { flex: 1; font-size: 0.9rem; color: var(--text-primary); }

.lb-rank-cost {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  min-width: 52px;
}

.lb-rank-row--top1 .lb-rank-name { color: var(--gold);   font-weight: 700; }
.lb-rank-row--top1 .lb-rank-num  { color: var(--gold); }
.lb-rank-row--top2 .lb-rank-name { color: var(--silver); font-weight: 600; }
.lb-rank-row--top2 .lb-rank-num  { color: var(--silver); }
.lb-rank-row--top3 .lb-rank-name { color: var(--bronze); font-weight: 600; }
.lb-rank-row--top3 .lb-rank-num  { color: var(--bronze); }

/* Blur top-3 names/cost during the cascade overlay — rank numbers stay visible */
.lb-list-overlay .lb-rank-row--top1 .lb-rank-name,
.lb-list-overlay .lb-rank-row--top2 .lb-rank-name,
.lb-list-overlay .lb-rank-row--top3 .lb-rank-name,
.lb-list-overlay .lb-rank-row--top1 .lb-rank-cost,
.lb-list-overlay .lb-rank-row--top2 .lb-rank-cost,
.lb-list-overlay .lb-rank-row--top3 .lb-rank-cost {
  filter: blur(6px);
  user-select: none;
}

/* ========================================
   Podium Section + Slot Styles
   ======================================== */

.lb-content-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.lb-list-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.lb-podium-section {
  flex-shrink: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lb-podium-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.lb-podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  position: relative;
}

.lb-podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.lb-podium-avatar {
  font-size: 2rem;
  margin-bottom: 8px;
  transform: translateY(20px);
  opacity: 0;
  transition-property: transform, opacity;
  transition-duration: 0.5s, 0.4s;
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1), ease;
}

.lb-podium-name {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 10px;
  max-width: 90px;
  line-height: 1.3;
  transform: translateY(10px);
  opacity: 0;
  transition-property: transform, opacity;
  transition-duration: 0.4s, 0.4s;
  transition-timing-function: ease, ease;
}

.lb-podium-block {
  width: 100%;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  transform: scaleY(0);
  transform-origin: bottom;
  transition-property: transform;
  transition-duration: 0.6s;
  transition-timing-function: cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Slot colours */
.lb-slot-3 .lb-podium-name  { color: var(--bronze); }
.lb-slot-3 .lb-podium-block {
  background: linear-gradient(180deg, rgba(205,127,50,0.3), rgba(205,127,50,0.12));
  height: 70px;
  color: var(--bronze);
}

.lb-slot-1 .lb-podium-avatar { font-size: 2.4rem; }
.lb-slot-1 .lb-podium-name   { color: var(--gold); font-size: 0.85rem; }
.lb-slot-1 .lb-podium-block  {
  background: linear-gradient(180deg, rgba(255,215,0,0.3), rgba(255,215,0,0.1));
  height: 110px;
  color: var(--gold);
  font-size: 1.8rem;
}

.lb-slot-2 .lb-podium-name  { color: var(--silver); }
.lb-slot-2 .lb-podium-block {
  background: linear-gradient(180deg, rgba(192,192,192,0.25), rgba(192,192,192,0.08));
  height: 85px;
  color: var(--silver);
}

/* Animation stagger by slot */
.lb-slot-3 .lb-podium-block  { transition-delay: 0.1s; }
.lb-slot-1 .lb-podium-block  { transition-delay: 0.0s; }
.lb-slot-2 .lb-podium-block  { transition-delay: 0.2s; }
.lb-slot-3 .lb-podium-avatar { transition-delay: 0.40s; }
.lb-slot-1 .lb-podium-avatar { transition-delay: 0.30s; }
.lb-slot-2 .lb-podium-avatar { transition-delay: 0.50s; }
.lb-slot-3 .lb-podium-name   { transition-delay: 0.45s; }
.lb-slot-1 .lb-podium-name   { transition-delay: 0.35s; }
.lb-slot-2 .lb-podium-name   { transition-delay: 0.55s; }

/* Trigger class — added by JS after crossfade */
.lb-podium-stage--animate .lb-podium-block  { transform: scaleY(1); }
.lb-podium-stage--animate .lb-podium-avatar { transform: translateY(0); opacity: 1; }
.lb-podium-stage--animate .lb-podium-name   { transform: translateY(0); opacity: 1; }

/* ── Sequential podium reveal ─────────────────────────────────────────────── */

/* Freeze ALL elements on a slot until JS removes this class */
.lb-slot--pending .lb-podium-block  { transform: scaleY(0) !important; transition: none !important; }
.lb-slot--pending .lb-podium-avatar { transform: translateY(20px) !important; opacity: 0 !important; transition: none !important; }
.lb-slot--pending .lb-podium-name   { transform: translateY(10px) !important; opacity: 0 !important; transition: none !important; }

/* Freeze ONLY avatar+name on slot-1 after block is released (1st-place drama) */
.lb-slot-1--block-only .lb-podium-avatar { transform: translateY(20px) !important; opacity: 0 !important; transition: none !important; }
.lb-slot-1--block-only .lb-podium-name   { transform: translateY(10px) !important; opacity: 0 !important; transition: none !important; }

/* 1st place block — slower, bouncier rise */
.lb-slot-1 .lb-podium-block { transition-duration: 0.9s; }

/* Override delays so avatar+name fire NOW instead of at the slot-1 CSS delay */
.lb-slot-1--avatarname-go .lb-podium-avatar { transition-delay: 0s !important; }
.lb-slot-1--avatarname-go .lb-podium-name   { transition-delay: 0.08s !important; }

/* Gold glow pulse for 1st place avatar */
@keyframes lb-gold-pulse {
  0%   { text-shadow: 0 0 0px #FFD700; }
  30%  { text-shadow: 0 0 28px #FFD700, 0 0 56px rgba(255,215,0,0.6); }
  60%  { text-shadow: 0 0 10px #FFD700; }
  80%  { text-shadow: 0 0 22px #FFD700, 0 0 44px rgba(255,215,0,0.5); }
  100% { text-shadow: 0 0 6px rgba(255,215,0,0.3); }
}
.lb-slot-1--glow .lb-podium-avatar {
  animation: lb-gold-pulse 2s ease-out forwards;
}

/* Gold flash overlay */
#lb-podium-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,215,0,0.5), transparent 70%);
  transition: opacity 0.18s ease;
  border-radius: 8px;
}
#lb-podium-flash.lb-podium-flash--on { opacity: 0.6; }

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ========================================
   Projects Page
   ======================================== */

.projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 24px 16px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.projects-page-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.projects-add-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 16px;
  transition: background 0.15s;
  white-space: nowrap;
}

.projects-add-btn:hover {
  background: #6e96f9;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 24px 40px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.projects-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 40px 0;
  text-align: center;
}

/* ── Project Card ──────────────────────────────────────────────────────────── */

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s;
}

.project-card:hover {
  border-color: rgba(91, 138, 247, 0.3);
}

.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.project-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.project-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.project-card__lead {
  font-size: 0.75rem;
  color: var(--gold);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.project-card__chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.project-card__description {
  padding: 0 20px 14px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-card__description--full {
  padding-bottom: 0;
}

/* Collapsed member row */
.project-card__members--collapsed {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 16px;
}

/* Expanded members section */
.project-card__members-section {
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}

.project-card__lead-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.project-card__members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 18px;
  flex-wrap: wrap;
}

/* ── Member Badges ─────────────────────────────────────────────────────────── */

.member-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}

.member-badge--lead {
  color: var(--gold);
  background: rgba(255, 215, 0, 0.08);
  border-color: rgba(255, 215, 0, 0.25);
  font-weight: 600;
}

/* ── Project Action Buttons ────────────────────────────────────────────────── */

.project-btn {
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  transition: background 0.15s, opacity 0.15s;
}

.project-btn--join {
  background: var(--accent);
  color: #fff;
}

.project-btn--join:hover {
  background: #6e96f9;
}

.project-btn--edit {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.project-btn--edit:hover {
  background: rgba(255, 255, 255, 0.1);
}

.project-btn--delete {
  background: rgba(224, 92, 106, 0.12);
  border: 1px solid rgba(224, 92, 106, 0.25);
  color: #e05c6a;
}

.project-btn--delete:hover {
  background: rgba(224, 92, 106, 0.22);
}

/* ── Project Modal ─────────────────────────────────────────────────────────── */

.project-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.project-modal--open {
  opacity: 1;
  pointer-events: auto;
}

.project-modal__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 480px;
}

.project-modal__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.project-modal__label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.project-modal__input,
.project-modal__textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.project-modal__input:focus,
.project-modal__textarea:focus {
  border-color: var(--accent);
}

.project-modal__input[readonly] {
  color: var(--text-muted);
  cursor: default;
}

.project-modal__textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.project-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.project-modal__btn {
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 9px 18px;
  transition: background 0.15s;
}

.project-modal__btn--cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.project-modal__btn--cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

.project-modal__btn--submit {
  background: var(--accent);
  color: #fff;
}

.project-modal__btn--submit:hover {
  background: #6e96f9;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
  .hero {
    padding: 64px 0 56px;
  }

  .section {
    padding: 48px 0;
  }

  .timeline::before {
    left: 52px;
  }

  .timeline-time {
    width: 44px;
    font-size: 0.72rem;
  }

  .timeline-content {
    padding: 12px 16px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 10px 12px;
  }

  .col-tokens:not(.col-total) {
    display: none;
  }

}

/* ========================================
   Auth modal
   ======================================== */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal--hidden {
  display: none;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.auth-modal__card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  width: min(400px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
}

.auth-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.auth-modal__close:hover {
  color: var(--text-primary);
}

.auth-modal .login-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(91, 138, 247, 0.3);
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 4px;
}

.auth-modal h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

#auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-modal__card input[type="text"],
.auth-modal__card input[type="password"] {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.auth-modal__card input[type="text"]:focus,
.auth-modal__card input[type="password"]:focus {
  border-color: var(--accent);
}

.auth-modal__card input::placeholder {
  color: #5a6080;
}

.auth-modal__card button[type="submit"] {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  transition: background 0.15s, opacity 0.15s;
}

.auth-modal__card button[type="submit"]:hover:not(:disabled) {
  background: #6e96f9;
}

.auth-modal__card button[type="submit"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Wrong-password overlay (shared animation — scoped to modal) */
#auth-modal .wrong-overlay {
  align-items: center;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  inset: 0;
  justify-content: center;
  position: absolute;
  border-radius: 12px;
  z-index: 10;
}

#auth-modal .wrong-overlay.active {
  display: flex;
}

#auth-modal .wrong-text {
  color: #ff3b3b;
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

#auth-modal .wrong-overlay.animating .wrong-text {
  animation: wrong-password 1.2s ease-in forwards;
}

@keyframes wrong-password {
  0%   { transform: scale(1);  opacity: 1; }
  80%  { transform: scale(12); opacity: 1; }
  100% { transform: scale(15); opacity: 0; }
}
