:root {
  --background: #fffdfa;
  --foreground: #282624;
  --card: #ffffff;
  --muted: #f6f3ef;
  --muted-2: #f0ece5;
  --muted-foreground: #67625d;
  --muted-foreground-70: rgba(103, 98, 93, 0.72);
  --border: #e6e0da;
  --primary: #e57255;
  --primary-08: rgba(229, 114, 85, 0.08);
  --primary-12: rgba(229, 114, 85, 0.12);
  --primary-25: rgba(229, 114, 85, 0.25);
  --primary-40: rgba(229, 114, 85, 0.4);
  --primary-foreground: #ffffff;
  --live: #009f31;
  --radius: 0.875rem;
  --shadow-card: 0 1px 2px rgba(40, 38, 36, 0.04), 0 8px 24px rgba(40, 38, 36, 0.05);
}
html.dark {
  --background: #1a1512;
  --foreground: #f7f5f1;
  --card: #231e1b;
  --muted: #2d2824;
  --muted-2: #35302b;
  --muted-foreground: #aba39b;
  --muted-foreground-70: rgba(171, 163, 155, 0.72);
  --border: rgba(255, 255, 255, 0.1);
  --live: #50c05f;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
.ico { width: 1.05em; height: 1.05em; flex-shrink: 0; }
.ico.inline { vertical-align: -0.15em; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ============ nav ============ */
.nav {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  padding: 26px 0 10px;
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.logo-mark { width: 21px; height: 21px; flex-shrink: 0; }
.logo-mark .up { stroke: var(--primary); }
.logo-mark .base { stroke: var(--foreground); }
.logo .tld { color: var(--foreground); }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 28px; font-size: 15.5px; color: var(--muted-foreground); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--foreground); }
.nav-links a.active { font-weight: 700; }
.theme-btn {
  background: none; border: none; cursor: pointer; color: var(--foreground);
  display: inline-flex; padding: 4px; border-radius: 8px; font-size: 17px;
}
.theme-btn:hover { background: var(--muted); }

/* ============ status pill ============ */
.status-wrap { text-align: center; margin: 26px 0 8px; }
.raised-hero { margin-bottom: 14px; }
.raised-amt {
  font-size: clamp(48px, 7vw, 76px); font-weight: 800; letter-spacing: -0.035em;
  line-height: 1; color: var(--live); font-variant-numeric: tabular-nums;
}
.raised-label {
  margin-top: 6px; font-size: 16px; font-weight: 600;
  color: var(--muted-foreground); letter-spacing: 0.01em;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 4px 7px; flex-wrap: wrap;
  justify-content: center; max-width: 100%;
  background: var(--muted); border-radius: 999px;
  padding: 9px 20px; font-size: 15px; color: var(--muted-foreground);
}
.status-pill .online { color: var(--live); font-weight: 700; }
.status-pill .strong { color: var(--foreground); font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; }
.dot.orange { background: var(--primary); }

/* ============ hero ============ */
.hero { text-align: center; padding: 34px 0 6px; }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.1; display: flex; align-items: center; justify-content: center;
  gap: 18px; flex-wrap: wrap;
}
.hero h1 .amount-group { display: inline-flex; align-items: center; gap: 12px; }
.hero h1 .amount { color: var(--primary); font-variant-numeric: tabular-nums; }
.step-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--primary-12); color: var(--primary);
  font-size: 20px; font-weight: 700; cursor: pointer; line-height: 1;
  transition: background .15s;
}
.step-btn:hover { background: var(--primary-25); }
.hero .sub {
  margin-top: 22px; font-size: 18px; color: var(--foreground);
  max-width: 640px; margin-left: auto; margin-right: auto;
}
.hero .sub .accent { color: var(--primary); }
.hero .charity-line { margin-top: 8px; font-size: 15.5px; color: var(--muted-foreground); }
.hero .charity-line b { color: var(--foreground); }

/* bid form */
.bid-form {
  display: flex; gap: 14px; justify-content: center; align-items: stretch;
  margin: 30px auto 0; max-width: 1180px; flex-wrap: wrap;
}
.bid-input-wrap {
  position: relative; flex: 1 1 380px; max-width: 680px;
}
.bid-input-wrap .icon {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  color: var(--muted-foreground); font-size: 17px; pointer-events: none;
}
.bid-input {
  width: 100%; height: 58px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--foreground);
  font-family: inherit; font-size: 17px; padding: 0 24px 0 50px;
}
.bid-input::placeholder { color: var(--muted-foreground); }
.bid-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-12); }
.charity-dd {
  height: 58px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--foreground);
  font-family: inherit; font-size: 16.5px; padding: 0 44px 0 22px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2367625d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 20px center;
}
.charity-dd:focus { outline: none; border-color: var(--primary); }
.outbid-btn {
  height: 58px; padding: 0 42px; border: none; border-radius: 999px;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 17.5px; font-weight: 700; cursor: pointer;
  transition: filter .15s, transform .12s;
}
.outbid-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.form-hint { margin-top: 16px; text-align: center; font-size: 15px; color: var(--muted-foreground); }
.desc-wrap { max-width: 680px; margin: 12px auto 0; }
.desc-input { height: 48px; font-size: 15px; padding: 0 22px; }
.form-err { margin-top: 10px; text-align: center; font-size: 14px; color: #e40014; font-weight: 600; display: none; }

/* ============ filter pills ============ */
.pills {
  display: flex; gap: 10px; margin: 34px 0 30px; overflow-x: auto;
  scrollbar-width: none; padding-bottom: 4px;
}
.pills::-webkit-scrollbar { display: none; }
.fpill {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  border-radius: 999px; padding: 9px 18px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: border-color .15s;
}
.fpill:hover { border-color: var(--muted-foreground); }
.fpill.sel { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }

/* ============ panels (trending / activity) ============ */
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; margin-bottom: 34px; }
@media (max-width: 760px) { .panels { grid-template-columns: minmax(0, 1fr); } }
.panel { min-width: 0; }
.panel-row .pright { flex-shrink: 0; }
.panel {
  background: var(--card); border-radius: 22px; padding: 20px 26px;
  box-shadow: var(--shadow-card); border: 1px solid var(--border);
}
.panel h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.panel-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 15px;
}
.panel .panel-row:last-child { border-bottom: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--muted-2); color: #fff;
  font-size: 14px; font-weight: 700;
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
}
.avatar img, .lb-avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #fff;
}
.avatar img { padding: 4px; box-sizing: border-box; object-fit: contain; }
.lb-avatar img { padding: 10px; box-sizing: border-box; object-fit: contain; }
.panel-row .pname { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-row .pname a { color: inherit; }
.panel-row .pname a:hover { text-decoration: underline; text-underline-offset: 3px; }
.panel-row .pmeta { color: var(--muted-foreground); font-weight: 400; }
.panel-row .pright { margin-left: auto; flex-shrink: 0; color: var(--muted-foreground); font-size: 14px; font-variant-numeric: tabular-nums; }
#activity .panel-row { animation: slideIn .4s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ============ split bar ============ */
.split-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow-card); padding: 20px 26px; margin-bottom: 34px;
}
.split-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.split-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--muted); }
.split-bar div { transition: width .6s ease; min-width: 2px; }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; font-size: 14px; color: var(--muted-foreground); }
.split-legend .chip { display: flex; align-items: center; gap: 7px; }
.split-legend .sq { width: 9px; height: 9px; border-radius: 3px; }
.split-legend b { color: var(--foreground); font-variant-numeric: tabular-nums; }

/* ============ leaderboard cards ============ */
.lb-card {
  position: relative;
  display: flex; align-items: center; gap: 22px;
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  padding: 26px 30px; margin-bottom: 18px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.lb-card:hover { border-color: var(--primary-40); box-shadow: var(--shadow-card); }
.lb-card.top1 { background: var(--primary-08); border-color: var(--primary-40); }
.lb-card.you { box-shadow: inset 4px 0 0 var(--live); }
.rank-badge {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 16px; font-weight: 800;
}
.lb-card .lb-avatar {
  width: 74px; height: 74px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #fff;
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
}
.lb-main .lb-name a { color: inherit; }
.lb-main .lb-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.lb-main { min-width: 0; flex: 1; }
.lb-main .lb-name { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.lb-main .lb-desc { color: var(--muted-foreground); font-size: 16px; margin-top: 2px; }
.lb-main .lb-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px;
  margin-top: 9px; font-size: 14px; color: var(--muted-foreground);
}
.lb-meta .cb { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lb-meta .clicks { display: inline-flex; align-items: center; gap: 6px; color: var(--foreground); font-weight: 700; }
.lb-amt {
  align-self: flex-start; flex-shrink: 0;
  font-size: 21px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums;
}
.claim-pill {
  position: absolute; right: 30px; bottom: 22px;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 13px; font-weight: 700; padding: 7px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .15s; white-space: nowrap;
}
@media (hover: hover) {
  .lb-card:hover .claim-pill { opacity: 1; pointer-events: auto; }
  .lb-card:hover .lb-name { text-decoration: underline; text-underline-offset: 3px; }
}
@media (max-width: 640px) {
  .lb-card { padding: 18px; gap: 14px; }
  .lb-card .lb-avatar { width: 52px; height: 52px; font-size: 22px; }
  .rank-badge { width: 40px; height: 40px; font-size: 13px; }
}
.show-more-btn {
  display: block; margin: 6px auto 0; padding: 12px 38px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  color: var(--foreground); font-size: 15px; font-weight: 600; cursor: pointer;
}
.show-more-btn:hover { border-color: var(--muted-foreground); }

/* ============ article pages (about / rules) ============ */
.article { padding: 30px 0 40px; }
.article h1 { font-size: 46px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 26px; }
.article h2 { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; margin: 40px 0 16px; }
.article p { font-size: 18px; color: var(--foreground); margin-bottom: 16px; }
.article p.muted, .article li { color: var(--muted-foreground); }
.article a { color: var(--primary); }
.article a:hover { text-decoration: underline; }
.article ul { padding-left: 24px; }
.article li { font-size: 17.5px; margin-bottom: 14px; }
.stat-cards { display: flex; gap: 18px; flex-wrap: wrap; margin: 26px 0; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-card); padding: 20px 28px; min-width: 200px;
}
.stat-card .num {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 28px; font-weight: 700; display: flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.stat-card .num .cur { color: var(--primary); }
.stat-card .lbl { color: var(--muted-foreground); font-size: 15px; margin-top: 2px; }

/* ============ foundation tiles ============ */
.org-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px; margin: 22px 0 10px;
}
.org-tile {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-card); padding: 16px 18px;
}
.org-mono {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: #fff; letter-spacing: 0.02em;
}
.org-logo {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  object-fit: contain; background: #fff; border: 1px solid var(--border); padding: 4px;
}
.org-tile .org-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.org-tile .org-cause { color: var(--muted-foreground); font-size: 13px; margin-top: 1px; }
.org-note { font-size: 13.5px; color: var(--muted-foreground-70); margin-top: 12px; }

/* ============ footer ============ */
footer {
  margin-top: 64px; padding: 26px 0 46px;
  font-size: 15px; color: var(--muted-foreground); text-align: center;
}
footer a { color: var(--primary); }
footer a:hover { text-decoration: underline; }

/* ============ mobile ============ */
@media (max-width: 700px) {
  body { overflow-x: clip; }
  .container, .narrow { padding: 0 16px; }
  .nav { padding: 16px 0 4px; }
  .logo { font-size: 18px; }
  .logo-mark { width: 18px; height: 18px; }
  .nav-links { gap: 14px; font-size: 13.5px; }
  .status-wrap { margin: 16px 0 4px; }
  .raised-amt { font-size: 44px; }
  .raised-label { font-size: 13.5px; }
  .status-pill { font-size: 12.5px; padding: 8px 14px; }
  .hero { padding: 22px 0 4px; }
  .hero h1 { font-size: 30px; gap: 10px; }
  .hero h1 .amount-group { gap: 8px; }
  .step-btn { width: 28px; height: 28px; font-size: 15px; }
  .hero .sub { margin-top: 14px; font-size: 15px; }
  .hero .charity-line { font-size: 13.5px; }
  .bid-form { flex-direction: column; gap: 10px; margin-top: 20px; }
  .bid-input-wrap { flex: 0 0 auto; width: 100%; max-width: none; }
  .bid-input, .charity-dd, .outbid-btn { width: 100%; height: 52px; font-size: 16px; }
  .desc-wrap { margin-top: 10px; }
  .desc-input { height: 46px; }
  .form-hint { font-size: 13px; }
  .pills { margin: 22px 0 20px; }
  .fpill { padding: 8px 14px; font-size: 13px; }
  .panels { gap: 16px; margin-bottom: 22px; }
  .panel { padding: 14px 18px; border-radius: 18px; }
  .panel h3 { font-size: 15.5px; }
  .panel-row { font-size: 13.5px; gap: 9px; }
  .split-card { padding: 14px 18px; border-radius: 18px; margin-bottom: 22px; }
  .split-card h3 { font-size: 15.5px; }
  .split-legend { font-size: 12.5px; gap: 4px 14px; }
  .lb-card { padding: 14px; gap: 10px; border-radius: 18px; margin-bottom: 12px; }
  .rank-badge { width: 34px; height: 34px; font-size: 12px; }
  .lb-card .lb-avatar { width: 44px; height: 44px; font-size: 18px; }
  .lb-avatar img { padding: 6px; }
  .lb-main .lb-name { font-size: 15.5px; }
  .lb-main .lb-desc {
    font-size: 13px; margin-top: 1px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .lb-main .lb-meta { font-size: 11.5px; gap: 3px 10px; margin-top: 5px; }
  .lb-amt { font-size: 16px; }
  .claim-pill { display: none; }
  .article h1 { font-size: 32px; }
  .article h2 { font-size: 20px; }
  .article p { font-size: 16px; }
  .article li { font-size: 15px; }
  .stat-card { min-width: 140px; padding: 14px 18px; }
  .stat-card .num { font-size: 21px; }
  footer { font-size: 13px; }
}

/* ============ toast ============ */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(90px);
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 13px 24px; font-size: 14.5px; font-weight: 600; z-index: 60; opacity: 0;
  transition: all .35s ease; max-width: 92vw; text-align: center;
  box-shadow: 0 14px 40px rgba(0,0,0,0.16); color: var(--foreground);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
