:root{
  --bg:#0c0d10; --panel:#0f1218; --card:#0f1116; --border:#1a1f2a;
  --text:#eef1f6; --muted:#9aa3b2; --accent:#2b5cff; --green:#22c55e; --red:#ef4444;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}

.container{max-width:1200px;margin:0 auto;padding:0 20px}

/* header */
.hdr{position:sticky;top:0;z-index:50;background:rgba(12,13,16,.88);backdrop-filter:blur(6px);border-bottom:1px solid var(--border)}
.nav{display:flex;align-items:center;gap:12px;padding:12px 0}
.brand{display:flex;align-items:center;gap:10px;font-weight:800}
.logo-img{width:28px;height:28px;border-radius:8px}
.risk-pill{font-size:12px;color:#d3d9e6;background:#0f141a;border:1px solid var(--border);padding:6px 10px;border-radius:999px}
.grow{flex:1}
.btn{display:inline-flex;align-items:center;gap:8px;border-radius:12px;padding:10px 14px;border:1px solid var(--border);cursor:pointer;transition:.2s;color:#e8eefc}
.btn:hover{transform:translateY(-1px)}
.btn-ghost{background:#151923}
.btn-primary{background:#1a2335;border-color:#24324a;color:#fff}
.btn-wallet.is-connected{background:#13291c;border-color:#1f3b2b}

/* ticker */
.ticker{white-space:nowrap;overflow:auto;display:flex;gap:14px;padding:10px 12px;background:#0b0d12;border-top:1px solid #000;border-bottom:1px solid var(--border)}
.event{min-width:260px;background:var(--card);border:1px solid var(--border);border-radius:16px;padding:12px}
.event .tag{font-size:11px;color:var(--muted);margin-bottom:8px}
.kv{display:flex;gap:10px}
.kv .chip{background:#0f141b;border:1px solid var(--border);padding:6px 10px;border-radius:10px;font-weight:700}

/* hero */
.hero{padding:56px 0 24px;border-bottom:1px solid var(--border)}
.layout{display:grid;grid-template-columns:1.3fr .9fr;gap:24px}
.hero-copy h1{margin:0 0 10px;font-size:56px;line-height:1.05;letter-spacing:-.02em}
.hero-copy p{margin:0 0 16px;color:#c8ccd6}

.widget{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:20px;position:relative}
.widget-title{margin-top:10px}
.widget .market{font-size:12px;color:var(--muted);margin:6px 0 8px}
.exch{display:flex;align-items:center;gap:10px;margin:10px 0}
.chip{display:inline-flex;align-items:center;gap:8px;background:#0f141b;border:1px solid var(--border);border-radius:10px;padding:6px 10px;font-size:13px;white-space:nowrap}
.chip.link{background:#162033;color:#cfe0ff}
.chip.link:hover{background:#1c2940}
.tag-top{position:absolute;left:20px;top:8px; /* поднял выше */ 
  font-size:12px;color:#c6cede;background:#0f141a;border:1px solid var(--border);border-radius:999px;padding:4px 10px}
.profit{position:absolute;right:16px;top:10px;color:var(--green);font-weight:800}

/* sections */
.section{padding:56px 0;border-bottom:1px solid var(--border)}
.center{text-align:center}.tight{margin-bottom:6px}
.muted{color:#b6bcc8}

/* chart */
.chart-card{position:relative;background:var(--card);border:1px solid var(--border);border-radius:16px;padding:16px}
#parlayChart{width:100%}
.chart-note{font-size:12px;color:#a8b1bf;margin-top:6px}
.chart-legend{position:absolute;display:flex;align-items:center;color:#e8ecf7;font-size:14px;background:rgba(12,15,22,.8);border:1px solid var(--border);border-radius:10px;padding:8px 10px;gap:24px}
.chart-legend.top-left{left:16px;top:16px}
.legend-dot{display:inline-block;width:10px;height:10px;border-radius:999px;margin-right:8px}
.legend-dot.a{background:#60a5fa}
.legend-dot.b{background:#34d399}
.chart-legend .spacer{display:none}

/* features */
.grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.card{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:20px;min-height:160px}
.card h3{margin:0 0 10px}

/* dashboard */
.dash-title{margin:0 0 10px;font-size:40px}
.tabs{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 18px}
.tab{padding:8px 12px;border:1px solid var(--border);border-radius:12px;background:#121722;color:#e8ecf7;cursor:pointer}
.tab.active{background:var(--accent);border-color:var(--accent);color:#fff}
.games{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.game{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:16px}
.game h4{margin:0 0 6px}
.booklist{margin-top:12px;background:#0f141b;border:1px solid var(--border);border-radius:12px;padding:10px;max-height:220px;overflow:auto}
.pair{display:flex;justify-content:space-between;align-items:center;margin:6px 0}
.pair small{opacity:.75}

/* modal + popover (wallet) */
.modal[hidden]{display:none}
.modal{position:fixed;inset:0;z-index:60;display:grid;place-items:center}
.modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.6)}
.modal__card{position:relative;width:min(520px,92vw);background:#0f1218;border:1px solid var(--border);border-radius:16px;padding:20px;color:#e8ecf7}
.modal__header{display:flex;align-items:center}
.modal__title{margin:0 0 10px}
.modal__close{margin-left:auto;background:#121722;border:1px solid var(--border);border-radius:10px;color:#cfd6e6;padding:6px 10px}
.wallet-item{display:flex;align-items:center;gap:10px;width:100%;margin:4px 0;padding:12px 14px;border-radius:12px;background:#141a25;color:#e8ecf7;border:1px solid var(--border);cursor:pointer}
.modal__hint{color:#b6bfd1}
.modal__error{color:#ff7b7b}

.wallet-pop{position:absolute;background:#0f1418;border:1px solid var(--border);border-radius:12px;padding:10px;min-width:220px;display:none;color:#e8ecf7}
.wallet-pop.is-open{display:block}
.wallet-pop__row{display:flex;gap:10px;align-items:center;margin-bottom:8px}
.btn-disconnect{background:#191f2b;border:1px solid var(--border);color:#cfe0ff;border-radius:10px;padding:8px 10px}

/* responsive */
@media (max-width:1024px){
  .layout{grid-template-columns:1fr}
  .games{grid-template-columns:1fr}
  .hero-copy h1{font-size:44px}
}
