/* DipTix.fun · theme system
 *
 * Themes live as data-theme="dark|black|light" on <body>.
 * Accent live as data-accent="cyan|green|purple|orange|pink" on <body>.
 * The :root block is the default (dark + cyan accent).
 *
 * All long-form color tokens are CSS custom properties so the entire app
 * recolors when a theme attribute changes. Smooth transitions handled by the
 * `.theme-transitions` class below (added briefly on theme switch). */
:root,
body[data-theme="dark"] {
  /* Dark theme · neutral near-black palette (was slightly blue-tinted GitHub-style).
     RGB triples are kept close so the whole UI reads as "dark grey" not "dark blue". */
  --bg:    #0c0d10;
  --bg-1:  #0f1115;   /* sidebar / topbar */
  --bg-2:  #14161b;   /* cards · bet panel · modal · pills */
  --bg-3:  #1a1d23;   /* hovers · raised cards */
  --line:  #20242c;
  --line-hi: #2a2f39;
  --text:  #e2e4ea;
  --muted: #7a8090;
  --accent: #6bd5ff;
  --up: #00e58a;
  --up-glow: #00e58a55;
  --down: #ff4d6a;
  --down-glow: #ff4d6a55;
  --yellow: #ffd23f;
  --shadow: 0 4px 16px rgba(0,0,0,.45);
  --r: 6px;
  --r-lg: 8px;
  --modal-backdrop: rgba(2, 4, 8, 0.62);
  --skel: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
}

/* Pure-black / OLED · TRUE black for every surface.
   Differentiation between panels comes from borders, not from grey layers. */
body[data-theme="black"] {
  --bg:     #000000;   /* body / main area */
  --bg-1:   #000000;   /* sidebar / topbar — same as body, no grey panel */
  --bg-2:   #000000;   /* bet panel / cards — also pure black */
  --bg-3:   #0a0c10;   /* hover only · tiny lift off pure black */
  --line:   #1c2028;
  --line-hi: #2a303a;
  --text:   #f4f6fb;
  --muted:  #828a9a;
  --shadow: 0 6px 22px rgba(0,0,0,.95);
  --modal-backdrop: rgba(0, 0, 0, 0.82);
}

/* Light · cream-white background, dark navy text, accent stays vivid */
body[data-theme="light"] {
  --bg:    #f5f7fb;
  --bg-1:  #ffffff;
  --bg-2:  #eef1f6;
  --bg-3:  #e3e8f0;
  --line:  #d3d9e3;
  --line-hi: #b6bfcd;
  --text:  #0a1430;
  --muted: #5a6478;
  --accent: #0070f3;
  --up:    #0bb472;
  --up-glow: #0bb47266;
  --down:  #e02d4c;
  --down-glow: #e02d4c66;
  --yellow: #c98f00;
  --shadow: 0 4px 18px rgba(10, 20, 48, 0.10);
  --modal-backdrop: rgba(20, 28, 50, 0.42);
  --skel: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
}

/* Accent color picker (overrides default accent/up only · doesn't touch down red).
   Apply to body via data-accent="<name>". */
body[data-accent="green"]  { --accent: #00e58a; }
body[data-accent="purple"] { --accent: #a387ff; }
body[data-accent="orange"] { --accent: #ff9d3a; }
body[data-accent="pink"]   { --accent: #ff6ec7; }
body[data-accent="cyan"]   { --accent: #6bd5ff; } /* default */

/* Smooth color transitions when theme switches · added briefly via JS */
body.theme-transitions,
body.theme-transitions * {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease !important;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px; line-height: 1.35; -webkit-font-smoothing: antialiased; height: 100%; overflow: hidden; }
body { display: flex; flex-direction: column; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input { font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 5px 8px; outline: 0; font-size: 12px; }
input:focus { border-color: var(--accent); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }

/* ---- topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-bottom: 1px solid var(--line);
  background: var(--bg-1); gap: 10px; flex: 0 0 auto; height: 44px;
}
.brand { display: flex; align-items: center; gap: 7px; }
.brand-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 6px var(--up-glow); }
.brand-name { font-weight: 700; font-size: 13px; letter-spacing: .2px; }
.brand-link { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: opacity .12s ease; }
.brand-link:hover { opacity: 0.85; text-decoration: none; color: var(--text); }
.brand-logo { display: block; border-radius: 5px; flex-shrink: 0; }
.brand-tag { color: var(--muted); font-size: 10px; }

.market-switch { display: flex; gap: 4px; background: var(--bg-2);
  padding: 2px; border-radius: var(--r); border: 1px solid var(--line);
  overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.market-switch::-webkit-scrollbar { height: 4px; }
.market-switch::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 2px; }
.m-btn { display: flex; align-items: center; gap: 6px; padding: 4px 8px;
  border-radius: 4px; color: var(--muted); font-weight: 600; transition: .15s ease;
  border: 1px solid transparent; font-size: 12px; white-space: nowrap; flex: 0 0 auto; }
.m-btn:hover { color: var(--text); }
.m-btn.active { background: var(--bg-3); color: var(--text); border-color: var(--line-hi); }
.m-sym { letter-spacing: .5px; }
.m-price { font-variant-numeric: tabular-nums; color: var(--accent); font-size: 11px; }

.wallet { display: flex; align-items: center; gap: 8px; }
.balance-stack { display: flex; flex-direction: column; gap: 1px; align-items: flex-end; line-height: 1.1; }
.balance-row { display: flex; gap: 6px; align-items: baseline; }
.balance-label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.balance { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; }
.balance.pending { color: var(--yellow); font-size: 11px; }
.balance-usd { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 10px; }
.balance-usd.pending { color: rgba(255,210,63,0.6); }

.session-pnl { display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  padding: 0 6px; border-left: 1px solid var(--line); line-height: 1.1; }
.session-pnl .balance-label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.session-pnl #session-pnl-value { font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.session-pnl.win #session-pnl-value  { color: var(--up); }
.session-pnl.loss #session-pnl-value { color: var(--down); }

.about-card { min-width: 460px; max-width: 540px; max-height: 80vh; overflow-y: auto; }
.about-body section { padding: 10px 0; border-bottom: 1px solid var(--line); }
.about-body section:last-child { border-bottom: 0; }
.about-body h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--accent); font-weight: 700; }
.about-body p { margin: 0 0 6px; font-size: 12px; line-height: 1.55; color: var(--text); }
.about-body ol { margin: 4px 0 4px 18px; padding: 0; font-size: 12px; line-height: 1.55; }
.about-body b.up   { color: var(--up); }
.about-body b.down { color: var(--down); }
.about-body code { background: var(--bg-3); padding: 1px 5px; border-radius: 3px; }

.hotkeys-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.hotkeys-list li { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hotkeys-list li:last-child { border-bottom: 0; }
.hotkeys-list kbd { background: var(--bg-3); border: 1px solid var(--line-hi); border-bottom-width: 2px;
  padding: 3px 8px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; font-weight: 700; min-width: 60px; text-align: center; flex-shrink: 0; }
.hotkeys-list span { font-size: 12px; }
.wallet-btn { background: var(--bg-3); border: 1px solid var(--line-hi); padding: 5px 10px;
  border-radius: var(--r); font-weight: 600; font-size: 12px; transition: .15s; }
.wallet-btn:hover { background: var(--bg-3); }
.wallet-btn.connected { background: rgba(0,229,138,0.10); border-color: rgba(0,229,138,0.4); color: var(--up); }

/* ---- layout ---- */
.layout { flex: 1; display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar { border-left: 0; border-top: 1px solid var(--line); } }

/* ---- chart ---- */
.chart-wrap { position: relative; padding: 10px 14px 4px;
  display: grid;
  grid-template-rows: auto auto minmax(240px, 1fr) auto auto auto;
  /* header / timeline / canvas / pool-bar / positions-bar / trades-strip */
  min-width: 0; min-height: 0; gap: 4px; }
.chart-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 2px 6px; }
.chart-title { font-weight: 700; font-size: 13px; }
.chart-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.meta-pill { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 3px 7px; display: flex; gap: 5px; align-items: center; font-size: 11px; }
.meta-label { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .6px; }
.meta-value { font-variant-numeric: tabular-nums; font-weight: 600; }
/* "vs Strike" live delta pill */
.meta-pill.from-strike { transition: background .15s, border-color .15s, color .15s; }
.meta-pill.from-strike .from-strike-value { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.meta-pill.from-strike.up   { background: rgba(0,229,138,0.10);  border-color: #1f5c3e; color: var(--up); }
.meta-pill.from-strike.down { background: rgba(255,77,106,0.10); border-color: #6b2333; color: var(--down); }

/* Countdown urgency states */
.meta-pill.countdown { transition: background .25s, border-color .25s, color .25s; }
.meta-pill.countdown .countdown-value { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.meta-pill.countdown.urgent { background: rgba(255,210,63,0.15); border-color: var(--yellow); color: var(--yellow); animation: cd-pulse 1s ease-in-out infinite; }
.meta-pill.countdown.critical { background: rgba(255,77,106,0.22); border-color: var(--down); color: var(--down); animation: cd-pulse-fast .45s ease-in-out infinite; }
@keyframes cd-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,210,63,0.0); }
  50% { box-shadow: 0 0 0 4px rgba(255,210,63,0.18); }
}
@keyframes cd-pulse-fast {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,77,106,0.0); transform: scale(1); }
  50% { box-shadow: 0 0 0 5px rgba(255,77,106,0.22); transform: scale(1.04); }
}

.tf-switch { display: flex; gap: 2px; background: var(--bg-2); padding: 2px;
  border-radius: var(--r); border: 1px solid var(--line); }
.tf-btn { padding: 3px 8px; border-radius: 4px; color: var(--muted); font-weight: 600;
  font-size: 11px; transition: .15s ease; }
.tf-btn:hover { color: var(--text); }
.tf-btn.active { background: var(--bg-3); color: var(--text); }

#chart { width: 100%; height: 100%; min-height: 0; display: block;
  background: #0a0d12; border-radius: var(--r-lg); border: 1px solid var(--line); }
body.chart-click-armed #chart { cursor: crosshair; }

/* Round timeline strip (current + next N rounds) */
.round-timeline { display: flex; gap: 8px; padding: 8px 2px; overflow-x: auto; }
.rt-item { display: grid; grid-template-rows: auto auto auto; gap: 2px;
  padding: 8px 12px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); min-width: 110px; flex-shrink: 0; cursor: default;
  transition: border-color .15s; }
/* Active round card · use a translucent yellow tint over the current theme bg
   so it works in dark / black / light without any one-off hardcoded colors. */
.rt-item.active { background: rgba(255, 210, 63, 0.10);
  border-color: var(--yellow); }
.rt-item.next   { border-color: var(--line-hi); }
.rt-label { font-size: 9px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.rt-item.active .rt-label { color: var(--yellow); }
.rt-strike { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; }
.rt-strike.placeholder { color: var(--muted); font-weight: 500; }
.rt-countdown { font-variant-numeric: tabular-nums; font-size: 10px; color: var(--muted); font-weight: 600; }
.rt-item.active .rt-countdown { color: var(--text); }
.rt-countdown.urgent { color: var(--yellow); }
.rt-countdown.critical { color: var(--down); animation: cd-pulse-fast .45s ease-in-out infinite; }
.rt-item.next { cursor: pointer; }
.rt-item.next:hover { background: var(--bg-3); border-color: var(--accent); }
.rt-queued { font-size: 10px; font-weight: 700; padding: 2px 0; border-radius: 4px;
  font-variant-numeric: tabular-nums; }
.rt-queued.UP   { color: var(--up); }
.rt-queued.DOWN { color: var(--down); }

/* Pre-bet modal */
.pb-side-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; }
.pb-side-btn { padding: 14px 8px; font-weight: 800; font-size: 14px; letter-spacing: .8px;
  border-radius: var(--r-lg); border: 1px solid var(--line); transition: .15s; }
.pb-side-btn.up   { background: rgba(0,229,138,0.10);  color: var(--up);   border-color: rgba(0,229,138,0.40); }
.pb-side-btn.down { background: rgba(255,77,106,0.10); color: var(--down); border-color: rgba(255,77,106,0.40); }
.pb-side-btn:not(.active) { opacity: .45; }
.pb-side-btn.active.up   { box-shadow: 0 0 0 1px var(--up-glow); }
.pb-side-btn.active.down { box-shadow: 0 0 0 1px var(--down-glow); }
.pb-stake-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.pb-stake-row input { flex: 1; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 8px 10px; }
.pb-info { padding: 6px 0; border-top: 1px solid var(--line); }

/* ---- pool bar ---- */
/* pool-bar layout: [UP side] [───meter───] [DOWN side]
   Side panels are FIXED-width (not min-width) so wider system fonts on macOS
   can't push the meter off-center. The meter uses `flex: 1 1 0` + `min-width: 0`
   to satisfy Safari's nested-flex rule that flex-grow children need an explicit
   zero basis AND zero min to shrink below their intrinsic content size. */
.pool-bar { display: flex; align-items: center; gap: 8px; padding: 6px 2px; }
.pool-side { display: flex; flex-direction: column; flex: 0 0 78px; width: 78px;
  overflow: hidden; }  /* fixed width survives San Francisco font widths */
.pool-side.up .pool-label { color: var(--up); }
.pool-side.down .pool-label { color: var(--down); text-align: right; }
.pool-side.down { align-items: flex-end; }
.pool-label { font-size: 9px; letter-spacing: .8px; text-transform: uppercase;
  line-height: 1.3; white-space: nowrap; }
.pool-value { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11px;
  line-height: 1.3; white-space: nowrap; }
.pool-meter { flex: 1 1 0; min-width: 0;  /* Safari nested-flex shrink fix */
  height: 5px; background: var(--down); border-radius: 999px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line); position: relative; }
.pool-meter-up { height: 100%; background: var(--up); transition: width .35s cubic-bezier(.2,.7,.2,1); }

/* ---- sidebar ---- */
.sidebar { border-left: 1px solid var(--line); padding: 12px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px; background: var(--bg-1); }
.sidebar h3 { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted);
  margin: 0 0 10px; font-weight: 600; }

/* ---- bet panel ---- */
.bet-panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; }
.price-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.price-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  border-radius: var(--r); border: 1px solid var(--line);
  transition: transform .08s, box-shadow .2s, background .2s;
  position: relative; overflow: hidden; text-align: left;
}
.price-tile.up   { background: rgba(0,229,138,0.10);  color: var(--up);   border-color: rgba(0,229,138,0.40); }
.price-tile.down { background: rgba(255,77,106,0.10); color: var(--down); border-color: rgba(255,77,106,0.40); }
.price-tile.up:hover   { box-shadow: 0 0 0 1px var(--up-glow); }
.price-tile.down:hover { box-shadow: 0 0 0 1px var(--down-glow); }
.price-tile:active { transform: translateY(1px); }
.price-tile.pulse { animation: pulse .35s ease-out; }
.tile-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 12px; letter-spacing: .6px; }
.tile-arrow { font-size: 14px; }
.tile-price { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; margin: 4px 0 0; }
.tile-c { font-size: 12px; margin-left: 2px; opacity: .8; }
.tile-mult { font-size: 10px; opacity: .8; margin-top: 4px; }

.stake-row-h { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.stake-row-h #stake { flex: 1; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stake-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 4px; }
.stake-quick button { background: var(--bg-3); border: 1px solid var(--line); border-radius: 4px;
  padding: 5px 0; font-weight: 700; color: var(--muted); font-size: 11px; transition: .15s;
  font-variant-numeric: tabular-nums; }
.stake-quick button:hover { color: var(--text); border-color: var(--line-hi); }
.stake-quick button.stake-min { color: var(--accent); border-color: var(--line-hi); }
.stake-quick button.stake-min:hover { color: var(--accent); background: #15212e; }
.stake-quick button.stake-max { color: var(--up); border-color: #1f5c3e; }
.stake-quick button.stake-max:hover { color: var(--up); background: #0e2419; }
/* Locked preset · greyed out + lock icon + no-pointer */
.stake-quick button.locked { color: var(--muted); border-color: var(--line);
  background: var(--bg-2); opacity: 0.45; cursor: not-allowed; position: relative; }
.stake-quick button.locked::after { content: "🔒"; position: absolute;
  right: 4px; top: 50%; transform: translateY(-50%); font-size: 9px; opacity: 0.6; }
.stake-quick button.locked:hover { color: var(--muted); background: var(--bg-2);
  border-color: var(--line); }

.bet-toggles { display: flex; gap: 10px; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--line); flex-wrap: wrap; }
.bp-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; user-select: none; }
.bp-toggle input { display: none; }
.bp-toggle .slider.sm { position: relative; display: inline-block; width: 24px; height: 14px;
  background: var(--bg-3); border: 1px solid var(--line-hi); border-radius: 999px; transition: .2s; }
.bp-toggle .slider.sm::before { content: ""; position: absolute; height: 8px; width: 8px;
  left: 2px; top: 2px; background: var(--muted); border-radius: 50%; transition: .2s; }
.bp-toggle input:checked + .slider.sm { background: var(--up); border-color: #1f5c3e; }
.bp-toggle input:checked + .slider.sm::before { transform: translateX(10px); background: #0a1a0e; }
.bp-toggle input:checked ~ span:last-child { color: var(--text); }

/* Bulk-cancel button — appears only when there are open limit orders */
.cancel-all-limits { margin-top: 8px; width: 100%; padding: 7px 10px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .6px; cursor: pointer;
  background: rgba(255,77,106,0.08); color: var(--down); border: 1px solid #6b2333;
  border-radius: var(--r); transition: background 0.12s ease, transform 0.06s ease; }
.cancel-all-limits:hover { background: rgba(255,77,106,0.18); }
.cancel-all-limits:active { transform: scale(0.985); }
.cancel-all-limits[hidden] { display: none; }

/* Tier explainer modal · shows the full 8-tier ladder */
.tier-modal-card { min-width: 520px; max-width: 600px; }
.tier-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto;
  margin-top: 14px; }
.tier-row { display: grid; grid-template-columns: 36px 80px 1fr 130px 100px;
  gap: 10px; align-items: center; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
  font-size: 12px; transition: all .12s; }
.tier-row.active { background: rgba(0,229,138,0.10); border-color: var(--up);
  box-shadow: 0 0 0 1px rgba(0,229,138,0.4), 0 6px 18px -8px rgba(0,229,138,0.35); }
.tier-row.locked { opacity: 0.55; }
.tier-row-emoji { font-size: 22px; }
.tier-row-name { font-weight: 800; font-size: 13px; color: var(--text); letter-spacing: 0.3px; }
.tier-row-floor { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.tier-row-cap { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.tier-row-status { font-size: 10px; font-weight: 800; letter-spacing: 1px;
  text-align: right; text-transform: uppercase; color: var(--muted); }
.tier-row.active .tier-row-status { color: var(--up); }
.tier-row.unlocked:not(.active) .tier-row-status { color: var(--accent); }

@media (max-width: 600px) {
  .tier-modal-card { min-width: auto; }
  .tier-row { grid-template-columns: 28px 1fr 80px; gap: 8px; padding: 10px; }
  .tier-row-floor, .tier-row-status { display: none; }
}

/* House-tier progress bar · clickable; opens explainer modal */
.tier-bar { margin-top: 8px; padding: 8px 10px; width: 100%; text-align: left;
  background: linear-gradient(180deg, rgba(0,229,138,0.04), transparent);
  border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; transition: border-color .12s, background .12s; font: inherit; color: inherit; }
.tier-bar:hover { border-color: rgba(0,229,138,0.35); background: linear-gradient(180deg, rgba(0,229,138,0.07), transparent); }
.tier-bar-info { color: var(--muted); font-size: 11px; }
.tier-bar-head { display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px; }
.tier-bar-name { font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
  color: var(--text); }
.tier-bar-cap { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.tier-bar-track { height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.tier-bar-fill { height: 100%;
  background: linear-gradient(90deg, var(--up), var(--accent));
  width: 0%; transition: width 0.6s cubic-bezier(0.2,0.8,0.2,1);
  box-shadow: 0 0 8px rgba(0,229,138,0.4); }
.tier-bar-foot { display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted);
  font-weight: 600; margin-top: 4px; }

.bet-status { margin-top: 6px; font-size: 11px; color: var(--muted); min-height: 14px; }
.bet-status.err { color: var(--down); }
.bet-status.ok { color: var(--up); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 currentColor; transform: scale(1); }
  60%  { box-shadow: 0 0 0 10px transparent; transform: scale(1.02); }
  100% { box-shadow: 0 0 0 0 transparent; transform: scale(1); }
}

/* ---- active positions (pro strip below chart) ---- */
.positions-bar { display: flex; flex-direction: column; gap: 8px; padding: 10px 6px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  min-height: 96px;
  /* HARD cap on height so the chart canvas above never gets squashed. */
  height: 320px; max-height: 320px;
  overflow: hidden; }
.positions-bar .pb-head { flex: 0 0 auto; }
/* The scrollable container — keyed by ID so it always applies, regardless of
   which class JS sets for the active/history/pending variant. */
#positions-list { flex: 1 1 0; min-height: 0; overflow-y: auto;
  display: flex; gap: 6px; padding: 0 2px 4px; }
#positions-list.cards  { flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
#positions-list.column { flex-direction: column; gap: 8px; }
.history-fixed { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pb-head { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pb-tabs { display: flex; gap: 2px; background: var(--bg-2); padding: 2px; border-radius: var(--r); border: 1px solid var(--line); }
.pb-tab { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 4px; color: var(--muted); font-weight: 700; font-size: 11px; transition: .15s; }
.pb-tab:hover { color: var(--text); }
.pb-tab.active { background: var(--bg-3); color: var(--text); }
.pb-count { font-size: 10px; color: var(--text); background: var(--bg); padding: 1px 6px; border-radius: 999px; font-weight: 700; min-width: 16px; text-align: center; }
.pb-tab:not(.active) .pb-count { color: var(--muted); background: transparent; }
.positions-empty { color: var(--muted); font-size: 11px; padding: 12px 6px; }
.position-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px 9px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-hi);
  border-radius: var(--r);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, transform .08s, box-shadow .15s, background .15s;
  flex: 0 0 auto;
  min-width: 196px;
}
.position-card:hover { background: var(--bg-3); border-color: var(--line-hi); }
.position-card:active { transform: translateY(1px); }
.position-card.up   { border-left-color: var(--up); }
.position-card.down { border-left-color: var(--down); }

/* Row 1: symbol + side + stake (right-aligned) + countdown */
.pc-r1 { display: flex; align-items: baseline; gap: 6px; }
.pc-sym  { font-weight: 800; font-size: 13px; letter-spacing: .3px; }
.pc-side { font-weight: 800; font-size: 10px; letter-spacing: .6px; padding: 1px 5px; border-radius: 3px; }
.pc-side.UP   { color: var(--up);   background: rgba(0,229,138,0.12); }
.pc-side.DOWN { color: var(--down); background: rgba(255,77,106,0.12); }
.pc-stake-inline { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.pc-cd { font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 800; color: var(--muted);
  padding: 1px 6px; border-radius: 3px; background: var(--bg-3); margin-left: 6px; }
.pc-cd.urgent  { color: var(--yellow); background: rgba(255,210,63,0.12); }
.pc-cd.critical { color: var(--down); background: rgba(255,77,106,0.18); animation: cd-pulse-fast .45s ease-in-out infinite; }

/* Row 2: entry → mark with multiplier hint */
.pc-r2 { display: flex; align-items: baseline; gap: 6px; padding-top: 1px;
  border-top: 1px dashed var(--line); padding-top: 5px; font-variant-numeric: tabular-nums; }
.pc-r2-k { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.pc-r2-v { font-size: 12px; font-weight: 700; }
.pc-r2-arrow { color: var(--muted); margin: 0 2px; }
.pc-r2-mult { margin-left: auto; font-size: 10px; color: var(--muted); }

/* Row 3: P&L SOL + percent */
.pc-r3 { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.pc-pnl     { font-weight: 800; font-size: 14px; }
.pc-pnl-pct { font-weight: 700; font-size: 11px; opacity: .85; margin-left: auto; }
.pc-pnl.win,  .pc-r3.win  .pc-pnl-pct  { color: var(--up); }
.pc-pnl.loss, .pc-r3.loss .pc-pnl-pct  { color: var(--down); }

/* History visuals: pie chart + recent-form strip */
.history-viz { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: center;
  padding: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  margin-bottom: 8px; }
.history-pie { width: 80px; height: 80px; }
.history-viz-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.viz-legend { display: flex; gap: 12px; font-size: 11px; }
.viz-legend .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.viz-legend .swatch.win { background: var(--up); }
.viz-legend .swatch.loss { background: var(--down); }
.viz-legend .swatch.refund { background: var(--yellow); }
.recent-form-row { display: flex; gap: 3px; }
.rf-square { width: 14px; height: 14px; border-radius: 2px; background: var(--bg-3); display: inline-block; }
.rf-square.WIN  { background: var(--up); }
.rf-square.LOSS { background: var(--down); }
.rf-square.REFUND { background: var(--yellow); }
.recent-form-label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }

/* Trade history rows (table-like) */
.history-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.history-stats > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.history-stats .hs-k { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.history-stats .hs-v { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; }
.history-stats .hs-v.win  { color: var(--up); }
.history-stats .hs-v.loss { color: var(--down); }

.history-filters { display: flex; gap: 4px; margin-bottom: 6px; }
.hf-chip { background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; transition: .15s; }
.hf-chip:hover { color: var(--text); border-color: var(--line-hi); }
.hf-chip.active { background: var(--bg-3); color: var(--text); border-color: var(--line-hi); }

.trades-table { display: flex; flex-direction: column; gap: 2px;
  padding-right: 2px; }
.trades-table .th, .trades-table .tr {
  display: grid;
  grid-template-columns: 52px 56px 40px 40px 56px 60px 96px 60px;
  gap: 5px; align-items: center; padding: 7px 10px; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.trades-table .tt-slot { color: var(--muted); font-size: 10px; font-weight: 600; }
.trades-table .th { color: var(--muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 1px solid var(--line); padding: 5px 10px; position: sticky; top: 0; background: var(--bg-1); z-index: 1; }
.trades-table .tr { background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; cursor: pointer;
  transition: background .12s, border-color .12s; }
.trades-table .tr:hover { background: var(--bg-3); border-color: var(--line-hi); }
.trades-table .tr.up   { border-left: 2px solid var(--up); }
.trades-table .tr.down { border-left: 2px solid var(--down); }
.trades-table .tt-side.UP   { color: var(--up);   font-weight: 800; font-size: 13px; }
.trades-table .tt-side.DOWN { color: var(--down); font-weight: 800; font-size: 13px; }
.trades-table .tt-pnl.win  { color: var(--up);   font-weight: 800; font-size: 13px; }
.trades-table .tt-pnl.loss { color: var(--down); font-weight: 800; font-size: 13px; }
.trades-table .tt-pnl { font-weight: 800; font-size: 13px; }
.trades-table .tt-result {
  text-align: right; font-size: 11px; font-weight: 800; letter-spacing: .5px;
}
.trades-table .tt-result.WIN     { color: var(--up); }
.trades-table .tt-result.LOSS    { color: var(--down); }
.trades-table .tt-result.REFUND  { color: var(--yellow); }
.trades-table .tt-time { color: var(--muted); font-size: 11px; }

.pending-table { display: flex; flex-direction: column; gap: 2px;
  padding-right: 2px; }
.pending-table .th, .pending-table .tr {
  display: grid;
  grid-template-columns: 48px 48px 64px 96px 78px;
  gap: 6px; align-items: center; padding: 7px 10px; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.pending-table .th { color: var(--muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-1); z-index: 1; }
.pending-table .tr { background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; transition: background .12s; }
.pending-table .tr:hover { background: var(--bg-3); }
.pending-table .tr.up { border-left: 2px solid var(--up); }
.pending-table .tt-cd { font-weight: 700; }
.pending-table .tt-cd.urgent { color: var(--yellow); }

/* Orders tab — limit-order rows with quick-cancel × button on the right */
.pending-table .th-orders,
.pending-table .tr-orders {
  grid-template-columns: 48px 48px 64px 1fr 70px 22px;
}
.cancel-trigger-x {
  background: transparent; color: var(--muted); border: 1px solid var(--line-hi);
  border-radius: 4px; font-size: 14px; line-height: 1; width: 22px; height: 22px;
  padding: 0; cursor: pointer; font-weight: 700; transition: all .12s;
  display: flex; align-items: center; justify-content: center;
}
.cancel-trigger-x:hover { background: rgba(255,77,106,0.18); color: var(--down); border-color: #6b2333; }

/* Referral panel in Settings */
.ref-link-row { display: flex; gap: 6px; margin: 6px 0 10px; }
.ref-link-input { flex: 1; padding: 8px 10px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line-hi); border-radius: 4px; }
.ref-link-input:focus { outline: 1px solid var(--accent); }
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ref-stat { padding: 8px 10px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 4px;
  display: flex; flex-direction: column; gap: 2px; }
.ref-stat-k { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.ref-stat-v { font-size: 14px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.ref-earn   { color: var(--up); }

/* Position-detail modal */
.position-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 12px 0 8px; }
.position-detail > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.position-detail .pd-k { font-size: 9px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.position-detail .pd-v { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.position-detail .pd-v.win  { color: var(--up); }
.position-detail .pd-v.loss { color: var(--down); }
.position-detail .pd-v.urgent  { color: var(--yellow); }
.position-detail .pd-v.critical { color: var(--down); animation: cd-pulse-fast .45s ease-in-out infinite; }
.position-detail .pd-sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- trades ticker (horizontal, under chart) ---- */
.trades-strip { display: flex; align-items: center; gap: 8px; padding: 4px 2px 2px;
  border-top: 1px solid var(--line); min-height: 28px; }
.ts-label { font-size: 9px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); flex-shrink: 0; }
.trades-strip-list { list-style: none; padding: 0; margin: 0; display: flex; gap: 6px;
  overflow-x: auto; flex: 1; white-space: nowrap; }
.trades-strip-list::-webkit-scrollbar { height: 4px; }
.trades-strip-list .trade-item { display: inline-flex; flex-shrink: 0; align-items: center; gap: 4px;
  background: var(--bg-3); padding: 3px 7px; border-radius: 999px; font-size: 10px;
  font-variant-numeric: tabular-nums; line-height: 1.2; animation: trade-in .2s ease-out; }
.trades-strip-list .trade-item .t-side { font-weight: 800; font-size: 10px; }
.trades-strip-list .trade-item .t-side.UP { color: var(--up); }
.trades-strip-list .trade-item .t-side.DOWN { color: var(--down); }
.trades-strip-list .trade-item .t-price { color: var(--muted); }
.trades-strip-list .trade-item .t-stake { font-weight: 700; }
.trades-strip-list .trade-item.whale {
  background: linear-gradient(135deg, rgba(255,210,63,0.16), rgba(255,140,40,0.10));
  border: 1px solid rgba(255,210,63,0.45);
  box-shadow: 0 0 8px rgba(255,210,63,0.35);
  animation: trade-in .2s ease-out, whale-pulse-tape 2s ease-in-out 1;
}
.trades-strip-list .trade-item .t-whale { font-size: 11px; }
@keyframes whale-pulse-tape {
  0%   { box-shadow: 0 0 6px rgba(255,210,63,0.4); }
  20%  { box-shadow: 0 0 18px rgba(255,210,63,0.7); }
  100% { box-shadow: 0 0 6px rgba(255,210,63,0.35); }
}
@keyframes trade-in {
  from { transform: translateX(-6px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ---- bets/history ---- */
.bets-panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; }
.bet-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px;
  max-height: 200px; overflow-y: auto; }
.bet-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 6px; align-items: center;
  padding: 4px 6px; background: var(--bg-3); border-radius: 4px; font-size: 11px; }
.bet-item .b-side { font-weight: 800; }
.bet-item .b-side.UP { color: var(--up); }
.bet-item .b-side.DOWN { color: var(--down); }
.bet-item .b-sym { color: var(--muted); font-variant-numeric: tabular-nums; }
.bet-item .b-payout { font-variant-numeric: tabular-nums; font-weight: 700; }
.bet-item .b-payout.WIN { color: var(--up); }
.bet-item .b-payout.LOSS { color: var(--down); }
.bet-item .b-payout.REFUND { color: var(--yellow); }
.bet-item .b-payout.PAID { color: var(--up); }
.bet-item .b-payout.pending { color: var(--muted); }

.history-panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; }
.round-history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px;
  max-height: 200px; overflow-y: auto; font-size: 11px; }
.rh-item { display: grid; grid-template-columns: 18px 1fr auto auto; gap: 6px; align-items: center;
  padding: 3px 6px; background: var(--bg-3); border-radius: 4px; }
.rh-item .rh-out { font-weight: 800; font-size: 10px; }
.rh-item .rh-out.UP { color: var(--up); }
.rh-item .rh-out.DOWN { color: var(--down); }
.rh-item .rh-out.TIE { color: var(--yellow); }
.rh-strike, .rh-close { font-variant-numeric: tabular-nums; color: var(--muted); }
.rh-close.up { color: var(--up); }
.rh-close.down { color: var(--down); }
.rh-delta { font-variant-numeric: tabular-nums; font-size: 10px; min-width: 56px; text-align: right; }
.rh-delta.up { color: var(--up); }
.rh-delta.down { color: var(--down); }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; background: var(--modal-backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(3px); }
.modal[hidden] { display: none !important; }
.modal-card { background: var(--bg-1); border: 1px solid var(--line-hi); border-radius: 10px;
  padding: 14px; min-width: 320px; max-width: 90vw; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h3 { font-size: 13px; margin: 0; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 700; }
.modal-x { font-size: 14px; color: var(--muted); padding: 0 6px; border-radius: 4px; }
.modal-x:hover { color: var(--text); background: var(--bg-3); }
.modal-actions { display: flex; gap: 6px; margin-top: 12px; justify-content: flex-end; }
.btn-primary { background: var(--up); color: #0a1a0e; border: 0; padding: 6px 14px; border-radius: var(--r); font-weight: 700; font-size: 12px; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--bg-3); color: var(--text); border: 1px solid var(--line-hi); padding: 6px 14px; border-radius: var(--r); font-weight: 600; font-size: 12px; }
.btn-secondary:hover { background: var(--bg-3); }
.btn-warn { background: var(--bg-3); color: var(--down); border: 1px solid #6b2333; padding: 6px 14px; border-radius: var(--r); font-weight: 600; font-size: 12px; }
.btn-warn:hover { background: rgba(255,77,106,0.12); }
.btn-icon { background: var(--bg-3); color: var(--muted); border: 1px solid var(--line); padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.btn-icon:hover { color: var(--text); border-color: var(--line-hi); }
.btn-icon.copied { color: var(--up); border-color: #1f5c3e; }

/* Deposit modal — pro layout */
.dep-card { min-width: 380px; max-width: 440px; }
.dep-amount-block { padding: 14px 0 4px; text-align: center; }
.dep-amount-block label { display: block; margin-bottom: 8px; text-align: left; }
.dep-amount-input { display: flex; align-items: baseline; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 10px 14px; transition: border-color .15s; }
.dep-amount-input:focus-within { border-color: var(--accent); }
.dep-amount-input input { background: transparent; border: 0; padding: 0; flex: 1;
  font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.dep-amount-input input:focus { outline: 0; }
.dep-sol { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .5px; }
.dep-amount-usd { font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; text-align: left; }

.dep-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.dep-presets button { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 6px 0; font-weight: 700; color: var(--muted); font-size: 12px; transition: .15s; }
.dep-presets button:hover { color: var(--text); border-color: var(--line-hi); background: var(--bg-3); }

.dep-flow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 10px 12px; margin: 12px 0 4px; }
.dep-step { min-width: 0; }
.dep-step-k { font-size: 9px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.dep-step-v { font-weight: 700; font-size: 12px; display: flex; align-items: center; gap: 4px; min-width: 0; }
.dep-arrow { color: var(--muted); font-size: 18px; }
.addr-mono { background: var(--bg-3); padding: 2px 6px; border-radius: 4px; font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.deposit-status { font-size: 12px; margin-top: 10px; min-height: 16px; color: var(--muted); text-align: center; }
.deposit-status.win { color: var(--up); }
.deposit-status.err { color: var(--down); }

/* ============ Deposit modal v2 ============ */
.dep-card-v2 { min-width: 460px; max-width: 520px; padding: 18px 22px 14px; }
.dep-head-wrap { display: flex; align-items: center; gap: 10px; }
.dep-net-badge { font-size: 9px; font-weight: 800; letter-spacing: 1px; padding: 3px 7px;
  border-radius: 4px; background: rgba(255,210,63,0.12); color: var(--yellow);
  border: 1px solid rgba(255,210,63,0.35); }

/* Big SOL + USD display */
.dep-value-display { text-align: center; padding: 14px 0 6px; }
.dep-value-line { display: inline-flex; align-items: baseline; gap: 8px;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-hi); border-radius: 12px;
  padding: 10px 22px; box-shadow: 0 8px 24px -10px rgba(0,229,138,0.18); }
.dep-value-amount { font-size: 42px; font-weight: 900; line-height: 1; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--up), #0bd07d); -webkit-background-clip: text;
  background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.dep-value-unit { font-size: 18px; font-weight: 800; color: var(--muted); }
.dep-value-usd { font-size: 13px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* Amount input · stays present for typing custom values */
.dep-amount-row { display: flex; align-items: baseline; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 14px; margin: 10px 0 6px; transition: border-color .12s; }
.dep-amount-row:focus-within { border-color: var(--accent); }
.dep-amount-row input { background: transparent; border: 0; padding: 0; flex: 1;
  font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.dep-amount-row input:focus { outline: 0; }
.dep-amount-unit { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .5px; }

.dep-presets-v2 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 4px 0 14px; }
.dep-presets-v2 button { background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 7px 0; font-weight: 700; color: var(--muted);
  font-size: 12px; font-variant-numeric: tabular-nums; transition: .12s; cursor: pointer; }
.dep-presets-v2 button:hover { color: var(--up); border-color: rgba(0,229,138,0.4); background: rgba(0,229,138,0.05); }

/* Visual wallet → escrow flow */
.dep-flow-v2 { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch;
  margin: 12px 0; }
.dep-flow-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.dep-flow-card.from { border-left: 2px solid var(--accent); }
.dep-flow-card.to   { border-left: 2px solid var(--up); }
.dep-flow-icon { font-size: 22px; line-height: 1; }
.dep-flow-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.dep-flow-val { background: var(--bg-3); padding: 4px 8px; border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px; font-weight: 700; color: var(--text); width: 100%; box-sizing: border-box;
  word-break: break-all; min-width: 0; }
.dep-flow-card .btn-icon { background: transparent; border: 1px solid var(--line-hi);
  border-radius: 4px; padding: 4px 8px; font-size: 10px; font-weight: 700;
  color: var(--muted); margin-top: 4px; cursor: pointer; transition: all .12s; width: 100%;
  text-align: center; }
.dep-flow-card .btn-icon:hover { color: var(--up); border-color: var(--up); background: rgba(0,229,138,0.08); }
.dep-flow-card .btn-icon.copied { color: var(--up); border-color: var(--up); background: rgba(0,229,138,0.12); }

/* Escrow card · address intentionally hidden behind a masked placeholder */
.dep-flow-escrow { background: linear-gradient(135deg, var(--bg-2), rgba(0,229,138,0.04));
  position: relative; overflow: hidden; }
.dep-flow-escrow::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(120px 60px at 20% 0%, rgba(0,229,138,0.12), transparent 60%);
  pointer-events: none; }
.dep-flow-escrow-val { position: relative; }
.dep-flow-escrow-mask { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; font-weight: 800; color: var(--up); letter-spacing: 2px;
  display: inline-block; opacity: 0.7;
  animation: escrowGlow 2.2s ease-in-out infinite; }
@keyframes escrowGlow {
  0%, 100% { opacity: 0.55; text-shadow: 0 0 6px rgba(0,229,138,0.4); }
  50%      { opacity: 1;    text-shadow: 0 0 12px rgba(0,229,138,0.7); }
}
.dep-flow-note { font-size: 9px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; margin-top: 6px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px; }
.dep-flow-escrow .dep-flow-note { color: var(--up); }
.dep-flow-escrow .dep-flow-note::before { content: "✓"; font-weight: 900; }

/* Tighten the "From · your wallet" card to match the new compact escrow card */
.dep-flow-card.from .dep-flow-val {
  background: var(--bg-3); border: 1px solid var(--line); padding: 5px 10px;
  font-size: 12px; font-weight: 800; color: var(--text); letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.dep-flow-arrow { display: flex; align-items: center; justify-content: center; position: relative; min-width: 24px; }
.dep-flow-arrow-line { position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--up)); border-radius: 2px; }
.dep-flow-arrow-tip { position: relative; z-index: 1; background: var(--bg-1);
  color: var(--up); font-size: 16px; font-weight: 800; padding: 0 4px;
  animation: dep-arrow-pulse 1.6s ease-in-out infinite; }
@keyframes dep-arrow-pulse {
  0%, 100% { transform: translateX(0); opacity: 0.7; }
  50%      { transform: translateX(4px); opacity: 1; }
}

/* Info chips */
.dep-info-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 12px; }
.dep-info-chip { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; }
.dep-info-k { font-size: 9px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); font-weight: 600; }
.dep-info-v { font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* Faucet hint */
.dep-faucet-hint { padding: 8px 12px; background: rgba(107,213,255,0.06);
  border: 1px dashed rgba(107,213,255,0.4); border-radius: 6px;
  font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 8px; }
.dep-faucet-hint a { color: var(--accent); font-weight: 700; }

/* Progress steps shown DURING the deposit */
.dep-progress { display: grid; grid-template-columns: 1fr 12px 1fr 12px 1fr 12px 1fr; gap: 4px;
  align-items: center; margin: 12px 0; padding: 10px 6px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 6px; }
.dep-progress-step { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.dep-progress-dot { width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-3); border: 2px solid var(--line-hi); transition: all .2s; }
.dep-progress-step.active .dep-progress-dot {
  background: var(--yellow); border-color: var(--yellow);
  box-shadow: 0 0 12px rgba(255,210,63,0.6);
  animation: dep-step-pulse 1.2s ease-in-out infinite;
}
.dep-progress-step.done .dep-progress-dot {
  background: var(--up); border-color: var(--up);
  box-shadow: 0 0 8px rgba(0,229,138,0.5);
}
.dep-progress-step.done .dep-progress-dot::after {
  content: "✓"; display: block; color: #061410; font-weight: 900; font-size: 10px;
  text-align: center; line-height: 8px;
}
.dep-progress-label { font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; }
.dep-progress-step.active .dep-progress-label,
.dep-progress-step.done .dep-progress-label { color: var(--text); }
.dep-progress-bar { height: 2px; background: var(--line); border-radius: 1px; }
@keyframes dep-step-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(0.85); opacity: 0.7; }
}

.dep-confirm-btn { font-size: 14px; font-weight: 800; padding: 11px 22px; }
.dep-confirm-btn span { font-variant-numeric: tabular-nums; }

/* ============ Level + Achievements (Stats pane) ============ */
.level-card { padding: 16px 18px;
  background: linear-gradient(135deg, rgba(0,229,138,0.06), rgba(107,213,255,0.04));
  border-color: rgba(0,229,138,0.25); }
.level-row { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; }
.level-badge { width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--up), #0bd07d);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 28px; color: #061410;
  box-shadow: 0 12px 28px -10px rgba(0,229,138,0.45);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.level-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.level-title { font-size: 14px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.level-xp { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.level-track { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.level-fill { height: 100%;
  background: linear-gradient(90deg, var(--up), var(--accent));
  transition: width 0.6s cubic-bezier(0.2,0.8,0.2,1);
  box-shadow: 0 0 10px rgba(0,229,138,0.4); }
.level-foot { font-size: 11px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

.ach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ach-cell { padding: 10px 6px; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r); text-align: center; transition: all .12s;
  display: flex; flex-direction: column; gap: 2px; cursor: help; }
.ach-cell.won { border-color: rgba(0,229,138,0.35); background: rgba(0,229,138,0.07); }
.ach-cell.locked { opacity: 0.40; filter: grayscale(1); }
.ach-emoji { font-size: 24px; line-height: 1; }
.ach-name { font-size: 10px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.4px; line-height: 1.2; }
.ach-xp { font-size: 9px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.ach-cell.won .ach-xp { color: var(--up); }

@media (max-width: 600px) {
  .ach-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============ Stats pane (Account modal) ============ */
.stats-pane { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; }
.stats-period { display: inline-flex; gap: 2px; background: var(--bg-2); padding: 3px;
  border-radius: var(--r); align-self: flex-start; border: 1px solid var(--line); }
.stats-period-btn { padding: 5px 10px; font-size: 11px; font-weight: 700; letter-spacing: .4px;
  background: transparent; color: var(--muted); border: none; border-radius: 4px; cursor: pointer; transition: all .12s; }
.stats-period-btn:hover { color: var(--text); }
.stats-period-btn.active { background: var(--accent); color: var(--bg-0); }

.stats-grid { display: grid; gap: 8px; }
.stats-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stats-card { padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); display: flex; flex-direction: column; gap: 4px; }
.stats-card-wide { grid-column: 1 / -1; }
.stats-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.stats-k { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.stats-v { font-size: 16px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.stats-v-big { font-size: 22px; }
.stats-sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stats-up { color: var(--up); }
.stats-down { color: var(--down); }

.stats-spark { width: 100%; height: 80px; display: block; }

.stats-sym-breakdown { display: flex; flex-direction: column; gap: 6px; }
.stats-sym-row { display: grid; grid-template-columns: 60px 1fr auto auto; gap: 10px;
  align-items: center; padding: 6px 8px; background: var(--bg-3);
  border-radius: var(--r); font-size: 12px; }
.stats-sym-bar { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; position: relative; }
.stats-sym-bar-fill { height: 100%; transition: width 0.4s ease; }
.stats-sym-sol { font-weight: 800; font-variant-numeric: tabular-nums; }
.stats-sym-count { font-size: 10px; color: var(--muted); }

@media (max-width: 600px) {
  .stats-grid-3, .stats-grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ============ Theme + accent pickers ============ */
.theme-picker { display: inline-flex; gap: 6px; }
.theme-swatch { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: var(--bg-3); border: 1px solid var(--line-hi); border-radius: 6px;
  font-size: 11px; font-weight: 700; color: var(--muted); cursor: pointer; transition: all .12s; }
.theme-swatch:hover { color: var(--text); border-color: var(--accent); }
.theme-swatch.active { color: var(--text); background: var(--bg-2);
  border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.ts-bg { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line-hi); display: inline-block; }
.ts-dark  { background: linear-gradient(135deg, #0a0d12 0%, #161c24 100%); }
.ts-black { background: #000; }
.ts-light { background: linear-gradient(135deg, #f5f7fb 0%, #e3e8f0 100%); }

.accent-picker { display: inline-flex; gap: 6px; }
.accent-swatch { width: 22px; height: 22px; border-radius: 50%;
  background: var(--sw); border: 2px solid transparent; cursor: pointer;
  transition: all .14s ease; box-shadow: 0 0 0 1px var(--line-hi); padding: 0; }
.accent-swatch:hover { transform: scale(1.15); }
.accent-swatch.active { border-color: var(--text); box-shadow: 0 0 0 1px var(--line-hi), 0 0 12px var(--sw); }

/* ============ Light-mode tweaks (small polish on top of the variable swap) ============ */
body[data-theme="light"] .topbar { background: var(--bg-1); border-bottom: 1px solid var(--line); }
body[data-theme="light"] .modal-card { box-shadow: 0 12px 48px -16px rgba(10, 20, 48, 0.25); }
body[data-theme="light"] .price-tile { box-shadow: 0 2px 6px rgba(10, 20, 48, 0.06); }
body[data-theme="light"] .btn-primary { color: #ffffff; }
body[data-theme="light"] .btn-secondary { background: var(--bg-1); border: 1px solid var(--line); color: var(--text); }
body[data-theme="light"] .btn-secondary:hover { background: var(--bg-2); border-color: var(--line-hi); }
body[data-theme="light"] .wallet-btn { background: var(--bg-1); border: 1px solid var(--line); color: var(--text); }
body[data-theme="light"] .wallet-btn:hover { background: var(--bg-2); }
body[data-theme="light"] input[type="number"],
body[data-theme="light"] input[type="text"] { background: var(--bg-1); color: var(--text); border-color: var(--line); }
body[data-theme="light"] .toast { background: var(--bg-1); border-color: var(--line-hi);
  box-shadow: 0 8px 24px -8px rgba(10, 20, 48, 0.18); color: var(--text); }
body[data-theme="light"] .pool-meter { background: var(--bg-2); }
body[data-theme="light"] code,
body[data-theme="light"] .addr-mono { background: var(--bg-2); color: var(--text); }

/* Pure-black polish · ensure surfaces stay #000 and rely on borders alone */
body[data-theme="black"] .topbar     { background: #000; border-bottom: 1px solid var(--line); }
body[data-theme="black"] .sidebar    { background: #000; }
body[data-theme="black"] .bet-panel,
body[data-theme="black"] .bets-panel,
body[data-theme="black"] .positions-bar,
body[data-theme="black"] .trades-strip,
body[data-theme="black"] .price-tile { background: #000; }
body[data-theme="black"] .price-tile { box-shadow: 0 0 0 1px var(--line-hi); }
body[data-theme="black"] .modal-card { background: #000; border: 1px solid var(--line-hi); }
body[data-theme="black"] .meta-pill  { background: #000; }
body[data-theme="black"] .market-switch,
body[data-theme="black"] .tf-switch,
body[data-theme="black"] .acct-tabs,
body[data-theme="black"] .settings-tabs { background: #000; }

/* Focus visibility · accent ring on all focusable elements */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible { outline-offset: 1px; }

/* ============ Compact mode (dense UI) ============ */
body.compact { font-size: 13px; }
body.compact .price-tile { padding: 8px 10px; }
body.compact .tile-price { font-size: 18px; }
body.compact .meta-pill  { padding: 4px 7px; font-size: 10px; }
body.compact .pb-tab     { padding: 4px 7px; font-size: 11px; }
body.compact .bet-panel  { gap: 6px; padding: 8px; }
body.compact .positions-bar { height: 280px; max-height: 280px; padding: 6px 4px; }
body.compact .modal-card { padding: 14px 16px; }

/* ============ Wallet connect modal (v2) ============ */
.wallet-card-v2 { min-width: 440px; max-width: 480px; }
.wallet-sub { margin: 4px 0 0; max-width: 380px; }

.wallet-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.wallet-list .wl-btn { display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  text-align: left; transition: all .15s ease; cursor: pointer; width: 100%; }
.wallet-list .wl-btn:not(:disabled):hover { background: var(--bg-3); border-color: var(--accent);
  transform: translateY(-1px); box-shadow: 0 6px 18px -8px rgba(107,213,255,0.35); }
.wallet-list .wl-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px; display: block; }
.wallet-list .wl-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.wallet-list .wl-name { font-weight: 800; font-size: 14px; color: var(--text); }
.wallet-list .wl-tag  { font-size: 11px; color: var(--muted); font-weight: 500; }
.wallet-list .wl-installed { font-size: 10px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--up); padding: 3px 8px;
  border: 1px solid rgba(0,229,138,0.4); background: rgba(0,229,138,0.08);
  border-radius: 4px; flex-shrink: 0; }
.wallet-list .wl-missing { font-size: 10px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); padding: 3px 8px;
  border: 1px solid var(--line-hi); border-radius: 4px; flex-shrink: 0; }
.wallet-list .wl-btn.install-link { opacity: 0.85; }
.wallet-list .wl-btn.install-link:hover { opacity: 1; border-color: var(--line-hi); }
.wallet-list .wl-btn.install-link:hover .wl-missing { color: var(--accent); border-color: var(--accent); }
.wallet-list .wl-btn.disabled { opacity: .65; cursor: default; }

.wallet-divider { display: flex; align-items: center; gap: 10px; margin: 18px 4px 8px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-weight: 700; }
.wallet-divider::before, .wallet-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.wallet-hw-list .wl-btn { cursor: default; background: rgba(255,210,63,0.04);
  border-color: rgba(255,210,63,0.25); }
.wl-hw-tag { font-size: 10px; font-weight: 800; letter-spacing: 0.5px;
  color: var(--yellow); padding: 3px 8px;
  border: 1px solid rgba(255,210,63,0.4); background: rgba(255,210,63,0.08);
  border-radius: 4px; flex-shrink: 0; }
.wallet-foot { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line);
  text-align: center; }
.wallet-foot a { color: var(--accent); font-weight: 700; }

.account-card { min-width: 460px; max-width: 540px; }
/* ----- Settings-tab section grouping ----- */
/* Sub-tabs inside the Settings pane keep the modal short regardless of how
   many options exist. Only one section visible at a time. */
.settings-pane-v2 { max-height: 70vh; overflow: hidden; display: flex; flex-direction: column; }
.settings-tabs { display: flex; gap: 2px; padding: 3px; background: var(--bg-2);
  border-radius: var(--r); margin-bottom: 10px; flex: 0 0 auto; }
.settings-tab { flex: 1; padding: 6px 8px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.4px; color: var(--muted); background: transparent; border: none;
  border-radius: 4px; cursor: pointer; transition: all .12s; }
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--text); background: var(--bg-3); }

.settings-pane-v2 .settings-section[hidden] { display: none !important; }
.settings-pane-v2 .settings-section { flex: 1 1 auto; overflow-y: auto; margin: 0 0 12px;
  padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.settings-pane-v2 .modal-actions { flex: 0 0 auto; }

/* Default for non-tabbed settings sections (legacy) */
.settings-section { margin: 8px 0 16px; padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--r); }
.settings-h { margin: 0 0 8px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 6px; }

/* Segmented control (currency / chart type) */
.seg { display: inline-flex; background: var(--bg-3); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg-btn { padding: 5px 10px; font-size: 11px; font-weight: 700; color: var(--muted);
  background: transparent; border: none; cursor: pointer; transition: all .12s; text-transform: uppercase; letter-spacing: .5px; }
.seg-btn:hover { color: var(--text); background: rgba(107,213,255,0.08); }
.seg-btn.active { background: var(--accent); color: var(--bg-0); }

/* Small button variant for inline section actions */
.btn-sm { padding: 5px 10px; font-size: 11px; font-weight: 700; border-radius: 4px; }

/* Withdraw quick-amount row */
.wd-quick { display: flex; gap: 4px; margin-top: 6px; }
.wd-quick button { flex: 1; padding: 6px 8px; font-size: 11px; font-weight: 700;
  background: var(--bg-3); color: var(--muted); border: 1px solid var(--line);
  border-radius: 4px; cursor: pointer; transition: all .12s; text-transform: uppercase; letter-spacing: .5px; }
.wd-quick button:hover { color: var(--text); background: var(--bg-2); border-color: var(--line-hi); }
.wd-quick button#wd-max { color: var(--up); border-color: #1f5c3e; }
.wd-quick button#wd-max:hover { background: rgba(0,229,138,0.10); }

/* Currency mode: hide the secondary unit. SOL is default; USD swaps prominence. */
body.currency-usd .balance { display: none; }
body.currency-usd .balance-usd { font-size: 14px; font-weight: 800; color: var(--text); }
body:not(.currency-usd) .balance-usd { font-size: 11px; color: var(--muted); }

/* Privacy: hide balance values when toggle is on */
body.hide-balances .balance-value,
body.hide-balances #acct-balance,
body.hide-balances #acct-pending,
body.hide-balances #acct-reserved,
body.hide-balances #acct-pnl,
body.hide-balances #acct-volume,
body.hide-balances #acct-total-deposits,
body.hide-balances #acct-total-withdrawals { filter: blur(7px); transition: filter .12s; }
body.hide-balances .balance-value:hover,
body.hide-balances #acct-balance:hover,
body.hide-balances #acct-pending:hover,
body.hide-balances #acct-reserved:hover,
body.hide-balances #acct-pnl:hover,
body.hide-balances #acct-volume:hover,
body.hide-balances #acct-total-deposits:hover,
body.hide-balances #acct-total-withdrawals:hover { filter: blur(0); }

.acct-tabs { display: flex; gap: 2px; background: var(--bg-2); padding: 3px; border-radius: var(--r);
  border: 1px solid var(--line); margin: 8px 0 12px; }
.acct-tab { flex: 1; padding: 6px 8px; border-radius: 4px; color: var(--muted);
  font-weight: 700; font-size: 12px; transition: .15s; }
.acct-tab:hover { color: var(--text); }
.acct-tab.active { background: var(--bg-3); color: var(--text); }
.acct-pane[hidden] { display: none; }
.acct-h4 { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 12px 0 6px; font-weight: 600; }
.acct-list { list-style: none; padding: 0; margin: 0; max-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.acct-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center;
  padding: 6px 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }
.acct-list .al-amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.acct-list .al-amt.in  { color: var(--up); }
.acct-list .al-amt.out { color: var(--down); }
.acct-list .al-sig { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px;
  color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-list .al-status { font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 2px 6px; border-radius: 3px; }
.acct-list .al-status.PENDING   { background: rgba(255,210,63,0.18);  color: var(--yellow); }
.acct-list .al-status.APPROVED  { background: rgba(107,213,255,0.18); color: var(--accent); }
.acct-list .al-status.COMPLETED { background: rgba(0,229,138,0.18);   color: var(--up); }
.acct-list .al-status.REJECTED, .acct-list .al-status.CANCELLED { background: rgba(255,77,106,0.18); color: var(--down); }
.acct-list .al-time { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 36px; height: 18px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--bg-3);
  border: 1px solid var(--line-hi); border-radius: 999px; transition: .2s; }
.switch .slider::before { position: absolute; content: ""; height: 12px; width: 12px;
  left: 2px; top: 2px; background: var(--muted); border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--up); border-color: #1f5c3e; }
.switch input:checked + .slider::before { transform: translateX(18px); background: #0a1a0e; }

.account-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.account-row .addr { background: var(--bg-3); padding: 2px 6px; border-radius: 4px; font-size: 10px; word-break: break-all; }
.account-row input { width: 160px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; border-bottom: 0; padding: 8px 0; }
.stats-row > div { display: flex; flex-direction: column; gap: 1px; background: var(--bg-2); padding: 6px; border-radius: var(--r); }
.stats-row span:last-child { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; }
.deposit-block { padding: 10px 0; border-top: 1px solid var(--line); }
.deposit-block h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 0 0 6px; }
.deposit-actions { display: flex; gap: 4px; margin-top: 6px; }
.deposit-actions input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; }
.deposit-actions button { background: var(--bg-3); border: 1px solid var(--line-hi); border-radius: var(--r); padding: 5px 12px; font-weight: 600; font-size: 11px; }
.deposit-actions button:hover { background: var(--bg-3); }

/* ---- toasts/flashes ---- */
.toast-host { position: fixed; bottom: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 50; pointer-events: none; }
.toast { background: var(--bg-3); border: 1px solid var(--line-hi); padding: 7px 10px; border-radius: var(--r);
  box-shadow: var(--shadow); font-size: 12px; max-width: 280px; animation: toast-in .2s ease-out; }
.toast.win  { border-color: rgba(0,229,138,0.45); color: var(--up); }
.toast.loss { border-color: rgba(255,77,106,0.45); color: var(--down); }
.toast.info { border-color: var(--line-hi); }
.toast.whale {
  border: 1px solid rgba(255,210,63,0.55);
  background: linear-gradient(135deg, rgba(255,210,63,0.18) 0%, rgba(255,140,40,0.10) 100%);
  color: var(--yellow); font-weight: 800; letter-spacing: 0.3px;
  box-shadow: 0 0 22px -4px rgba(255,210,63,0.5);
  animation: toast-in 0.25s ease-out, whale-pulse 2.2s ease-in-out 1;
}
@keyframes whale-pulse {
  0%   { transform: scale(1);    box-shadow: 0 0 22px -4px rgba(255,210,63,0.65); }
  20%  { transform: scale(1.04); box-shadow: 0 0 38px -2px rgba(255,210,63,0.85); }
  100% { transform: scale(1);    box-shadow: 0 0 22px -4px rgba(255,210,63,0.50); }
}
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s; z-index: 40; }
.flash.win  { background: radial-gradient(600px 300px at center, var(--up-glow), transparent 70%); opacity: 1; }
.flash.loss { background: radial-gradient(600px 300px at center, var(--down-glow), transparent 70%); opacity: 1; }
.flash.fade { opacity: 0; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }
