:root {
  --bg: #070d18;
  --bg-soft: #0d1729;
  --card: rgba(16, 27, 46, 0.9);
  --line: rgba(244, 200, 106, 0.24);
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #eef3ff;
  --muted: #98a9ca;
  --gold: #f4c86a;
  --gold-deep: #d99a32;
  --jade: #34d399;
  --danger: #f87171;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: radial-gradient(circle at 18% 0%, #15294a 0%, var(--bg) 62%); color: var(--text); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; min-height: 100vh; }
a { color: var(--gold); }
code { background: rgba(255, 255, 255, 0.07); padding: 2px 6px; border-radius: 6px; font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; color: #dbeafe; }

.topbar { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(12px); background: rgba(7, 13, 24, 0.86); border-bottom: 1px solid var(--line-soft); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-orb { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #161108; box-shadow: 0 4px 18px rgba(244, 200, 106, 0.35); }
.brand small { display: block; color: var(--muted); font-size: 11.5px; }

.nav-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nav-btn, .nav-link { background: transparent; border: 1px solid transparent; color: var(--muted); padding: 8px 13px; border-radius: 10px; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; }
.nav-btn:hover, .nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-btn.is-active { background: rgba(244, 200, 106, 0.14); border-color: var(--line); color: var(--gold); }

.wallet-bar { display: flex; align-items: center; gap: 8px; }
.status-pill { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.status-pill.is-online { color: var(--jade); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.1); }
.status-pill.is-standby { color: var(--gold); border-color: var(--line); background: rgba(244, 200, 106, 0.1); }

.btn { cursor: pointer; border-radius: 10px; padding: 10px 15px; font-weight: 600; font-size: 13.5px; border: 1px solid var(--line); background: rgba(244, 200, 106, 0.1); color: var(--gold); transition: transform 0.12s ease, opacity 0.12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #161006; border: none; }
.btn-jade { background: linear-gradient(135deg, #34d399, #10b981); color: #042217; border: none; }
.btn-ghost { background: rgba(255, 255, 255, 0.05); color: var(--text); border-color: var(--line-soft); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-full { width: 100%; margin-top: 12px; padding: 12px 16px; font-size: 14.5px; }

.container { max-width: 1180px; margin: 0 auto; padding: 24px 16px 56px; }
.panel { display: none; }
.panel.is-active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.hero-card { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; margin-bottom: 18px; }
.pill-gold { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--gold); background: rgba(244, 200, 106, 0.14); border: 1px solid rgba(244, 200, 106, 0.26); }
h1 { margin: 12px 0 10px; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; }
h2 { margin: 0 0 10px; font-size: 19px; }
h3 { margin: 0 0 10px; font-size: 16.5px; }
.gold-text { color: var(--gold); }
.lead { color: #cbd5e1; line-height: 1.6; font-size: 14.5px; margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.spec-card { background: rgba(7, 13, 24, 0.72); border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px; }
.spec-list { margin: 0; display: grid; gap: 8px; }
.spec-list > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); padding-bottom: 6px; font-size: 13px; }
.spec-list dt { color: var(--muted); }
.spec-list dd { margin: 0; text-align: right; }
.copyable { cursor: pointer; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-box { background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px; padding: 14px 16px; }
.metric-box span { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.metric-box strong { font-size: 22px; color: var(--gold); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: 16px; padding: 18px; }
.clean-list { margin: 8px 0 0; padding-left: 18px; color: #cbd5e1; font-size: 13.5px; line-height: 1.65; }
.clean-list li { margin-bottom: 6px; }

.field-group { display: flex; gap: 8px; margin-top: 10px; }
.field-group input { flex: 1; background: rgba(7, 13, 24, 0.8); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.result-box { margin-top: 12px; padding: 12px; border-radius: 10px; background: rgba(7, 13, 24, 0.72); border: 1px solid var(--line-soft); font-size: 13px; line-height: 1.55; word-break: break-word; }
.is-hidden { display: none; }

/* DEX SWAP */
.swap-layout { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 18px; align-items: start; }
.swap-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 10px; }
.swap-box { background: rgba(7, 13, 24, 0.85); border: 1px solid var(--line-soft); border-radius: 14px; padding: 14px; }
.swap-row-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.swap-input-row { display: flex; gap: 10px; align-items: center; }
.swap-input-row input { flex: 1; min-width: 0; background: transparent; border: none; color: var(--text); font-size: 24px; font-weight: 700; outline: none; }
.swap-input-row select { background: #14223b; color: var(--gold); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 13.5px; }
.flip-wrap { display: flex; justify-content: center; margin: -8px 0; position: relative; z-index: 2; }
.flip-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #13213a; color: var(--gold); font-size: 16px; cursor: pointer; }
.slippage-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.slip-pills { display: flex; gap: 6px; }
.slip-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-soft); color: var(--text); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 12px; }
.slip-btn.is-active { border-color: var(--gold); color: var(--gold); background: rgba(244, 200, 106, 0.14); }
.quote-meta { margin-top: 12px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); display: grid; gap: 6px; font-size: 13px; }
.quote-meta > div { display: flex; justify-content: space-between; gap: 10px; }
.quote-meta span { color: var(--muted); }
.pool-list { display: grid; gap: 10px; margin-top: 12px; }
.pool-item { padding: 12px; border-radius: 12px; background: rgba(7, 13, 24, 0.72); border: 1px solid var(--line-soft); font-size: 13px; }
.info-note { margin-top: 14px; padding: 12px; border-radius: 12px; background: rgba(52, 211, 153, 0.07); border: 1px solid rgba(52, 211, 153, 0.25); font-size: 13px; line-height: 1.55; color: #d1fae5; }

/* FUN */
.fun-hero { margin-bottom: 16px; }
.fun-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.arcade-card { grid-column: 1 / -1; }
.arcade-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.arcade-stats { display: flex; gap: 14px; font-size: 13.5px; }
.arcade-stats strong { color: var(--gold); }
.wheel-card { display: flex; flex-direction: column; align-items: center; }
.wheel-wrap { position: relative; margin: 8px 0 4px; }
.wheel-pointer { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); color: var(--gold); font-size: 20px; text-shadow: 0 2px 8px #000; z-index: 2; }
#arcadeCanvas { width: 100%; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, #091326 0%, #0e1d36 100%); display: block; touch-action: none; }
.eco-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.eco-pill { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(244, 200, 106, 0.08); text-decoration: none; font-weight: 600; font-size: 13px; }

.footer { max-width: 1180px; margin: 0 auto; padding: 18px 16px 32px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12.5px; }

@media (max-width: 860px) {
  .hero-card, .two-col, .swap-layout, .fun-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

