/* ================================================================
   Tippy Design System — Light (default) + Dark theme
   Base.org palette: Primary Blue #0052FF, Warm Amber #FF8A00
   Typography: Space Grotesk (display), Inter (body)
   Enhanced with Base-inspired gradients and patterns
   ================================================================ */

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

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

/* ---------- Theme Variables ---------- */
:root, [data-theme="light"] {
  --bg: #f8f9fb;
  --bg2: #f0f1f4;
  --surface: #ffffff;
  --surface2: #f4f5f7;
  --card: #ffffff;
  --card-hover: #f8f9fb;
  --border: #e2e4e8;
  --border-soft: #eceef1;
  --text: #0a0b0d;
  --text-secondary: #3d4047;
  --muted: #6b7280;
  --muted2: #9ca3af;
  --accent: #0052ff;
  --accent-2: #1859ff;
  --accent-soft: #3b7aff;
  --accent-bg: rgba(0, 82, 255, 0.08);
  --accent-bg2: rgba(0, 82, 255, 0.04);
  --warm: #ff8a00;
  --warm-2: #ff9f2e;
  --warm-bg: rgba(255, 138, 0, 0.08);
  --white: #ffffff;
  --glow: rgba(0, 82, 255, 0.15);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(0, 82, 255, 0.12);
  --shadow-warm: 0 4px 16px rgba(255, 138, 0, 0.25);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-bg: rgba(248, 249, 251, 0.88);
  --skeleton-shine: rgba(0, 0, 0, 0.04);
  --code-bg: #f4f5f7;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --chart-bar: linear-gradient(180deg, var(--accent-soft), var(--accent));
}

[data-theme="dark"] {
  --bg: #0a0b0d;
  --bg2: #111318;
  --surface: #16181e;
  --surface2: #1b1e25;
  --card: #16181e;
  --card-hover: #1b1e25;
  --border: #26292e;
  --border-soft: #1f2228;
  --text: #f0f0f0;
  --text-secondary: #c8ccd4;
  --muted: #8b929a;
  --muted2: #646b74;
  --accent: #0052ff;
  --accent-2: #1859ff;
  --accent-soft: #83b4ff;
  --accent-bg: rgba(0, 82, 255, 0.14);
  --accent-bg2: rgba(0, 82, 255, 0.06);
  --warm: #ff9f2e;
  --warm-2: #ffb347;
  --warm-bg: rgba(255, 159, 46, 0.14);
  --white: #f0f0f0;
  --glow: rgba(0, 82, 255, 0.35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 22px rgba(0, 82, 255, 0.2);
  --shadow-warm: 0 4px 16px rgba(255, 159, 46, 0.3);
  --nav-bg: rgba(10, 11, 13, 0.85);
  --skeleton-shine: rgba(255, 255, 255, 0.05);
  --code-bg: #1b1e25;
  --chart-bar: linear-gradient(180deg, var(--accent-soft), var(--accent));
}

/* ---------- Scroll Progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; width: 0%; height: 3px; z-index: 1000;
  background: linear-gradient(90deg, #0052ff, #3b7aff);
  box-shadow: 0 0 12px rgba(0, 82, 255, 0.6);
  transition: width 0.1s ease-out;
}

/* ---------- Selection ---------- */
::selection { background: rgba(0, 82, 255, 0.3); color: var(--text); }

html { scroll-behavior: smooth; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ---------- Body ---------- */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Ambient gradient overlay */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1000px 500px at 85% -10%, var(--accent-bg), transparent 60%),
    radial-gradient(800px 400px at -5% 105%, var(--accent-bg2), transparent 60%);
}

/* ---------- Ambient Orbs ---------- */
.orb { position: fixed; border-radius: 50%; filter: blur(100px); z-index: -1; pointer-events: none; opacity: 0.6; }
[data-theme="dark"] .orb { opacity: 1; }
.orb-a {
  width: 500px; height: 500px; top: -180px; right: -160px;
  background: radial-gradient(circle, rgba(0, 82, 255, 0.15), transparent 70%);
  animation: floaty 12s ease-in-out infinite, orbShift 20s ease-in-out infinite;
}
.orb-b {
  width: 400px; height: 400px; bottom: -200px; left: -180px;
  background: radial-gradient(circle, rgba(0, 82, 255, 0.1), transparent 70%);
  animation: floaty 15s ease-in-out infinite reverse, orbShift 25s ease-in-out infinite reverse;
}
.orb-c {
  width: 600px; height: 600px; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 82, 255, 0.05), transparent 60%);
  animation: floaty 18s ease-in-out infinite;
  pointer-events: none;
}

/* ---------- Keyframes ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(0, 82, 255, 0.4); }
  70% { box-shadow: 0 0 0 14px rgba(0, 82, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 82, 255, 0); }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.6); }
  70% { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes shine {
  from { transform: translateX(-140%) skewX(-20deg); }
  to { transform: translateX(260%) skewX(-20deg); }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
@keyframes countdownBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}
@keyframes orbShift {
  0%, 100% { filter: blur(100px) hue-rotate(0deg); }
  50% { filter: blur(100px) hue-rotate(30deg); }
}

/* ---------- Base Mark (logo) ---------- */
.base-mark {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 800; line-height: 1;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.base-mark svg { width: 62%; height: 62%; display: block; }
.pulse-ring { animation: pulseRing 2.8s ease-out infinite; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -0.3px;
}
.brand:hover .base-mark { transform: rotate(-8deg) scale(1.08); }
.brand-name b { font-weight: 800; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Theme Toggle ---------- */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  transition: all 0.25s var(--ease);
  color: var(--muted);
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: scale(1.08);
}
.theme-toggle .icon-sun, [data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
:not([data-theme="dark"]) .theme-toggle .icon-moon { display: inline; }

/* ---------- Main ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* ---------- Reveal on Scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 100px 24px 60px; animation: fadeUp 0.8s var(--ease) both; position: relative; }
.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 82, 255, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(0, 82, 255, 0.06), transparent);
  pointer-events: none;
  z-index: -1;
}
.hero h1 { animation: fadeUp 0.8s var(--ease) 0.08s both; }
.hero h1 .accent {
  background: linear-gradient(135deg, #0052ff 0%, #1859ff 50%, #3b7aff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  position: relative;
}
.hero h1 .accent::after {
  content: "";
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #0052ff, transparent);
  opacity: 0.4;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 600; margin-bottom: 32px;
  letter-spacing: 0.2px; text-decoration: none;
  transition: all 0.25s;
  box-shadow: var(--shadow-sm);
}
.hero-badge:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.hero-badge .base-mark { width: 18px; height: 18px; font-size: 11px; }
.hero h1 {
  font-size: clamp(42px, 7vw, 72px); font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.05; margin-bottom: 24px; color: var(--text);
  font-family: "Space Grotesk", "Inter", sans-serif;
}
.hero-sub { max-width: 640px; margin: 0 auto 36px; color: var(--muted); font-size: 19px; line-height: 1.6; animation: fadeUp 0.8s var(--ease) 0.12s both; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; animation: fadeUp 0.8s var(--ease) 0.2s both; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 12px;
  text-decoration: none; font-weight: 700; font-size: 15px; cursor: pointer; border: none;
  position: relative; overflow: hidden;
  transition: all 0.25s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, #0052ff, #1859ff);
  color: #fff; box-shadow: 0 4px 16px rgba(0, 82, 255, 0.3);
}
.btn-primary:hover { transform: translateY(-3px); filter: brightness(1.15); box-shadow: 0 8px 28px rgba(0, 82, 255, 0.45); }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: 0; width: 42%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: translateX(-140%) skewX(-20deg);
}
.btn-primary:hover::after { animation: shine 0.9s var(--ease); }
.btn-ghost {
  border: 1px solid var(--border); color: var(--text); background: var(--surface);
  transition: all 0.25s var(--ease);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-glow); }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin: 28px 0 60px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; text-align: center;
  transition: all 0.3s var(--ease);
  animation: fadeUp 0.6s var(--ease) both;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  opacity: 0;
  transition: opacity 0.3s;
}
.stat-card:hover::before { opacity: 1; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.18s; }
.stat-card:nth-child(5) { animation-delay: 0.24s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }
.stat-card:hover {
  transform: translateY(-6px);
  border-color: #0052ff;
  box-shadow: var(--shadow-lg), 0 0 24px rgba(0, 82, 255, 0.25);
}
.stat-value {
  font-size: 36px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--accent);
  font-family: "Space Grotesk", "Inter", sans-serif;
}
.stat-card:nth-child(even) .stat-value { color: var(--warm); }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- Sections ---------- */
.section { margin-bottom: 60px; }
.section h2 {
  font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 20px;
  font-family: "Space Grotesk", "Inter", sans-serif;
  position: relative;
  display: inline-block;
}
.section h2::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--warm), var(--accent));
  border-radius: 2px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.markets { display: grid; gap: 14px; }

/* ---------- Market Cards ---------- */
.market-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  position: relative;
  transition: all 0.3s var(--ease);
  animation: fadeUp 0.55s var(--ease) backwards;
}
.market-card:hover {
  transform: translateY(-5px);
  border-color: #0052ff;
  box-shadow: var(--shadow-lg), 0 0 24px rgba(0, 82, 255, 0.2);
}
.market-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.market-question { font-size: 17px; font-weight: 700; color: var(--text); }
.market-meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.option { margin-bottom: 12px; }
.option-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.option-label { font-weight: 600; color: var(--text); }
.option-val { color: var(--muted); }
.bar { height: 8px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  transform-origin: left;
  animation: growX 0.9s var(--ease) backwards;
  transition: width 0.6s var(--ease);
}
.market-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; }
.pot { color: var(--muted); }
.status-open { color: var(--accent); font-weight: 700; }
.status-closed { color: var(--muted); }
.status-resolved { color: var(--accent); }

/* ---------- Status Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.chip-open { background: var(--accent-bg); color: var(--accent); }
.chip-open::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); animation: pulseDot 1.8s ease-in-out infinite;
}
.chip-resolved { background: rgba(22, 163, 74, 0.1); color: var(--success); }
.chip-cancelled { background: rgba(107, 114, 128, 0.1); color: var(--muted); }

/* ---------- Volume Chart ---------- */
.chart {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 22px 12px; min-height: 180px;
}
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart-bar {
  width: 100%; min-height: 2px; border-radius: 6px 6px 0 0;
  background: var(--chart-bar);
  transform-origin: bottom;
  animation: growY 0.8s var(--ease) backwards;
  transition: height 0.6s var(--ease);
}
.chart-col:hover .chart-bar { filter: brightness(1.15); }
.chart-day { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* ---------- Winner Highlight ---------- */
.option-winner .option-label { color: var(--accent); font-weight: 700; }
.option-winner .bar-fill, .bar-fill-win {
  background: linear-gradient(90deg, var(--accent-2), var(--accent-soft));
  box-shadow: 0 0 14px rgba(0, 82, 255, 0.35);
}
.option-winner { animation: glowPulse 3.2s ease-in-out infinite; }

/* ---------- Leaderboard ---------- */
.leaderboard { display: grid; gap: 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px;
  transition: all 0.25s var(--ease);
  animation: fadeUp 0.5s var(--ease) backwards;
}
.lb-row:hover { border-color: var(--accent); transform: translateX(3px); box-shadow: var(--shadow-glow); }
.lb-place { font-weight: 800; width: 28px; color: var(--muted); }
.lb-name { font-weight: 700; flex: 1; color: var(--text); }
.lb-amt { color: var(--accent); font-weight: 700; }

/* ---------- Wallet Panel ---------- */
.wallet {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  transition: all 0.3s;
}
.wallet:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.wallet-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 15px; color: var(--text); }
.wallet-row b { color: var(--accent); }
.wallet-addr {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px; color: var(--muted); word-break: break-all;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin: 8px 0 16px;
}
.hint { font-size: 12.5px; color: var(--muted); }

/* ---------- Footer Badge ---------- */
.powered {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); text-decoration: none; font-weight: 600;
  transition: color 0.25s;
}
.powered:hover { color: var(--accent); }
.powered .base-mark { width: 16px; height: 16px; font-size: 10px; }

.footer {
  border-top: 1px solid var(--border-soft); text-align: center;
  padding: 32px 24px; color: var(--muted); font-size: 13px;
}
.footer p { margin-bottom: 10px; }
.footer-grid {
  max-width: 1100px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  text-align: left;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .base-mark { width: 26px; height: 26px; font-size: 15px; }
.footer-tag { display: block; color: var(--muted2); font-size: 12px; }
.footer-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chain-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 12px; font-weight: 600;
  transition: all 0.2s;
}
.chain-chip:hover { border-color: var(--accent); color: var(--accent); }

.author-links {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap; margin: 0 0 14px; font-size: 12px;
}
.author-links span { color: var(--muted2); }
.author-links a {
  color: var(--muted); text-decoration: none; font-weight: 600;
  transition: color 0.2s;
}
.author-links a:hover { color: var(--accent); }

.empty { color: var(--muted); padding: 24px; text-align: center; animation: fadeIn 0.4s both; }

.m-link { color: var(--accent); text-decoration: none; font-weight: 600; transition: color 0.2s; }
.m-link:hover { text-decoration: underline; color: var(--accent-2); }

/* ---------- How It Works ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: all 0.3s var(--ease);
  animation: fadeUp 0.6s var(--ease) backwards;
}
.step:nth-child(2) { animation-delay: 0.1s; }
.step:nth-child(3) { animation-delay: 0.2s; }
.step:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow), var(--shadow-glow); }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; font-size: 15px;
  animation: popIn 0.55s var(--ease) both;
}
.step h3 { font-size: 17px; margin-bottom: 6px; color: var(--text); }
.step p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.5; }

/* ---------- User / Donate Page ---------- */
.user-hero { text-align: center; padding: 52px 24px 24px; animation: fadeUp 0.7s var(--ease) both; }
.avatar {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; margin-bottom: 16px; color: #fff;
  animation: popIn 0.6s var(--ease) both;
}
.qr {
  margin: 24px auto; width: 220px; height: 220px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s var(--ease);
}
.qr img { width: 100%; height: 100%; display: block; }
.qr:hover { transform: scale(1.03); box-shadow: var(--shadow-glow); }
.deposit-box { max-width: 580px; margin: 0 auto; }

/* ---------- Urgent Countdown ---------- */
.countdown-urgent { color: var(--danger); font-weight: 700; animation: countdownBlink 1.4s ease-in-out infinite; }

/* ---------- Loading Skeletons ---------- */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--bg2); border-radius: 10px;
  color: transparent !important;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.skeleton-card {
  height: 110px; border-radius: var(--radius);
  background: var(--bg2); position: relative; overflow: hidden;
  border: 1px solid var(--border-soft);
}
.skeleton-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.skeleton-bar {
  flex: 1; border-radius: 6px 6px 0 0;
  background: var(--bg2); position: relative; overflow: hidden; min-height: 12px;
}
.skeleton-bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

/* ---------- Onchain Market Page ---------- */
.oc-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.oc-option { margin: 10px 0; }
.oc-option-head { display: flex; justify-content: space-between; font-size: 14px; }
.oc-option-bar { height: 10px; border-radius: 6px; background: var(--border); overflow: hidden; margin-top: 4px; }
.oc-option-fill { height: 100%; background: var(--accent); transition: width 0.6s var(--ease); }

/* ---------- Theme Transition ---------- */
.theme-transitioning * {
  transition-duration: 0s !important;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Print ---------- */
@media print {
  .nav, .orb, .theme-toggle, .hero-cta { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .market-card, .stat-card { border: 1px solid #ddd; box-shadow: none; }
}

/* ---------- Atoms ---------- */
.accent { color: var(--accent); }
.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: -0.2px;
}
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg); color: var(--text-secondary);
  padding: 1px 6px; border-radius: 6px;
}
.btn-sm { padding: 8px 16px; font-size: 13.5px; border-radius: 10px; }
.btn-full { width: 100%; justify-content: center; margin-top: 12px; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Connect cards ---------- */
.connect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 820px) { .connect-grid { grid-template-columns: 1fr; } }
.tg-widget { display: flex; justify-content: center; align-items: center; min-height: 48px; margin-top: 12px; }
.connect-list { list-style: none; padding: 0; }
.connect-list li {
  padding: 10px 0 10px 18px; border-left: 2px solid var(--border);
  margin-bottom: 4px; font-size: 14.5px; color: var(--text-secondary);
}
.connect-list li b { color: var(--text); }
.connect-list li:hover { border-left-color: var(--accent); }

/* ---------- Workspace shell ---------- */
.ws {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}
.ws-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--border-soft);
}
.ws-user { font-size: 14.5px; font-weight: 700; }
.ws-bal { font-size: 26px; font-weight: 800; letter-spacing: -0.6px; color: var(--accent); }
.ws-cur { font-size: 13px; font-weight: 700; color: var(--muted); }
.ws-actions { display: flex; gap: 8px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.tab {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  transition: all 0.2s var(--ease);
}
.tab:hover { color: var(--text); border-color: var(--accent); }
.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 12px rgba(0, 82, 255, 0.28);
}
.panel { animation: fadeUp 0.35s var(--ease) both; }

/* ---------- Form fields ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-bottom: 7px; }
.input {
  width: 100%; padding: 12px 14px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--shadow-glow);
}
.input:disabled { opacity: 0.55; cursor: not-allowed; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; }

/* ---------- Amount chips ---------- */
.amount-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.amount-chip {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  transition: all 0.2s var(--ease);
}
.amount-chip:hover { border-color: var(--accent); color: var(--accent); }
.amount-chip.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* ---------- Option pickers ---------- */
.opt-list { display: grid; gap: 8px; }
.opt-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 14.5px;
  padding: 12px 14px; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.2s var(--ease); text-align: left;
}
.opt-btn:hover { border-color: var(--accent); }
.opt-btn.selected {
  background: var(--accent-bg); border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.opt-label { font-weight: 600; }
.opt-price { color: var(--muted); font-variant-numeric: tabular-nums; }
.opt-btn.selected .opt-price { color: var(--accent); }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }

/* ---------- Review rows ---------- */
.review {
  margin-top: 20px; padding: 18px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); animation: slideDown 0.3s var(--ease) both;
}
.rows { display: grid; gap: 1px; background: var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; }
.row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  background: var(--card); padding: 11px 14px; font-size: 14px;
}
.row-k { color: var(--muted); }
.row-v { font-weight: 700; text-align: right; word-break: break-all; }
.row-v.pos { color: var(--success); }
.row-v.neg { color: var(--danger); }
.hint.pos { color: var(--success); }
.hint.neg { color: var(--danger); }

/* ---------- Messages ---------- */
.msg { margin-top: 12px; font-size: 14px; min-height: 0; }
.msg:empty { display: none; }
.msg.ok { color: var(--success); font-weight: 600; }
.msg.err { color: var(--danger); font-weight: 600; }

/* ---------- QR + copy ---------- */
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }

/* ---------- Fees and limits table ---------- */
.terms-table {
  width: 100%; border-collapse: collapse;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.terms-table th, .terms-table td {
  text-align: left; padding: 12px 16px; font-size: 14.5px;
  border-bottom: 1px solid var(--border-soft);
}
.terms-table th {
  background: var(--surface2); color: var(--text-secondary);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.5px;
}
.terms-table tr:last-child td { border-bottom: none; }
.terms-table td:last-child { font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ---------- Bot command menu ---------- */
.cmd-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.cmd {
  display: flex; align-items: baseline; gap: 10px;
  background: var(--card); padding: 10px 14px; font-size: 14px;
  border: none; font-family: inherit; text-align: left; cursor: pointer;
  transition: background 0.2s var(--ease);
}
.cmd:hover { background: var(--card-hover); }
.cmd:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cmd b { color: var(--accent); font-size: 13.5px; white-space: nowrap; }
.cmd span { color: var(--muted); }
@media (max-width: 520px) { .cmd-grid { grid-template-columns: 1fr; } }

@media print {
  .ws, .connect, .tabs, .review { break-inside: avoid; }
  .cmd-grid { break-inside: auto; }
}
