/* Hypee – light trading-app look: calm paper background, white cards, ink type, lime accent.
   Steam = blue, Twitch = violet, time-lapse = magenta. Mobile first. */

:root {
  --bg: #F4F4F1;
  --card: #FFFFFF;
  --ink: #111316;
  --ink2: #3A3E45;
  --muted: #6B6F76;
  --line: #E6E6E0;
  --soft: #EDEDE8;
  --lime: #C4F135;
  --lime-d: #9BC417;
  --up: #0E9F6E;
  --up-bg: #E3F5EC;
  --down: #E5484D;
  --down-bg: #FCE9E9;
  --steam: #3D7BFF;
  --twitch: #9B6BFF;
  --sim: #FF4FA3;
  --warn: #B7791F;
  --warn-bg: #FFF4DB;
  --r: 20px;
  --r-s: 12px;
  --shadow: 0 1px 2px rgb(17 19 22 / 4%), 0 8px 24px -12px rgb(17 19 22 / 10%);
  --f: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fd: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 500 15px/1.5 var(--f);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.noscroll { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--fd); letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
p { margin: 0 0 10px; }
small { font-size: 12px; }
code { font-size: 13px; background: var(--soft); padding: 1px 5px; border-radius: 6px; }
kbd { font: 600 10px var(--f); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.num, .mono { font-family: var(--fd); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; line-height: 1.45; }
.center { text-align: center; }
.up-t { color: var(--up); } .down-t { color: var(--down); } .flat-t { color: var(--muted); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.page { min-width: 0; }
main { max-width: 1180px; margin: 0 auto; padding: 12px 16px 6px; }

.brand { display: inline-flex; align-items: center; gap: 9px; }
.logo svg { width: 30px; height: 30px; display: block; }
.logo rect { fill: var(--ink); }
.logo path { fill: none; stroke: var(--lime); stroke-width: 6.5; stroke-linecap: round; stroke-linejoin: round; }
.logo circle { fill: var(--lime); }
.wordmark { font: 700 21px var(--fd); letter-spacing: -0.03em; }

/* nav: bottom tab bar on phones */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: rgb(255 255 255 / 94%); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.nav > .brand, .nav-foot { display: none; }
.nav-items { display: flex; height: var(--nav-h); }
.nav-items button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 700; color: var(--muted); min-width: 0;
}
.nav-items button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
.nav-items button kbd { display: none; }
.nav-items button.on { color: var(--ink); }
.nav-items button.on .ic { background: var(--lime); border-radius: 9px; padding: 2px; width: 30px; height: 24px; stroke-width: 2; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: rgb(244 244 241 / 88%); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.top-brand .wordmark { display: none; }
.mswitch { display: flex; background: var(--soft); border-radius: 999px; padding: 3px; gap: 2px; }
.mswitch button {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.mswitch button .ic { width: 17px; height: 17px; }
.mswitch button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(17 19 22 / 12%); }
body[data-market="players"] .mswitch button.on .ic { color: var(--steam); }
body[data-market="streamers"] .mswitch button.on .ic { color: var(--twitch); }
.status { display: none; gap: 6px; flex-wrap: wrap; }
.wallet {
  margin-left: auto; display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: baseline; text-align: right;
  padding: 5px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); line-height: 1.2;
}
.wallet .w-l { grid-column: 1 / -1; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.wallet b { font: 700 15px var(--fd); white-space: nowrap; }
.wallet b small { font-size: 10px; color: var(--muted); }
.wallet .chg { font-size: 11px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--card); border: 1px solid var(--line); flex: none; }
.sound-btn.on { background: var(--lime); border-color: var(--lime); color: var(--ink); }

@media (max-width: 420px) {
  .top { gap: 6px; padding: 8px 12px; }
  .mswitch button { padding: 7px 7px; font-size: 12px; gap: 4px; }
  .mswitch button .ic { display: none; }
  .wallet { padding: 4px 8px; }
  .wallet .w-l { font-size: 8.5px; letter-spacing: .02em; white-space: nowrap; }
  .wallet .chg { display: none; }
  .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
  main { padding-left: 12px; padding-right: 12px; }
}
@media (min-width: 720px) { .status { display: flex; } }

/* desktop: left sidebar */
@media (min-width: 1000px) {
  .shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .nav {
    position: sticky; top: 0; height: 100vh; padding: 18px 14px; border-top: 0; border-right: 1px solid var(--line);
    background: var(--card); display: flex; flex-direction: column; gap: 18px; backdrop-filter: none;
  }
  .nav > .brand { display: inline-flex; padding: 4px 8px 8px; }
  .nav-items { flex-direction: column; height: auto; gap: 2px; }
  .nav-items button { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; color: var(--ink2); }
  .nav-items button kbd { display: inline-block; margin-left: auto; }
  .nav-items button:hover { background: var(--bg); }
  .nav-items button.on { background: var(--ink); color: #fff; }
  .nav-items button.on .ic { background: none; padding: 0; width: 20px; height: 20px; color: var(--lime); }
  .nav-items button.on kbd { color: #9a9ea6; border-color: #3a3e45; }
  .nav-foot { display: flex; flex-direction: column; margin-top: auto; gap: 2px; }
  .nav-foot button { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; font-size: 14px; color: var(--muted); }
  .nav-foot button:hover { background: var(--bg); color: var(--ink); }
  .top { padding: 14px 28px; }
  .top-brand { display: none; }
  main { padding: 18px 28px 40px; }
  .foot { padding-left: 28px; padding-right: 28px; }
}

/* time-lapse bar */
.simbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  margin: 6px 16px 0; padding: 10px 14px; border-radius: 16px; background: #FFE7F3; color: #8A1450; font-size: 13px;
}
.simbar b { display: inline-flex; align-items: center; gap: 6px; color: var(--sim); font-family: var(--fd); }
.simbar b .ic { width: 16px; height: 16px; }
.sim-clock { font-family: var(--fd); font-weight: 600; }
.simbar-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 1000px) { .simbar { margin: 6px 28px 0; } }

/* ---------- building blocks ---------- */
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; }
@media (min-width: 860px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .grid > .hero, .grid > .span2 { grid-column: 1 / -1; }
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; margin-bottom: 14px; }
.grid > .card { margin-bottom: 0; }
.card.warn { background: var(--warn-bg); border-color: #F3DDA6; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.big-num { font: 700 38px/1.1 var(--fd); letter-spacing: -0.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.big-num small { font-size: 16px; color: var(--muted); font-weight: 600; }
.chg-line { font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.chg { font-style: normal; font-weight: 700; font-family: var(--fd); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg.up { color: var(--up); } .chg.down { color: var(--down); } .chg.flat { color: var(--muted); }
.row-flex { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.row-flex.center { justify-content: center; }
.empty { text-align: center; color: var(--muted); padding: 22px 12px; font-size: 14px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 26px 10px; font-size: 14px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { background: var(--bg); border-radius: var(--r-s); padding: 10px 12px; margin: 10px 0; display: flex; gap: 8px; align-items: flex-start; }
.note .ic { width: 16px; height: 16px; margin-top: 2px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 4px 8px; border-radius: 999px; background: var(--soft); color: var(--ink2); white-space: nowrap; vertical-align: middle;
}
.tag.live { background: var(--up-bg); color: var(--up); }
.tag.demo, .tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.sim { background: #FFE7F3; color: #C0236F; }
.tag.tw { background: #F0EAFF; color: #6D3FE0; }
.tag.hot, .tag.you { background: var(--lime); color: var(--ink); }
.tag.soon { background: var(--ink); color: var(--lime); }
.tag.held { background: var(--ink); color: #fff; }
.tag.long { background: var(--up-bg); color: var(--up); }
.tag.short, .tag.down { background: var(--down-bg); color: var(--down); }
.tag.bot { background: #EEF0F3; color: var(--muted); }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #EB0400; margin-right: 5px; vertical-align: 1px; box-shadow: 0 0 0 0 rgb(235 4 0 / 50%); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgb(235 4 0 / 0%); } 100% { box-shadow: 0 0 0 0 rgb(235 4 0 / 0%); } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 18px; border-radius: 999px;
  background: var(--lime); color: var(--ink); font-weight: 800; font-size: 14px; border: 1px solid transparent; transition: transform .08s, background .15s;
}
.btn:hover { background: #B6E61F; }
.btn:active { transform: scale(.98); }
.btn .ic { width: 17px; height: 17px; }
.btn.ghost { background: var(--card); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.long { background: var(--up); color: #fff; }
.btn.short { background: var(--down); color: #fff; }
.btn.danger { background: var(--down); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.big { padding: 15px 22px; font-size: 16px; }
.btn.wide { width: 100%; }
.btn:disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; transform: none; border-color: transparent; }
.link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(17 19 22 / 12%); }
.ranges { display: inline-flex; gap: 2px; }
.ranges button { padding: 5px 10px; border-radius: 9px; font: 700 12px var(--fd); color: var(--muted); }
.ranges button.on { background: var(--ink); color: #fff; }

/* badges */
.bdg {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px;
  background: hsl(var(--h) 70% 93%); color: hsl(var(--h) 55% 30%); font: 700 11px var(--fd); letter-spacing: -0.02em; overflow: hidden;
}
.bdg.s { border-radius: 50%; background: hsl(var(--h) 60% 92%); box-shadow: inset 0 0 0 2px #E4DAFF; }

/* ---------- home ---------- */
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.chart-box { margin: 12px 0 4px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.kpis > div { background: var(--bg); border-radius: var(--r-s); padding: 10px 12px; }
.kpis span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.kpis b { font: 700 17px var(--fd); font-variant-numeric: tabular-nums; }
@media (min-width: 600px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.idx-now { text-align: right; }
.idx-now b { display: block; font: 700 20px var(--fd); }

.map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 62px; gap: 6px; }
.tile {
  border-radius: 12px; padding: 8px 9px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; min-width: 0;
  background: var(--soft); color: var(--ink);
}
.tile.up { background: color-mix(in srgb, var(--up) var(--a), #F1F1EC); }
.tile.down { background: color-mix(in srgb, var(--down) var(--a), #F1F1EC); }
.tile.strong { color: #fff; }
.tile b { font: 700 13px var(--fd); }
.tile-n { font-size: 11px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; }
.tile-c { font: 700 12px var(--fd); }
.tile.t-xl { grid-column: span 2; grid-row: span 2; }
.tile.t-xl b { font-size: 18px; }
.tile.t-xl .tile-n, .tile.t-l .tile-n { display: block; }
.tile.t-l { grid-column: span 2; }
.tile:hover { filter: brightness(.96); }

.movers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.mv-col h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mover { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; border-radius: 10px; text-align: left; min-width: 0; }
.mover:hover { background: var(--bg); }
.mover .bdg { width: 30px; height: 30px; font-size: 9px; border-radius: 9px; }
.mv-n { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mover .chg { font-size: 12px; }

.rule .week { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 3px; margin: 8px 0 10px; }
.week i { height: 14px; border-radius: 4px; background: var(--soft); }
.week i.buy { background: var(--ink); }
.week i.open { background: var(--lime); box-shadow: inset 0 0 0 1px var(--lime-d); }
.split-bar { display: flex; border-radius: 10px; overflow: hidden; margin: 4px 0 12px; font-size: 12px; font-weight: 800; }
.split-bar i { font-style: normal; padding: 8px 10px; color: #fff; }
.split-bar .tw { background: var(--twitch); }
.split-bar .dem { background: var(--ink); color: var(--lime); }
.ticks { margin: 0 0 12px; padding-left: 0; list-style: none; }
.ticks li { position: relative; padding-left: 22px; margin-bottom: 6px; }
.ticks li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 10px; height: 10px; border-radius: 3px; background: var(--lime); }
.pro { background: var(--ink); color: #fff; border-color: var(--ink); }
.pro .muted { color: #9a9ea6; }
.pro .btn.ghost { background: transparent; color: #fff; border-color: #3A3E45; }
@media (min-width: 900px) { .pro .ticks { display: flex; flex-wrap: wrap; gap: 4px 28px; } }
.ad-slot {
  display: grid; place-items: center; min-height: 90px; border: 1.5px dashed #CFCFC8; border-radius: var(--r); color: #A3A69E;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: repeating-linear-gradient(45deg, transparent 0 10px, rgb(0 0 0 / 1.5%) 10px 20px);
  margin-bottom: 14px;
}
.grid > .ad-slot { margin-bottom: 0; }

/* ---------- charts (charts.js) ---------- */
.lc { position: relative; width: 100%; touch-action: pan-y; user-select: none; }
.lc-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lc-l { fill: none; stroke: var(--ink); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.lc-l2 { fill: none; stroke: #B9BBC0; stroke-width: 1.2; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.lc-base { stroke: #C9CAC4; stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.lc-g0 { stop-color: var(--ink); stop-opacity: .14; } .lc-g1 { stop-color: var(--ink); stop-opacity: 0; }
.lc-up .lc-l { stroke: var(--up); } .lc-up .lc-g0 { stop-color: var(--up); }
.lc-down .lc-l { stroke: var(--down); } .lc-down .lc-g0 { stop-color: var(--down); }
.lc-brand .lc-g0 { stop-color: var(--lime); stop-opacity: .55; }
.lc-y { position: absolute; right: 14px; transform: translateY(-50%); font: 600 10px var(--fd); color: var(--muted); background: rgb(255 255 255 / 75%); padding: 0 3px; border-radius: 4px; pointer-events: none; }
.lc-x { position: absolute; bottom: -18px; transform: translateX(-50%); font: 600 10px var(--fd); color: var(--muted); white-space: nowrap; pointer-events: none; }
.lc-x.l { transform: none; } .lc-x.r { transform: translateX(-100%); }
.lc-bl { position: absolute; left: 0; transform: translateY(-120%); font-size: 10px; font-weight: 700; color: var(--muted); pointer-events: none; }
.lc-end { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgb(17 19 22 / 10%); pointer-events: none; }
.lc-up .lc-end { background: var(--up); box-shadow: 0 0 0 4px rgb(14 159 110 / 16%); }
.lc-down .lc-end { background: var(--down); box-shadow: 0 0 0 4px rgb(229 72 77 / 16%); }
.lc-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink); opacity: .35; pointer-events: none; }
.lc-dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); pointer-events: none; }
.lc-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--ink); color: #fff; padding: 5px 9px; border-radius: 9px;
  font-size: 11px; line-height: 1.35; white-space: nowrap; pointer-events: none; display: flex; flex-direction: column; align-items: center; z-index: 2;
}
.lc-tip b { font: 700 13px var(--fd); }
.lc-tip span { color: #B9BBC0; }
.lc-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; text-align: center; padding: 0 20px; background: var(--bg); border-radius: var(--r-s); }
.chart-box.lc { margin-bottom: 24px; }
.legend-line { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.legend-line i { display: inline-block; width: 14px; height: 0; border-top: 2.5px solid var(--ink); margin-left: 6px; }
.legend-line i.l2 { border-top: 1.5px dashed #B9BBC0; }
.legend-line .span-note { margin-left: auto; text-align: right; }

.donut { position: relative; flex: none; }
.donut svg { width: 100%; height: 100%; display: block; }
.donut-track { stroke: var(--soft); }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.donut-c b { font: 700 22px var(--fd); }
.donut-c span { font-size: 11px; color: var(--muted); }
.alloc { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.legend li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend li b { margin-left: auto; font-family: var(--fd); }

.hbars { display: flex; flex-direction: column; gap: 4px; }
.hb { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; align-items: center; gap: 10px; text-align: left; padding: 4px 6px; border-radius: 9px; width: 100%; }
button.hb:hover { background: var(--bg); }
.hb-l { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--bg); }
.hb-bar i { display: block; height: 100%; }
.hb-bar .st { background: var(--steam); } .hb-bar .tw { background: var(--twitch); }
.hb-v { font: 700 12px var(--fd); min-width: 52px; text-align: right; }

.spark { display: block; overflow: visible; }
.spark polyline { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark.up polyline, .spark.up circle { stroke: var(--up); } .spark.up .dot { fill: var(--up); }
.spark.down polyline, .spark.down circle { stroke: var(--down); } .spark.down .dot { fill: var(--down); }
.spark.flat polyline, .spark.flat circle { stroke: #9A9EA6; } .spark.flat .dot { fill: #9A9EA6; }
.spark.empty line { stroke: var(--line); stroke-dasharray: 3 3; }
.spark circle { fill: none; }

/* ---------- lists ---------- */
.list-card { padding: 6px 6px 12px; }
.list-card > .tiny { padding: 8px 12px 0; margin: 0; }
.list-card > .btn.wide { margin: 8px 6px 0; width: calc(100% - 12px); }
.thead, .trow { display: grid; grid-template-columns: 26px minmax(0, 1fr) 76px 58px; gap: 8px; align-items: center; padding: 8px 10px; }
.thead { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.thead.l { grid-template-columns: 34px minmax(0, 1fr) auto; }
.trow { width: 100%; text-align: left; border-radius: 12px; }
.trow:hover, .mrow:hover, .pos-main:hover { background: var(--bg); }
.r { text-align: right; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; }
.rk { font: 700 13px var(--fd); color: var(--muted); text-align: center; }
.nm { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.nm > span, .nm > b, .nm > small { min-width: 0; }
.nm b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm > span { display: block; flex: 1; }
.hide-s { display: none !important; }
@media (min-width: 640px) {
  .hide-s { display: block !important; }
  .thead, .trow { grid-template-columns: 30px minmax(0, 1fr) 90px 90px 70px 84px; }
}
.demo-dot { font-size: 9px; color: var(--warn); margin-left: 2px; font-weight: 800; }
.mrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 12px; text-align: left; }
.mrow .nm { display: block; }
.mrow .r b { font-size: 15px; }
.mrow .chg { font-size: 12px; }
.market-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; }
.search .ic { color: var(--muted); width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 11px 0; font-size: 15px; }
.search:focus-within { border-color: var(--ink); }

/* positions */
.pos { border-top: 1px solid var(--line); padding: 8px 0; }
.card > .pos:first-of-type, .card-head + .pos { border-top: 0; }
.pos-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px; border-radius: 12px; text-align: left; }
.pos-main .nm { display: block; }
.pos-main .nm b { white-space: normal; }
.pos-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 6px 4px 56px; flex-wrap: wrap; }
.hold { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.hold .ic { width: 15px; height: 15px; }
.hold.open { color: var(--up); font-weight: 700; }
.hold b { color: var(--ink); font-family: var(--fd); }
.hrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--line); }
.hist .hrow:first-child, .card-head + .hrow { border-top: 0; }
.hrow .nm { display: block; }
.broke { background: var(--lime); border-color: var(--lime-d); }
.broke .btn { background: var(--ink); color: #fff; }

/* league */
.lrow { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; }
.lrow .rk { width: 34px; flex: none; font-size: 15px; }
.lrow .nm { display: block; }
.lrow.me { background: #F4FBDF; box-shadow: inset 0 0 0 1.5px var(--lime-d); }
.lgap { text-align: center; color: var(--muted); }
.me-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.me-name { font: 700 20px var(--fd); }

/* daily call */
.tips { display: flex; flex-direction: column; gap: 2px; }
.tip { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.tips > .tip:first-child { border-top: 0; }
.tip .nm { display: block; min-width: 140px; }
.tip.ok { background: var(--up-bg); border-radius: 12px; }
.tip.bad { background: var(--down-bg); border-radius: 12px; }
.updown { display: flex; gap: 6px; margin-left: auto; }
.updown button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 800; font-size: 13px; }
.updown button.on.up { background: var(--up); border-color: var(--up); color: #fff; }
.updown button.on.down { background: var(--down); border-color: var(--down); color: #fff; }
.tip-res { flex-basis: 100%; font-size: 13px; color: var(--ink2); padding-left: 50px; }
.tips > .btn { margin-top: 12px; }
.countdown { font: 700 34px var(--fd); margin: 6px 0; font-variant-numeric: tabular-nums; }
.score-big { font: 700 56px/1 var(--fd); text-align: center; margin: 6px 0; }
.score-big small { font-size: 24px; color: var(--muted); }
.verdict { text-align: center; font-weight: 700; }
.emoji-row { text-align: center; font-size: 24px; letter-spacing: 4px; }

/* IPO */
.ipo-form form { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; }
.ipo-form .search { min-width: 200px; }
.steps { padding-left: 20px; margin: 12px 0; }
.steps li { margin-bottom: 8px; padding-left: 4px; }
.steps li::marker { font-family: var(--fd); font-weight: 700; color: var(--muted); }
.ipo-teaser { background: linear-gradient(135deg, #F3EEFF, #FFFFFF 60%); }

/* ---------- detail sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap[hidden], .modal-wrap[hidden] { display: none; }
.sheet-backdrop, .modal-backdrop { position: absolute; inset: 0; background: rgb(17 19 22 / 38%); backdrop-filter: blur(2px); }
.sheet {
  position: relative; width: 100%; max-height: 94vh; overflow-y: auto; background: var(--card); border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgb(17 19 22 / 18%); animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
@media (min-width: 900px) {
  .sheet-wrap { justify-content: flex-end; align-items: stretch; }
  .sheet { width: 480px; max-height: none; height: 100vh; border-radius: 24px 0 0 24px; animation-name: left; }
  @keyframes left { from { transform: translateX(30px); opacity: .4; } }
}
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sheet-head .bdg { width: 46px; height: 46px; font-size: 13px; }
.sh-t { flex: 1; min-width: 0; }
.sh-t h2 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.close-x { width: 38px; height: 38px; border-radius: 50%; background: var(--bg); font-size: 22px; line-height: 1; flex: none; }
.sh-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.sh-price b { font: 700 34px var(--fd); letter-spacing: -0.02em; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 10px; }
.facts > div { background: var(--bg); border-radius: var(--r-s); padding: 9px 11px; }
.facts span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.facts b { font: 700 15px var(--fd); }
.trade { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.side-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.side-toggle button { border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 12px; text-align: left; background: var(--card); }
.side-toggle b { display: block; font: 700 16px var(--fd); }
.side-toggle small { color: var(--muted); }
.side-toggle button.on.long { border-color: var(--up); background: var(--up-bg); }
.side-toggle button.on.long b { color: var(--up); }
.side-toggle button.on.short { border-color: var(--down); background: var(--down-bg); }
.side-toggle button.on.short b { color: var(--down); }
.amt { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 14px; padding: 4px 14px; }
.amt:focus-within { border-color: var(--ink); }
.amt span { font-size: 13px; color: var(--muted); font-weight: 700; }
.amt input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 700 22px var(--fd); padding: 8px 0; text-align: right; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chips button { padding: 6px 11px; border-radius: 999px; background: var(--bg); font: 700 12px var(--fd); }
.chips button:hover { background: var(--soft); }
.preview { font-size: 13px; color: var(--ink2); margin: 4px 0 12px; line-height: 1.6; }
.rule-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; }
.rule-note .ic { width: 14px; height: 14px; margin-top: 2px; }
#shPos h3 { margin-top: 16px; }
#shPos .pos-foot { padding-left: 6px; }
.sh-links { margin-top: 14px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { position: relative; width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto; background: var(--card); border-radius: 24px; padding: 20px; box-shadow: 0 20px 60px rgb(17 19 22 / 25%); animation: up .2s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { font-size: 20px; }
.modal .steps li { margin-bottom: 10px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting label { font-weight: 700; }
.setting input[type=range] { width: 46%; accent-color: var(--ink); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--soft); transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--lime); }
.switch input:focus-visible + span { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.stat-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid > div { background: var(--bg); border-radius: var(--r-s); padding: 10px; text-align: center; }
.stat-grid b { display: block; font: 700 17px var(--fd); }
.stat-grid span { font-size: 11px; color: var(--muted); font-weight: 600; }
.dist { margin: 8px 0; }
.dist-row { display: grid; grid-template-columns: 34px 1fr 28px; gap: 8px; align-items: center; font: 600 12px var(--fd); margin-bottom: 4px; }
.dist-row > span:nth-child(2) { background: var(--bg); border-radius: 5px; height: 14px; overflow: hidden; }
.dist-bar { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
.dist-bar.hi { background: var(--lime-d); }
.prose ul { padding-left: 18px; margin: 0 0 10px; }
.prose li { margin-bottom: 6px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 80;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 10px 30px rgb(17 19 22 / 25%); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.win { background: var(--up); }
.toast.loss { background: #2A2D33; }
@media (min-width: 1000px) { .toast { bottom: 24px; } }

/* footer */
.foot { max-width: 1180px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 30px); color: var(--muted); font-size: 12px; line-height: 1.55; }
.foot .legal { color: var(--ink); font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; }
.foot .link { color: var(--muted); }
@media (min-width: 1000px) { .foot { padding-bottom: 30px; } main { padding-bottom: 24px; } }

canvas.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 90; }

/* reduced motion */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* streamer order book */
.book h3 { margin: 16px 0 8px; }
.calc { background: var(--bg); border-radius: var(--r-s); padding: 4px 12px; }
.calc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.calc-row:first-child { border-top: 0; }
.calc-row > span { display: block; min-width: 0; }
.calc-row small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 500; }
.calc-row b { font: 700 14px var(--fd); white-space: nowrap; text-align: right; }
.calc-row.sum b { font-size: 15px; }
.calc-row.total { border-top: 2px solid var(--ink); }
.calc-row.total b { font-size: 17px; }
.ls { padding: 10px 0 6px; border-top: 1px solid var(--line); }
.ls-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.ls-bar { height: 10px; border-radius: 6px; background: var(--down); overflow: hidden; }
.ls-bar i { display: block; height: 100%; background: var(--up); border-right: 2px solid var(--card); }
.ls-bar.empty { background: var(--line); }
.ls-bar.empty i { background: transparent; border: 0; }
.ls p { margin: 6px 0 0; }
.book .facts b small { display: block; font: 500 11px var(--f); color: var(--muted); }
.streams { list-style: none; margin: 0; padding: 0; }
.streams li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--line); font-size: 13px; }
.streams li:first-child { border-top: 0; }
.streams li span { color: var(--muted); min-width: 0; }
.streams li b { font-family: var(--fd); white-space: nowrap; }
.streams li b small { color: var(--muted); font-weight: 500; }

/* rankings tables (players: 5 cols, categories: 4 cols) + IPO overview */
.thead.ipo, .trow.ipo { grid-template-columns: 26px minmax(0, 1fr) 64px 74px; }
@media (min-width: 640px) {
  .thead.c5, .trow.c5 { grid-template-columns: 30px minmax(0, 1fr) 90px 70px 84px; }
  .thead.c4, .trow.c4 { grid-template-columns: 30px minmax(0, 1fr) 110px 80px; }
  .thead.ipo, .trow.ipo { grid-template-columns: 30px minmax(0, 1fr) 100px 100px 90px 84px; }
}
div.trow:hover { background: none; }
a.trow { color: inherit; text-decoration: none; }
a.trow:hover { background: var(--bg); }
.trow .mono { white-space: nowrap; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); padding: 2px 0; margin-bottom: 2px; }
.back-btn:hover { color: var(--ink); }
.ipo-more { margin-top: 10px; }
.nm > .bdg { flex: none; display: grid; } /* badge inside a ranking row keeps its size */
.trow.ipo .nm b { white-space: normal; } /* status tag may wrap below the channel name */

/* ---------- account: sign-in, profile, avatars ---------- */
.acct-btn { flex: none; position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.acct-btn .av { width: 100%; height: 100%; border-radius: 11px; }
.acct-btn.todo::after { content: ''; position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--down); box-shadow: 0 0 0 2px var(--bg); }
.acct-btn.out { width: auto; padding: 0 14px; background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 800; font-size: 14px; white-space: nowrap; }
.acct-btn.out:hover { background: #2A2E34; }
.top .wallet[hidden] ~ .sound-btn { margin-left: auto; }
.av { display: inline-block; flex: none; width: 32px; height: 32px; border-radius: 10px; overflow: hidden; background: var(--soft); }
.av svg { display: block; width: 100%; height: 100%; }
.av.md { width: 46px; height: 46px; border-radius: 14px; }
.av.lg { width: 64px; height: 64px; border-radius: 18px; }
.lrow .av { width: 30px; height: 30px; border-radius: 9px; }
.lrow .nm { min-width: 0; flex: 1; }
.rep-btn { flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-right: -4px; border-radius: 8px; color: var(--muted); opacity: .5; }
.rep-btn:hover, .rep-btn:focus-visible { opacity: 1; background: var(--bg); color: var(--down); }
.rep-btn .ic { width: 15px; height: 15px; }
.me-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.me-card .small { margin: 4px 0 0; }
.hero-out .out-t { font: 700 26px var(--fd); margin: 8px 0 6px; }
.hero-out p { max-width: 46ch; }
.out-card p { margin-top: 0; }
.out-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

a.btn { text-decoration: none; }
.login-list { display: grid; gap: 10px; margin: 16px 0 14px; }
.lp-twitch { background: #9146FF; border-color: #9146FF; color: #fff; }
.lp-twitch:hover { background: #7C2FF5; }
.lp-discord { background: #5865F2; border-color: #5865F2; color: #fff; }
.lp-discord:hover { background: #4752C4; }
.lp-google { background: var(--card); border-color: var(--line); color: var(--ink); }
.lp-google:hover { background: var(--bg); }
.lp-dev { background: var(--card); border: 1.5px dashed var(--muted); color: var(--ink); }
.lp-dev:hover { background: var(--bg); }
.login-fine { display: flex; gap: 8px; align-items: flex-start; }
.login-fine .ic { flex: none; width: 15px; height: 15px; margin-top: 1px; }

.field { display: grid; gap: 6px; }
.field > span, .field-l { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field input, .inp { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: 600 16px var(--f); }
.field input:focus, .inp:focus { outline: none; border-color: var(--ink); background: var(--card); }
.field input:disabled { opacity: .55; }
.field-hint { margin: 6px 0 0; }
.field-l { margin: 16px 0 8px; }
.form-err { margin: 8px 0 0; color: var(--down); font-size: 13px; font-weight: 700; }
.warn-note { background: var(--warn-bg); color: var(--warn); }
.avatar-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.av-pick { aspect-ratio: 1; padding: 0; border-radius: 14px; overflow: hidden; border: 2px solid transparent; transition: transform .12s; }
.av-pick svg { display: block; width: 100%; height: 100%; }
.av-pick:hover { transform: translateY(-2px); }
.av-pick.on { border-color: var(--ink); box-shadow: 0 0 0 3px var(--lime); }
.prof-form .btn.ghost { margin-top: 8px; }
.acc-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.acc-top small { display: block; margin-top: 2px; }
.acc-list .hrow:first-child { border-top: 0; }
.acc-list .nm b { font-weight: 700; }
.acc-actions { margin-top: 6px; }
.danger-zone { margin-top: 20px; padding: 14px; border-radius: var(--r-s); background: var(--down-bg); }
.danger-zone h3 { margin-top: 0; color: var(--down); }
.danger-zone .row-flex { margin-top: 8px; }
.danger-zone .inp { flex: 1 1 140px; width: auto; background: var(--card); }
.danger-zone p { margin-bottom: 0; }
.report-list { display: grid; gap: 8px; margin-top: 12px; }
@media (max-width: 420px) {
  .top { gap: 5px; }
  body.signed-in #btnSettings { display: none; } /* phones: settings sit in the profile dialog */
  .acct-btn { width: 34px; height: 34px; border-radius: 10px; }
  .acct-btn .av { border-radius: 9px; }
  .acct-btn.out { padding: 0 10px; font-size: 12.5px; }
  .avatar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 380px) { .top-brand { display: none; } } /* phones up to 380 px: home is in the bottom bar; keeps room for a long wallet label */
.acc-top > div { flex: 1; min-width: 0; }
.acc-top .acc-set { flex: none; }
