/* KILOX — game screen styles (P1: the line). Mobile-first. */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--void);
  color: var(--ice);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.x { color: var(--long); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--hairline);
  min-height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-shrink: 0;
  color: var(--ice);            /* wordmark is white; .x spans stay green */
  text-decoration: none;
}
.brand .monogram-sm { color: var(--ice); }

/* thin vertical divider used to separate header zones */
.tb-sep {
  width: 1px;
  height: 22px;
  background: var(--hairline);
  flex-shrink: 0;
}
@media (max-width: 640px) { .tb-sep { display: none; } }

.monogram-sm {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
}

.brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.08em;
}

/* ---- asset switcher ---- */
.assets {
  display: flex;
  gap: var(--s1);
  margin-left: var(--s2);       /* sits with the brand on the left */
  margin-right: var(--s3);
  overflow-x: auto;
  scrollbar-width: none;
}
.assets::-webkit-scrollbar { display: none; }

.assets button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 5px 11px 5px 6px;
  border-radius: var(--r-pill);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.asset-logo {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  flex-shrink: 0;
}
.assets button.more {
  color: var(--muted);
  border-style: dashed;
}
.assets button.more.active {
  color: var(--void);
  background: var(--long);
  border-color: var(--long);
  border-style: solid;
}
.more-caret { opacity: 0.7; }

/* ---- coin picker modal ---- */
.coin-card { width: min(460px, 100%); padding: var(--s5) var(--s4) var(--s4); }
.coin-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: var(--s3);
}
.coin-search {
  width: 100%;
  appearance: none;
  background: rgba(11, 14, 20, 0.65);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  color: var(--ice);
  font-size: 14px;
  padding: 12px var(--s3);
  outline: none;
  margin-bottom: var(--s3);
  transition: border-color var(--t-fast) var(--ease);
}
.coin-search:focus { border-color: rgba(0, 230, 118, 0.55); }
.coin-list { max-height: 52vh; overflow-y: auto; }
.cp-row {
  display: grid;
  grid-template-columns: 26px 54px 1fr auto auto;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  appearance: none;
  background: none;
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 11px var(--s2);
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast) var(--ease);
}
.cp-row:hover { background: rgba(255, 255, 255, 0.03); }
.cp-row.current { background: rgba(0, 230, 118, 0.06); }
.cp-logo { width: 24px; height: 24px; border-radius: 50%; }
.cp-sym { font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: var(--ice); }
.cp-name { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-price { font-size: 12px; color: var(--ice); }
.cp-chg { font-size: 11px; min-width: 58px; text-align: right; }
.cp-chg.up { color: var(--long); }
.cp-chg.down { color: var(--short); }

.assets button:hover { color: var(--ice); }

.assets button.active {
  color: var(--void);
  background: var(--long);
  border-color: var(--long);
}

/* primary zone: your money + account. secondary zone: tools. */
.acct-group, .util-group {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-shrink: 0;
}
.util-group { gap: var(--s1); }
/* account cluster hugs the right; the tools sit just past it */
.acct-group { margin-left: auto; }

/* balance reads as a small wallet: a muted DEMO tag fused to the amount */
.balance-wrap {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  background: var(--panel);
  overflow: hidden;
  transition: border-color var(--t-fast) var(--ease);
}
.balance-wrap:hover { border-color: rgba(0, 230, 118, 0.45); }
.bal-tag {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0 8px;
  border-right: 1px solid var(--hairline);
}
.balance {
  appearance: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--ice);
  padding: 6px 12px;
  background: transparent;
  border: none;
  transition: color var(--t-fast) var(--ease);
}
.balance:hover { color: var(--long); }

/* ---- feed status ---- */
.feed-status {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  color: var(--muted);
}

.feed-status[data-state="live"] {
  color: var(--long);
  border-color: rgba(0, 230, 118, 0.35);
}

.feed-status[data-state="reconnecting"] {
  color: var(--short);
  border-color: rgba(255, 61, 90, 0.35);
}

/* ---- price readout ---- */
.readout {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  padding: var(--s4) var(--s4) var(--s2);
}

.price {
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  transition: color 160ms var(--ease), text-shadow 160ms var(--ease);
}
.price.tick-up { color: var(--long); text-shadow: 0 0 18px rgba(0, 230, 118, 0.45); }
.price.tick-down { color: var(--short); text-shadow: 0 0 18px rgba(255, 61, 90, 0.45); }

.delta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.delta.up { color: var(--long); }
.delta.down { color: var(--short); }

/* ---- chart stage ---- */
.stage {
  flex: 1;
  min-height: 0;
  position: relative;
  background:
    radial-gradient(120% 90% at 72% 38%, rgba(0, 230, 118, 0.045) 0%, rgba(0, 230, 118, 0) 55%),
    radial-gradient(140% 110% at 50% 30%, #111726 0%, var(--void) 62%);
}

.stage::after {
  /* vignette — pulls the eye to the line */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(105% 85% at 50% 45%, rgba(0,0,0,0) 55%, rgba(0,0,0,0.38) 100%);
}

#chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---- result flashes (win = gold detonation, bust = fast red) ---- */
.flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms var(--ease);
}
.flash.on { opacity: 1; }
.flash.gold { background: radial-gradient(70% 70% at 50% 45%, rgba(242,201,76,0.32) 0%, rgba(242,201,76,0) 70%); }
.flash.win  { background: radial-gradient(70% 70% at 50% 45%, rgba(0,230,118,0.22) 0%, rgba(0,230,118,0) 70%); }
.flash.bust { background: radial-gradient(80% 80% at 50% 50%, rgba(255,61,90,0.30) 0%, rgba(255,61,90,0) 75%); }

.result {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--s3) var(--s5);
  background: rgba(18, 23, 34, 0.92);
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.result.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.result.win { border-color: rgba(242, 201, 76, 0.45); }
.result.lose { border-color: rgba(255, 61, 90, 0.4); }
.r-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.r-pnl { font-size: 24px; font-weight: 700; }
.r-pnl.up { color: var(--long); }
.r-pnl.down { color: var(--short); }

/* ---- control deck — floating glass console over the chart ---- */
.deck {
  position: relative;
  z-index: 5;
  padding: 0 var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  margin-top: -30px;               /* floats up over the stage */
  pointer-events: none;            /* only the card itself catches input */
}

.deck-idle, .deck-open {
  pointer-events: auto;
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: var(--s4) var(--s4) var(--s3);
  background: rgba(15, 20, 31, 0.78);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.deck-idle::before, .deck-open::before {
  /* light seam across the card's top edge */
  content: "";
  position: absolute;
  top: -1px; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 230, 118, 0.5), transparent);
}
.deck[data-mode="idle"] .deck-open { display: none; }
.deck[data-mode="open"] .deck-idle { display: none; }

.win-preview {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: calc(-1 * var(--s1)) 0 var(--s3);
  letter-spacing: 0.02em;
  min-height: 15px;
}
.win-preview .wp-win { color: var(--long); font-weight: 700; }
.win-preview .wp-move { color: var(--ice); }

.mute {
  appearance: none;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.mute:hover { color: var(--ice); }
.mute.off { color: var(--short); border-color: rgba(255, 61, 90, 0.35); }

.row { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }

.lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  flex-shrink: 0;
  width: 84px;
}

.stake-box {
  display: flex;
  align-items: center;
  background: rgba(11, 14, 20, 0.65);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  padding: 0 var(--s3);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.stake-box:focus-within {
  border-color: rgba(0, 230, 118, 0.55);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.35), 0 0 0 3px rgba(0, 230, 118, 0.12);
}
.stake-box input {
  appearance: none;
  background: none;
  border: none;
  outline: none;
  color: var(--ice);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  width: 84px;
  padding: 11px 0;
}
.stake-box input::-webkit-outer-spin-button,
.stake-box input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stake-box .unit { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.stake-box .unit-pre { font-size: 18px; font-weight: 700; color: var(--muted); margin-right: 4px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button {
  appearance: none;
  border: 1px solid var(--hairline);
  background: rgba(18, 23, 34, 0.8);
  color: var(--muted);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  padding: 8px 13px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.chips button:hover { color: var(--ice); border-color: #34405a; transform: translateY(-1px); }
.chips button:active { transform: translateY(0); }
.chips button.active {
  color: var(--ice);
  background: rgba(0, 230, 118, 0.10);
  border-color: rgba(0, 230, 118, 0.6);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.18), inset 0 0 8px rgba(0, 230, 118, 0.08);
}
.chips.mult button.active {
  color: var(--long);
}
.chips.mult button.m1000 { border-color: rgba(242, 201, 76, 0.45); color: var(--gold); }
.chips.mult button.m1000.active {
  color: var(--gold);
  background: rgba(242, 201, 76, 0.10);
  border-color: rgba(242, 201, 76, 0.75);
  box-shadow: 0 0 14px rgba(242, 201, 76, 0.22), inset 0 0 8px rgba(242, 201, 76, 0.10);
}

.updown { gap: var(--s3); margin-bottom: 0; flex-wrap: nowrap; }
.big {
  appearance: none;
  border: none;
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.06em;
  padding: 19px 0;
  border-radius: 14px;
  cursor: pointer;
  color: #06210f;
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.big * { pointer-events: none; }   /* live numbers can never steal the tap */
.big::after {
  /* glass highlight across the top of the button */
  content: "";
  position: absolute;
  inset: 0 0 55% 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0));
  border-radius: 14px 14px 0 0;
}
.big:hover { filter: brightness(1.06); }
.big:active { transform: translateY(1px) scale(0.985); }
.big.up {
  background: linear-gradient(180deg, #0cf587 0%, #00c765 100%);
  box-shadow: 0 10px 30px rgba(0, 230, 118, 0.32), inset 0 1px 0 rgba(255,255,255,0.4);
}
.big.down {
  background: linear-gradient(180deg, #ff5d78 0%, #ec2242 100%);
  box-shadow: 0 10px 30px rgba(255, 61, 90, 0.32), inset 0 1px 0 rgba(255,255,255,0.35);
  color: #2b060d;
}
.big .arrow { font-size: 15px; }

.deck-err {
  min-height: 16px;
  margin-top: var(--s2);
  text-align: center;
  color: var(--short);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---- open position ---- */
.pos-head {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  margin-bottom: var(--s3);
  flex-wrap: wrap;
}
.pos-dir { font-family: var(--font-mono); font-weight: 700; font-size: 14px; }
.pos-dir.up { color: var(--long); }
.pos-dir.down { color: var(--short); }
.pos-meta, .pos-entry { font-size: 13px; color: var(--muted); }

.pnl-bar-wrap { margin-bottom: var(--s3); }
.pnl-bar {
  position: relative;
  height: 8px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.pnl-fill {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 0;
  background: var(--long);
  transition: left 80ms linear, width 80ms linear;
}
.pnl-fill.neg { background: var(--short); }
.pnl-zero {
  position: absolute;
  left: 50%; top: -2px; bottom: -2px;
  width: 1px;
  background: var(--muted);
  opacity: 0.6;
}
.pnl-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.big.cashout {
  width: 100%;
  background: linear-gradient(180deg, #0cf587 0%, #00c765 100%);
  box-shadow: 0 10px 32px rgba(0, 230, 118, 0.35), inset 0 1px 0 rgba(255,255,255,0.4);
  font-size: 19px;
}
.big.cashout.neg {
  background: linear-gradient(180deg, #ff5d78 0%, #ec2242 100%);
  box-shadow: 0 10px 32px rgba(255, 61, 90, 0.35), inset 0 1px 0 rgba(255,255,255,0.35);
  color: #2b060d;
}
.big.cashout .num { display: inline-block; min-width: 7ch; text-align: right; }
.big.cashout .pct { font-size: 13px; opacity: 0.75; min-width: 9ch; }

/* ---- account button ---- */
.acct {
  appearance: none;
  border: 1px solid rgba(0, 230, 118, 0.5);
  background: rgba(0, 230, 118, 0.08);
  color: var(--long);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.acct:hover { background: rgba(0, 230, 118, 0.16); }
.acct.named { border-color: var(--hairline); background: var(--panel); color: var(--ice); }
.acct.warn { border-color: rgba(255, 61, 90, 0.5); background: rgba(255, 61, 90, 0.1); color: var(--short); }

/* ---- modal ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 11, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: var(--s4);
}
.modal[hidden], .drawer[hidden] { display: none; }

.modal-card {
  position: relative;
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: var(--s5);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.modal-x {
  position: absolute;
  top: 10px; right: 14px;
  appearance: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}
.modal-x:hover { color: var(--ice); }

.modal-tabs { display: flex; gap: var(--s2); margin-bottom: var(--s2); }
.tab {
  appearance: none;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 6px 2px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--ice); border-bottom-color: var(--long); }

.modal-sub { color: var(--muted); font-size: 12px; margin-bottom: var(--s4); }

#acct-form { display: flex; flex-direction: column; gap: var(--s3); }
#acct-form input {
  appearance: none;
  background: rgba(11, 14, 20, 0.65);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  color: var(--ice);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 12px var(--s3);
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
}
#acct-form input:focus { border-color: rgba(0, 230, 118, 0.55); }
.modal-submit { font-size: 15px; padding: 14px 0; }

/* ---- history drawer ---- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  background: rgba(5, 7, 11, 0.5);
}
.drawer-card {
  width: min(440px, 100%);
  height: 100%;
  background: var(--void);
  border-left: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s4);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.drawer-head .modal-x { position: static; }
.hist-list { flex: 1; overflow-y: auto; padding: var(--s2) var(--s4); }
.hist-empty { color: var(--muted); font-size: 13px; text-align: center; padding: var(--s6) 0; }
.hist-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
}
.h-dir.up { color: var(--long); }
.h-dir.down { color: var(--short); }
.h-asset { font-family: var(--font-mono); font-weight: 700; width: 42px; }
.h-mult { color: var(--muted); width: 46px; }
.h-stake { color: var(--muted); width: 60px; }
.h-prices { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.h-pnl { font-weight: 700; }
.h-pnl.up { color: var(--long); }
.h-pnl.down { color: var(--short); }

/* ---- daily bonus chip ---- */
.bonus {
  appearance: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold);
  padding: 5px 10px;
  border: 1px solid rgba(242, 201, 76, 0.55);
  background: rgba(242, 201, 76, 0.1);
  border-radius: var(--r-pill);
  animation: bonus-pulse 1.8s var(--ease) infinite;
}
@keyframes bonus-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(242, 201, 76, 0); }
  50% { box-shadow: 0 0 14px rgba(242, 201, 76, 0.4); }
}

/* ---- live wins ticker ---- */
.ticker {
  display: flex;
  align-items: stretch;
  height: 34px;
  border-bottom: 1px solid var(--hairline);
  background: var(--void);
  white-space: nowrap;
}
.ticker-label {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 0 var(--s4);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
  z-index: 2;
}
.tk-live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--long);
  box-shadow: 0 0 8px var(--long);
  animation: pulse 1.6s var(--ease) infinite;
}
.ticker-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 0 var(--s4);
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  background: linear-gradient(90deg, rgba(0,230,118,0.07), rgba(0,230,118,0.02));
}
.tk-top-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--long);
  border: 1px solid rgba(0,230,118,0.45);
  border-radius: var(--r-pill);
  padding: 2px 7px;
}
.ticker-viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
}
/* soft fade at both edges so items enter/exit cleanly */
.ticker-viewport::before, .ticker-viewport::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}
.ticker-viewport::before { left: 0; background: linear-gradient(90deg, var(--void), transparent); }
.ticker-viewport::after { right: 0; background: linear-gradient(270deg, var(--void), transparent); }

.ticker-track {
  display: flex;
  align-items: center;
  height: 100%;
  animation: tk-scroll 60s linear infinite;
}
@keyframes tk-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.tk-item {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-size: 12px;
}
.tk-item::before {
  content: "";
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--hairline);
  align-self: center;
  margin: 0 30px;
}
.tk-handle { color: var(--ice); font-weight: 600; }
.tk-win {
  color: var(--long);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}
.tk-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.tk-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* the pinned top-win cell: no leading dot divider, brighter number */
.tk-item.top::before { display: none; }
.tk-item.top { gap: 9px; }
.tk-item.top .tk-win { text-shadow: 0 0 14px rgba(0, 230, 118, 0.6); }

/* ---- profile ---- */
.prof-id { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.prof-avatar {
  width: 52px; height: 52px;
  border-radius: 14px;
  flex-shrink: 0;
  border: 1px solid var(--hairline);
}
.prof-handle { font-family: var(--font-mono); font-weight: 700; font-size: 18px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s2);
  margin-bottom: var(--s4);
}
.stat {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-v { font-weight: 700; font-size: 17px; }
.stat-v.gold { color: var(--gold); }
.stat-l { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; color: var(--muted); }

.w-action.logout {
  border-color: rgba(255, 61, 90, 0.4);
  background: rgba(255, 61, 90, 0.06);
  color: var(--short);
}
.w-action.logout:hover { background: rgba(255, 61, 90, 0.14); }

.r-actions { display: flex; gap: var(--s2); }
.share-btn.again {
  border-color: rgba(242, 201, 76, 0.5);
  background: rgba(242, 201, 76, 0.1);
  color: var(--gold);
}
.share-btn.again:hover { background: rgba(242, 201, 76, 0.2); }

/* ---- streak chip ---- */
.streak {
  font-weight: 700;
  font-size: 12px;
  color: var(--long);
  padding: 4px 9px;
  border: 1px solid rgba(0, 230, 118, 0.4);
  border-radius: var(--r-pill);
  background: rgba(0, 230, 118, 0.08);
}
.streak.hot {
  color: var(--gold);
  border-color: rgba(242, 201, 76, 0.55);
  background: rgba(242, 201, 76, 0.1);
  box-shadow: 0 0 12px rgba(242, 201, 76, 0.25);
}

/* ---- share button on result toast ---- */
.share-btn {
  appearance: none;
  margin-top: var(--s2);
  border: 1px solid rgba(0, 230, 118, 0.5);
  background: rgba(0, 230, 118, 0.1);
  color: var(--long);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.share-btn:hover { background: rgba(0, 230, 118, 0.2); }
.result { pointer-events: auto; }

/* ---- leaderboard ---- */
.lb-controls {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.lb-tabs { display: flex; gap: 4px; }
.lb-tabs button {
  appearance: none;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.lb-tabs button.active { color: var(--long); border-color: rgba(0, 230, 118, 0.5); background: rgba(0, 230, 118, 0.08); }

.lb-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
}
.lb-row.me { background: rgba(0, 230, 118, 0.05); margin: 0 calc(-1 * var(--s2)); padding-left: var(--s2); padding-right: var(--s2); border-radius: 8px; }
.lb-rank { width: 28px; color: var(--muted); font-weight: 700; }
.lb-row:nth-child(1) .lb-rank { color: var(--gold); }
.lb-row:nth-child(2) .lb-rank, .lb-row:nth-child(3) .lb-rank { color: var(--ice); }
.lb-handle { flex: 1; font-family: var(--font-mono); font-weight: 700; }
.lb-rounds { color: var(--muted); font-size: 11px; }

/* ---- wallet ---- */
.wallet-pane { padding: var(--s4); overflow-y: auto; }
.w-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: var(--s2);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.w-soon {
  color: var(--gold);
  border: 1px solid rgba(242, 201, 76, 0.5);
  background: rgba(242, 201, 76, 0.08);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 9px;
}
.w-bal { font-size: 34px; font-weight: 700; margin-bottom: var(--s1); }
.w-bal.muted { color: var(--muted); }
.w-note { color: var(--muted); font-size: 12px; margin-bottom: var(--s4); }

.w-action {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(0, 230, 118, 0.5);
  background: rgba(0, 230, 118, 0.08);
  color: var(--long);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 12px 0;
  border-radius: var(--r-ctl);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.w-action:hover { background: rgba(0, 230, 118, 0.16); }
.w-action.dim { border-color: var(--hairline); background: var(--panel); color: var(--muted); cursor: not-allowed; }

.w-stub {
  margin-top: var(--s5);
  padding: var(--s4);
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
}
.w-stub-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: var(--s3);
}
.w-currencies { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s3); }
.w-cur {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--hairline);
  padding: 4px 8px;
  border-radius: var(--r-pill);
}
.w-addr-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  background: rgba(11, 14, 20, 0.65);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  padding: var(--s3);
  margin-bottom: var(--s2);
}
.w-addr { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; filter: blur(3px); }
.w-qr {
  width: 44px; height: 44px;
  border-radius: 6px;
  background:
    repeating-conic-gradient(var(--hairline) 0% 25%, var(--panel) 0% 50%) 0 0 / 11px 11px;
  opacity: 0.6;
  flex-shrink: 0;
}
.w-stub-note { color: var(--muted); font-size: 11px; }
.w-input {
  appearance: none;
  width: 100%;
  background: rgba(11, 14, 20, 0.5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  color: var(--ice);
  font-size: 13px;
  padding: 11px var(--s3);
  margin-bottom: var(--s2);
  outline: none;
}
.w-input:focus { border-color: rgba(0, 230, 118, 0.5); }

/* ---- testnet wallet controls ---- */
.w-row {
  display: flex; align-items: center; gap: var(--s2);
  padding: 10px 0; border-bottom: 1px solid var(--hairline);
}
.w-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--muted); flex-shrink: 0; width: 72px; }
.w-v { font-size: 13px; color: var(--ice); }
.w-mini {
  margin-left: auto; appearance: none; cursor: pointer;
  font-family: var(--font-mono); font-weight: 700; font-size: 10px; letter-spacing: 0.08em;
  color: var(--long); border: 1px solid rgba(0, 230, 118, 0.4);
  background: rgba(0, 230, 118, 0.08); padding: 5px 9px; border-radius: var(--r-pill);
}
.w-mini:hover { background: rgba(0, 230, 118, 0.16); }
.w-mini:disabled { opacity: 0.6; cursor: default; }
.w-status { font-family: var(--font-mono); font-size: 11px; margin-top: 6px; min-height: 14px; color: var(--muted); word-break: break-word; }
.w-status.ok { color: var(--long); }
.w-status.err { color: var(--short); }
.w-action:disabled { opacity: 0.6; cursor: default; }
.w-row-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.w-addr-real { color: var(--ice); font-size: 12px; letter-spacing: 0.02em; word-break: break-all; }
.w-net { color: var(--muted); opacity: 0.75; }
/* balance tag turns green in REAL (USDT) play mode */
.bal-tag.real { color: var(--long); background: rgba(0, 230, 118, 0.10); }

/* ---- footer ---- */
.foot {
  padding: var(--s2) var(--s4);
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid var(--hairline);
}

/* ---- mobile header: wraps into rows so nothing is ever cut off ----
   row 1: brand + balance/sign-up + tools ; row 2: full-width coin strip
   (if row 1 is too tight, tools wrap gracefully rather than clipping). */
@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    column-gap: var(--s2);
    row-gap: 9px;
    padding: 9px var(--s3);
    min-height: 0;
  }
  .tb-sep.dsk { display: none; }         /* zone dividers are desktop-only */

  .brand { order: 1; }
  .acct-group { order: 2; margin-left: auto; gap: var(--s2); }
  .util-group { order: 3; flex: 0 0 auto; gap: 6px; }
  .util-group .mute { padding: 4px 7px; }

  /* coins always get their own full-width, horizontally scrollable row */
  .assets {
    order: 4;
    flex: 0 0 100%;
    width: 100%;
    margin: 0;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---- mobile deck: compact so the chart keeps room & the line stays in view ---- */
@media (max-width: 640px) {
  .readout { padding: var(--s2) var(--s4) 2px; }
  .deck { margin-top: -8px; padding-left: var(--s3); padding-right: var(--s3); }
  .deck-idle, .deck-open { padding: var(--s3) var(--s3) var(--s2); border-radius: 16px; }
  .row { margin-bottom: var(--s2); }
  .lbl { width: auto; }
  .stake-box input { font-size: 16px; }
  .win-preview { margin: 2px 0 8px; font-size: 12px; }
  .big { padding: 13px 0; font-size: 16px; border-radius: 12px; }
  .big .arrow { font-size: 12px; }
}

@media (max-width: 480px) {
  .brand-name { display: none; }
  .price { font-size: 32px; }
  .lbl { width: auto; }
  .balance { font-size: 13px; padding: 6px 10px; }
  .bal-tag { padding: 0 6px; }
}
