:root {
  --bg: #0a0a0d;
  --panel: #131318;
  --panel-2: #1c1c24;
  --border: #2a2a34;
  --text: #f0f0f5;
  --muted: #8b8b9a;
  --accent: #6d5cff;        /* black + indigo/violet theme */
  --accent-dim: #4f3fd4;
  --accent-glow: rgba(109, 92, 255, 0.12);
  --yes: #34d399;           /* semantic: YES / up (emerald) */
  --yes-bg: rgba(52, 211, 153, 0.12);
  --no: #fb7185;            /* semantic: NO / down (soft rose) */
  --no-bg: rgba(251, 113, 133, 0.12);
  --green: #34d399;
  --red: #fb7185;
  --yellow: #f4c542;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* Centered content column (full-bleed bar backgrounds, inset content) like
   Polymarket: --gutter is the side padding that grows to center a --maxw column
   on wide screens and collapses to 20px on narrow ones. */
:root { --maxw: 1200px; --gutter: max(20px, calc((100% - var(--maxw)) / 2)); }

/* Topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px var(--gutter); border-bottom: 1px solid var(--border);
  background: var(--panel); position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.brand .logo { color: var(--accent); }
.brand .accent { color: var(--accent); }
.brand .tagline { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 10px; }
.account { display: flex; align-items: center; gap: 14px; }
.balance { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.email { color: var(--muted); font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.off { background: var(--accent); }

/* Buttons */
.btn {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: .12s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; padding: 12px; font-size: 15px; margin-top: 8px; }
.btn.tiny { padding: 4px 9px; font-size: 12px; }

/* Auth */
.auth-view { display: flex; justify-content: center; padding: 70px 20px; }
.auth-card {
  max-width: 460px; width: 100%; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 34px;
}
.auth-card h1 { margin: 0 0 8px; font-size: 26px; }
.auth-card h1::after { content: ""; display: block; width: 48px; height: 3px; background: var(--accent); margin-top: 10px; border-radius: 2px; }
.sub { color: var(--muted); line-height: 1.5; }
#auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
input, select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 10px; border-radius: 8px; font-size: 14px; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
.fineprint { font-size: 12px; color: var(--muted); margin-top: 16px; }
.error { color: var(--accent); font-size: 13px; min-height: 16px; }

/* Tabs */
.tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--border); background: var(--panel); }
.tabs.small { border: none; padding: 14px 0 0; background: none; }
.tab {
  background: none; border: none; color: var(--muted); padding: 14px 16px;
  cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* Panels */
.app-view { padding-bottom: 60px; }
.panel { padding: 18px var(--gutter); }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.toolbar input { max-width: 320px; }
.toolbar select { max-width: 160px; }
.count-pill { color: var(--muted); font-size: 12px; margin-left: auto; }

/* Category bar */
.cat-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: thin; }
.cat-bar::-webkit-scrollbar { height: 6px; }
.cat-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.cat-chip {
  white-space: nowrap; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--muted); padding: 7px 14px; border-radius: 999px; cursor: pointer;
  font-size: 13px; transition: .12s; display: flex; gap: 6px; align-items: center;
}
.cat-chip:hover { color: var(--text); border-color: var(--accent); }
.cat-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.cat-chip .c-count { font-size: 11px; opacity: .7; }

/* Card grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.market-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: .12s;
  min-height: 168px;
}
.market-card:hover { border-color: #3a3a48; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.mc-head { display: flex; align-items: center; gap: 8px; }
.mc-thumb {
  width: 38px; height: 38px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: var(--panel-2); border: 1px solid var(--border);
}
.mc-thumb.placeholder { display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 15px; }
.mc-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mc-meta .row { display: flex; gap: 6px; align-items: center; }
.mc-question { font-size: 14px; font-weight: 600; line-height: 1.35; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mc-prob { display: flex; align-items: baseline; gap: 6px; }
.mc-prob .big { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mc-prob .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.mc-bar { height: 5px; background: var(--no-bg); border-radius: 3px; overflow: hidden; }
.mc-bar > span { display: block; height: 100%; background: var(--yes); border-radius: 3px; transition: width .4s; }
.mc-actions { display: flex; gap: 8px; margin-top: auto; }
.mc-btn { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; transition: .12s; background: var(--panel-2); }
.mc-btn .t { display: block; font-size: 11px; font-weight: 500; opacity: .8; }
.mc-btn.yes { color: var(--yes); }
.mc-btn.yes:hover { background: var(--yes-bg); border-color: var(--yes); }
.mc-btn.no { color: var(--no); }
.mc-btn.no:hover { background: var(--no-bg); border-color: var(--no); }
.mc-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

.venue-badge {
  font-size: 10px; padding: 2px 7px; border-radius: 5px; background: var(--panel-2);
  border: 1px solid var(--border); color: var(--muted); font-weight: 600; letter-spacing: .3px;
}
.venue-SIM { color: var(--yellow); }
.venue-POLY { color: #a78bff; }
.venue-KALSHI { color: #2ec5c5; }
.flash-up { animation: flashUp .6s; }
.flash-dn { animation: flashDn .6s; }
@keyframes flashUp { from { color: var(--yes); } }
@keyframes flashDn { from { color: var(--no); } }

/* Tables (portfolio/orders/keys/data) */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.data-table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.data-table td.num, .data-table th.num { text-align: right; }
.data-table tbody tr:hover { background: var(--panel-2); }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); } .neg { color: var(--red); }

/* Overlay / ticket */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; justify-content: center; align-items: center; z-index: 50; backdrop-filter: blur(2px); }
.ticket { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 380px; position: relative; }
.close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; }
.ticket-question { font-size: 16px; font-weight: 600; padding-right: 24px; }
.ticket-venue { color: var(--muted); font-size: 12px; margin: 4px 0 16px; }
.seg { display: flex; gap: 0; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-btn { flex: 1; background: var(--bg); border: none; color: var(--muted); padding: 9px; cursor: pointer; font-size: 13px; }
.seg-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
#seg-outcome .seg-btn.active[data-outcome="YES"] { background: var(--yes); }
#seg-outcome .seg-btn.active[data-outcome="NO"] { background: var(--no); }
.ticket label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
.ticket-quote { background: var(--panel-2); border-radius: 8px; padding: 10px; margin: 14px 0 8px; font-size: 13px; }
.ticket-est { color: var(--muted); font-size: 13px; }
.ticket-result { margin-top: 12px; font-size: 13px; }

/* Toasts */
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: 11px 14px; border-radius: 8px; max-width: 320px; animation: slideIn .2s; }
.toast.good { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }

/* Code */
.codeblock { background: #08080b; border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-top: 18px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; color: #c4c4d4; line-height: 1.55; }
#new-key-banner .secret-box { background: rgba(109,92,255,.08); border: 1px solid var(--accent); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.secret-box code { background: #08080b; word-break: break-all; }
.muted { color: var(--muted); }
.link { color: var(--accent); cursor: pointer; text-decoration: none; }
.loading { color: var(--muted); padding: 40px; text-align: center; grid-column: 1 / -1; }

/* ---- Engagement / casino-style UI ---- */

/* Confetti */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 200; }

/* Header extras */
.balance { transition: color .2s; }
.balance.flash-up { animation: balUp .7s; }
.balance.flash-dn { animation: balDn .7s; }
@keyframes balUp { 0% { color: var(--yes); transform: scale(1.12); } }
@keyframes balDn { 0% { color: var(--no); transform: scale(1.12); } }
.bonus-btn { background: linear-gradient(135deg, #6d5cff, #ff7a3d); border: none; color: #fff;
  font-weight: 700; padding: 8px 13px; border-radius: 8px; cursor: pointer; font-size: 13px;
  box-shadow: 0 0 0 0 rgba(109,92,255,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(109,92,255,.5);} 70% { box-shadow: 0 0 0 10px rgba(109,92,255,0);} }
.streak { font-weight: 700; color: #ff8a3d; font-size: 13px; }
.level-badge { background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 11px; font-size: 12px; font-weight: 600; }
.level-badge .lv { color: var(--accent); }

/* Activity ticker */
.ticker-bar { display: flex; align-items: center; gap: 14px; background: #0e0e13;
  border-bottom: 1px solid var(--border); padding: 7px 22px; overflow: hidden; white-space: nowrap; }
.online { color: var(--yes); font-size: 12px; font-weight: 600; flex-shrink: 0; }
.online::before { content: "● "; }
.ticker-track { display: flex; gap: 28px; animation: scrollTicker 40s linear infinite; }
.ticker-track:hover { animation-play-state: paused; }
@keyframes scrollTicker { from { transform: translateX(0);} to { transform: translateX(-50%);} }
.tick-item { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.tick-item b { color: var(--text); }
.tick-item .buy { color: var(--yes); } .tick-item .sell { color: var(--no); }

/* Sub-nav (Portfolio) */
.subnav { display: flex; gap: 6px; margin-bottom: 18px; }
.sub-tab { background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.sub-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.badge-dot { font-size: 10px; background: rgba(255,255,255,.15); padding: 1px 6px; border-radius: 999px; margin-left: 4px; }

/* Level card */
.level-card { background: linear-gradient(135deg, #1a1320, #131318); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; display: flex;
  align-items: center; gap: 18px; }
.level-card .ring { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 18px; color: #fff;
  background: conic-gradient(var(--accent) var(--p,0%), #2a2a34 0); flex-shrink: 0; }
.level-card .ring span { width: 42px; height: 42px; border-radius: 50%; background: var(--panel);
  display: flex; align-items: center; justify-content: center; }
.level-card .lc-body { flex: 1; }
.level-card .lc-title { font-weight: 700; font-size: 15px; }
.level-card .lc-sub { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.level-bar { height: 7px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.level-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ff7a3d); }

/* Agents */
.agent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 12px; margin-top: 16px; }
.agent-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.agent-card .ac-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.agent-card .ac-avatar { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg,#a78bff,#6d5cff);
  display: flex; align-items: center; justify-content: center; font-size: 18px; }
.agent-card .ac-name { font-weight: 700; }
.agent-card .ac-meta { color: var(--muted); font-size: 12px; }
.agent-card .ac-status { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.ac-status.active { background: var(--yes-bg); color: var(--yes); }
.ac-status.revoked { background: var(--no-bg); color: var(--no); }

/* Leaderboard */
#leaderboard-table tr.me { background: rgba(109,92,255,.08); }
#leaderboard-table tr.me td:first-child::after { content: " ★"; color: var(--accent); }
.rank-medal { font-size: 16px; }

/* Backtest */
.bt-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .bt-layout { grid-template-columns: 1fr; } }
.bt-form { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.bt-form h3 { margin: 0 0 6px; }
.bt-form label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.bt-form select, .bt-form input { width: 100%; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.bt-strat-desc { margin: 8px 0 4px; font-size: 12px; }
.bt-param label { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.bt-param label .muted { font-weight: 400; font-size: 11px; }
.bt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.block { width: 100%; margin-top: 16px; }
.btn:disabled { opacity: .6; cursor: progress; }

.bt-results { min-height: 200px; }
.bt-empty { color: var(--muted); text-align: center; padding: 48px 16px; border: 1px dashed var(--border);
  border-radius: 12px; }
.bt-empty.err { color: var(--red); border-color: var(--red); }
.bt-summary { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.bt-headline { font-size: 30px; font-weight: 800; }
.bt-headline .bt-sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.bt-strat-tag { font-size: 12px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.bt-equity { width: 100%; height: 180px; display: block; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 14px; }
.bt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
@media (max-width: 560px) { .bt-stats { grid-template-columns: repeat(2, 1fr); } }
.bt-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.bt-stat-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bt-stat-v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.bt-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }

/* Quick bets + payout (ticket) */
.quick-bets { display: flex; gap: 6px; margin-top: 8px; }
.quick-bets button { flex: 1; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 7px; padding: 7px; cursor: pointer; font-size: 12px; }
.quick-bets button:hover { border-color: var(--accent); color: var(--text); }
.payout-box { background: linear-gradient(135deg, rgba(34,197,94,.1), transparent); border: 1px solid rgba(34,197,94,.3);
  border-radius: 8px; padding: 10px 12px; margin: 4px 0 8px; font-size: 13px; }
.payout-box b { color: var(--yes); font-size: 16px; }

/* Bonus modal */
.bonus-modal { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 30px;
  width: 360px; text-align: center; position: relative; }
.bonus-gift { font-size: 56px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.bonus-modal h2 { margin: 6px 0; }
.streak-dots { display: flex; justify-content: center; gap: 8px; margin: 18px 0; }
.streak-dots .sd { width: 30px; height: 30px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.streak-dots .sd.on { background: linear-gradient(135deg,#6d5cff,#ff7a3d); color: #fff; border: none; font-weight: 700; }
.bonus-result { margin-top: 12px; min-height: 18px; font-weight: 600; }

/* Hot badge on cards */
.hot-badge { font-size: 10px; background: linear-gradient(135deg,#6d5cff,#ff7a3d); color: #fff;
  padding: 2px 7px; border-radius: 5px; font-weight: 700; }

/* Header account states */
.acct-actions { display: flex; align-items: center; gap: 12px; }
.profile { position: relative; }
.profile-icon { width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #ff7a3d); color: #fff; font-weight: 800; font-size: 13px; }
.profile-menu { position: absolute; right: 0; top: 46px; width: 230px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 8px; z-index: 60;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.pm-head { padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.pm-email { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.pm-bal { color: var(--yes); font-size: 12px; margin-top: 2px; }
.pm-item { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text);
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.pm-item:hover { background: var(--panel-2); }
.pm-item.danger { color: var(--no); margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; }

/* Auth modal card */
#auth-overlay .auth-card { position: relative; width: 400px; max-width: 92vw; background: var(--panel);
  border: 1px solid var(--border); border-radius: 16px; padding: 34px; }
#auth-overlay .auth-card h1 { font-size: 30px; line-height: 1.12; margin: 0 0 12px; }
#auth-overlay .auth-card .sub { color: var(--muted); margin-bottom: 18px; }
#auth-overlay .tabs.small { display: inline-flex; gap: 4px; margin-bottom: 14px; }
#auth-form { display: flex; flex-direction: column; gap: 10px; }
.fineprint { color: var(--muted); font-size: 12px; margin-top: 14px; text-align: center; }

/* Settings modal */
.settings-modal { background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px; width: 380px; max-width: 92vw; position: relative; }
.settings-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.settings-row span { color: var(--muted); }

/* ===== v3: sticky chrome, JS ticker, portfolio split, market page ===== */

#top-chrome { position: sticky; top: 0; z-index: 100; background: var(--bg); }
#top-chrome .topbar { position: static; }
.brand { cursor: pointer; }
.hdr-values { display: flex; gap: 18px; }
.hdr-values .hv { display: flex; flex-direction: column; line-height: 1.15; }
.hdr-values .hv span { color: var(--muted); font-size: 11px; }
.hdr-values .hv b { font-variant-numeric: tabular-nums; }

/* Profile dropdown head */
.profile-menu { position: absolute; right: 0; top: 46px; width: 240px; }
.pm-head { display: flex; gap: 10px; align-items: center; }
.pm-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; color: #fff; font-weight: 800;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), #ff7a3d); }
.pm-lvl { color: var(--accent); font-size: 12px; margin-top: 2px; }

/* Ticker: JS-driven seamless marquee */
.ticker-bar { display: flex; align-items: center; gap: 14px; background: #0e0e13;
  border-bottom: 1px solid var(--border); padding: 7px var(--gutter); }
.online { color: var(--yes); font-size: 12px; font-weight: 600; flex-shrink: 0; white-space: nowrap; }
.online::before { content: "● "; }
.ticker-viewport { flex: 1; overflow: hidden; position: relative; }
/* width:max-content + per-item margin (not flex gap) makes translateX(-50%)
   align exactly with the duplicated half -> seamless, no jump. */
.ticker-track { display: flex; width: max-content; white-space: nowrap; will-change: transform;
  animation: tickerScroll 70s linear infinite; }
.ticker-bar:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* fixed width so in-place content updates never change track width (no jump) */
.tick-item { flex: 0 0 auto; width: 300px; overflow: hidden; text-overflow: ellipsis;
  font-size: 12px; color: var(--muted); margin-right: 34px; }
.tick-item b { color: var(--text); }
.tick-item .buy { color: var(--yes); } .tick-item .sell { color: var(--no); }

/* Sticky category bar (rolls under the chrome) */
/* cat-bar now lives inside the sticky top-chrome → full-bleed, gutter-padded */
.cat-bar { padding: 4px var(--gutter) 10px; border-bottom: 1px solid var(--border); }
.cat-bar.chrome-off { display: none; }
.top-search { flex: 1; min-width: 0; max-width: 440px; margin: 0 22px;
  padding: 9px 14px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; }
.top-search:focus { border-color: var(--accent); }
@media (max-width: 680px) { .top-search { display: none; } }

/* Portfolio split layout: content left, sub-nav right */
.portfolio-layout { display: flex; gap: 22px; align-items: flex-start; }
.pf-main { flex: 1; min-width: 0; }
.pf-side { width: 200px; flex-shrink: 0; position: sticky; top: calc(var(--chrome-h, 150px) + 16px);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.pf-side-title { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 4px 8px 10px; }
.pf-side .sub-tab { display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--muted); padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; margin-bottom: 2px; }
.pf-side .sub-tab:hover { background: var(--panel-2); color: var(--text); }
.pf-side .sub-tab.active { background: var(--accent); color: #fff; font-weight: 600; }

/* ===== Market detail page ===== */
.market-view { padding: 18px var(--gutter) 80px; }
.back-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px 0 14px; }
.back-btn:hover { color: var(--text); }
.md-layout { display: flex; gap: 24px; align-items: flex-start; }
.md-main { flex: 1; min-width: 0; }
.md-trade { width: 340px; flex-shrink: 0; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; position: sticky; top: calc(var(--chrome-h, 150px) + 16px); }

.md-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.md-header .mc-thumb { width: 52px; height: 52px; }
.md-h-body h1 { font-size: 24px; margin: 6px 0 4px; line-height: 1.2; }
.md-breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.md-sub { color: var(--muted); font-size: 12px; }
.live-badge { color: var(--accent); font-weight: 700; font-size: 11px; animation: livePulse 1.6s infinite; }
@keyframes livePulse { 50% { opacity: .35; } }
.open-badge { color: var(--yes); font-weight: 600; font-size: 11px; }

/* Multi-line chart legend */
#md-now .lg { font-size: 12px; color: var(--muted); margin-right: 14px; white-space: nowrap; }
#md-now .lg.sel { color: var(--text); }
#md-now .lg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
#md-now .lg b { color: var(--text); }
.md-chart-top { flex-wrap: wrap; gap: 8px; }

.md-chartcard { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.md-chart-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.md-now-pct { font-size: 30px; font-weight: 800; }
.md-now-lbl { color: var(--muted); font-size: 12px; margin-left: 10px; }
.md-types, .md-ranges { display: flex; gap: 6px; }
.md-ranges { margin-top: 10px; }
.chip-sm { background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.chip-sm.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.md-chart-wrap { position: relative; height: 320px; }
#md-chart { width: 100%; height: 320px; display: block; }
.md-chips { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.md-chip { position: absolute; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 7px;
  animation: chipFloat 2.2s ease-out forwards; }
.md-chip.yes { color: var(--yes); background: var(--yes-bg); }
.md-chip.no { color: var(--no); background: var(--no-bg); }
.md-chip.self { font-size: 14px; border: 1px solid currentColor; animation-duration: 2.6s; }
@keyframes chipFloat { 0% { opacity: 0; transform: translateY(10px) scale(.8); }
  15% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-70px); } }

.md-about { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-top: 18px; }
.md-about h3 { margin: 0 0 8px; } .md-about p { color: var(--muted); line-height: 1.55; margin: 0; }

.md-comments { margin-top: 22px; }
.comment-form { display: flex; gap: 8px; margin: 12px 0 18px; }
.comment-form input { flex: 1; }
.comment-form .btn { width: auto; }
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.cm-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; background: var(--panel-2);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.cm-head { font-size: 13px; } .cm-head .muted { font-size: 11px; margin-left: 6px; }
.cm-text { font-size: 14px; margin-top: 2px; }

/* Trade box */
.tb-seg { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 9px; margin-bottom: 12px; }
.tb-seg .seg-btn { flex: 1; background: none; border: none; color: var(--muted); padding: 8px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.tb-seg .seg-btn.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.tb-outcomes { display: flex; gap: 8px; margin-bottom: 14px; }
.tb-out { flex: 1; border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: 12px; border-radius: 9px; cursor: pointer; font-weight: 700; display: flex; flex-direction: column; gap: 2px; }
.tb-out span { font-size: 12px; font-weight: 500; color: var(--muted); }
.tb-out.yes.active { background: var(--yes-bg); border-color: var(--yes); color: var(--yes); }
.tb-out.no.active { background: var(--no-bg); border-color: var(--no); color: var(--no); }
.tb-typelabel, .tb-amtlabel { display: block; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.tb-typelabel select { margin-top: 5px; }
.tb-amt { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 12px; margin-top: 5px; }
.tb-amt span { color: var(--muted); font-size: 18px; }
.tb-amt input { border: none; background: none; font-size: 22px; font-weight: 700; padding: 10px 0; }
.tb-quote { color: var(--muted); font-size: 12px; margin: 12px 0 8px; text-align: center; }
.tb-quote b { color: var(--text); }
.tb-submit { width: 100%; }

@media (max-width: 860px) {
  .md-layout, .portfolio-layout { flex-direction: column; }
  .md-trade, .pf-side { width: 100%; position: static; }
}

/* ===== Event grouping: multi-outcome cards + detail outcomes list ===== */
.event-card .oc-list { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.oc-row { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.oc-row:hover { background: var(--panel-2); }
.oc-name { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-pct { font-weight: 700; font-size: 14px; min-width: 40px; text-align: right; }
.oc-mini { display: flex; gap: 5px; }
.oc-btn { border: 1px solid var(--border); background: var(--panel-2); color: var(--muted);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; transition: .1s; }
.oc-btn.yes:hover, .oc-btn.yes.active { border-color: var(--yes); color: var(--yes); background: var(--yes-bg); }
.oc-btn.no:hover, .oc-btn.no.active { border-color: var(--no); color: var(--no); background: var(--no-bg); }
.oc-more { font-size: 12px; color: var(--accent); padding: 4px 8px; }
.oc-count { font-size: 11px; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 1px 8px; }

.md-outcomes { margin-top: 20px; }
.md-outcomes h3 { margin: 0 0 10px; }
.md-oc-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: var(--panel); transition: .1s; }
.md-oc-row:hover { border-color: #3a3a48; }
.md-oc-row.active { border-color: var(--accent); background: rgba(255, 46, 78, .06); }
.md-oc-row .name { flex: 1; font-weight: 600; }
.md-oc-row .oc-pct { font-size: 18px; font-weight: 800; min-width: 54px; }
.md-oc-row .oc-btn { padding: 8px 12px; }
.tb-outcome-name { font-weight: 700; font-size: 15px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

/* ===== Developer docs page ===== */
.docs-layout { display: grid; grid-template-columns: 210px 1fr; gap: 30px; align-items: start; }
.docs-nav { position: sticky; top: calc(var(--chrome-h) + 16px); display: flex; flex-direction: column; gap: 2px; }
.docs-nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.docs-nav a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: 7px; border-left: 2px solid transparent; }
.docs-nav a:hover { color: var(--text); background: var(--panel-2); }
.docs-nav a.active { color: var(--text); border-left-color: var(--accent); background: var(--panel-2); }
.docs-content { max-width: 780px; min-width: 0; }
.docs-content h1 { margin: 0 0 6px; }
.docs-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 4px; }
.docs-section { scroll-margin-top: calc(var(--chrome-h) + 20px); padding: 24px 0; border-top: 1px solid var(--border); }
.docs-section h2 { margin: 0 0 10px; font-size: 20px; }
.docs-section h3 { margin: 22px 0 8px; }
.docs-section p { line-height: 1.6; }
.docs-ul { line-height: 1.85; padding-left: 18px; }
.docs-content code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.codeblock-wrap { position: relative; margin: 10px 0; }
.copy-btn { position: absolute; top: 8px; right: 8px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 4px 9px; font-size: 11px; cursor: pointer; z-index: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.codeblock { background: #0c0c11; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font: 12.5px/1.55 ui-monospace, Menlo, Consolas, monospace; color: #d6d6e0; white-space: pre; }
.codeblock.small { font-size: 12px; padding: 12px 14px; }
.ep { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: var(--panel); }
.ep-head { display: flex; align-items: center; gap: 10px; }
.ep-method { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; letter-spacing: .04em; }
.ep-method.get { background: rgba(52,211,153,.15); color: #34d399; }
.ep-method.post { background: rgba(79,157,255,.15); color: #4f9dff; }
.ep-method.delete { background: rgba(255,77,94,.15); color: #ff6b78; }
.ep-path { background: none !important; border: none !important; font-size: 13.5px; color: var(--text); padding: 0 !important; }
.ep-auth { margin-left: auto; font-size: 11px; color: #f4c542; }
.ep-pub { margin-left: auto; font-size: 11px; color: var(--muted); }
.ep-desc { color: var(--muted); font-size: 13px; margin-top: 6px; }
.ep-params { font-size: 12px; margin-top: 6px; color: var(--muted); }
.ep-sub { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 10px 0 4px; }
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
  .docs-nav a { border-left: none; }
}

/* 24h change chip */
.chg { font-size: 11px; font-weight: 700; margin-left: 6px; white-space: nowrap; }
.chg.up { color: var(--yes); } .chg.down { color: var(--no); }
.md-oc-row .chg { min-width: 46px; text-align: right; }

/* Site footer / legal disclaimer */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px;
  padding: 22px var(--gutter) 40px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.site-footer strong { color: #b9b9c6; }
.site-footer .footer-links { margin-top: 8px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.fineprint a { color: var(--muted); text-decoration: underline; }

/* ---- launch-readiness UI ---- */

/* Google button + auth helpers */
.btn.google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #1f1f1f; border: none; font-weight: 600; padding: 11px; }
.btn.google:hover { filter: brightness(0.94); }
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.link-btn { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer;
  padding: 8px 0 0; text-decoration: underline; display: block; }
.link-btn:hover { color: var(--accent); }
.msg { font-size: 13px; min-height: 16px; margin-top: 8px; }
.msg.ok { color: var(--yes); } .msg.err { color: var(--no); }

/* Verify-email banner */
.verify-banner { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #f4c542;
  background: rgba(244,197,66,.10); border-bottom: 1px solid rgba(244,197,66,.35); padding: 9px var(--gutter); }
.verify-banner .link-btn { color: #f4c542; padding: 0; }
.verify-banner .vb-close { margin-left: auto; background: none; border: none; color: #f4c542;
  font-size: 18px; cursor: pointer; line-height: 1; }

/* Cookie-consent banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 150; display: flex;
  align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 12px;
  color: var(--muted); background: var(--panel); border-top: 1px solid var(--border); padding: 12px var(--gutter); }
.cookie-banner a { color: var(--accent); }

/* Watchlist heart/star */
.watch-btn { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer;
  line-height: 1; padding: 2px 4px; transition: .12s; }
.watch-btn:hover { color: var(--yellow); transform: scale(1.15); }
.watch-btn.on { color: var(--yellow); }
.market-card { position: relative; }
.market-card > .mc-head .watch-btn { position: absolute; top: 8px; right: 8px; }
.tb-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.tb-top .tb-outcome-name { flex: 1; font-weight: 700; font-size: 15px; border: none; margin: 0; padding: 0; }
.tb-top .watch-btn { position: static; }

/* Loading skeletons */
.market-card.skeleton { pointer-events: none; }
.sk { background: linear-gradient(90deg, var(--panel-2) 25%, #26262f 37%, var(--panel-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-head { height: 38px; } .sk-line { height: 14px; margin-top: 12px; }
.sk-line.short { width: 55%; } .sk-actions { height: 36px; margin-top: auto; }

/* ---- captivating front page: hero + rails + stats ---- */
.home-top { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; cursor: pointer; min-height: 232px;
  background: radial-gradient(120% 120% at 0% 0%, #1a1320 0%, #101015 60%);
  border: 1px solid var(--border); border-radius: 16px; padding: 22px; transition: border-color .15s; }
.hero:hover { border-color: #4a2a36; }
.hero-main { display: flex; flex-direction: column; min-width: 0; }
.hero-meta { display: flex; gap: 12px; align-items: center; }
.hero-meta .mc-thumb { width: 46px; height: 46px; border-radius: 10px; }
.hero-meta .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-vol { color: var(--muted); font-size: 12px; margin-top: 4px; }
.live-badge { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .3px; animation: livePulse 1.6s infinite; }
@keyframes livePulse { 50% { opacity: .45; } }
.hero-title { font-size: 25px; font-weight: 800; line-height: 1.14; margin: 14px 0; }
.hero-big { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.hero-pct { font-size: 48px; font-weight: 800; color: var(--yes); line-height: 1; }
.hero-big .lbl { color: var(--muted); }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; }
.hero-actions .mc-btn { flex: 1; padding: 12px; font-size: 15px; }
.hero-oclist { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.hero-oc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; }
.hero-oc:hover { background: rgba(255,255,255,.04); }
.hero-oc .ho-name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-oc .ho-pct { font-weight: 800; min-width: 48px; text-align: right; }
.hero-chart { position: relative; align-self: stretch; min-height: 190px; }
.hero-chart canvas { width: 100%; height: 100%; display: block; }
.hc-tag { position: absolute; top: 4px; right: 6px; font-size: 10px; color: var(--yes); text-transform: uppercase; letter-spacing: .5px; }
.hc-tag::before { content: "● "; }

.home-rail { display: flex; flex-direction: column; gap: 16px; }
.rail-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px 6px; }
.rail-head { font-weight: 700; font-size: 13px; padding: 2px 10px 8px; }
.rail-head .muted { font-weight: 400; }
.rail-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.rail-row:hover { background: var(--panel-2); }
.rr-rank { color: var(--muted); font-size: 12px; width: 14px; font-weight: 700; flex-shrink: 0; }
.rr-title { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-pct { font-weight: 700; font-size: 13px; flex-shrink: 0; }

.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-cell { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; text-align: center; }
.sc-val { font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sc-val.pos { color: var(--yes); } .sc-val.accent { color: var(--accent); }
.sc-lbl { color: var(--muted); font-size: 12px; margin-top: 2px; }

@media (max-width: 880px) {
  .home-top { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-chart { min-height: 130px; }
  .stats-band { grid-template-columns: repeat(2, 1fr); }
}

/* Interactive chart hover tooltip */
.md-chart-wrap { position: relative; }
#md-chart { cursor: crosshair; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 120px;
  background: rgba(10,10,14,.92); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.chart-tip .ct-when { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.chart-tip .ct-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-tip .ct-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.chart-tip .ct-row b { margin-left: auto; }

/* Market page: stats row, order book, related */
.md-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.ms-cell { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ms-lbl { color: var(--muted); font-size: 11px; }
.ms-val { font-weight: 700; font-size: 15px; margin-top: 2px; }
.md-book, .md-related { margin-top: 18px; }
.md-book h3, .md-related h3 { margin: 0 0 10px; }
.ob { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ob-side { display: flex; flex-direction: column; }
.ob-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 5px 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.ob-bar { position: absolute; right: 0; top: 0; bottom: 0; opacity: .14; }
.ob-row.ask .ob-bar { background: var(--no); } .ob-row.bid .ob-bar { background: var(--yes); }
.ob-row.ask .ob-px { color: var(--no); } .ob-row.bid .ob-px { color: var(--yes); }
.ob-px { width: 58px; font-weight: 600; z-index: 1; } .ob-sz { color: var(--muted); margin-left: auto; z-index: 1; }
.ob-spread { text-align: center; color: var(--muted); font-size: 11px; padding: 5px; background: var(--panel-2); border-block: 1px solid var(--border); }
.related-list { display: flex; flex-direction: column; gap: 5px; }
.related-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); cursor: pointer; }
.related-row:hover { border-color: #3a3a48; }
.rel-title { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-pct { font-weight: 700; }
@media (max-width: 880px) { .md-stats { grid-template-columns: repeat(2, 1fr); } }

/* ==========================================================================
   MY TEAMS (sports) — nav, onboarding, FIFA-style squad, player cards, bets
   ========================================================================== */
.nav-pill {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: 7px 13px; border-radius: 999px; cursor: pointer; font-size: 13px;
  font-weight: 600; white-space: nowrap; transition: .15s; margin-left: 4px;
}
.nav-pill:hover { border-color: var(--accent); transform: translateY(-1px); }
.nav-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 16px var(--accent-glow); }
.app-view .panel[data-panel="myteams"] { padding-top: 6px; }
.badge-dot { font-size: 9px; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 999px; vertical-align: middle; margin-left: 4px; text-transform: uppercase; letter-spacing: .4px; }

/* signed-out gate */
.mt-gate { text-align: center; max-width: 640px; margin: 50px auto; }
.mt-gate-emoji { font-size: 64px; animation: floaty 3s ease-in-out infinite; }
.mt-gate h1 { font-size: 30px; margin: 14px 0 8px; line-height: 1.15; }
.mt-gate-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }
.mt-gate-actions .btn { width: auto; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* My Teams home */
.mt-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; }
.mt-head h1 { font-size: 24px; margin: 0; }
.rail-head { font-weight: 800; font-size: 12px; letter-spacing: .8px; color: var(--muted); text-transform: uppercase; }
.mt-live-rail { margin-top: 8px; }
.mt-live-strip { display: flex; gap: 10px; overflow-x: auto; padding: 8px 0; }
.live-chip { display: flex; align-items: center; gap: 9px; background: var(--panel); border: 1px solid var(--border);
  border-left: 3px solid var(--tcol, var(--accent)); border-radius: 12px; padding: 8px 14px; cursor: pointer; min-width: 220px; color: var(--text); }
.live-chip img { width: 30px; height: 30px; object-fit: contain; }
.lc-name { font-weight: 700; font-size: 13px; }
.lc-score { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 8px; }
.team-tile { position: relative; display: flex; align-items: center; gap: 12px; text-align: left;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tcol) 26%, var(--panel)), var(--panel) 70%);
  border: 1px solid var(--border); border-radius: 14px; padding: 14px; cursor: pointer; color: var(--text); transition: .16s; overflow: hidden; }
.team-tile:hover { transform: translateY(-3px); border-color: var(--tcol, var(--accent)); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.tt-crest { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; flex-shrink: 0; }
.tt-crest img { width: 48px; height: 48px; object-fit: contain; }
.tt-name { font-weight: 700; font-size: 15px; }
.tt-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tt-live { position: absolute; top: 10px; right: 12px; color: var(--red); animation: pulse 1.3s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ---- Onboarding wizard ---- */
.mt-onboard { animation: fadeUp .35s ease both; }
.onboard-wrap { max-width: 860px; margin: 10px auto 40px; }
.onboard-head { text-align: center; margin-bottom: 22px; }
.ob-step { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--accent); text-transform: uppercase; }
.onboard-head h1 { font-size: 30px; margin: 8px 0 4px; }
.sport-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.sport-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px;
  background: var(--panel); border: 2px solid var(--border); border-radius: 16px; cursor: pointer; color: var(--text); transition: .16s; }
.sport-tile:hover { transform: translateY(-3px); border-color: var(--accent); }
.sport-tile.on { border-color: var(--accent); background: var(--accent-glow); }
.st-emoji { font-size: 38px; }
.st-name { font-weight: 700; font-size: 15px; }
.st-leagues { font-size: 11px; color: var(--muted); }
.st-check { position: absolute; top: 8px; right: 10px; opacity: 0; color: var(--accent); font-weight: 900; transition: .16s; transform: scale(.5); }
.sport-tile.on .st-check { opacity: 1; transform: scale(1); }
.onboard-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; position: sticky; bottom: 0;
  background: linear-gradient(transparent, var(--bg) 40%); padding: 16px 0 6px; }
.onboard-foot .btn { width: auto; }
.onboard-foot .btn.big { min-width: 220px; }

.league-accordion { display: flex; flex-direction: column; gap: 8px; }
.league-block { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--panel); }
.league-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: none; color: var(--text); cursor: pointer; font-size: 14px; }
.league-row:hover { background: rgba(255,255,255,.03); }
.lr-emoji { font-size: 20px; } .lr-name { flex: 1; font-weight: 700; text-align: left; } .lr-count { color: var(--muted); font-size: 12px; } .lr-chev { color: var(--muted); }
.league-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.crest-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; background: var(--bg);
  border: 2px solid var(--border); border-radius: 12px; cursor: pointer; color: var(--text); transition: .14s; }
.crest-pick:hover { transform: translateY(-2px); border-color: var(--tcol, var(--accent)); }
.crest-pick.on { border-color: var(--tcol, var(--accent)); background: color-mix(in srgb, var(--tcol) 18%, var(--bg)); box-shadow: inset 0 0 0 1px var(--tcol); }
.cp-logo { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.cp-logo img { width: 44px; height: 44px; object-fit: contain; }
.cp-name { font-size: 11px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---- Team overview (squad) ---- */
.team-view, .player-view { padding: 14px var(--gutter) 64px; animation: fadeUp .3s ease both; }
.back-btn.light { margin-bottom: 12px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 12px; }
.sec-head h2 { font-size: 18px; margin: 0; }
.sec-note { font-size: 12px; color: var(--muted); }
.sec-note.sim { color: var(--yellow); border: 1px solid color-mix(in srgb, var(--yellow) 40%, transparent); padding: 1px 8px; border-radius: 999px; }

.team-hero { position: relative; border-radius: 20px; overflow: hidden; padding: 26px; margin-bottom: 22px;
  background: linear-gradient(135deg, var(--tcol) -10%, var(--tcol2) 60%, var(--panel) 130%);
  border: 1px solid var(--border); animation: heroIn .5s cubic-bezier(.2,.8,.2,1) both; }
.team-hero .th-bg { position: absolute; inset: 0; background: radial-gradient(circle at 85% -20%, rgba(255,255,255,.18), transparent 55%); pointer-events: none; }
.th-main { position: relative; display: flex; align-items: center; gap: 22px; }
.th-crest { width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 900;
  background: rgba(0,0,0,.25); border-radius: 18px; backdrop-filter: blur(4px); flex-shrink: 0; animation: pop .5s .1s both; }
.th-crest img { width: 78px; height: 78px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.th-info { flex: 1; min-width: 0; }
.th-loc { font-size: 14px; opacity: .85; font-weight: 600; }
.th-name { font-size: 40px; margin: 2px 0 8px; line-height: 1; text-shadow: 0 2px 14px rgba(0,0,0,.4); }
.th-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.th-pill { background: rgba(0,0,0,.3); padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.follow-btn { align-self: flex-start; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.3); color: #fff;
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13px; transition: .15s; white-space: nowrap; }
.follow-btn:hover { background: rgba(0,0,0,.55); }
.follow-btn.on { background: #fff; color: #111; border-color: #fff; }

.live-strip { position: relative; display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 20px;
  background: rgba(0,0,0,.32); border-radius: 14px; padding: 12px 18px; }
.ls-team { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ls-team img { width: 26px; height: 26px; object-fit: contain; }
.ls-team.mine .ls-abbr { color: #fff; } .ls-team .ls-abbr { opacity: .9; }
.ls-score { font-size: 22px; font-variant-numeric: tabular-nums; min-width: 28px; text-align: center; }
.ls-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ls-vs { font-size: 11px; opacity: .7; }
.ls-badge { font-size: 11px; font-weight: 800; letter-spacing: .5px; padding: 2px 8px; border-radius: 999px; }
.ls-badge.live { background: var(--red); color: #fff; animation: pulse 1.4s infinite; }
.ls-badge.final { background: rgba(255,255,255,.2); }
.ls-badge.upc { background: rgba(255,255,255,.15); }

/* pitch + formation */
.squad-section { margin-bottom: 26px; }
.pitch { background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 60px, transparent 60px 120px),
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    linear-gradient(180deg, #11241a, #0d1a14);
  border: 1px solid var(--border); border-radius: 18px; padding: 26px 14px; display: flex; flex-direction: column; gap: 22px; }
.formation-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; }

.player-card { position: relative; width: 132px; padding: 12px 10px 14px; cursor: pointer; color: #1a1206;
  border: none; border-radius: 14px; text-align: center; transition: transform .18s ease, box-shadow .18s ease;
  animation: cardIn .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms);
  background: linear-gradient(160deg, #e9c46a, #c98f2b); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.player-card.gold { background: linear-gradient(160deg, #f7e08b, #d4a32a); }
.player-card.silver { background: linear-gradient(160deg, #e9edf2, #aab4c0); }
.player-card.bronze { background: linear-gradient(160deg, #e0a877, #b06a38); }
.player-card:hover { transform: translateY(-8px) scale(1.05) rotate(-1deg); box-shadow: 0 16px 34px rgba(0,0,0,.5); z-index: 2; }
.pc-top { display: flex; justify-content: space-between; font-weight: 900; }
.pc-rating { font-size: 22px; line-height: 1; }
.pc-pos { font-size: 11px; align-self: flex-start; opacity: .85; }
.pc-photo { height: 64px; display: flex; align-items: flex-end; justify-content: center; margin: 2px 0 4px; }
.pc-photo img { height: 70px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.pc-ph { width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; }
.pc-name { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid rgba(0,0,0,.2); padding-top: 5px; }
.pc-jersey { font-size: 11px; font-weight: 700; opacity: .7; }

/* team rails (markets + schedule) */
.team-rails { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.sched-list { display: flex; flex-direction: column; gap: 6px; }
.sched-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.sr-when { font-size: 12px; color: var(--muted); width: 52px; }
.sr-logo { width: 22px; height: 22px; object-fit: contain; }
.sr-opp { flex: 1; font-weight: 600; font-size: 13px; }
.sr-res { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sim-disclaimer { font-size: 11px; color: var(--muted); margin-top: 18px; }

/* ---- bet cards + ticket ---- */
.bet-list { display: flex; flex-direction: column; gap: 10px; }
.bet-card { background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 13px 15px; transition: border-color .15s; }
.bet-card:hover { border-color: #3a3a48; }
.bc-q { font-weight: 600; font-size: 14px; margin-bottom: 9px; }
.bc-row { display: flex; align-items: center; gap: 12px; }
.bc-mid { display: flex; flex-direction: column; line-height: 1; }
.bc-mid .sb-pct { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bc-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.bc-actions { display: flex; gap: 8px; margin-left: auto; }
.sb-btn { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 13px; transition: .12s; }
.sb-btn i { font-style: normal; font-weight: 500; opacity: .8; font-size: 12px; }
.sb-btn.yes:hover, .sb-btn.yes.sel { background: var(--yes-bg); border-color: var(--yes); color: var(--yes); }
.sb-btn.no:hover, .sb-btn.no.sel { background: var(--no-bg); border-color: var(--no); color: var(--no); }
.bc-ticket { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); animation: fadeUp .2s ease both; }
.tk-amtrow { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; }
.tk-amtrow span { color: var(--muted); } .tk-amtrow input { border: none; background: none; padding: 9px 0; }
.tk-quickrow { display: flex; gap: 6px; margin-top: 8px; }
.tk-quick { flex: 1; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 7px; padding: 6px; cursor: pointer; font-size: 12px; }
.tk-quick:hover { border-color: var(--accent); }
.tk-payout { font-size: 12px; color: var(--muted); min-height: 16px; margin: 9px 0; }
.tk-payout b { color: var(--text); }
.tk-place.buy-no { background: var(--no); border-color: var(--no); }
.ticket-result { font-size: 13px; margin-top: 8px; min-height: 16px; }

/* ---- player detail ---- */
.player-hero { display: flex; gap: 26px; align-items: center; border-radius: 20px; padding: 26px; margin-bottom: 22px;
  background: linear-gradient(135deg, var(--tcol) -10%, var(--tcol2) 70%, var(--panel) 130%); border: 1px solid var(--border); animation: heroIn .5s cubic-bezier(.2,.8,.2,1) both; }
.ph-card { position: relative; width: 170px; flex-shrink: 0; border-radius: 16px; padding: 14px; text-align: center; color: #1a1206;
  background: linear-gradient(160deg, #f7e08b, #d4a32a); box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: pop .5s .1s both; }
.ph-card.silver { background: linear-gradient(160deg, #e9edf2, #aab4c0); }
.ph-card.bronze { background: linear-gradient(160deg, #e0a877, #b06a38); }
.phc-rating { position: absolute; top: 12px; left: 14px; font-size: 30px; font-weight: 900; line-height: 1; }
.phc-pos { position: absolute; top: 16px; right: 14px; font-weight: 800; font-size: 13px; }
.phc-photo { height: 110px; display: flex; align-items: flex-end; justify-content: center; margin: 8px 0; }
.phc-photo img { height: 120px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.phc-name { font-weight: 800; font-size: 16px; border-top: 1px solid rgba(0,0,0,.2); padding-top: 8px; }
.ph-info { flex: 1; min-width: 0; color: #fff; }
.ph-team { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; opacity: .92; cursor: pointer; background: rgba(0,0,0,.25); padding: 4px 12px; border-radius: 999px; }
.ph-team img { width: 22px; height: 22px; object-fit: contain; }
.ph-info h1 { font-size: 36px; margin: 10px 0 8px; text-shadow: 0 2px 14px rgba(0,0,0,.4); }
.ph-bio { display: flex; gap: 8px; flex-wrap: wrap; }
.ph-bio span { background: rgba(0,0,0,.28); padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.ph-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.pstat { text-align: center; } .ps-v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; } .ps-k { font-size: 11px; opacity: .85; text-transform: uppercase; letter-spacing: .5px; }
.ps-note { font-size: 11px; opacity: .7; margin-top: 6px; }
.player-body { display: grid; grid-template-columns: 1fr 1.2fr; gap: 26px; }
.gamelog-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.gamelog th, .gamelog td { white-space: nowrap; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes heroIn { from { opacity: 0; transform: scale(.97) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(22px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 880px) {
  .team-rails, .player-body { grid-template-columns: 1fr; }
  .player-hero { flex-direction: column; text-align: center; }
  .ph-bio, .ph-stats { justify-content: center; }
  .th-name { font-size: 30px; } .th-main { flex-wrap: wrap; }
  .ph-info h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .player-card, .team-hero, .player-hero, .th-crest, .ph-card, .mt-onboard, .team-view, .player-view, .mt-gate-emoji, .tt-live, .ls-badge.live { animation: none !important; }
  .player-card:hover { transform: translateY(-4px); }
}
