@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
  --bg:        #06040d;
  --surface:   #0e0a1a;
  --surface-2: #150f22;
  --border:    rgba(255, 255, 255, 0.06);
  --border-2:  rgba(255, 255, 255, 0.10);
  --accent:    #d4a843;
  --accent-dim: rgba(212, 168, 67, 0.12);
  --accent-2:  #8b3ac8;
  --text:      #f0f0f8;
  --text-2:    #8585a0;
  --text-3:    #38384e;
  --success:   #22c55e;
  --radius:    12px;
  --max:       1100px;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Starfield canvas ───────────────────────────────────────────────── */
#starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* everything above stars */
nav, section, footer, .container { position: relative; z-index: 1; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Nav ────────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 4, 12, 0.90);
  backdrop-filter: blur(20px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  text-decoration: none;
}

.wordmark em {
  font-style: normal;
  color: var(--accent);
}

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(212, 168, 67, 0.20);
  flex-shrink: 0;
}

.nav-cta {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-2);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.nav-cta:hover { border-color: var(--accent); color: var(--accent); }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  padding: 96px 0 80px;
  position: relative;
  overflow: hidden;
}

/* soft glow behind hero text */
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse at center,
    rgba(139, 58, 200, 0.11) 0%,
    transparent 65%);
  pointer-events: none;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(212, 168, 67, 0.28);
  background: rgba(212, 168, 67, 0.08);
  padding: 5px 13px;
  border-radius: 99px;
  margin-bottom: 30px;
}

.hero-label .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%       { opacity: 0.3; transform: scale(0.6); }
}

.hero h1 {
  font-size: clamp(36px, 5vw, 62px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -2px;
  color: var(--text);
  max-width: 700px;
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 17px;
  color: var(--text-2);
  max-width: 500px;
  margin-bottom: 48px;
  line-height: 1.75;
}

/* ── Donation form ──────────────────────────────────────────────────── */
.donate-form { max-width: 480px; }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
}

.input-row { display: flex; gap: 10px; }

input[type="text"] {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]::placeholder { color: var(--text-3); }

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.12);
}

.btn-primary {
  height: 48px;
  padding: 0 26px;
  background: var(--accent);
  color: #05050a;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.1px;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-primary:hover  { opacity: 0.88; }
.btn-primary:active { transform: scale(0.98); }

.field-error {
  font-size: 12px;
  color: #f87171;
  margin-top: 8px;
  display: none;
}

/* result panel */
#result-panel {
  display: none;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.result-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}

.result-url {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.btn-donate {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  background: var(--accent);
  color: #05050a;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.btn-donate:hover { opacity: 0.85; }

.result-divider { height: 1px; background: var(--border); margin: 14px 0; }

.profile-hint { font-size: 12px; color: var(--text-3); }
.profile-hint a { color: var(--text-2); text-underline-offset: 3px; }
.profile-hint a:hover { color: var(--accent); }

/* ── Hero two-column layout ──────────────────────────────────────────── */
.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-left { width: 100%; }

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stream-embed-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-2);
  aspect-ratio: 16 / 9;
  width: 100%;
}

.stream-embed-wrap #twitch-embed,
.stream-embed-wrap #twitch-embed iframe {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.stream-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.stream-link:hover { opacity: 1; }

@media (max-width: 860px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }
  .hero-right { order: -1; }
  .hero-left { max-width: 100%; }
}

/* ── Stats strip ────────────────────────────────────────────────────── */
.stats-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 44px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stat-item {
  padding: 0 36px;
  border-right: 1px solid var(--border);
}

.stat-item:first-child { padding-left: 0; }
.stat-item:last-child  { border-right: none; padding-right: 0; }

.stat-value {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 7px;
}

.stat-value.accent { color: var(--accent); }
.stat-value.loading { color: var(--text-3); font-size: 30px; letter-spacing: -1px; }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

/* ── Live feed ──────────────────────────────────────────────────────── */
.live-section {
  padding: 64px 0 0;
}

.live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--success);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.20);
  padding: 5px 12px;
  border-radius: 99px;
}

.live-badge .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.feed-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.feed-panel-header {
  display: grid;
  grid-template-columns: 40px 1fr 100px 90px;
  padding: 11px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
}

.feed-item {
  display: grid;
  grid-template-columns: 40px 1fr 100px 90px;
  align-items: center;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  animation: feedSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: rgba(255,255,255,0.02); }

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

.feed-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(139, 58, 200, 0.18);
  border: 1px solid rgba(212, 168, 67, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

.feed-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}

.feed-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.feed-time {
  font-size: 12px;
  color: var(--text-3);
  text-align: right;
}

.feed-empty {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

/* ── Two-column section ─────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 72px 0;
}

.section-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 28px;
}

/* ── Leaderboard ────────────────────────────────────────────────────── */
.leaderboard-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.lb-header {
  display: grid;
  grid-template-columns: 36px 1fr 90px;
  padding: 11px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
}

.lb-row {
  display: grid;
  grid-template-columns: 36px 1fr 90px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255,255,255,0.02); }

.lb-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
}

.lb-rank.r1 { color: #fbbf24; }
.lb-rank.r2 { color: #9ca3af; }
.lb-rank.r3 { color: #c97c3a; }

.lb-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}

.lb-empty {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

/* ── Steps ──────────────────────────────────────────────────────────── */
.steps-panel { display: flex; flex-direction: column; }

.step {
  display: flex;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; }

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.step-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  letter-spacing: -0.2px;
}

.step-body p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-note {
  font-size: 12px;
  color: var(--text-3);
}

.footer-force {
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
  letter-spacing: 0.2px;
}

.footer-credit {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-credit:hover { color: var(--accent-2); }

/* ── Supporter page ─────────────────────────────────────────────────── */
.profile-hero {
  padding: 72px 0 52px;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,232,31,0.25), rgba(255,153,68,0.25));
  border: 2px solid rgba(212, 168, 67, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  margin: 0 auto 22px;
  letter-spacing: -1px;
}

.profile-name {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.status-badge.active {
  background: rgba(34,197,94,0.09);
  border: 1px solid rgba(34,197,94,0.22);
  color: var(--success);
}

.status-badge.inactive {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
}

.status-badge .indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.active .indicator { animation: pulse 2.4s ease-in-out infinite; }

.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  max-width: 560px;
  margin: 0 auto 20px;
}

.stats-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.stats-card-row:last-child { border-bottom: none; }
.stats-card-row .k { font-size: 13px; color: var(--text-2); }
.stats-card-row .v { font-size: 14px; font-weight: 700; color: var(--text); }

.progress-wrap {
  max-width: 560px;
  margin: 0 auto 20px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.progress-track {
  height: 3px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.expired-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 560px;
  margin: 0 auto 20px;
  text-align: center;
  display: none;
}

.expired-cta p { font-size: 14px; color: var(--text-2); margin-bottom: 20px; }

.not-found-panel {
  text-align: center;
  padding: 80px 0;
  display: none;
}

.not-found-panel h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.not-found-panel p { font-size: 14px; color: var(--text-2); margin-bottom: 28px; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .hero { padding: 60px 0 48px; }
  .input-row { flex-direction: column; }
  .btn-primary { width: 100%; justify-content: center; height: 52px; }
  .stats-grid { grid-template-columns: 1fr; gap: 28px; }
  .stat-item { padding: 0; border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 24px; }
  .stat-item:last-child { border-bottom: none; padding-bottom: 0; }
  .two-col { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 10px; text-align: center; }
}
