/* rucmc — components */

/* ---------- container ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ---------- ticker strip ---------- */
.ticker {
  height: var(--ticker-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.ticker-track {
  display: flex;
  gap: 32px;
  align-items: center;
  height: 100%;
  padding: 0 var(--container-pad);
  white-space: nowrap;
  animation: ticker-scroll 90s linear infinite;
  width: max-content;
}
.ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.ticker-item .sym { font-weight: 600; color: var(--text-primary); }
.ticker-item .px  { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.ticker-item .ch  { font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12px; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- header ---------- */
.header {
  height: var(--header-h);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 120ms var(--ease);
}
.nav a:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav a.active { color: var(--brand); }
.nav .caret { color: var(--text-tertiary); }

.search {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-secondary);
  color: var(--text-tertiary);
}
.search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
}
.search input::placeholder { color: var(--text-tertiary); }
.search kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
}
.icon-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
}
.btn:hover { background: var(--border); }
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-outline:hover { background: var(--bg-tertiary); }
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
}
.btn-ghost:hover { background: var(--bg-tertiary); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }

/* ---------- pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.pill-up   { background: var(--up-bg);   color: var(--up); }
.pill-down { background: var(--down-bg); color: var(--down); }
.pill-flat { background: var(--bg-tertiary); color: var(--neutral); }
.pill-soft { background: var(--brand-soft); color: var(--brand); }
.pill-warn { background: #FEF3C7; color: #B45309; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.chip:hover { background: var(--bg-secondary); border-color: var(--border); }

/* ---------- cards ---------- */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 20px; }

/* ---------- table ---------- */
.coin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.coin-table thead th {
  position: sticky;
  top: var(--header-h);
  background: var(--bg-primary);
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.coin-table thead th.left { text-align: left; }
.coin-table thead th .sorted { color: var(--text-primary); }
.coin-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}
.coin-table tbody td.left { text-align: left; }
.coin-table tbody tr { cursor: pointer; transition: background 100ms var(--ease); }
.coin-table tbody tr:hover { background: var(--bg-secondary); }

/* compact variant */
.coin-table.compact thead th { padding: 8px 10px; font-size: 11px; }
.coin-table.compact tbody td { padding: 9px 10px; font-size: 13px; }

/* spacious variant */
.coin-table.spacious thead th { padding: 16px 14px; }
.coin-table.spacious tbody td { padding: 18px 14px; font-size: 14.5px; }

.rank { color: var(--text-tertiary); font-size: 13px; font-weight: 500; width: 36px; }
.coin-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.coin-cell > div { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; gap: 1px; }
.coin-logo {
  width: 28px; height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  font-family: var(--font-sans);
}
.coin-logo.sm { width: 22px; height: 22px; font-size: 10px; }
.coin-logo.lg { width: 48px; height: 48px; font-size: 18px; }
.coin-logo.xl { width: 56px; height: 56px; font-size: 20px; }
.coin-name {
  font-weight: 600; font-size: 14px;
  display: block; max-width: 100px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* обёртка таблиц; горизонтальный скролл включаем только на мобиле,
   чтобы не ломать sticky-шапку на десктопе */
.table-wrap { width: 100%; }
/* приоритет колонок на мобиле: оставляем #, монету, цену, 24ч, капитализацию */
@media (max-width: 760px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .coin-table .mob-hide { display: none !important; }
  .coin-table .coin-name { max-width: 100px; }
}
@media (max-width: 460px) {
  .coin-table .xs-hide { display: none !important; }
}
.coin-ticker { display: block; color: var(--text-tertiary); font-size: 11.5px; font-weight: 500; margin-left: 0; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.02em; }
@media (max-width: 768px) { .coin-name { max-width: 100px; } }
@media (max-width: 640px) { .coin-name { max-width: 70px; } }
.coin-meta { color: var(--text-tertiary); font-size: 12px; }

/* sparkline */
.spark { display: block; width: 140px; height: 40px; }
.spark.sm { width: 100px; height: 28px; }

/* market stat bar */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.stat-bar .cell {
  padding: 14px 18px;
  border-right: 1px solid var(--border);
}
.stat-bar .cell:last-child { border-right: none; }
.stat-bar .label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 4px;
}
.stat-bar .value {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* breadcrumbs */
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-tertiary);
}
.crumbs a { color: var(--text-secondary); }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { color: var(--text-tertiary); }
.crumbs .current { color: var(--text-primary); }

/* footer */
.footer {
  margin-top: 64px;
  background: #0F172A;
  color: #94A3B8;
  font-size: 13.5px;
}
.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 48px var(--container-pad) 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer h4 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #CBD5E1;
  margin: 0 0 14px;
  font-weight: 600;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin: 8px 0; }
.footer a { color: #94A3B8; }
.footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #1F2937;
  padding: 20px var(--container-pad);
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #64748B;
}

/* tooltip-like info dot */
.info-dot {
  display: inline-flex; width: 13px; height: 13px;
  border-radius: 999px; background: transparent;
  border: 1px solid var(--text-tertiary); color: var(--text-tertiary);
  align-items: center; justify-content: center; font-size: 9px;
  margin-left: 4px; cursor: help;
  font-family: var(--font-sans);
}

/* sections */
.section { margin: 40px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
.section-head a { font-size: 13px; font-weight: 500; }

/* tab bar */
.tabs {
  display: inline-flex;
  background: var(--bg-tertiary);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 0;
}
.tabs button {
  height: 30px;
  padding: 0 12px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 4px;
}
.tabs button.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}

/* coin logo color presets — used for placeholder data */
.lg-btc { background: linear-gradient(135deg, #F7931A, #E58306); }
.lg-eth { background: linear-gradient(135deg, #627EEA, #3C5BDB); }
.lg-usdt{ background: linear-gradient(135deg, #26A17B, #1F8862); }
.lg-bnb { background: linear-gradient(135deg, #F0B90B, #C99700); }
.lg-sol { background: linear-gradient(135deg, #9945FF, #14F195); }
.lg-xrp { background: linear-gradient(135deg, #23292F, #4F5762); }
.lg-usdc{ background: linear-gradient(135deg, #2775CA, #1D5BA0); }
.lg-doge{ background: linear-gradient(135deg, #C3A634, #A18820); }
.lg-ada { background: linear-gradient(135deg, #0033AD, #002787); }
.lg-trx { background: linear-gradient(135deg, #EF0027, #B8001E); }
.lg-ton { background: linear-gradient(135deg, #0098EA, #0078BE); }
.lg-shib{ background: linear-gradient(135deg, #FFA409, #E68C00); }
.lg-avax{ background: linear-gradient(135deg, #E84142, #B82E2F); }
.lg-link{ background: linear-gradient(135deg, #2A5ADA, #1E44A8); }
.lg-dot { background: linear-gradient(135deg, #E6007A, #B0005F); }
.lg-bch { background: linear-gradient(135deg, #0AC18E, #088A6A); }
.lg-near{ background: linear-gradient(135deg, #000000, #3B4252); }
.lg-matic{ background: linear-gradient(135deg, #8247E5, #5E2EBB); }
.lg-ltc { background: linear-gradient(135deg, #345D9D, #244478); }
.lg-icp { background: linear-gradient(135deg, #F15A24, #29ABE2); }
.lg-binance { background: linear-gradient(135deg, #F0B90B, #C99700); }
.lg-okx { background: linear-gradient(135deg, #0F172A, #475569); }
.lg-bybit { background: linear-gradient(135deg, #F7A600, #C97F00); }
.lg-kucoin { background: linear-gradient(135deg, #24AE8F, #1A8870); }
.lg-bitget { background: linear-gradient(135deg, #00F0FF, #0090C9); color: #0F172A; }
.lg-mexc { background: linear-gradient(135deg, #1972F5, #1457C2); }

/* misc */
.divider { height: 1px; background: var(--border); margin: 24px 0; border: none; }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 4px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.grow { flex: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .search { max-width: 240px; }
  .stat-bar { grid-template-columns: repeat(3, 1fr); }
  .stat-bar .cell:nth-child(3n) { border-right: none; }
  .stat-bar .cell { border-bottom: 1px solid var(--border); }
  .stat-bar .cell:nth-last-child(-n+3) { border-bottom: none; }
}
@media (max-width: 768px) {
  .header-inner { gap: 12px; }
  .nav { display: none; }
  .search { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; padding: 36px var(--container-pad) 24px; }
  .footer-bottom { flex-direction: column; gap: 6px; align-items: flex-start; }
  .stat-bar { grid-template-columns: repeat(2, 1fr); }
  .stat-bar .cell:nth-child(odd) { border-right: 1px solid var(--border); }
  .stat-bar .cell:nth-child(even) { border-right: none; }
  .stat-bar .cell { border-bottom: 1px solid var(--border); }
  .stat-bar .cell:nth-last-child(-n+2) { border-bottom: none; }
  .ticker { display: none; }
}
@media (max-width: 640px) {
  .header-inner { padding: 0 var(--container-pad); }
  .footer-inner { grid-template-columns: 1fr; }
  .stat-bar { grid-template-columns: 1fr; }
  .stat-bar .cell { border-right: none !important; border-bottom: 1px solid var(--border) !important; }
  .stat-bar .cell:last-child { border-bottom: none !important; }
  .coin-table thead th, .coin-table tbody td { padding: 10px 8px; font-size: 13px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .crumbs { font-size: 12px; flex-wrap: wrap; }
}

/* mobile menu */
.mobile-menu-btn { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: var(--r-sm); border: none; background: transparent; color: var(--text-primary); }
.mobile-menu-btn:hover { background: var(--bg-tertiary); }
@media (max-width: 768px) {
  .mobile-menu-btn { display: inline-flex; }
}

.mobile-drawer {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,0.5); backdrop-filter: blur(4px);
  display: none;
}
.mobile-drawer.open { display: block; }
.mobile-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 86%; max-width: 360px;
  background: var(--bg-primary); padding: 18px 18px 24px;
  display: flex; flex-direction: column; gap: 8px;
  animation: drwIn 200ms var(--ease);
}
@keyframes drwIn { from { transform: translateX(100%); } to { transform: none; } }
.mobile-drawer-panel .drw-search { background: var(--bg-secondary); height: 44px; padding: 0 14px; border-radius: var(--r-sm); display: flex; align-items: center; gap: 8px; color: var(--text-tertiary); margin-bottom: 8px; }
.mobile-drawer-panel .drw-search input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; color: var(--text-primary); }
.mobile-drawer-panel a {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: var(--r-sm); color: var(--text-primary); font-weight: 500;
}
.mobile-drawer-panel a:hover, .mobile-drawer-panel a.active { background: var(--bg-tertiary); color: var(--brand); }
.mobile-drawer-panel .close-x {
  position: absolute; right: 10px; top: 10px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--text-secondary); border-radius: var(--r-sm);
}
