/* ═══════════════════════════════════════════════════════════
   CryptoPulse — ежедневный обзор крипторынка
   Тёмная тема, без внешних зависимостей.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #0b0e14;
  --bg-2: #0f131c;
  --panel: #12161f;
  --panel-2: #161b26;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #e6edf3;
  --muted: #9aa4b2;
  --faint: #6b7280;
  --green: #16c784;
  --green-dim: #0e9f6e;
  --red: #ea3943;
  --red-dim: #c62f38;
  --violet: #8a7dff;
  --accent-1: #6d7bff;
  --accent-2: #22d3ee;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(109, 123, 255, 0.10), transparent 60%),
    radial-gradient(1000px 500px at 0% 0%, rgba(34, 211, 238, 0.06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.wrap { width: min(1140px, 92vw); margin: 0 auto; }

.num, .delta, .stat-value, .chip-value, .t-price, .t-num, .mv-price, .spot-price, .gauge-val {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ── Шапка ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 14, 20, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 62px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 6px 18px -6px rgba(109, 123, 255, 0.7);
}
.brand-text { font-size: 18px; }
.brand.sm .brand-text { font-size: 16px; }
.nav {
  display: flex;
  gap: 22px;
  margin-left: 8px;
  font-size: 14.5px;
  color: var(--muted);
}
.nav a { transition: color 0.15s; }
.nav a:hover { color: var(--text); }
.header-meta { margin-left: auto; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  white-space: nowrap;
}
.badge-live { color: #b8f5da; background: rgba(22, 199, 132, 0.12); border-color: rgba(22, 199, 132, 0.35); }
.badge-snap { color: var(--muted); background: rgba(255, 255, 255, 0.04); }
.badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(22, 199, 132, 0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 199, 132, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(22, 199, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 199, 132, 0); }
}

/* ── Hero ── */
.hero { padding: 54px 0 26px; }
.hero-kicker {
  margin: 0 0 14px;
  color: var(--violet);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.hero-headline {
  margin: 0 0 16px;
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  background: linear-gradient(180deg, #fff, #c6cfdd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  max-width: 20ch;
}
.hero-summary {
  margin: 0 0 26px;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 18.5px);
}
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  min-width: 150px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  position: relative;
}
.chip-label { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.03em; }
.chip-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.chip-value { font-size: 19px; font-weight: 700; }
.chip .delta { font-size: 12.5px; }

/* ── Секции ── */
.section { padding: 30px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.section-title { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -0.01em; }
.section-title.sm { font-size: 17px; margin-bottom: 14px; }
.section-sub { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Дельты ── */
.delta { font-weight: 650; }
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }
.delta-flat { color: var(--muted); }

/* ── Карточки показателей ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.stat { padding: 18px 18px 16px; }
.stat-label { color: var(--faint); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-value { margin-top: 8px; font-size: 24px; font-weight: 780; letter-spacing: -0.01em; }
.stat-sub { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ── Тепловая карта ── */
.tf-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tf-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tf-btn:hover { color: var(--text); }
.tf-btn.active { background: var(--accent-1); color: #fff; }

.treemap-wrap { padding: 8px; overflow: hidden; }
.treemap {
  position: relative;
  width: 100%;
  height: clamp(360px, 52vw, 560px);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2);
}
.tm-cell {
  position: absolute;
  border-radius: 5px;
  padding: 5px 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.12;
  cursor: default;
  transition: filter 0.12s, outline-color 0.12s;
  outline: 1px solid transparent;
}
.tm-cell:hover { filter: brightness(1.14); outline-color: rgba(255, 255, 255, 0.4); z-index: 2; }
.tm-sym { font-weight: 700; font-size: 12px; letter-spacing: 0.01em; }
.tm-sym-lg { font-size: 15px; }
.tm-chg { font-size: 11px; opacity: 0.92; font-variant-numeric: tabular-nums; }

.heat-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.legend-bar {
  width: 220px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ea3943, #7a2b33, #262b36, #1f6d50, #16c784);
}

/* ── Сетки ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-mood { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 18px; }

/* ── Лидеры движения ── */
.movers-card { padding: 20px; }
.movers-list { display: flex; flex-direction: column; }
.mover {
  display: grid;
  grid-template-columns: 30px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-top: 1px solid var(--line);
}
.mover:first-child { border-top: none; }
.mv-name { display: flex; flex-direction: column; min-width: 0; }
.mv-sym { font-weight: 700; font-size: 14px; }
.mv-full { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-price { color: var(--text); font-size: 14px; }
.mover .delta { min-width: 74px; text-align: right; font-size: 14px; }

.coin-ico {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; background: var(--panel-2); flex: none;
}
.coin-ico.mono {
  display: inline-grid; place-items: center;
  color: #fff; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
}

/* ── Индекс страха и жадности ── */
.fng-card { padding: 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.fng-card .section-title { align-self: flex-start; }
.gauge-box { width: 100%; max-width: 260px; margin: 4px auto 2px; }
.gauge-val { fill: #fff; font-size: 34px; font-weight: 800; }
.fng-label { font-size: 20px; font-weight: 750; margin-top: 2px; }
.fng-spark { width: 100%; margin: 10px 0 4px; }
.fng-desc { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }
.c-red { color: var(--red); }
.c-orange { color: #ff9332; }
.c-yellow { color: #f3d42f; }
.c-lgreen { color: #8fce49; }
.c-green { color: var(--green); }

/* ── BTC / ETH в фокусе ── */
.spot {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.spot-head { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; }
.spot-head .coin-ico { width: 40px; height: 40px; }
.spot-name { font-weight: 700; font-size: 16px; }
.spot-sym { color: var(--muted); font-size: 13px; }
.spot-price { font-size: 22px; font-weight: 780; }
.spot-deltas { display: flex; gap: 8px; margin: 16px 0 6px; }
.db {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.db-l { color: var(--faint); font-size: 11.5px; text-transform: uppercase; }
.db .delta { font-size: 14.5px; }
.spot-spark { margin-top: auto; padding-top: 12px; }
.spot-spark .spark { width: 100%; height: auto; }

/* ── Таблица монет ── */
.table-card { padding: 6px 6px; overflow-x: auto; }
.coin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.coin-table th {
  text-align: right;
  padding: 12px 14px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.coin-table th.t-rank, .coin-table td.t-rank { text-align: center; width: 40px; color: var(--faint); }
.coin-table th:nth-child(2) { text-align: left; }
.coin-table td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.coin-table tr:last-child td { border-bottom: none; }
.coin-table tbody tr { transition: background 0.12s; }
.coin-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.t-coin { display: flex; align-items: center; gap: 10px; text-align: left !important; }
.t-name { font-weight: 650; }
.t-sym { color: var(--muted); font-size: 12.5px; text-transform: uppercase; }
.t-price { font-weight: 650; }
.t-spark { width: 108px; }
.t-spark .spark { vertical-align: middle; }

/* ── Обзор дня ── */
.review-card { padding: clamp(22px, 4vw, 38px); }
.review-eyebrow { margin: 0 0 8px; color: var(--violet); font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.review-headline { margin: 0 0 14px; font-size: clamp(22px, 3.4vw, 30px); font-weight: 780; letter-spacing: -0.01em; }
.review-summary { margin: 0 0 18px; font-size: 18px; color: var(--text); }
.review-body p { margin: 0 0 14px; color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.review-body strong { color: var(--text); font-weight: 700; }
.review-bullets {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.review-bullets li {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  position: relative;
  padding-left: 30px;
}
.review-bullets li::before {
  content: "";
  position: absolute;
  left: 13px; top: 50%;
  width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

/* ── Подвал ── */
.site-footer { border-top: 1px solid var(--line); margin-top: 30px; padding: 30px 0 46px; background: var(--bg-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-note { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }
.disclaimer { color: var(--faint); font-size: 12.5px; max-width: 52ch; margin: 0; }

/* ── Адаптив ── */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-mood { grid-template-columns: 1fr 1fr; }
  .fng-card { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .nav { display: none; }
  .grid-2, .grid-mood { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 20px; }
  .chip { flex: 1 1 42%; min-width: 0; }
  .t-hide { display: none; }
}
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
}

/* ═══════════════ Терминал реального времени ═══════════════ */
.term-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sym-tabs { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.sym-tab { appearance: none; border: none; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.sym-tab:hover { color: var(--text); }
.sym-tab.active { background: var(--accent-1); color: #fff; }

.ws-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); white-space: nowrap; }
.ws-status .dot { width: 8px; height: 8px; border-radius: 50%; }
.ws-live { color: #b8f5da; background: rgba(22,199,132,.12); border-color: rgba(22,199,132,.35); }
.ws-live .dot { background: var(--green); animation: pulse 1.8s infinite; }
.ws-connecting { color: #f3d42f; background: rgba(243,212,47,.10); border-color: rgba(243,212,47,.3); }
.ws-connecting .dot { background: #f3d42f; }
.ws-offline { color: #ffb3b8; background: rgba(234,57,67,.12); border-color: rgba(234,57,67,.3); }
.ws-offline .dot { background: var(--red); }

.terminal { padding: 0; overflow: hidden; }
.term-grid { display: grid; grid-template-columns: 1.5fr 1fr; }
.term-col { padding: 16px 18px; border-left: 1px solid var(--line); min-width: 0; }
.term-col:first-child { border-left: none; }
.term-price-col { display: flex; flex-direction: column; }
.col-title { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin-bottom: 10px; }

/* Цена + график */
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tp-sym { font-weight: 700; font-size: 15px; color: var(--muted); }
.tp-change { font-size: 14px; }
.tp-price { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tp-price.flash-up { animation: flashUp .5s ease-out; }
.tp-price.flash-down { animation: flashDown .5s ease-out; }
@keyframes flashUp { 0% { color: var(--green); } 100% { color: var(--text); } }
@keyframes flashDown { 0% { color: var(--red); } 100% { color: var(--text); } }
.tp-stats { display: flex; gap: 16px; margin: 10px 0 12px; flex-wrap: wrap; }
.tstat { display: flex; flex-direction: column; gap: 2px; }
.tstat-l { font-size: 11px; color: var(--faint); text-transform: uppercase; }
.tstat-v { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.term-chart { width: 100%; height: 210px; display: block; margin: auto 0; }

/* Стакан */
.book-head, .trades-head { display: grid; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .03em; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.book-head { grid-template-columns: 1fr auto; }
.book-head span:last-child { text-align: right; }
.book-side { display: flex; flex-direction: column; }
.book-row { position: relative; display: grid; grid-template-columns: 1fr auto; font-size: 12.5px; padding: 2.5px 2px; font-variant-numeric: tabular-nums; }
.book-row .bar { position: absolute; top: 1px; bottom: 1px; right: 0; border-radius: 3px; z-index: 0; }
.book-ask .bar { background: rgba(234,57,67,.15); }
.book-bid .bar { background: rgba(22,199,132,.15); }
.book-row .bp, .book-row .bq { position: relative; z-index: 1; }
.book-ask .bp { color: var(--red); }
.book-bid .bp { color: var(--green); }
.book-row .bq { text-align: right; color: var(--muted); }
.book-mid { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; margin: 5px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.book-spread { font-size: 11.5px; color: var(--faint); font-weight: 500; }

/* Лента сделок */
.trades-head { grid-template-columns: 1fr 1fr auto; }
.trades-head span:nth-child(2) { text-align: center; }
.trades-head span:last-child { text-align: right; }
.trades-list { display: flex; flex-direction: column; margin-top: 3px; }
.trade-row { display: grid; grid-template-columns: 1fr 1fr auto; font-size: 12.5px; padding: 2.5px 2px; font-variant-numeric: tabular-nums; animation: rowIn .28s ease-out; }
.trade-row .tp { font-weight: 600; }
.trade-buy .tp { color: var(--green); }
.trade-sell .tp { color: var(--red); }
.trade-row .tq { text-align: center; color: var(--text); }
.trade-row .tt { text-align: right; color: var(--faint); }
@keyframes rowIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.term-footer { display: flex; justify-content: flex-end; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }

@media (max-width: 680px) {
  .term-grid { grid-template-columns: 1fr; }
  .term-col { border-left: none; border-top: 1px solid var(--line); }
  .term-price-col { border-top: none; }
  .term-chart { height: 180px; margin: 14px 0; }
}
