:root {
  --bg: #ffffff;
  --bg-soft: #f7f6f2;
  --card: #ffffff;
  --text: #17171a;
  --text-muted: #70707a;
  --border: #eae7e1;
  --border-strong: #ddd9d1;
  --accent: #ff6a3d;
  --accent-strong: #f4511e;
  --accent-soft: #fff0ea;
  --accent-text: #fff;
  --shadow: none;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

[data-theme="dark"] {
  --bg: #101014;
  --bg-soft: #17171c;
  --card: #1b1b21;
  --text: #f2f2f5;
  --text-muted: #9a9aa5;
  --border: #26262e;
  --border-strong: #33333d;
  --accent-soft: #2b1a13;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.logo-mark {
  color: var(--accent);
}

.logo-dot {
  color: var(--accent);
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a,
.theme-toggle {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav a:hover,
.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px 16px;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a,
  .theme-toggle {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
  }
}

/* ---------- Visitor pill ---------- */

.visitor-pill {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.pill-link {
  color: var(--accent);
  font-weight: 600;
}

.pill-link:hover {
  text-decoration: underline;
}

/* ---------- Claim ---------- */

.claim {
  text-align: center;
  margin: 40px 0 26px;
}

.claim-title {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.step-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}

.step-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.step-btn:active {
  transform: scale(0.95);
}

.claim-price {
  min-width: 110px;
  font-size: inherit;
  font-weight: inherit;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.claim-desc {
  max-width: 560px;
  margin: 0 auto;
  font-size: 15px;
  color: var(--text-muted);
}

/* ---------- Form ---------- */

.join-form {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 760px;
  margin: 26px auto 0;
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  height: 54px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field-icon {
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex: none;
  overflow: hidden;
}

.field-icon svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.field-icon .input-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.field-input {
  flex: 1 1 60%;
}

.field-select {
  flex: 1 1 30%;
}

.field input,
.field select {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  height: 100%;
  min-width: 0;
}

.field select {
  cursor: pointer;
}

.field select option {
  background: var(--card);
  color: var(--text);
}

.btn-primary {
  height: 54px;
  padding: 0 28px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0 0;
}

@media (max-width: 720px) {
  .join-form {
    flex-direction: column;
    align-items: stretch;
  }

  .field-input,
  .field-select {
    flex: none;
  }

  .btn-primary {
    width: 100%;
  }
}

/* ---------- Filters ---------- */

.filters {
  display: flex;
  gap: 8px;
  margin: 30px 0 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter {
  flex: none;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.filter:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* ---------- Ranking ---------- */

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  min-height: 88px;
  transition: border-color 0.15s ease;
}

.entry:hover {
  border-color: var(--border-strong);
}

.entry-pos {
  flex: none;
  width: 46px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--text-muted);
}

.entry-pos .pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 0 8px;
}

.entry-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-muted);
  overflow: hidden;
}

.entry-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.entry-body {
  flex: 1;
  min-width: 0;
}

.entry-name {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-name a:hover {
  text-decoration: underline;
}

.entry-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-amount {
  flex: none;
  text-align: right;
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

/* Top 1 */
.entry.top-1 {
  background: var(--accent-soft);
  border-color: var(--accent);
  padding: 18px 20px;
}

.entry.top-1 .entry-pos .pos-badge {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.entry.top-1 .entry-avatar {
  width: 48px;
  height: 48px;
  border-color: var(--accent);
  color: var(--accent);
}

.entry.top-1 .entry-name {
  font-size: 17px;
}

.entry.top-1 .entry-amount {
  color: var(--accent);
  font-size: 19px;
}

/* Top 2 y 3 */
.entry.top-3 .entry-pos .pos-badge {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.entry.top-3 .entry-amount {
  color: var(--accent);
}

.entry.top-20 {
  border-width: 1.5px;
}

/* ---------- Empty / loading ---------- */

.entry-loading,
.entry-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 0;
  font-size: 14px;
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.page-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.page-btn.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.pagination-meta {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ---------- Activity ---------- */

.activity {
  margin-top: 40px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.activity-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.activity-item .entry-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.activity-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-meta {
  color: var(--text-muted);
  white-space: nowrap;
}

.activity-meta .amount {
  font-weight: 700;
  color: var(--accent);
}

.activity-time {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12.5px;
  flex: none;
}

@media (max-width: 720px) {
  .activity-list {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .activity-list::-webkit-scrollbar {
    display: none;
  }

  .activity-item {
    flex: none;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
  }
}

/* ---------- How it works ---------- */

.how {
  margin-top: 48px;
  padding-bottom: 30px;
}

.how h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.how-list {
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 14.5px;
}

.how-list li {
  margin-bottom: 8px;
}

.how-list li::marker {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 34px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-inner a:hover {
  color: var(--accent);
}
