:root {
  --cmc-blue: #3861fb;
  --cmc-blue-hover: #1e53e5;
  --green: #16c784;
  --red: #ea3943;
  --text: #0d1421;
  --muted: #58667e;
  --line: #eff2f5;
  --bg: #ffffff;
  --soft: #f8fafd;
  --chip: #f3f5f7;
  --shadow: 0 4px 24px rgba(88,102,126,.08);
  --max: 1310px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}

/* Promo */
.promo-banner {
  background: linear-gradient(90deg, #171924, #3861fb 55%, #16c784);
  color: #fff;
  font-size: 12px;
}
.promo-banner-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.promo-cta {
  background: #fff;
  color: var(--cmc-blue);
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

/* Global stats */
.global-stats {
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  background: #fff;
}
.global-stats-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  white-space: nowrap;
}
.global-stats b { color: var(--text); font-weight: 600; }
.up { color: var(--green) !important; }
.down { color: var(--red) !important; }
.live-meta { margin-inline-start: auto; display: inline-flex; gap: 8px; align-items: center; }
.live-badge {
  font-weight: 700; font-size: 11px;
  padding: 2px 8px; border-radius: 999px;
}
.live-badge.on { background: #e8faf2; color: var(--green); }
.live-badge.off { background: var(--chip); color: var(--muted); }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.logo-mark {
  width: 24px; height: 24px;
  background: var(--cmc-blue);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.nav {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.nav a:hover { color: var(--cmc-blue); }
.nav a.active { color: var(--cmc-blue); }
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.locale-control select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: #fff;
  font-size: 12px;
  max-width: 128px;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 210px;
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
}
.search:focus-within { border-color: #c5d1ff; background: #fff; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 12px; }
.btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-ghost { background: transparent; }
.btn-blue { background: var(--cmc-blue); color: #fff; }
.btn-blue:hover { background: var(--cmc-blue-hover); }
.btn-green { background: var(--green); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--line); }
.btn-sm { padding: 6px 10px; font-size: 11px; }

/* Subnav */
.subnav {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.subnav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.subnav a {
  padding: 12px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.subnav a:hover, .subnav a.active {
  color: var(--text);
  border-bottom-color: var(--cmc-blue);
}

/* Rewards strip compact */
.rewards-strip {
  max-width: var(--max);
  margin: 12px auto 0;
  padding: 0 16px;
}
.rewards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.reward-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fff, #f7f9ff);
}
.reward-card .label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.reward-card .value { font-size: 22px; font-weight: 800; margin-top: 2px; }
.reward-card .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.reward-card .action { margin-top: 8px; }
.progress {
  height: 6px; background: #e9eef7; border-radius: 999px; overflow: hidden; margin-top: 10px;
}
.progress > span {
  display: block; height: 100%; width: 62%;
  background: linear-gradient(90deg, var(--cmc-blue), var(--green));
}

/* Page shell */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 16px 48px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.page-head h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 820px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.tab.active {
  background: #eef2ff;
  color: var(--cmc-blue);
  border-color: #d6e0ff;
}

/* Highlights */
.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.hl-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.hl-card h3 {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.hl-card h3 a { color: var(--cmc-blue); font-weight: 600; }
.hl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.hl-row:first-of-type { border-top: 0; }
.coin-ico {
  width: 24px; height: 24px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  display: grid; place-items: center;
  color: #fff; font-size: 9px; font-weight: 800;
}
.coin-name { font-weight: 650; font-size: 13px; }
.coin-sym {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  text-transform: uppercase;
}
.chg { font-weight: 650; font-size: 12px; margin-left: auto; white-space: nowrap; }

/* Table */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  background: #fff;
}
table.markets {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  font-size: 13px;
}
.markets th {
  text-align: left;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  white-space: nowrap;
  cursor: default;
}
.markets td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
.markets tr:hover td { background: #fafbfd; }
.markets .right { text-align: right; }
.markets .star {
  border: 0; background: transparent; color: #c5cdd9; cursor: pointer; font-size: 14px;
}
.markets .star.on { color: #f6b93b; }
.name-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.name-cell a:hover .coin-name { color: var(--cmc-blue); }
.spark { width: 136px; height: 40px; }
.vol-sub { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.mini-claim {
  border: 0; background: #eef8f3; color: var(--green);
  border-radius: 8px; padding: 5px 8px; font-weight: 700; font-size: 11px; cursor: pointer;
}

/* Content pages */
.content-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  margin-bottom: 12px;
}
.content-card h2 { font-size: 18px; margin-bottom: 8px; }
.content-card p { color: var(--muted); margin-bottom: 10px; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.link-list { display: grid; gap: 8px; }
.link-list a {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.link-list a:hover { border-color: #c5d1ff; background: #f8faff; }
.link-list .ext { color: var(--muted); font-size: 12px; font-weight: 500; }

.coin-hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
  margin-bottom: 16px;
}
.stat-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.stat-box .k { font-size: 11px; color: var(--muted); font-weight: 600; }
.stat-box .v { font-size: 18px; font-weight: 800; margin-top: 4px; }

/* Float / modal */
.float-reward {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 280px; background: #0d1421; color: #fff;
  border-radius: 14px; box-shadow: 0 12px 40px rgba(13,20,33,.35); padding: 14px;
}
.float-reward h4 { font-size: 14px; margin-bottom: 4px; }
.float-reward p { font-size: 12px; color: #aab4c4; margin-bottom: 10px; }
.float-reward .row { display: flex; gap: 8px; }
.float-reward .close {
  position: absolute; top: 8px; right: 10px;
  background: transparent; border: 0; color: #8b97a8; cursor: pointer;
}
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(13,20,33,.55);
  z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}
.modal-head {
  padding: 16px 16px 0;
  display: flex; justify-content: space-between; align-items: start;
}
.modal-body { padding: 12px 16px 16px; }
.modal-body p { color: var(--muted); margin-bottom: 10px; }
.bonus-box {
  border: 1px dashed #c9d6ff; background: #f5f8ff;
  border-radius: 12px; padding: 14px; text-align: center; margin-bottom: 12px;
}
.bonus-box .amt { font-size: 28px; font-weight: 800; color: var(--cmc-blue); }
.bonus-box .sub { color: var(--muted); font-size: 12px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.field input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; outline: none;
}
.field input:focus { border-color: #a9bcff; box-shadow: 0 0 0 3px rgba(56,97,251,.12); }
.modal-actions .btn { width: 100%; }
.status-toast {
  display: none; margin-top: 10px; padding: 10px;
  border-radius: 8px; font-size: 12px; background: #eef8f3; color: #0f7a4d; border: 1px solid #cfeede;
}
.status-toast.warn { background: #fff8e8; color: #8a5a00; border-color: #ffe2a8; }
.spinner {
  width: 14px; height: 14px; border: 2px solid #dbe4ff; border-top-color: var(--cmc-blue);
  border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; margin-right: 6px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--soft);
  padding: 28px 16px;
  font-size: 12px;
  color: var(--muted);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 18px;
}
.site-footer h4 { color: var(--text); margin-bottom: 10px; font-size: 13px; }
.site-footer a { display: block; margin: 6px 0; }
.site-footer a:hover { color: var(--cmc-blue); }
.disclaimer { margin-top: 18px; max-width: var(--max); margin-left: auto; margin-right: auto; line-height: 1.6; }

html[dir="rtl"] .header-actions { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .markets .right { text-align: left; }
html[dir="rtl"] .chg { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .float-reward { right: auto; left: 16px; }
html[dir="rtl"] .live-meta { margin-inline-start: 0; margin-inline-end: auto; }

@media (max-width: 980px) {
  .nav { display: none; }
  .rewards-grid, .highlights, .coin-hero, .grid-2, .footer-inner { grid-template-columns: 1fr 1fr; }
  .search { min-width: 140px; }
}
@media (max-width: 640px) {
  .rewards-grid, .highlights, .coin-hero, .grid-2, .stat-boxes, .footer-inner { grid-template-columns: 1fr; }
  .float-reward { left: 12px; right: 12px; width: auto; }
  .header-actions .btn-ghost { display: none; }
}
