html { scroll-behavior: smooth; }
:root { --bg:#0c0f14; --panel:#141923; --muted:#9aa6b2; --text:#e6ebf2; --brand:#7aa2ff; --line:#202737; --ring:#2b3347; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header { position: sticky; top: 0; z-index: 60; background: rgba(12,15,20,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header__inner { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.primary-nav { display: flex; gap: 14px; align-items: center; }

.hamburger { display: none; position: relative; background: none; border: 0; width: 42px; height: 34px; border-radius: 8px; border: 1px solid var(--ring); }
.hamburger .bar, .hamburger .bar::before, .hamburger .bar::after { content: ""; position: absolute; left: 9px; right: 9px; height: 2px; background: #c8d2e3; border-radius: 2px; display: block; }
.hamburger .bar { top: 50%; transform: translateY(-50%); }
.hamburger .bar::before { top: -8px; }
.hamburger .bar::after { top: 8px; }
.site-header.open .hamburger .bar { background: transparent; }
.site-header.open .hamburger .bar::before { transform: translateY(8px) rotate(45deg); }
.site-header.open .hamburger .bar::after { transform: translateY(-8px) rotate(-45deg); }

.shell { max-width: 1440px; margin: 0 auto; padding: 0; }
.hero { padding: 0 16px; }
.hero .breadcrumbs { font-size: 12px; color: var(--muted); margin-top: 8px; }
h1 { font-size: 44px; line-height: 1.15; margin: 10px 0 12px; }
.lead { color: var(--muted); margin-bottom: 8px; }

.layout { display: grid; grid-template-columns: 260px 816px 300px; column-gap: 32px; align-items: start; }

.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; position: sticky; top: 84px; max-height: calc(100vh - 98px); overflow-y: auto; overflow-x: hidden; -ms-overflow-style: none; scrollbar-width: none; }
.toc::-webkit-scrollbar { width: 0; height: 0; background: transparent; }
.toc-title { all: unset; display: block; width: 100%; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); cursor: pointer; padding: 2px 4px 8px; }
#toc-list { list-style: none; margin: 0; padding: 0; }
#toc-list li { margin: 6px 0; }
#toc-list a { display: block; padding: 7px 10px; border-radius: 10px; color: var(--text); }
#toc-list a.active { background: color-mix(in oklab, var(--brand) 22%, transparent); outline: 1px solid color-mix(in oklab, var(--brand) 55%, var(--ring)); }
#toc-list .sub { padding-left: 10px; border-left: 1px dashed var(--line); margin: 6px 0 8px 8px; }

.doc, .widget { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.doc { padding: 0; }
.doc > * { padding: 0 0px; max-width: 768px; margin: 0 auto; }
.doc h2 { margin: 22px 0 10px; }
.doc h3 { margin: 16px 0 8px; }
.doc img, .doc video, .doc iframe { max-width: 100%; height: auto; display: block; }

.side { position: sticky; top: 84px; display: grid; gap: 16px; }
.widget { padding: 16px; }
.banner .banner-box { width: 300px; height: 600px; border: 1px dashed var(--ring); display: grid; place-items: center; color: var(--muted); border-radius: 12px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 10px 0 20px; border-radius: 12px; border: 1px solid var(--line); display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table::-webkit-scrollbar { height: 6px; }
table::-webkit-scrollbar-thumb { background: var(--ring); border-radius: 4px; }
th, td { 
  padding: 12px 16px; 
  border-bottom: 1px solid var(--line); 
  min-width: 170px; 
  vertical-align: top; 
  line-height: 1.4; 
}
th { text-align: left; background: color-mix(in oklab, var(--panel) 60%, transparent); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }

.helpfaces { display: flex; gap: 10px; margin-top: 8px; }
.face { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; cursor: pointer; border: 1px solid var(--ring); background: #0e1524; transition: transform .06s ease; }
.face:hover { transform: translateY(-1px); }
.face.active { outline: 2px solid var(--brand); }
.note { font-size: 12px; color: var(--muted); margin-top: 6px; }

@media (max-width: 1439.98px) {
  .shell, .site-header__inner { max-width: 1200px; }
  .layout { grid-template-columns: 220px 808px 300px; column-gap: 24px; }
  .doc > * { padding: 0 20px; }
}

@media (max-width: 1199.98px) {
  .shell, .site-header__inner { max-width: 1024px; }
  .layout { grid-template-columns: 680px 300px; column-gap: 24px; }
  .toc { position: relative; top: auto; max-height: none; overflow: visible; grid-column: 1 / -1; margin: 12px 0; }
  #toc-list { display: none; }
  .toc.open #toc-list { display: block; }
  .primary-nav { display: none; }
  .hamburger { display: block; }
  .site-header.open .primary-nav { display: flex; position: absolute; left: 0; right: 0; top: 100%; background: rgba(12,15,20,.96); border-bottom: 1px solid var(--line); padding: 10px 16px; gap: 8px; flex-direction: column; z-index: 70; align-items: flex-start; text-align: left; }
  .primary-nav a { display: block; width: 100%; text-align: left; padding: 8px 4px; }
  .doc > * { max-width: none; padding: 0 20px; margin: 0; width: 100%; }
  .side { position: relative; top: auto; margin-top: 12px; }
}

@media (max-width: 1023.98px) {
  .site-header__inner { max-width: none; }
  .layout { grid-template-columns: minmax(0,1fr); column-gap: 0; }
  .doc { max-width: none; margin: 0; }
  .doc > * { max-width: none; width: 100%; margin: 0; padding: 0 16px; }
}

.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 20px 0 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; transition: transform 0.2s ease, border-color 0.2s ease; }
.card:hover { transform: translateY(-3px); border-color: var(--brand); }
.card h4 { margin: 0 0 10px 0; color: var(--text); font-size: 18px; }
.card p { margin: 0 0 10px 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.card p:last-child { margin-bottom: 0; }

.pro-tip { background: color-mix(in oklab, var(--brand) 10%, transparent); border: 1px dashed var(--brand); padding: 16px 20px; border-radius: 12px; margin: 20px 0; color: var(--text); font-size: 15px; }
.pro-tip strong { color: var(--brand); }

.checklist-container { display: flex; flex-wrap: wrap; gap: 24px; margin: 20px 0 32px; }
.checklist { flex: 1 1 280px; background: color-mix(in oklab, var(--panel) 60%, transparent); border: 1px solid var(--line); border-left: 4px solid var(--brand); padding: 20px; border-radius: 0 12px 12px 0; }
.checklist h3 { margin: 0 0 16px 0; font-size: 18px; color: var(--text); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 28px; margin-bottom: 12px; color: var(--muted); font-size: 15px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: bold; font-size: 16px; }

.threat-list { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
.threat-row { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid #e53935; border-radius: 0 8px 8px 0; padding: 16px 20px; }
.threat-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.threat-header h4 { margin: 0; font-size: 16px; color: var(--text); }
.tag { font-size: 10px; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }
.tag.exploit { background: rgba(229, 57, 53, 0.15); color: #ff5252; }
.threat-row p { margin: 0 0 12px 0; font-size: 14px; color: var(--muted); }
.fix-box { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 4px; display: flex; gap: 8px; font-size: 14px; color: var(--text); }
.fix-box strong { color: var(--brand); font-weight: 600; }

.tier-list { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.tier-item { display: flex; align-items: center; gap: 20px; background: color-mix(in oklab, var(--panel) 40%, transparent); border: 1px solid var(--line); padding: 16px; border-radius: 12px; transition: border-color 0.2s; }
.tier-item:hover { border-color: var(--ring); }
.tier-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--ring); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.tier-content h4 { margin: 0 0 4px 0; font-size: 16px; }
.tier-content p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.4; }

.feature-list { display: grid; gap: 24px; margin: 24px 0; }
.feature-item { display: flex; gap: 16px; align-items: flex-start; }
.feature-item .icon-box { background: rgba(122, 162, 255, 0.1); color: var(--brand); padding: 12px; border-radius: 10px; border: 1px solid color-mix(in oklab, var(--brand) 30%, transparent); }
.feature-item h4 { margin: 0 0 6px 0; font-size: 16px; }
.feature-item p { margin: 0; font-size: 14px; color: var(--muted); }

.card-binance { --brand-color: #FCD535; --brand-bg: rgba(252, 213, 53, 0.05); --btn-text: #000000; }
.card-bybit { --brand-color: #F7A600; --brand-bg: rgba(247, 166, 0, 0.05); --btn-text: #000000; }
.card-okx { --brand-color: #FFFFFF; --brand-bg: rgba(255, 255, 255, 0.05); --btn-text: #000000; }
.card-bitget { --brand-color: #00E4B1; --brand-bg: rgba(0, 228, 177, 0.05); --btn-text: #000000; }
.card-hyperliquid { --brand-color: #38BDF8; --brand-bg: rgba(56, 189, 248, 0.05); --btn-text: #000000; }
.card-mexc { --brand-color: #2E6AFA; --brand-bg: rgba(46, 106, 250, 0.05); --btn-text: #FFFFFF; }
.card-dydx { --brand-color: #6966FF; --brand-bg: rgba(105, 102, 255, 0.05); --btn-text: #FFFFFF; }

.exchange-card { position: relative; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--brand-bg) 0%, var(--panel) 100%); border: 1px solid color-mix(in oklab, var(--brand-color) 20%, var(--line)); border-radius: 16px; padding: 24px; margin-bottom: 32px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); transition: all 0.3s ease; overflow: hidden; }
.exchange-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--brand-color); box-shadow: 0 0 12px var(--brand-color); }
.exchange-card:hover { transform: translateY(-4px); border-color: color-mix(in oklab, var(--brand-color) 50%, var(--line)); box-shadow: 0 12px 32px color-mix(in oklab, var(--brand-color) 15%, transparent); }

.exchange-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px; 
  margin-bottom: 16px;
  border-bottom: 1px solid color-mix(in oklab, var(--brand-color) 15%, var(--line));
  padding-bottom: 16px;
}

.exchange-badge {
  background: color-mix(in oklab, var(--brand-color) 15%, transparent);
  color: var(--brand-color);
  border: 1px solid color-mix(in oklab, var(--brand-color) 30%, transparent);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: right;
  line-height: 1.2;
  flex-shrink: 0;
}
.exchange-header h3 { margin: 0; font-size: 24px; display: flex; align-items: center; gap: 12px; color: #fff; }

.exchange-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 20px 0; background: #090b10; padding: 16px 20px; border-radius: 12px; border-left: 3px solid var(--brand-color); }
.stat-item { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 16px; font-weight: 700; color: #fff; }

.btn-affiliate { display: inline-flex; align-items: center; justify-content: center; background: var(--brand-color); color: var(--btn-text); padding: 14px 24px; border-radius: 10px; font-weight: 700; font-size: 16px; text-decoration: none; transition: all 0.2s ease; margin-top: 16px; width: 100%; text-transform: uppercase; letter-spacing: 0.02em; box-shadow: 0 4px 16px color-mix(in oklab, var(--brand-color) 30%, transparent); }
.btn-affiliate:hover { filter: brightness(1.15); transform: translateY(-2px); box-shadow: 0 6px 20px color-mix(in oklab, var(--brand-color) 50%, transparent); color: var(--btn-text); text-decoration: none; }
@media (min-width: 768px) { .btn-affiliate { width: auto; } }

.web3-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin: 20px 0; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; border: none; }
.web3-table::-webkit-scrollbar { height: 6px; }
.web3-table::-webkit-scrollbar-thumb { background: var(--ring); border-radius: 4px; }
.web3-table th { background: transparent; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.web3-table tbody tr { background: var(--panel); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.web3-table tbody tr:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.2); position: relative; z-index: 10; }
.web3-table td { padding: 16px 20px; border-bottom: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.web3-table td:first-child { border-left: 1px solid var(--line); border-radius: 12px 0 0 12px; font-weight: 700; color: #fff; }
.web3-table td:last-child { border-right: 1px solid var(--line); border-radius: 0 12px 12px 0; }

.badge-yes { background: rgba(0, 228, 177, 0.15); color: #00E4B1; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.badge-no { background: rgba(229, 57, 53, 0.15); color: #ff5252; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.fee-highlight { color: #00E4B1; font-weight: 700; }
/* --- Reality Check: CEX vs DEX Block --- */
.vs-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 32px 0;
  position: relative;
}

@media (min-width: 768px) {
  .vs-container {
    flex-direction: row;
    align-items: stretch;
  }
}

.vs-card {
  flex: 1;
  background: linear-gradient(180deg, color-mix(in oklab, var(--panel) 100%, transparent) 0%, #090b10 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}


.vs-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.vs-cex::before { background: linear-gradient(90deg, #FCD535, #F7A600); box-shadow: 0 0 15px rgba(247, 166, 0, 0.6); }
.vs-dex::before { background: linear-gradient(90deg, #38BDF8, #6966FF); box-shadow: 0 0 15px rgba(105, 102, 255, 0.6); }

.vs-header { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.vs-sub { font-size: 14px; color: var(--muted); margin-bottom: 20px; border-bottom: 1px dashed var(--line); padding-bottom: 16px; }

.vs-list { list-style: none; padding: 0; margin: 0; }
.vs-list li { position: relative; padding-left: 28px; margin-bottom: 16px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.vs-list li:last-child { margin-bottom: 0; }
.vs-list li::before { content: "⚡"; position: absolute; left: 0; top: 2px; font-size: 14px; }
.vs-list strong { color: #fff; display: block; margin-bottom: 4px; font-size: 15px; }


.vs-divider { display: none; }
@media (min-width: 768px) {
  .vs-divider {
    display: grid; place-items: center; width: 44px; height: 44px;
    background: #090b10; border: 2px solid var(--line); border-radius: 50%;
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    font-weight: 800; font-size: 14px; color: var(--muted); z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
}
/* --- Maker vs Taker Visuals --- */
.fee-container { 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
  margin: 24px 0; 
}
@media (min-width: 768px) { 
  .fee-container { flex-direction: row; } 
}

.fee-card {
  flex: 1;
  background: linear-gradient(180deg, color-mix(in oklab, var(--panel) 100%, transparent) 0%, #090b10 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.fee-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.fee-maker::before { background: #00E4B1; box-shadow: 0 0 10px rgba(0, 228, 177, 0.4); }
.fee-taker::before { background: #F7A600; box-shadow: 0 0 10px rgba(247, 166, 0, 0.4); }

.fee-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.fee-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: 18px; }
.fee-maker .fee-icon { background: rgba(0, 228, 177, 0.1); border: 1px solid rgba(0, 228, 177, 0.2); }
.fee-taker .fee-icon { background: rgba(247, 166, 0, 0.1); border: 1px solid rgba(247, 166, 0, 0.2); }


.fee-terminal {
  background: #090b10;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-top: 32px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}
.terminal-top { 
  display: flex; 
  justify-content: space-between; 
  border-bottom: 1px dashed var(--line); 
  padding-bottom: 12px; 
  margin-bottom: 24px; 
  font-family: monospace; 
  font-size: 12px; 
  color: var(--muted); 
  text-transform: uppercase; 
}


.bar-group { margin-bottom: 20px; }
.bar-group:last-child { margin-bottom: 0; }
.bar-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.bar-track { width: 100%; height: 8px; background: #1a1d26; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease-in-out; }

.fill-maker { width: 36%; background: linear-gradient(90deg, #00E4B1, #00a883); }
.fill-taker { width: 100%; background: linear-gradient(90deg, #F7A600, #d9381e); }
/* --- Trading Battles Card (Simulator) --- */
.card-tradingbattles {
  border-top: 3px solid #94A3B8; 
  transition: all 0.3s ease;
}

.card-tradingbattles:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(148, 163, 184, 0.15);
  transform: translateY(-2px);
}


.card-tradingbattles .btn-white {
  background: #ffffff;
  color: #090b10; /* Темный цвет текста, под цвет фона сайта */
  border: 1px solid #ffffff;
  font-weight: 600;
  transition: all 0.2s ease;
}

.card-tradingbattles .btn-white:hover {
  background: #e2e8f0; 
  border-color: #e2e8f0;
  color: #000;
}
