:root {
   --panel: var(--surface-2); --panel2: var(--surface); --line: #2a2e42;
  --fg: var(--text);   --accent2: var(--purple);
  --green: var(--ok); --red: var(--bad); --gold: var(--warn);
  /* facelift tokens (additive — existing vars unchanged) */
  --line-strong: #384063;      /* hover/active borders */
  --fg-2: var(--text-2);             /* softer body copy */
  --faint: var(--muted);            /* hints / disabled */
  --accent-ink: #11121a;       /* text on accent fills */
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --green-soft: color-mix(in srgb, var(--green) 14%, transparent);
  --red-soft: color-mix(in srgb, var(--red) 14%, transparent);
  --ring: rgba(122,162,247,.35);
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, monospace;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-pill: 999px;
  --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.5);
  --t: .15s ease;
  /* back-compat aliases so figgie/tradingfloor tokens resolve on the Tokyo Night palette */
  --card: var(--panel); --border: var(--line); --text-muted: var(--muted);
  --accent-dim: var(--accent-soft); --radius: var(--r);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--bg); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  background: rgba(26,27,38,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: .5px; }
.brand a { color: inherit; } .brand a:hover { text-decoration: none; }
.brand span { color: var(--accent2); }
main { max-width: 980px; margin: 0 auto; padding: 24px 16px 64px; }
.btn {
  background: var(--accent); color: #11121a; border: 0; border-radius: 10px;
  padding: 9px 15px; font-weight: 700; cursor: pointer; text-decoration: none;
  display: inline-block; font-size: 14px; transition: filter var(--t), border-color var(--t), background var(--t), transform var(--t);
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.hero { text-align: center; padding: 72px 16px; }
.hero h1 { font-size: 34px; margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0 0 28px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); transition: border-color var(--t), box-shadow var(--t); }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.stat .value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.pos { color: var(--green); } .neg { color: var(--red); }
.userbar { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--panel2); object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 28px 0 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { color: var(--muted); width: 36px; }
.me { background: rgba(122,162,247,.08); }
.muted { color: var(--muted); }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.teamrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stakebtns { display: inline-flex; gap: 6px; }
.stakebtns button { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--fg); cursor: pointer; font-weight: 700; transition: border-color var(--t), background var(--t); }
.stakebtns button:hover { border-color: var(--accent); background: var(--panel); }
.gamecard { border-bottom: 1px solid var(--line); padding: 16px 18px; }
.gamecard:last-child { border-bottom: 0; }
.matchup { font-size: 15px; font-weight: 600; line-height: 1.3; }
.matchup .at { color: var(--muted); font-weight: 400; margin: 0 3px; }
.gtime { font-size: 12px; margin-top: 2px; }
.gline { font-size: 14px; margin-top: 7px; line-height: 1.5; }
.fairrow { font-size: 13px; margin-top: 7px; color: var(--muted); }
.fairrow strong { color: var(--fg); font-weight: 600; }
.fairlabel { font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
  background: var(--panel2); color: var(--accent2); padding: 1px 7px; border-radius: 6px; margin-right: 2px; }
.linetable { width: auto; min-width: 340px; max-width: 520px; margin-top: 10px; border-collapse: collapse; font-size: 14px; }
.linetable th { text-align: right; font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 600; padding: 3px 14px 5px; }
.linetable th:first-child { text-align: left; }
.linetable td { padding: 6px 14px; border-top: 1px solid var(--line); }
.linetable td.tm { font-weight: 600; }
.linetable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.linetable tr.favrow td { background: rgba(122, 162, 247, 0.07); }
.linetable tr.favrow td.tm { color: var(--accent); }
.totalrow { font-size: 13px; margin-top: 8px; color: var(--muted); }
.totalrow strong { color: var(--fg); }
/* trade panel */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 6px 14px; cursor: pointer; font-family: inherit; font-size: 13px; }
.seg button.on { background: var(--accent); color: #11121a; font-weight: 600; }
.tradeform { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.tradeform input, .tradeform select { background: var(--panel2); border: 1px solid var(--line); color: var(--fg);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; width: 130px; }
.tradeform #strike { width: 90px; }
.btn.buy { background: var(--green); color: #11121a; border: 0; border-radius: 8px; padding: 8px 22px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn.sell { background: var(--red); color: #11121a; border: 0; border-radius: 8px; padding: 8px 22px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn.buy:hover, .btn.sell:hover { filter: brightness(1.1); }
.profhead { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.profhead h1 { margin: 0; font-size: 26px; }
.lbselect { background: var(--panel2); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color var(--t); }
.lbselect:hover { border-color: var(--accent); }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details[open] summary::before { content: "▾ "; }
details:not([open]) summary::before { content: "▸ "; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--muted); font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--fg); text-decoration: none; }
.rangebtn.on { border-color: var(--accent); color: var(--fg); background: var(--panel); }
tbody tr:hover { background: rgba(122,162,247,.06); }
.date-hd { padding: 9px 16px; background: var(--panel2); color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--line); }
.fav { font-weight: 700; }
.dog { color: var(--muted); }
.spread { color: var(--gold); font-weight: 600; }
.over { color: var(--gold); } .under { color: var(--accent); }
.bk { font-size: 9px; color: var(--muted); margin-left: 2px; vertical-align: super; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.bookchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-family: inherit;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; transition: background .12s, border-color .12s; }
.bookchip .dot { width: 8px; height: 8px; }
.bookchip:hover { border-color: var(--accent); }

/* ── Levels & achievements (profile + HQ home) ── */
.lvlpill { display: inline-block; margin-left: 12px; padding: 3px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--bg); background: var(--accent); vertical-align: middle; }
.lvlbar { height: 6px; border-radius: 999px; background: var(--line); margin: 6px 0 4px; overflow: hidden; }
.lvlbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.achgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.achbadge { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel2); }
.achbadge .ae { font-size: 20px; flex: 0 0 auto; }
.achbadge .an { font-size: 13px; font-weight: 600; }
.lblrow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lblrow .r { color: var(--muted); font-size: 12px; }

/* ── Bet logging (Lines page) ── */
.logbtn { margin-left: auto; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--accent); background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 11px; transition: background .12s, border-color .12s, color .12s; }
.logbtn:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.matchup { display: flex; align-items: center; gap: 8px; }

/* Odds-format toggle (Lines page "My Bets" header) */
.myb-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.oddsfmt { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.ofbtn { font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
  color: var(--muted); background: transparent; border: 0; padding: 4px 11px;
  transition: background .12s, color .12s; }
.ofbtn + .ofbtn { border-left: 1px solid var(--line); }
.ofbtn:hover { color: var(--fg); }
.ofbtn.on { background: var(--accent); color: var(--bg); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: flex;
  align-items: center; justify-content: center; z-index: 100; padding: 16px; backdrop-filter: blur(2px); }
.modal-overlay.hidden { display: none; }
.modal-card { position: relative; width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.modal-x { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; }
.modal-x:hover { color: var(--fg); }

.bet-head { font-size: 17px; font-weight: 700; margin-bottom: 14px; padding-right: 18px; }
.seg-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 12px 0 5px; }
.seg-row { display: flex; gap: 6px; }
.seg { flex: 1; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 9px 6px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--fg);
  transition: background .12s, border-color .12s; }
.seg:hover { border-color: var(--accent); }
.seg.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.seg-tag { opacity: .8; font-weight: 700; font-size: 12px; }
.seg.on .seg-tag { opacity: 1; }

.bet-inputs { display: flex; gap: 8px; margin: 14px 0 4px; }
.bet-inputs label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.bet-inputs input { font-family: inherit; font-size: 15px; font-weight: 600; color: var(--fg);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; width: 100%; }
.bet-inputs input:focus { outline: none; border-color: var(--accent); }

.btn.primary { background: var(--accent); color: var(--bg); border: none; font-weight: 700; cursor: pointer;
  border-radius: 10px; padding: 11px; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; margin-top: 14px; font-size: 15px; }
.bet-msg { min-height: 14px; font-size: 12px; margin-top: 8px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 80px);
  background: var(--panel); border: 1px solid var(--accent); color: var(--fg); font-weight: 600;
  padding: 11px 18px; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.5); z-index: 200;
  opacity: 0; transition: transform .25s, opacity .25s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.nav a { transition: color var(--t); }

/* ── Responsive (was entirely absent) ── */
@media (max-width: 680px) {
  header { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .nav { gap: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; order: 3; }
  .nav::-webkit-scrollbar { display: none; }
  main { padding: 18px 12px 56px; }
  .hero { padding: 48px 12px; } .hero h1 { font-size: 26px; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
  table, .linetable { font-size: 13px; }
  th, td { padding: 8px 9px; }
  .profhead h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
