/* ── Cryptogaming UI — CG logo brand theme ─────────────────────────────────── */
:root {
  --bg: #000000;
  --bg-elevated: #060608;
  --bg-panel: #0a0a10;
  --bg-card: #101018;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.11);
  --border-focus: rgba(0, 204, 255, 0.5);
  --text: #eceef2;
  --text-secondary: #b4bac4;
  --muted: #7a828e;
  --cyan: #00ccff;
  --blue: #0066ff;
  --purple: #cc33ff;
  --violet: #6600cc;
  --gold: #ffd700;
  --brand-grad: linear-gradient(90deg, var(--cyan) 0%, var(--purple) 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(0, 204, 255, 0.18) 0%, rgba(204, 51, 255, 0.14) 100%);
  --green: #5CFF8A;
  --green-dim: #3be06a;
  --green-bg: rgba(92, 255, 138, 0.12);
  --green-zone: rgba(92, 255, 138, 0.22);
  --red: #FF4D6A;
  --red-dim: #ff3355;
  --red-bg: rgba(255, 77, 106, 0.12);
  --red-zone: rgba(255, 77, 106, 0.22);
  --yellow: #ffd700;
  --yellow-tag: linear-gradient(145deg, #ffe566 0%, #d4a800 100%);
  --start-tag: linear-gradient(145deg, #c8f7d0 0%, #7ee08a 100%);
  --end-tag-up: linear-gradient(145deg, #b8ffcd 0%, #5CFF8A 50%, #2fd45a 100%);
  --end-tag-down: linear-gradient(145deg, #ffb3c0 0%, #FF4D6A 50%, #e02040 100%);
  --prize-bg: rgba(255, 215, 0, 0.08);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --topbar-h: 60px;
  --sidebar-w: 304px;
  --brand-logo-h: 34px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabs-scroll-h: clamp(200px, 34vh, 380px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 0% 0%, rgba(0, 204, 255, 0.07), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 100%, rgba(204, 51, 255, 0.06), transparent 50%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(255, 215, 0, 0.03), transparent);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.green { color: var(--green); }
.red { color: var(--red); }

/* ── TOPBAR ───────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 12px 20px;
  padding: 0 20px;
  min-height: var(--topbar-h);
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: none;
  box-shadow: none;
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--brand-grad);
  opacity: 0.85;
  pointer-events: none;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}
.market-picker {
  position: relative;
  z-index: 45;
}
.topbar-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
}
.topbar-logo img {
  height: var(--brand-logo-h);
  width: var(--brand-logo-h);
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 10px rgba(0, 204, 255, 0.35));
}
.topbar-center {
  display: flex; align-items: center; justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topbar-center::-webkit-scrollbar { display: none; }
.topbar-right {
  display: flex; align-items: center; gap: 8px;
  justify-self: end;
  flex-shrink: 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; letter-spacing: -0.02em;
}
.brand .logo { color: var(--green); font-size: 10px; }

.market-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  max-width: min(200px, 42vw);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-inset);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.market-btn:hover {
  border-color: var(--border-2);
  background: var(--bg-hover);
}
.market-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.market-icon .market-logo-img,
.market-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.caret { color: var(--muted); font-size: 9px; opacity: 0.8; flex-shrink: 0; }
#marketLabel {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.header-prize {
  display: flex; align-items: center; gap: 10px;
  height: 36px;
  background: var(--prize-bg);
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  box-shadow: var(--shadow-inset);
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
/* Client: remove prize-pool chip on website (amounts remain in players bar). */
body:not(.tg-app) .header-prize {
  display: none !important;
}
.header-prize:hover {
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: var(--shadow-inset), 0 0 12px rgba(255, 215, 0, 0.12);
}
.header-prize-icon { color: var(--gold); display: flex; opacity: 0.95; }
.header-prize-text {
  display: flex; flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  gap: 1px;
}
.header-prize-label {
  font-size: 9px; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}
.header-prize-val {
  font-size: 15px; font-weight: 700; color: var(--gold);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}

.header-bonus-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 52px;
  height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(240, 192, 32, 0.55);
  background: linear-gradient(160deg, #f5d04a 0%, #e8a820 100%);
  color: #1a1200;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 4px 16px rgba(240, 192, 32, 0.35);
  animation: bonus-pill-pulse 2.5s ease-in-out infinite;
  transition: transform 0.15s var(--ease), filter 0.2s var(--ease);
}
.header-bonus-pill:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.header-bonus-pill:active { transform: scale(0.98); }
.header-bonus-pct {
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}
.header-bonus-lbl {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  opacity: 0.85;
}
@keyframes bonus-pill-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,0.2) inset, 0 4px 16px rgba(240,192,32,0.35); }
  50% { box-shadow: 0 0 0 1px rgba(255,255,255,0.35) inset, 0 6px 22px rgba(240,192,32,0.55); }
}

/* ── DEPOSIT PROMO ────────────────────────────────────────────────────────── */
.promo-strip {
  position: sticky;
  top: var(--topbar-h);
  z-index: 39;
  background: linear-gradient(
    90deg,
    rgba(240, 192, 32, 0.16) 0%,
    rgba(0, 204, 255, 0.1) 50%,
    rgba(240, 192, 32, 0.16) 100%
  );
  border-bottom: 1px solid rgba(240, 192, 32, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 20px rgba(240, 192, 32, 0.08);
}
.promo-strip-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  padding: 12px 20px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}
.promo-strip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--yellow-tag);
  color: #1a1200;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(240, 192, 32, 0.25);
}
.promo-strip-pct { font-size: 13px; letter-spacing: 0; }
.promo-strip-text {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.45;
}
.promo-strip-text strong { color: var(--yellow); font-weight: 700; }
.promo-strip-btn {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 204, 255, 0.45);
  background: var(--green-bg);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.promo-strip-btn:hover {
  background: rgba(0, 204, 255, 0.16);
  border-color: rgba(0, 204, 255, 0.6);
}
.promo-strip-btn:active { transform: scale(0.98); }

/* Hero promo — main chart area */
.promo-hero {
  margin: 0 12px 10px;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(240, 192, 32, 0.14) 0%,
    rgba(0, 204, 255, 0.08) 45%,
    rgba(240, 192, 32, 0.12) 100%
  );
  border: 1px solid rgba(240, 192, 32, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(240, 192, 32, 0.12),
    0 0 48px rgba(0, 204, 255, 0.06);
  animation: promo-hero-glow 3s ease-in-out infinite;
}
@keyframes promo-hero-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset, 0 8px 32px rgba(240,192,32,0.12), 0 0 40px rgba(46,230,109,0.05); }
  50% { box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset, 0 10px 40px rgba(240,192,32,0.2), 0 0 56px rgba(46,230,109,0.1); }
}
.promo-hero-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px 20px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.promo-hero-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(160deg, #f5d04a 0%, #e8a820 100%);
  color: #1a1200;
  box-shadow: 0 4px 16px rgba(240, 192, 32, 0.35);
  flex-shrink: 0;
}
.promo-hero-pct {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}
.promo-hero-badge-lbl {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-top: 2px;
}
.promo-hero-copy {
  flex: 1;
  min-width: 180px;
  text-align: center;
}
.promo-hero-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.promo-hero-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.promo-hero-btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--green) 0%, #1fc85a 100%);
  color: #041208;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 204, 255, 0.35);
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.promo-hero-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 204, 255, 0.45);
}
.promo-hero-btn:active { transform: scale(0.98); }

.bet-promo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(240, 192, 32, 0.16) 0%, rgba(0, 204, 255, 0.1) 100%);
  border: 1px solid rgba(240, 192, 32, 0.45);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
  box-shadow: 0 4px 18px rgba(240, 192, 32, 0.12);
}
.bet-promo:hover {
  border-color: rgba(240, 192, 32, 0.55);
  background: linear-gradient(135deg, rgba(240, 192, 32, 0.2) 0%, rgba(0, 204, 255, 0.12) 100%);
  transform: translateY(-1px);
}
.bet-promo-pct {
  font-size: 20px;
  font-weight: 900;
  color: var(--yellow);
  line-height: 1;
  letter-spacing: -0.03em;
}
.bet-promo-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bet-promo-text {
  font-size: 11px;
  font-weight: 800;
  color: var(--yellow);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bet-promo-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
}
.auth-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.balance {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-inset);
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.balance:hover {
  border-color: rgba(0, 204, 255, 0.35);
  background: rgba(0, 204, 255, 0.06);
}
.bal-icon {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(145deg, #2ebd96, #1a8f6e);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  flex-shrink: 0;
}
button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
button.ghost.sm { height: 32px; padding: 0 10px; font-size: 11px; }
button.ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border-2);
  color: var(--text);
}
button.primary {
  background: var(--brand-grad);
  color: #050508;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 204, 255, 0.25), 0 2px 12px rgba(204, 51, 255, 0.15);
  transition: filter 0.2s var(--ease), transform 0.12s var(--ease);
}
button.primary:hover { filter: brightness(1.06); }
button.primary:active { transform: scale(0.98); }
.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.icon-btn:hover { background: var(--bg-hover); border-color: var(--border-2); }
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span {
  display: block; width: 16px; height: 2px;
  background: var(--text); border-radius: 2px;
}

/* ── LAYOUT ───────────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 0;
  min-height: calc(100vh - var(--topbar-h));
  align-items: stretch;
}

/* ── CHART PANEL ──────────────────────────────────────────────────────────── */
.chart-panel {
  background: transparent;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  border-right: 1px solid var(--border);
}

.info-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto minmax(100px, 1fr);
  align-items: center;
  gap: 16px 24px;
  padding: 0 0 14px;
}
.info-block {
  display: flex; flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.info-block.left { justify-self: start; }
.info-block.right {
  text-align: right;
  align-items: flex-end;
  justify-self: end;
}
.info-label {
  font-size: 10px; color: var(--muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; line-height: 1.2;
}
.info-val {
  font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.info-val.green { color: var(--green); }
.info-val.red { color: var(--red); }

.info-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.wins-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 20px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 6px;
}
.wins-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}
.wins-side.up-side { align-items: flex-end; text-align: right; }
.wins-side.down-side { align-items: flex-start; text-align: left; }
.wins-lbl {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  opacity: 0.9;
  white-space: nowrap;
}
.wins-detail {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 5px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.wins-detail .wins-stake { font-weight: 800; }
.wins-detail .wins-ret-wrap {
  font-weight: 700;
  opacity: 0.88;
  font-size: 13px;
}
.wins-detail .wins-ret { font-weight: inherit; }
.wins-detail .wins-pct {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0;
}
.ring-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

/* Circular countdown */
.ring-timer {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(0, 204, 255, 0.35));
}
.ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3.5;
}
.ring-progress {
  fill: none;
  stroke: var(--green);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 238.76;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.25s linear, stroke 0.2s;
}
.ring-timer.locked .ring-progress {
  stroke: #f5c518;
  filter: drop-shadow(0 0 6px rgba(245, 197, 24, 0.5));
}
.ring-timer.urgent .ring-progress {
  stroke: var(--red);
  filter: drop-shadow(0 0 8px rgba(255, 77, 90, 0.55));
}
.ring-timer.urgent {
  filter: drop-shadow(0 0 18px rgba(255, 77, 90, 0.45));
  animation: timerPulse 0.85s ease-in-out infinite;
}
@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.ring-time {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: none;
  z-index: 2;
  line-height: 1;
}
.ring-time-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}
.ring-time-unit {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.72;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}
.ring-timer.urgent .ring-time-num { color: var(--red); }
.ring-timer.locked .ring-time-num { color: #f5c518; }
.ring-phase {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  white-space: nowrap;
  line-height: 1;
  text-align: center;
}
.ring-timer.locked .ring-phase { color: #f5c518; }
.ring-timer.urgent .ring-phase { color: var(--red); }

/* ── CHART ────────────────────────────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: clamp(300px, 42vh, 420px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  contain: layout style;
  /* Equal green (top) / red (bottom) backdrop — Start sits on the midline */
  background:
    linear-gradient(180deg, rgba(92, 255, 138, 0.14) 0%, rgba(92, 255, 138, 0.06) 50%, rgba(255, 77, 106, 0.06) 50%, rgba(255, 77, 106, 0.14) 100%),
    var(--bg-card);
}
.chart-wrap canvas {
  position: relative;
  z-index: 3;
  width: 100% !important;
  height: 100% !important;
}

.chart-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  text-align: center;
  line-height: 1.15;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.22);
  letter-spacing: -0.02em;
  pointer-events: none;
  user-select: none;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
}
.chart-overlay:not(.hidden) {
  background: transparent;
}

.win-flash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: rgba(0, 0, 0, 0.72);
}
.win-flash.active,
.win-flash.active.hidden {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.win-flash__text {
  font-size: clamp(40px, 10vw, 84px);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-transform: uppercase;
  animation: winFlashPulse 0.55s ease-in-out 5;
}
.win-flash.up {
  background: radial-gradient(ellipse at center, rgba(0, 204, 255, 0.5) 0%, rgba(0, 0, 0, 0.82) 70%);
}
.win-flash.up .win-flash__text {
  color: #00e5ff;
  text-shadow:
    0 0 24px rgba(0, 229, 255, 0.95),
    0 0 64px rgba(0, 204, 255, 0.55);
}
.win-flash.down {
  background: radial-gradient(ellipse at center, rgba(255, 92, 106, 0.5) 0%, rgba(0, 0, 0, 0.82) 70%);
}
.win-flash.down .win-flash__text {
  color: #ff5c6a;
  text-shadow:
    0 0 24px rgba(255, 92, 106, 0.95),
    0 0 64px rgba(239, 68, 68, 0.55);
}
.win-flash.draw {
  background: radial-gradient(ellipse at center, rgba(245, 197, 24, 0.45) 0%, rgba(0, 0, 0, 0.82) 70%);
}
.win-flash.draw .win-flash__text {
  color: #f5c518;
  text-shadow:
    0 0 24px rgba(245, 197, 24, 0.95),
    0 0 64px rgba(245, 197, 24, 0.45);
}
@keyframes winFlashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.price-tag {
  position: absolute;
  z-index: 5;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  line-height: 1.2;
  box-shadow: var(--shadow-sm);
}
.price-tag .tag-lbl {
  font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  opacity: 0.8;
}
.price-tag .tag-val { font-size: 12px; font-weight: 800; letter-spacing: -0.02em; }
.price-tag.start {
  left: 8px;
  top: 50%;
  bottom: auto;
  right: auto;
  transform: translateY(-50%);
  z-index: 9;
  min-width: 86px;
  padding: 8px 12px;
  background: var(--start-tag);
  color: #063316;
  border: 2px solid rgba(34, 140, 58, 0.65);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(126, 224, 138, 0.55);
}
.price-tag.start .tag-lbl {
  color: rgba(6, 51, 22, 0.78);
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 1;
}
.price-tag.start .tag-val {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
/* End marker — on the tip inside green (UP) / red (DOWN) band */
.price-tag.end {
  left: 0;
  right: auto;
  top: 0;
  bottom: auto;
  z-index: 11;
  min-width: 104px;
  padding: 10px 14px;
  transform: translateY(-50%);
  animation: endTagPulse 0.85s ease-in-out infinite;
  pointer-events: none;
}
.price-tag.end.is-end-up {
  background: var(--end-tag-up);
  color: #052210;
  border: 2px solid rgba(92, 255, 138, 0.95);
  box-shadow:
    0 2px 14px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(92, 255, 138, 0.75);
}
.price-tag.end.is-end-down {
  background: var(--end-tag-down);
  color: #1a0508;
  border: 2px solid rgba(255, 77, 106, 0.95);
  box-shadow:
    0 2px 14px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(255, 77, 106, 0.75);
}
/* DRAW — grey End badge (exact start === end only) */
.price-tag.end.is-end-draw {
  background: linear-gradient(145deg, #d0d4dc 0%, #9aa3b2 50%, #7a8494 100%);
  color: #1a1d24;
  border: 2px solid rgba(154, 163, 178, 0.95);
  box-shadow:
    0 2px 14px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(154, 163, 178, 0.45);
}
.price-tag.end.is-end-draw .tag-lbl { color: rgba(26, 29, 36, 0.75); }
.price-tag.end .tag-lbl {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  opacity: 1;
  text-transform: uppercase;
}
.price-tag.end.is-end-up .tag-lbl { color: rgba(5, 34, 16, 0.85); }
.price-tag.end.is-end-down .tag-lbl { color: rgba(40, 5, 8, 0.9); }
.price-tag.end .tag-val {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
@keyframes endTagPulse {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.08); }
}
.price-tag.live {
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  z-index: 7;
  min-width: 72px;
  background: var(--yellow-tag);
  color: #1a1200;
  box-shadow: 0 0 14px rgba(245, 197, 24, 0.45);
  will-change: top, left;
}
.price-tag.live .tag-lbl { color: rgba(26, 18, 0, 0.7); }
.price-tag.live .tag-val {
  font-size: 13px;
  letter-spacing: -0.03em;
}
.price-tag.live.is-end {
  font-weight: 900;
  min-width: 96px;
  padding: 9px 12px;
  z-index: 12;
  animation: endTagPulse 0.85s ease-in-out infinite;
}
.price-tag.live.is-end .tag-lbl {
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.1em;
  opacity: 1;
}
.price-tag.live.is-end .tag-val {
  font-size: 15px;
  font-weight: 900;
}
/* End tip in green band when UP */
.price-tag.live.is-end-up {
  background: var(--end-tag-up);
  color: #052210;
  box-shadow:
    0 2px 14px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(92, 255, 138, 0.75);
  border: 2px solid rgba(92, 255, 138, 0.95);
}
.price-tag.live.is-end-up .tag-lbl {
  color: rgba(5, 34, 16, 0.85);
}
/* End tip in red band when DOWN */
.price-tag.live.is-end-down {
  background: var(--end-tag-down);
  color: #1a0508;
  box-shadow:
    0 2px 14px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(255, 77, 106, 0.75);
  border: 2px solid rgba(255, 77, 106, 0.95);
}
.price-tag.live.is-end-down .tag-lbl {
  color: rgba(40, 5, 8, 0.9);
}
.price-tag.live.is-end-draw {
  background: linear-gradient(145deg, #d0d4dc 0%, #9aa3b2 50%, #7a8494 100%);
  color: #1a1d24;
  box-shadow:
    0 2px 14px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(154, 163, 178, 0.45);
  border: 2px solid rgba(154, 163, 178, 0.95);
}
.price-tag.live.is-end-draw .tag-lbl {
  color: rgba(26, 29, 36, 0.75);
}
.price-tag.live.price-flash {
  box-shadow: 0 0 22px rgba(245, 197, 24, 0.85);
}
.price-tag.live.price-flash .tag-val {
  transform: scale(1.03);
  transition: transform 0.1s ease;
}

.live-dot {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #f5c518;
  box-shadow: 0 0 10px rgba(245, 197, 24, 0.65);
  z-index: 8;
  pointer-events: none;
  left: 0;
  top: 0;
  right: auto;
  display: none;
  will-change: top, left;
}
.live-dot.visible { display: block; }

/* ── STATS ROW ────────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 16px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.stat-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-lbl {
  font-size: 10px; color: var(--muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; line-height: 1.2;
}
.stat-val {
  font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.stat-item.stat-faint .stat-lbl { color: rgba(139, 146, 153, 0.65); }
.stat-item.stat-faint .stat-val {
  color: rgba(139, 146, 153, 0.5);
  font-weight: 500;
}

/* Live players bar (bc.game style, below chart) */
.players-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-inset);
}
.players-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.players-side.players-down { align-items: flex-end; }
.players-head-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.players-head-row--down {
  justify-content: flex-end;
}
.players-amt {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.players-n {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.players-stakes {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: flex-end;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  width: 100%;
}
.players-stakes::-webkit-scrollbar { display: none; }
.players-stakes--down {
  justify-content: flex-end;
}
.player-stake {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 44px;
}
.player-stake-av {
  --av-hue: 200;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid hsl(var(--av-hue) 75% 52%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 12px hsl(var(--av-hue) 80% 48% / 0.45);
  background: linear-gradient(
    145deg,
    hsl(var(--av-hue) 55% 28%),
    hsl(calc(var(--av-hue) + 40) 60% 18%)
  );
  position: relative;
}
.player-stake-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.player-stake-init {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.player-stake-av.is-fallback .player-stake-init {
  display: flex;
}
.player-stake-amt {
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.player-stake-amt.green { color: var(--green); }
.player-stake-amt.red { color: var(--red); }
.players-divider {
  width: 1px;
  margin: 2px 12px;
  background: linear-gradient(180deg, transparent, var(--border-2), transparent);
  flex-shrink: 0;
}
.dots {
  display: flex; align-items: center; gap: 4px;
  justify-self: end;
  flex-wrap: wrap;
}
.recent-results {
  display: flex;
  align-items: center;
  padding: 6px 4px 2px;
  min-height: 22px;
}
.recent-results .dots {
  width: 100%;
  justify-self: start;
  justify-content: flex-start;
}
.dots span {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
  line-height: 1;
}
.dots .up {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(0, 204, 255, 0.28);
}
.dots .down {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(255, 92, 106, 0.28);
}

/* ── TABS & LEADERBOARD ───────────────────────────────────────────────────── */
.tabs-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tabs {
  display: flex; align-items: flex-end; gap: 24px;
  padding: 12px 0 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-scroll {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.panel-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }
.panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 6px;
}
.panel-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}
.tab {
  background: transparent; border: 0;
  color: var(--muted);
  padding: 0 0 12px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
  cursor: pointer;
  position: relative;
  transition: color 0.2s var(--ease);
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--text); }
.tab.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--green);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 8px rgba(0, 204, 255, 0.4);
}
.tab-panel {
  padding-top: 12px;
  max-height: var(--tabs-scroll-h);
}
.tab-panel.panel-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  scroll-padding-bottom: 8px;
}
.tab-panel.tab-panel--lb {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 12px;
}
.tab-panel.hidden { display: none; }
.list-empty--cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.list-empty--cta p { margin: 0; color: var(--muted); font-size: 13px; }
.list-empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.bet-panel--pulse {
  animation: bet-panel-pulse 1.4s var(--ease);
}
@keyframes bet-panel-pulse {
  0%, 100% { box-shadow: none; }
  35% { box-shadow: 0 0 0 2px rgba(0, 204, 255, 0.45), 0 0 24px rgba(0, 204, 255, 0.2); }
}
.welcome-perk[role="button"] { cursor: pointer; }

.list-empty {
  text-align: center; color: var(--muted);
  padding: 28px 16px;
}

.positions-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
}
.position-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.position-row:last-child { border-bottom: 0; }
.position-row--live {
  background: rgba(0, 204, 255, 0.06);
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
  border-bottom-color: transparent;
  margin-bottom: 4px;
}
.position-main {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.position-side { font-size: 13px; letter-spacing: 0.04em; }
.position-amt { font-size: 15px; color: var(--text); }
.position-live {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #041018;
  background: linear-gradient(90deg, #00e5ff, #00ccff);
  padding: 2px 7px;
  border-radius: 999px;
}
.position-meta {
  font-size: 11px;
  color: var(--muted);
}
.my-live-position {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 10px;
  margin: 0 0 4px;
  border-radius: 10px;
  border: 1px solid rgba(0, 204, 255, 0.28);
  background: rgba(0, 204, 255, 0.08);
  font-size: 13px;
  font-weight: 800;
}
.my-live-position.hidden { display: none !important; }
.my-live-position-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border);
}
.history-row:last-child { border-bottom: 0; }
.history-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.history-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.history-user {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-detail {
  font-size: 11px;
  color: var(--muted);
}
.history-result {
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tab-panel--lb .lb-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.lb-filters { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.lb-filters select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.lb-filters select:focus { outline: none; border-color: var(--border-focus); }
.tab-panel--lb .lb-scroll {
  flex: 1;
  min-height: 0;
  max-height: calc(var(--tabs-scroll-h) - 52px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.15);
}
.lb-scroll { overflow: auto; }
.lb-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.lb-table th {
  text-align: left;
  padding: 10px 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-elevated);
  box-shadow: 0 1px 0 var(--border);
}
.lb-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.lb-table tr:hover td { background: var(--bg-hover); }
.lb-trader {
  display: flex; align-items: center; gap: 10px;
}
.lb-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ── BET PANEL (right sidebar) ────────────────────────────────────────────── */
.bet-panel {
  background: var(--bg-panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  border-left: 1px solid transparent;
  box-shadow: inset 1px 0 0 var(--border);
}
.bet-panel-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.bet-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.side-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 700;
  font-size: 14px;
  padding: 2px 0 4px;
  letter-spacing: -0.02em;
}
.side-up { color: var(--green); }
.side-down { color: var(--red); }
.side-vs {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
}

.winner-box {
  text-align: center;
  padding: 12px 10px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0, 204, 255, 0.1) 0%, rgba(0, 204, 255, 0.04) 100%);
  border: 1px solid rgba(0, 204, 255, 0.18);
  box-shadow: var(--shadow-inset);
  line-height: 1.1;
  color: var(--green);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.winner-box--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.wl-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 4px 2px;
}
.wl-top {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}
.wl-win { color: var(--green); }
.wl-lose { color: var(--red); }
.winner-box.winner-flash {
  border-color: rgba(0, 204, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 204, 255, 0.25), 0 0 18px rgba(0, 204, 255, 0.2);
  transform: scale(1.02);
}
.winner-count,
.loser-count {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.winner-label,
.loser-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.winner-amt,
.loser-amt {
  display: block;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* Live traders (Up / Down avatars) */
.traders-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.traders-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-inset);
}
.traders-col.up { border-top: 2px solid var(--green); }
.traders-col.down { border-top: 2px solid var(--red); }
.traders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  min-height: 16px;
}
.traders-side-lbl { text-transform: uppercase; letter-spacing: 0.04em; }
.traders-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.traders-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-content: flex-start;
  min-height: 56px;
}
.trader-chip {
  --av-hue: 200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid hsl(var(--av-hue) 70% 50%);
  box-shadow: 0 0 8px hsl(var(--av-hue) 75% 45% / 0.35);
  background: linear-gradient(145deg, hsl(var(--av-hue) 50% 25%), hsl(calc(var(--av-hue) + 35) 55% 16%));
  cursor: default;
  flex-shrink: 0;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.traders-col.up .trader-chip { border-color: rgba(61, 255, 122, 0.35); }
.traders-col.down .trader-chip { border-color: rgba(255, 77, 90, 0.35); }
.traders-col.up .trader-chip:hover {
  border-color: var(--green);
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(61, 255, 122, 0.35);
}
.traders-col.down .trader-chip:hover {
  border-color: var(--red);
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(255, 77, 90, 0.35);
}
.trader-chip .trader-av {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg-card);
}
.trader-chip.trader-demo { opacity: 0.92; }
.trader-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  background: linear-gradient(
    135deg,
    hsl(var(--av-hue, 200) 55% 28%),
    hsl(calc(var(--av-hue, 200) + 40) 55% 18%)
  );
}
.traders-col.up .trader-fallback { color: var(--green); }
.traders-col.down .trader-fallback { color: var(--red); }

.bet-input { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.bet-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.bet-usd { color: var(--text-secondary); font-weight: 500; font-variant-numeric: tabular-nums; }
.amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-height: 48px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.amount-row:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 204, 255, 0.12);
}
.usdt-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2ebd96, #1a8f6e);
  color: #fff;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.amount-row input {
  flex: 1; min-width: 0;
  background: transparent; border: 0;
  color: var(--text);
  font-size: 20px; font-weight: 700;
  outline: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }
.mini {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.mini:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--border-2);
}

.bet-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
  align-items: stretch;
}
.bet-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.bet-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bet-summary-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bet-summary-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Compact countdown between Up/Down — shown on mobile; hidden on desktop */
.bet-timer {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 56px;
  padding: 6px 4px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  line-height: 1;
  user-select: none;
}
.bet-timer-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.bet-timer-unit {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.bet-timer-phase {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green);
  margin-top: 2px;
}
.bet-timer.locked .bet-timer-num { color: #f5c518; }
.bet-timer.locked .bet-timer-phase { color: #f5c518; }
.bet-timer.urgent .bet-timer-num { color: var(--red); }
.bet-timer.urgent .bet-timer-phase { color: var(--red); }
.bet-timer.urgent {
  animation: timerPulse 0.85s ease-in-out infinite;
  border-color: rgba(255, 92, 106, 0.45);
}
.big-up, .big-down {
  border: 0;
  padding: 14px 10px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  letter-spacing: -0.02em;
  transition: filter 0.2s var(--ease), transform 0.12s var(--ease), box-shadow 0.2s var(--ease);
}
.big-up {
  background: linear-gradient(145deg, #7dff9f 0%, #3be06a 55%, #2bc85a 100%);
  color: #052210;
  box-shadow: 0 4px 14px rgba(92, 255, 138, 0.35);
}
.big-down {
  background: linear-gradient(145deg, #ff7a90 0%, #FF4D6A 55%, #ff3355 100%);
  color: #1a0508;
  box-shadow: 0 4px 14px rgba(255, 77, 106, 0.35);
}
.big-up:hover, .big-down:hover { filter: brightness(1.06); }
.big-up:active, .big-down:active { transform: scale(0.98); }
.big-up:disabled, .big-down:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.3);
}
.bet-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  opacity: 0.95;
}

/* ── MOBILE NAV ───────────────────────────────────────────────────────────── */
.mobile-nav {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  padding: 16px;
}
.mobile-nav-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 56px;
}
.mobile-nav hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

/* ── MODALS ───────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow: hidden;
  overscroll-behavior: none;
}
body.wallet-open {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}
body.wallet-open .layout {
  overflow: hidden !important;
  touch-action: none;
}
.modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 400px; max-width: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.modal-card--brand {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-elevated), var(--bg-elevated)) padding-box,
    var(--brand-grad) border-box;
  box-shadow:
    0 0 0 1px rgba(0, 204, 255, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.65),
    0 0 48px rgba(0, 204, 255, 0.08),
    0 0 48px rgba(204, 51, 255, 0.06);
}
.modal-brand {
  display: flex;
  justify-content: center;
  padding: 20px 20px 0;
}
.modal-logo {
  width: 72px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 16px rgba(0, 204, 255, 0.4));
}
.modal-card.wide { width: 520px; }
.modal-head {
  display: flex; align-items: center; gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  min-height: 52px;
}
.tab-btn {
  background: transparent; border: 0;
  color: var(--muted); font-weight: 600;
  font-size: 13px; padding: 4px 0;
  cursor: pointer;
  position: relative;
  transition: color 0.2s var(--ease);
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--text); }
.tab-btn.active::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -12px;
  height: 2px; background: var(--green);
  border-radius: 2px;
}
.close {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: transparent; border: 0;
  color: var(--muted); font-size: 22px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.close:hover { background: var(--bg-hover); color: var(--text); }
.modal-body {
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-body input, .modal-body select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 13px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.modal-body input:focus, .modal-body select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 204, 255, 0.12);
}
.modal-body button.big { width: 100%; margin-top: 4px; }
.error { color: var(--red); font-size: 12px; min-height: 18px; line-height: 1.4; }

/* Wallet modal */
.wallet-modal { width: 480px; }
.wallet-header {
  padding: 0;
  border-bottom: 1px solid var(--border);
}
.wallet-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  position: relative;
}
.wallet-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.wallet-close { position: static; transform: none; flex-shrink: 0; }
.wallet-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 12px;
  border-top: 0;
}
.wallet-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px !important;
  font-size: 12px !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.wallet-tab.active::after { bottom: 0; }
.wallet-tab-icon {
  font-size: 11px;
  opacity: 0.75;
}
.wallet-body { padding-top: 16px; }
.wallet-body label {
  display: block;
  margin-bottom: 4px;
}
.deposit-note.promo {
  color: var(--green);
  border-left: 2px solid var(--green);
  padding-left: 10px;
  margin-top: 4px;
}

.qr-row {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px; border-radius: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.copy-btn {
  background: var(--green-bg);
  border: 1px solid rgba(61,255,122,0.3);
  color: var(--green);
  padding: 4px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
}
.code-line {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; word-break: break-all;
}
.deposit-note { font-size: 11px; color: var(--muted); }

/* ── WALLET MODAL ─────────────────────────────────────────────────────────── */
.wallet-modal {
  width: 440px;
  max-width: 100%;
  background: linear-gradient(180deg, #141414 0%, var(--bg-card) 120px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}
.wallet-header {
  padding: 18px 18px 0;
  border-bottom: 1px solid var(--border);
}
.wallet-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.wallet-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wallet-close {
  position: static;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}
.wallet-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.wallet-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-bottom: 12px;
}
.wallet-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  position: relative;
}
.wallet-tab::after { display: none; }
.wallet-tab-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.wallet-tab.active {
  color: var(--text);
  background: rgba(61, 255, 122, 0.08);
  border-color: rgba(61, 255, 122, 0.25);
}
.wallet-tab.active .wallet-tab-icon {
  background: var(--green-bg);
  border-color: rgba(61, 255, 122, 0.35);
  color: var(--green);
}
.wallet-modal {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 680px);
  overflow: hidden;
}
.wallet-modal.wallet-modal--deposit,
.wallet-modal.wallet-modal--withdraw {
  max-height: min(92vh, 720px);
}
.wallet-body {
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  max-height: none;
}
.wallet-body.wallet-body--deposit,
.wallet-body.wallet-body--withdraw {
  overflow: hidden;
}
.wallet-panel--fit {
  flex: 1;
  min-height: 0;
  gap: 10px;
  overflow: hidden;
}
/* Deposit phase must join the flex height chain so mid-content can scroll */
.wallet-panel--fit > .wallet-deposit-phase {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 0;
}
.wallet-fit-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.wallet-fit-scroll * {
  touch-action: pan-y;
}
.wallet-fit-scroll input,
.wallet-fit-scroll textarea,
.wallet-fit-scroll select {
  touch-action: manipulation;
}
.wallet-cta-stack {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  margin-top: 2px;
  background: linear-gradient(180deg, transparent 0%, rgba(20, 20, 20, 0.96) 18%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  bottom: 0;
  z-index: 5;
}
.wallet-cta-stack .wallet-submit {
  width: 100%;
  margin: 0;
}
.wallet-cta-secondary {
  background: linear-gradient(135deg, rgba(0, 204, 255, 0.2) 0%, rgba(61, 255, 122, 0.18) 100%) !important;
  border: 1px solid rgba(61, 255, 122, 0.35) !important;
  color: var(--text) !important;
}
.wallet-cta-link {
  width: 100%;
  text-align: center;
}
.wallet-steps--compact {
  margin-bottom: 2px;
}
.wallet-steps--compact .wallet-step {
  padding: 6px 8px;
  font-size: 10px;
}
.wallet-body.wallet-body--scroll {
  overflow-y: auto;
  max-height: min(60vh, 520px);
}
.wallet-body.wallet-body--pay {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(68vh, 560px);
}
.wallet-body.wallet-body--pay .wallet-panel--deposit {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.wallet-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.wallet-balance-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(61, 255, 122, 0.06);
  border: 1px solid rgba(61, 255, 122, 0.18);
}
.wallet-balance-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  min-width: 0;
}
.wallet-balance-strip-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wallet-balance-strip-value {
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.wallet-balance-strip-value small {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.wallet-balance-strip-value.green { color: var(--green); }
.wallet-balance-strip-value.muted { color: var(--muted); font-weight: 700; }
.wallet-deposit-phase {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.wallet-deposit-phase.hidden { display: none; }
.wallet-deposit-phase--pay {
  flex: 1;
  min-height: 0;
  gap: 0;
}
.wallet-deposit-phase--pay .wallet-pay-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 2px;
}
.wallet-track-dock {
  flex-shrink: 0;
  width: 100%;
}
.wallet-track-dock:empty {
  display: none;
}
.wallet-modal--pay {
  max-height: min(92vh, 720px);
}
.wallet-pay-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}
.wallet-pay-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 4px 0 2px;
}
.wallet-pay-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}
.wallet-pay-amount {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.05;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.wallet-pay-unit {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.wallet-pay-qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}
.wallet-pay-qr-block .wallet-qr-label {
  margin: 0;
  font-size: 12px;
}
.wallet-pay-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.wallet-pay-steps {
  margin: 0;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.wallet-pay-steps li::marker {
  color: var(--green);
  font-weight: 700;
}
.wallet-pay-steps-memo {
  color: var(--yellow);
  font-weight: 600;
}
.wallet-copy-block--highlight .wallet-copy-label {
  color: var(--yellow);
}
.wallet-copy-row--highlight {
  border-color: rgba(240, 192, 32, 0.45);
  background: rgba(240, 192, 32, 0.08);
}
.wallet-copy-row--highlight .wallet-copy-value {
  color: var(--yellow);
  font-size: 13px;
  font-weight: 800;
}
.wallet-memo-warn {
  margin: -4px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(240, 192, 32, 0.9);
}
.wallet-tonkeeper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 280px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #0098ea, #0077c8);
  border: 1px solid rgba(0, 152, 234, 0.5);
  box-shadow: 0 4px 16px rgba(0, 152, 234, 0.25);
  transition: filter 0.12s, transform 0.12s;
}
.wallet-tonkeeper-btn:hover {
  filter: brightness(1.08);
  color: #fff;
}
.wallet-tonkeeper-btn:active { transform: scale(0.99); }
.wallet-tonkeeper-btn.hidden { display: none; }
.wallet-deposit-actions {
  display: flex;
  justify-content: center;
}
.wallet-secondary-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.wallet-secondary-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: rgba(255, 255, 255, 0.07);
}
.wallet-withdraw-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(61, 255, 122, 0.08);
  border: 1px solid rgba(61, 255, 122, 0.22);
}
.wallet-withdraw-summary-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wallet-withdraw-summary-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wallet-withdraw-summary-value {
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--green);
  line-height: 1.1;
}
.wallet-withdraw-summary-value small {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.wallet-withdraw-summary-meta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
}
.wallet-panel--withdraw .wallet-field,
.wallet-panel--deposit .wallet-field {
  width: 100%;
}
.wallet-panel--withdraw .wallet-networks,
.wallet-panel--deposit .wallet-networks {
  width: 100%;
}
.wallet-field--net-pills {
  flex-shrink: 0;
  gap: 0;
  margin: 0;
}
.wallet-net-pills {
  display: flex;
  gap: 4px;
}
.wallet-net-pill {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.wallet-net-pill.active {
  border-color: rgba(61, 255, 122, 0.45);
  background: rgba(61, 255, 122, 0.1);
  color: var(--green);
}
.wallet-label-muted {
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}
.wallet-hint--receive {
  margin: 0;
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}
.wallet-note--compact {
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.4;
}
.wallet-balance-card {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(61, 255, 122, 0.12) 0%, rgba(61, 255, 122, 0.03) 50%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(61, 255, 122, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.wallet-balance-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.wallet-balance-value {
  font-size: 28px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.wallet-balance-value small {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin-left: 4px;
}
.wallet-balance-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.wallet-stat-label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}
.wallet-stat-value {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.wallet-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(245, 197, 24, 0.1);
  border: 1px solid rgba(245, 197, 24, 0.28);
  font-size: 11px;
  line-height: 1.4;
  color: #f5e6a8;
}
.wallet-banner strong { color: var(--yellow); }
.wallet-bonus-toggle {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--text-dim, #b8b8c8);
  cursor: pointer; padding: 6px 0;
}
.wallet-bonus-toggle input { margin-top: 2px; accent-color: var(--cyan, #00ccff); }
.wallet-bonus-toggle small { display: block; font-size: 11px; color: #888; }
.wallet-deposit-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.wallet-panel--deposit .wallet-bonus-option {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.wallet-panel--deposit .wallet-bonus-toggle {
  font-size: 12px;
  gap: 6px;
  padding: 0;
}
.wallet-panel--deposit .wallet-bonus-toggle small {
  font-size: 10px;
  line-height: 1.3;
}
.wallet-panel--deposit .wallet-balance-strip {
  padding: 8px 10px;
}
.wallet-panel--deposit .wallet-wager {
  padding: 8px 10px;
}
.wallet-panel--deposit .wallet-field {
  gap: 6px;
}
.wallet-bonus-option {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.wallet-bonus-option:has(input:checked) {
  border-color: rgba(0, 204, 255, 0.45);
  background: rgba(0, 204, 255, 0.08);
}
.wallet-field { display: flex; flex-direction: column; gap: 8px; }
.wallet-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wallet-networks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wallet-net {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.wallet-net:hover { border-color: var(--border-2); }
.wallet-net.active {
  border-color: rgba(61, 255, 122, 0.45);
  background: rgba(61, 255, 122, 0.06);
  box-shadow: 0 0 0 1px rgba(61, 255, 122, 0.15);
}
.wallet-net-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}
.wallet-net-icon.bsc {
  background: linear-gradient(135deg, #f0b90b, #e8a800);
  color: #1a1200;
}
.wallet-net-icon.ton {
  background: linear-gradient(135deg, #0098ea 0%, #006bb3 100%);
  color: #fff;
}
.wallet-net-icon.tron {
  background: linear-gradient(135deg, #ef0027, #b8001e);
  color: #fff;
}
.wallet-net-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wallet-net-text strong { font-size: 13px; font-weight: 800; }
.wallet-net-text small { font-size: 10px; color: var(--muted); }
.wallet-amount-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wallet-amount-wrap:focus-within {
  border-color: rgba(61, 255, 122, 0.4);
  box-shadow: 0 0 0 3px rgba(61, 255, 122, 0.1);
}
.wallet-amount-prefix,
.wallet-amount-suffix {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.wallet-amount-input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  padding: 12px 8px !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums;
  outline: none !important;
  box-shadow: none !important;
}
.wallet-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wallet-preset {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.wallet-preset:hover {
  border-color: rgba(61, 255, 122, 0.35);
  background: var(--green-bg);
  color: var(--green);
}
.wallet-preset.max {
  margin-left: auto;
  color: var(--green);
  border-color: rgba(61, 255, 122, 0.3);
}
.wallet-text-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wallet-text-input:focus {
  border-color: rgba(61, 255, 122, 0.4);
  box-shadow: 0 0 0 3px rgba(61, 255, 122, 0.1);
}
.wallet-hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.wallet-fee-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wallet-fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.wallet-fee-row.total {
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
  font-weight: 800;
  font-size: 14px;
}
.wallet-fee-row.total span:last-child { color: var(--green); }
.wallet-submit {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.wallet-submit.deposit {
  background: var(--brand-grad);
  color: #041208;
  box-shadow: 0 4px 20px rgba(61, 255, 122, 0.25);
}
.wallet-submit.withdraw {
  background: linear-gradient(135deg, #ff6b7a, #ff4d5a);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 77, 90, 0.25);
}
.wallet-submit:hover:not(:disabled) { filter: brightness(1.06); }
.wallet-submit:active:not(:disabled) { transform: scale(0.99); }
.wallet-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.wallet-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}
.wallet-step {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
}
.wallet-step.active {
  color: var(--green);
  background: var(--green-bg);
  border-color: rgba(61, 255, 122, 0.25);
}
.wallet-deposit-result,
.wallet-pay-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.wallet-pay-copy:empty {
  display: none;
}
@keyframes walletFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.wallet-deposit-hero {
  text-align: center;
}
.wallet-deposit-hero .amount {
  font-size: 26px;
  font-weight: 900;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.wallet-deposit-hero .network {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.wallet-qr-frame {
  display: flex;
  justify-content: center;
  margin: 0 auto;
  padding: 8px;
  width: fit-content;
  max-width: 100%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 2px solid rgba(239, 0, 39, 0.35);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.wallet-qr-frame--sm {
  padding: 6px;
  border-radius: 12px;
}
.wallet-qr-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 184px;
  height: 184px;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
}
.wallet-qr-wrap--sm {
  width: 116px;
  height: 116px;
  padding: 6px;
  border-radius: 10px;
}
.wallet-qr-wrap--pay {
  width: 212px;
  height: 212px;
  padding: 8px;
}
.wallet-qr-wrap img {
  width: 168px;
  height: 168px;
  display: block;
  border-radius: 6px;
  object-fit: contain;
}
.wallet-qr-wrap--sm img {
  width: 104px;
  height: 104px;
}
.wallet-qr-wrap--pay img {
  width: 196px;
  height: 196px;
}
.wallet-qr-wrap img.is-hidden {
  opacity: 0;
  visibility: hidden;
}
.wallet-qr-loading {
  position: absolute;
  inset: 8px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.wallet-qr-loading.is-loading {
  opacity: 1;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: walletQrShimmer 1s ease-in-out infinite;
}
@keyframes walletQrShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.wallet-qr-panel {
  text-align: center;
  margin: 12px 0 4px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.wallet-qr-label {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.wallet-qr-addr-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 10px 10px 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.wallet-qr-addr {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: var(--text-secondary);
  word-break: break-all;
  line-height: 1.45;
}
.wallet-qr-copy,
.wallet-copy-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(61, 255, 122, 0.35);
  background: var(--green-bg);
  color: var(--green);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.wallet-qr-copy:hover:not(:disabled),
.wallet-copy-icon:hover {
  background: rgba(61, 255, 122, 0.2);
  border-color: rgba(61, 255, 122, 0.55);
}
.wallet-qr-copy:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.wallet-track {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.wallet-track--prominent {
  border-width: 2px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.wallet-track--pending {
  border-color: rgba(240, 192, 32, 0.55);
  background: linear-gradient(180deg, rgba(240, 192, 32, 0.14), rgba(240, 192, 32, 0.05));
}
.wallet-track--confirmed {
  border-color: rgba(0, 204, 255, 0.55);
  background: linear-gradient(180deg, rgba(0, 204, 255, 0.16), var(--green-bg));
}
.wallet-track-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.wallet-track-copy {
  flex: 1;
  min-width: 0;
}
.wallet-track-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.wallet-track--pending .wallet-track-title {
  color: var(--yellow);
}
.wallet-track--confirmed .wallet-track-title {
  color: var(--green);
}
.wallet-track--success-hero .wallet-track-title {
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--green);
}
.wallet-deposit-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 28px 16px 20px;
}
.wallet-deposit-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 900;
  color: #04140a;
  background: var(--green, #3dff7a);
  box-shadow: 0 0 0 8px rgba(61, 255, 122, 0.15);
}
.wallet-deposit-success-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--green, #3dff7a);
  line-height: 1.3;
}
.wallet-deposit-success-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.wallet-txhash-box {
  margin: 10px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wallet-txhash-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wallet-txhash-row .wallet-text-input {
  flex: 1;
  min-width: 0;
}
.wallet-track-status {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}
.wallet-track-status strong {
  color: var(--yellow);
  font-weight: 800;
}
.wallet-track-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.wallet-track-spinner {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 3px solid rgba(240, 192, 32, 0.22);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: walletTrackSpin 0.85s linear infinite;
}
.wallet-track-check {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 900;
  color: var(--green);
  background: rgba(0, 204, 255, 0.2);
  border: 2px solid rgba(0, 204, 255, 0.45);
}
@keyframes walletTrackSpin {
  to { transform: rotate(360deg); }
}
.wallet-track-bar {
  height: 5px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.wallet-track-bar-fill {
  display: block;
  height: 100%;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), #f5a623);
  animation: walletTrackBar 1.8s ease-in-out infinite;
}
@keyframes walletTrackBar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.wallet-track-tx {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  background: rgba(0, 204, 255, 0.1);
  border: 1px solid rgba(0, 204, 255, 0.3);
}
.wallet-track-tx:hover {
  background: rgba(0, 204, 255, 0.18);
  text-decoration: none;
}
.wallet-copy-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wallet-copy-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.wallet-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.wallet-copy-value {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  word-break: break-all;
  font-family: ui-monospace, 'Cascadia Code', monospace;
}
.wallet-copy-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(61, 255, 122, 0.35);
  background: var(--green-bg);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.12s;
}
.wallet-copy-btn:hover { background: rgba(61, 255, 122, 0.2); }
.wallet-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
}
.wallet-wager {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(61, 255, 122, 0.04);
  border: 1px solid rgba(61, 255, 122, 0.12);
}
.wallet-wager-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
}
.wallet-wager-label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.wallet-wager-pct { color: var(--green); }
.wallet-wager-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.wallet-wager-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1fa855, var(--green));
  transition: width 0.25s ease;
}
.wallet-wager-meta {
  margin: 8px 0 0;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.45;
}
.wallet-history-section { display: flex; flex-direction: column; gap: 8px; }
.wallet-history-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 8px 0 4px;
}
.wallet-history-list { display: flex; flex-direction: column; gap: 6px; }
.wallet-tx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.wallet-tx-main { min-width: 0; }
.wallet-tx-type {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 2px;
}
.wallet-tx-detail {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wallet-tx-hash {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.wallet-tx-hash:hover { color: #7dd3fc; }
.wallet-deposit-success-tx {
  margin: 8px 0 14px;
  font-size: 12px;
  color: var(--muted);
}
.wallet-tx-right {
  text-align: right;
  flex-shrink: 0;
}
.wallet-tx-amt {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.wallet-tx-amt.in { color: var(--green); }
.wallet-tx-amt.out { color: var(--red); }
.wallet-status {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wallet-status--pending {
  background: rgba(245, 197, 24, 0.15);
  color: var(--yellow);
}
.wallet-status--success {
  background: var(--green-bg);
  color: var(--green);
}
.wallet-status--error {
  background: var(--red-bg);
  color: var(--red);
}
.wallet-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.wallet-success-state {
  text-align: center;
  padding: 28px 20px 24px;
}
.wallet-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid rgba(0, 204, 255, 0.25);
}
.wallet-success-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wallet-success-msg {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.wallet-success-detail {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text);
}
.wallet-panel--withdraw-success .wallet-secondary-btn {
  width: 100%;
}

/* ── REFER & EARN ─────────────────────────────────────────────────────────── */
.refer-modal {
  width: 440px;
  max-width: 100%;
  background: linear-gradient(180deg, #141414 0%, var(--bg-card) 120px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}
.refer-header {
  padding: 18px 18px 0;
  border-bottom: 1px solid var(--border);
}
.refer-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.refer-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.refer-close {
  position: static;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}
.refer-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.refer-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(78vh, 720px);
  overflow-y: auto;
}
.refer-banner { margin-bottom: 0; }
.refer-stats-card { margin-bottom: 0; }
.refer-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.refer-copy-code {
  height: 44px;
  font-weight: 700;
}
.refer-code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.refer-code-row .wallet-text-input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.refer-save-btn {
  flex-shrink: 0;
  width: auto;
  padding: 0 18px;
  height: 44px;
}
.refer-list {
  max-height: 220px;
  overflow-y: auto;
}


.market-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 200;
  min-width: 240px;
  max-width: min(320px, 92vw);
  max-height: min(420px, 70vh);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px;
  box-shadow: var(--shadow-md);
}
.market-menu-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
}
.market-menu .item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s var(--ease);
}
.market-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.market-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.market-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.market-chg {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.market-menu .item .market-icon {
  width: 28px;
  height: 28px;
}
.market-menu .item.active {
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.25);
}
.market-menu .item:hover { background: var(--green-bg); }
.market-menu .item.disabled { opacity: 0.4; cursor: not-allowed; }

/* ── TOAST ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(72px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 100;
  font-weight: 600;
  font-size: 13px;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* ── ADMIN (unchanged structure, matched palette) ─────────────────────────── */
.admin-layout { padding: 18px; display: grid; gap: 16px; max-width: 1400px; margin: 0 auto; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-inset);
}
.admin-card .big { font-size: 22px; font-weight: 800; margin-top: 4px; }
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  overflow-x: auto;
}
.admin-section h3 { margin: 0 0 14px; }
.admin-section table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-section th, .admin-section td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
}
.admin-section th { color: var(--muted); font-size: 11px; }
.admin-section .row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { accent-color: var(--green); }
.admin-section input, .admin-section select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --sidebar-w: 288px; }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .chart-panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .bet-panel {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
  }
  .bet-panel-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
  }
  .bet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
  }
  .side-title { width: 100%; }
  .winner-box { flex: 1; min-width: 140px; }
  .bet-input { flex: 1; min-width: 200px; }
  .bet-buttons { width: 100%; }
}

@media (max-width: 720px) {
  html {
    height: 100%;
  }
  html,
  body {
    min-height: 100%;
  }
  body {
    height: 100dvh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-bottom: calc(8px + var(--safe-bottom));
    scroll-behavior: auto;
  }
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 8px 12px;
  }
  .topbar-logo img { height: var(--brand-logo-h); width: var(--brand-logo-h); }
  .topbar-left {
    gap: 8px;
    min-width: 0;
  }
  .topbar-right { min-width: 0; }
  .market-picker {
    flex: 1;
    min-width: 0;
  }
  .market-btn {
    width: 100%;
    max-width: 100%;
  }
  .topbar-center {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
  }
  .auth-actions #walletBtn,
  .auth-actions #referralBtn,
  .auth-actions #logoutBtn,
  .auth-actions #signupBtn,
  .auth-actions #loginBtn { display: none !important; }
  .nav-toggle { display: inline-flex; }

  .info-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-top: max(4px, env(safe-area-inset-top, 0px));
  }
  .info-block.left,
  .info-block.right {
    display: none;
  }
  .info-center {
    padding-bottom: 4px;
    width: 100%;
  }
  .wins-row {
    max-width: 100%;
    column-gap: 10px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 2px;
  }
  .wins-detail { font-size: 13px; gap: 3px; }
  .wins-detail .wins-ret-wrap,
  .wins-detail .wins-pct { font-size: 13px; }
  .wins-lbl { font-size: 11px; }
  .phase-text { font-size: 15px; margin-top: 4px; }
  .phase-sub { font-size: 12px; }
  .players-bar { padding: 6px 8px; margin-top: 4px; }
  .players-side { gap: 4px; }
  .players-head-row { gap: 4px; }
  .players-amt { font-size: 12px; }
  .players-n { font-size: 9px; }
  .players-stakes { gap: 6px; padding-bottom: 0; }
  .players-divider { margin: 0 6px; }
  .player-stake { gap: 2px; min-width: 34px; }
  .player-stake-av {
    width: 30px;
    height: 30px;
    border-width: 1.5px;
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.35),
      0 0 8px hsl(var(--av-hue) 80% 48% / 0.35);
  }
  .player-stake-amt { font-size: 9px; }
  .bet-panel .traders-row { display: none; }
  .ring-timer { width: 76px; height: 76px; }
  .ring-time-num { font-size: 26px; }
  .ring-time-unit { font-size: 10px; }
  .ring-phase { font-size: 11px; }
  .phase-text { font-size: 16px; }
  .phase-sub { font-size: 13px; }
  .chart-wrap { height: min(280px, 38vh); min-height: 220px; }
  .chart-overlay {
    font-size: clamp(17px, 5.2vw, 24px);
    padding: 12px 14px;
    letter-spacing: -0.01em;
  }
  .price-tag.start {
    left: 6px;
    min-width: 78px;
    padding: 7px 10px;
  }
  .price-tag.start .tag-lbl { font-size: 9px; }
  .price-tag.start .tag-val { font-size: 13px; }
  .price-tag.live { min-width: 64px; }
  .price-tag.live .tag-val { font-size: 11px; }
  .header-prize { padding: 0 8px; gap: 6px; }
  .header-prize-label { display: none; }
  .header-prize-val { font-size: 13px; }
  .header-bonus-pill { min-width: 44px; height: 38px; padding: 0 8px; }
  .header-bonus-pct { font-size: 12px; }
  :root { --tabs-scroll-h: clamp(180px, 30vh, 300px); }
  .lb-table { min-width: 460px; }
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 4px 0 0;
  }
  .recent-results { padding: 4px 0 0; }
  .chart-wrap { height: min(170px, 24vh); min-height: 130px; }
  .players-stakes { max-height: 40px; overflow: hidden; }
  .bet-icon { font-size: 20px; }
  .players-bar { padding: 6px 8px; margin-top: 4px; }
  .dots { justify-self: start; }

  .layout {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }
  .chart-panel {
    display: contents;
    border-right: 0;
  }
  .chart-main {
    order: 1;
    display: flex;
    flex-direction: column;
    padding: 4px 10px 0;
    gap: 0;
    background: transparent;
    flex-shrink: 0;
  }
  /*
   * Default viewport = green zone (stats → chart → players → bet).
   * Blue zone (wins / money distributed) sits above — scroll up to reveal.
   * History sits below — scroll down.
   */
  .chart-main > .info-row {
    order: 0;
    scroll-margin-top: 8px;
  }
  .chart-main > .stats-row {
    order: 2;
    scroll-margin-top: 4px;
  }
  .chart-main > .chart-wrap { order: 3; }
  .chart-main > .players-bar { order: 4; }
  .chart-main > .recent-results { order: 5; }
  .players-stakes { display: none; }
  .bet-panel {
    display: contents;
  }
  .bet-actions {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: static;
    z-index: auto;
    padding: 4px 10px 2px;
    background: var(--bg-panel);
    box-shadow: inset 0 1px 0 var(--border);
    flex-shrink: 0;
  }
  .winner-box,
  #winnerBox {
    display: none !important;
  }
  .tabs-section {
    display: flex !important;
    flex-direction: column;
    order: 3;
    max-height: min(34vh, 260px);
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 4px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
  }
  .tabs-section .tabs {
    flex-shrink: 0;
    gap: 4px;
    padding: 6px 8px 0;
  }
  .tabs-section .tab {
    font-size: 11px;
    padding: 6px 10px;
  }
  .tabs-section .panel-scroll,
  .tabs-section .lb-scroll {
    max-height: calc(min(34vh, 260px) - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .chart-main > .recent-results {
    display: block;
    padding: 2px 0 4px;
    overflow-x: auto;
  }
  .bet-panel-head {
    display: none !important;
  }
  .site-footer {
    display: none;
  }
  .info-row {
    padding: 6px 0 8px;
    gap: 4px 8px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
  }
  .chart-wrap {
    height: min(230px, 32vh);
    min-height: 170px;
    max-height: 260px;
    margin: 0 -6px 2px;
    width: calc(100% + 12px);
    border-radius: 8px;
  }
  .players-bar { margin-top: 2px; padding: 4px 6px; }
  .stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    margin-top: 4px;
    padding: 4px 0;
  }
  .recent-results {
    display: block;
    padding: 4px 0 2px;
    overflow-x: auto;
  }
  .amount-row { min-height: 40px; }
  .bet-buttons {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: stretch;
  }
  .bet-timer {
    display: flex;
  }
  .ring-col {
    display: none;
  }
  .wins-row {
    grid-template-columns: 1fr 1fr;
  }
  .big-up, .big-down { min-height: 56px; font-size: 16px; }
  .promo-strip-inner { padding: 8px 12px; gap: 8px 10px; }
  .promo-strip-text { font-size: 11px; }
  .promo-hero { margin: 0 8px 8px; }
  .promo-hero-inner { padding: 12px 14px; gap: 10px 12px; }
  .promo-hero-title { font-size: 13px; }
  .promo-hero-sub { font-size: 11px; }
  .promo-hero-btn { width: 100%; }
  .bet-promo { width: 100%; }
  .modal {
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-bottom));
  }
  .modal-card, .modal-card.wide {
    width: min(100%, 520px);
    max-width: 100%;
    border-radius: var(--radius-lg);
    max-height: min(92vh, calc(100dvh - 32px - var(--safe-bottom)));
    overflow: hidden;
    margin: auto;
  }
  .modal-card.wallet-modal {
    display: flex;
    flex-direction: column;
    max-height: min(94vh, calc(100dvh - 16px - var(--safe-bottom)));
    overflow: hidden;
  }
  .wallet-modal.wallet-modal--deposit,
  .wallet-modal.wallet-modal--withdraw {
    max-height: min(94vh, calc(100dvh - 12px - var(--safe-bottom)));
  }
  .wallet-body {
    padding: 10px 12px 12px;
  }
  .wallet-body.wallet-body--scroll {
    max-height: min(55vh, 480px);
  }
  .wallet-panel--fit {
    gap: 8px;
  }
  .wallet-fit-scroll {
    gap: 8px;
  }
  .wallet-cta-stack {
    padding-top: 8px;
    gap: 6px;
  }
  .wallet-panel--deposit .wallet-bonus-option {
    padding: 7px 9px;
  }
  .wallet-panel--withdraw .wallet-withdraw-summary-value {
    font-size: 20px;
  }
  .wallet-pay-amount {
    font-size: 28px;
  }
  .wallet-qr-wrap--pay {
    width: 188px;
    height: 188px;
  }
  .wallet-qr-wrap--pay img {
    width: 172px;
    height: 172px;
  }
  .wallet-withdraw-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .wallet-withdraw-summary-meta {
    text-align: left;
  }
  .wallet-networks { grid-template-columns: 1fr 1fr; }
}

/* ── WELCOME POPUP (first visit) ─────────────────────────────────────────── */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 204, 255, 0.12), transparent 65%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(204, 51, 255, 0.1), transparent 60%),
    rgba(2, 3, 6, 0.88);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  animation: welcomeFadeIn 0.4s var(--ease) both;
}
.welcome-overlay.hidden {
  display: none !important;
}

/* ── ADMIN BROADCAST POPUP ───────────────────────────────────────────────── */
.announcement-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 3, 6, 0.88);
  backdrop-filter: blur(12px);
}
.announcement-overlay.hidden {
  display: none !important;
}
.announcement-card {
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(18, 22, 32, 0.98), rgba(8, 10, 16, 0.98));
  border: 1px solid rgba(0, 204, 255, 0.25);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.announcement-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.announcement-card p {
  margin: 0 0 20px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  white-space: pre-wrap;
}
.announcement-card .welcome-cta {
  width: 100%;
}

.welcome-backdrop-glow {
  position: absolute;
  width: min(520px, 90vw);
  height: min(520px, 70vh);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 204, 255, 0.18) 0%, rgba(204, 51, 255, 0.1) 40%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: welcomeGlowPulse 4s ease-in-out infinite;
}
.welcome-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-width: 100%;
  box-sizing: border-box;
  padding: 32px 28px 26px;
  border-radius: 24px;
  background:
    linear-gradient(165deg, rgba(0, 204, 255, 0.1) 0%, transparent 38%),
    linear-gradient(220deg, rgba(204, 51, 255, 0.09) 0%, transparent 48%),
    linear-gradient(180deg, rgba(18, 18, 28, 0.97) 0%, rgba(0, 0, 0, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 32px 80px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(0, 204, 255, 0.14),
    0 0 80px rgba(204, 51, 255, 0.1);
  overflow: hidden;
  animation: welcomeSlideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.welcome-card-border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--welcome-border-angle, 0deg),
    var(--cyan),
    var(--purple),
    var(--gold),
    var(--cyan)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.85;
  animation: welcomeBorderSpin 5s linear infinite;
}
@property --welcome-border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.welcome-shine {
  position: absolute;
  top: -50%;
  left: -30%;
  width: 100%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(0, 204, 255, 0.28), transparent 68%);
  pointer-events: none;
  animation: welcomeShineDrift 6s ease-in-out infinite;
}
.welcome-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.welcome-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.55;
}
.welcome-orb--1 {
  width: 120px;
  height: 120px;
  top: -20px;
  right: -30px;
  background: rgba(0, 204, 255, 0.35);
  animation: welcomeOrbFloat 7s ease-in-out infinite;
}
.welcome-orb--2 {
  width: 90px;
  height: 90px;
  bottom: 20%;
  left: -25px;
  background: rgba(204, 51, 255, 0.3);
  animation: welcomeOrbFloat 9s ease-in-out infinite reverse;
}
.welcome-orb--3 {
  width: 60px;
  height: 60px;
  bottom: -10px;
  right: 25%;
  background: rgba(255, 215, 0, 0.25);
  animation: welcomeOrbFloat 5.5s ease-in-out infinite 1s;
}
.welcome-badge {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #050508;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--brand-grad);
  box-shadow:
    0 4px 16px rgba(0, 204, 255, 0.35),
    0 0 20px rgba(204, 51, 255, 0.25);
  animation: welcomeBadgePop 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}
.welcome-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s, transform 0.2s var(--ease);
}
.welcome-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(0, 204, 255, 0.35);
  transform: rotate(90deg);
}
.welcome-hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 28px 0 20px;
}
.welcome-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcome-logo-ring {
  position: absolute;
  width: calc(100% + 28px);
  height: calc(100% + 28px);
  border-radius: 50%;
  border: 2px solid transparent;
  background:
    linear-gradient(#000, #000) padding-box,
    var(--brand-grad) border-box;
  opacity: 0.75;
  animation: welcomeRingPulse 2.5s ease-in-out infinite;
}
.welcome-logo {
  position: relative;
  z-index: 1;
  width: min(112px, 38vw);
  height: auto;
  display: block;
  animation: welcomeLogoFloat 4s ease-in-out infinite;
  filter:
    drop-shadow(0 0 24px rgba(0, 204, 255, 0.45))
    drop-shadow(0 0 20px rgba(204, 51, 255, 0.3));
}
.welcome-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(0, 204, 255, 0.08);
  border: 1px solid rgba(0, 204, 255, 0.35);
  box-shadow: 0 0 20px rgba(0, 204, 255, 0.15);
}
.welcome-title {
  position: relative;
  z-index: 2;
  margin: 0 0 20px;
  font-size: clamp(1.2rem, 4.8vw, 1.42rem);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.035em;
  text-align: center;
  color: var(--text);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
  animation: welcomeTitleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}
.welcome-highlight {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(0, 204, 255, 0.35));
}
.welcome-perks {
  position: relative;
  z-index: 2;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.welcome-perk {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  min-width: 0;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: welcomePerkIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.welcome-perk > div {
  min-width: 0;
  flex: 1 1 auto;
}
.welcome-perk:nth-child(1) { animation-delay: 0.2s; }
.welcome-perk:nth-child(2) { animation-delay: 0.3s; }
.welcome-perk:hover {
  transform: translateX(4px);
}
.welcome-perk--bonus {
  border-color: rgba(255, 215, 0, 0.35);
  background: linear-gradient(105deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 255, 255, 0.02) 55%);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.08);
}
.welcome-perk--bonus:hover {
  box-shadow: 0 0 32px rgba(255, 215, 0, 0.15);
}
.welcome-perk--refer {
  border-color: rgba(204, 51, 255, 0.32);
  background: linear-gradient(105deg, rgba(204, 51, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 55%);
  box-shadow: 0 0 24px rgba(204, 51, 255, 0.08);
}
.welcome-perk--refer:hover {
  box-shadow: 0 0 32px rgba(204, 51, 255, 0.15);
}
.welcome-perk-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--cyan);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.welcome-perk--bonus .welcome-perk-icon {
  color: var(--gold);
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.welcome-perk--refer .welcome-perk-icon {
  color: var(--purple);
  border-color: rgba(204, 51, 255, 0.4);
  box-shadow: 0 0 16px rgba(204, 51, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.welcome-perk strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.welcome-perk > div span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.welcome-trust {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: welcomePerkIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}
.welcome-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.welcome-trust-item strong {
  color: var(--text);
  font-weight: 700;
}
.welcome-trust-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 204, 255, 0.7);
  flex-shrink: 0;
  animation: welcomeDotPulse 2s ease-in-out infinite;
}
.welcome-trust-dot--green {
  background: var(--purple);
  box-shadow: 0 0 12px rgba(204, 51, 255, 0.65);
  animation-delay: 0.5s;
}
.welcome-cta {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 16px 22px;
  border: 0;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #050508;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  background: var(--brand-grad);
  box-shadow:
    0 6px 28px rgba(0, 204, 255, 0.35),
    0 6px 28px rgba(204, 51, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
  animation: welcomeCtaIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.45s both;
}
.welcome-cta-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
  animation: welcomeCtaShine 3s ease-in-out infinite;
}
.welcome-cta-text {
  position: relative;
}
.welcome-cta-arrow {
  position: relative;
  font-size: 18px;
  transition: transform 0.2s var(--ease);
}
.welcome-cta:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 10px 36px rgba(0, 204, 255, 0.45),
    0 10px 36px rgba(204, 51, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.welcome-cta:hover .welcome-cta-arrow {
  transform: translateX(4px);
}
.welcome-cta:active {
  transform: translateY(0) scale(0.99);
}
@keyframes welcomeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes welcomeSlideUp {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes welcomeBorderSpin {
  to { --welcome-border-angle: 360deg; }
}
@keyframes welcomeGlowPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
@keyframes welcomeShineDrift {
  0%, 100% { transform: translate(0, 0); opacity: 0.8; }
  50% { transform: translate(8%, 6%); opacity: 1; }
}
@keyframes welcomeOrbFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, -14px); }
}
@keyframes welcomeBadgePop {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes welcomeRingPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes welcomeLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes welcomeTitleIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes welcomePerkIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes welcomeCtaIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes welcomeCtaShine {
  0% { left: -100%; }
  40%, 100% { left: 140%; }
}
@keyframes welcomeDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.85); }
}

@media (max-width: 480px) {
  .topbar { padding: 6px 10px; gap: 6px; }
  .market-btn { height: 32px; padding: 0 10px; font-size: 12px; }
  .chart-overlay { font-size: clamp(15px, 4.8vw, 20px); }
  .info-val { font-size: 13px; }
  .bet-input,
  .bet-buttons {
    width: 100%;
    min-width: 0;
  }
  .amount-row { padding: 8px; }
  .amount-row input { font-size: 18px; }
  .bet-buttons {
    position: static;
    z-index: auto;
    margin-top: 0;
    padding-top: 0;
    background: transparent;
  }

  /* Welcome popup — fit phone width without clipping perk text */
  .welcome-overlay {
    align-items: flex-start;
    justify-content: center;
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-bottom: calc(12px + var(--safe-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .welcome-card {
    width: 100%;
    max-width: 100%;
    max-height: none;
    padding: 22px 14px 18px;
    border-radius: 18px;
    overflow: visible;
    box-sizing: border-box;
  }
  .welcome-badge {
    font-size: 9px;
    padding: 4px 10px;
    top: 12px;
  }
  .welcome-close {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
  }
  .welcome-logo-wrap .welcome-logo,
  .welcome-logo {
    width: 72px;
    height: 72px;
  }
  .welcome-title {
    font-size: 1.05rem;
    line-height: 1.35;
    padding: 0 2px;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .welcome-perks {
    gap: 8px;
    margin-bottom: 12px;
  }
  .welcome-perk {
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    min-width: 0;
  }
  .welcome-perk > div {
    min-width: 0;
    flex: 1 1 auto;
  }
  .welcome-perk-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 15px;
  }
  .welcome-perk strong {
    font-size: 12.5px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .welcome-perk > div span {
    font-size: 11px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .welcome-trust {
    padding: 10px 12px;
    margin-bottom: 14px;
  }
  .welcome-trust-item {
    font-size: 11px;
    align-items: flex-start;
  }
}

.chart-overlay.hidden { display: none; }

.phase-text {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-top: 8px;
}
.phase-text.hidden { display: none; }
.phase-sub {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}
.phase-sub.hidden { display: none; }

.stat-item.stat-all-paid {
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(0, 204, 255, 0.12), rgba(204, 51, 255, 0.1));
  border: 1px solid rgba(0, 204, 255, 0.28);
}
.stat-item.stat-all-paid .stat-all-paid-lbl {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.stat-item.stat-all-paid .stat-all-paid-val {
  color: var(--green, #00e676);
  font-weight: 800;
  font-size: 15px;
}

.link-btn.forgot-link {
  background: none;
  border: none;
  color: var(--cyan, #00ccff);
  font-size: 12px;
  padding: 4px 0 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.link-btn.forgot-link:hover { text-decoration: underline; }
.link-btn.forgot-link.hidden { display: none; }

.modal-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

/* ── AUTH MODALS (login / signup / reset) ─────────────────────────────────── */
.auth-modal {
  z-index: 90;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 204, 255, 0.1), transparent 65%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(204, 51, 255, 0.08), transparent 60%),
    rgba(2, 3, 6, 0.88);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  animation: welcomeFadeIn 0.35s var(--ease) both;
}
.auth-backdrop-glow {
  position: absolute;
  width: min(480px, 90vw);
  height: min(480px, 65vh);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 204, 255, 0.16) 0%, rgba(204, 51, 255, 0.09) 40%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: welcomeGlowPulse 4s ease-in-out infinite;
}
.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 28px 26px 24px;
  border-radius: 24px;
  background:
    linear-gradient(165deg, rgba(0, 204, 255, 0.1) 0%, transparent 38%),
    linear-gradient(220deg, rgba(204, 51, 255, 0.09) 0%, transparent 48%),
    linear-gradient(180deg, rgba(18, 18, 28, 0.97) 0%, rgba(0, 0, 0, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 32px 80px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(0, 204, 255, 0.12),
    0 0 80px rgba(204, 51, 255, 0.08);
  overflow: hidden;
  animation: welcomeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-card--compact {
  padding-top: 36px;
}
.auth-card-border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--auth-border-angle, 0deg),
    var(--cyan),
    var(--purple),
    var(--gold),
    var(--cyan)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.85;
  animation: authBorderSpin 5s linear infinite;
}
@property --auth-border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.auth-shine {
  position: absolute;
  top: -50%;
  left: -30%;
  width: 100%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(0, 204, 255, 0.22), transparent 68%);
  pointer-events: none;
  animation: welcomeShineDrift 6s ease-in-out infinite;
}
.auth-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.5;
}
.auth-orb--1 {
  width: 100px;
  height: 100px;
  top: -20px;
  right: -25px;
  background: rgba(0, 204, 255, 0.32);
  animation: welcomeOrbFloat 7s ease-in-out infinite;
}
.auth-orb--2 {
  width: 80px;
  height: 80px;
  bottom: 18%;
  left: -20px;
  background: rgba(204, 51, 255, 0.28);
  animation: welcomeOrbFloat 9s ease-in-out infinite reverse;
}
.auth-orb--3 {
  width: 56px;
  height: 56px;
  bottom: -8px;
  right: 22%;
  background: rgba(255, 215, 0, 0.22);
  animation: welcomeOrbFloat 5.5s ease-in-out infinite 1s;
}
.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s, transform 0.2s var(--ease);
}
.auth-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(0, 204, 255, 0.35);
  transform: rotate(90deg);
}
.auth-badge {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #050508;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--brand-grad);
  box-shadow:
    0 4px 16px rgba(0, 204, 255, 0.35),
    0 0 20px rgba(204, 51, 255, 0.25);
}
.auth-hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 8px 0 16px;
}
.auth-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-logo-ring {
  position: absolute;
  width: calc(100% + 22px);
  height: calc(100% + 22px);
  border-radius: 50%;
  border: 2px solid transparent;
  background:
    linear-gradient(#000, #000) padding-box,
    var(--brand-grad) border-box;
  opacity: 0.75;
  animation: welcomeRingPulse 2.5s ease-in-out infinite;
}
.auth-logo {
  position: relative;
  z-index: 1;
  width: 72px;
  height: auto;
  display: block;
  filter:
    drop-shadow(0 0 20px rgba(0, 204, 255, 0.4))
    drop-shadow(0 0 16px rgba(204, 51, 255, 0.25));
}
.auth-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 204, 255, 0.08);
  border: 1px solid rgba(0, 204, 255, 0.32);
}
.auth-title {
  position: relative;
  z-index: 2;
  margin: 0 0 18px;
  font-size: clamp(1.1rem, 4.2vw, 1.28rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.03em;
  text-align: center;
  color: var(--text);
}
.auth-title--compact {
  margin-top: 8px;
}
.auth-hint {
  position: relative;
  z-index: 2;
  margin: -8px 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
.auth-tabs {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-tab {
  flex: 1;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.auth-tab:hover:not(.active) {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}
.auth-tab.active {
  color: #050508;
  background: var(--brand-grad);
  box-shadow:
    0 4px 16px rgba(0, 204, 255, 0.3),
    0 4px 16px rgba(204, 51, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.auth-tab.active::after {
  display: none;
}
.auth-form {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.auth-optional {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}
.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}
.auth-input:focus {
  border-color: rgba(0, 204, 255, 0.45);
  background: rgba(0, 0, 0, 0.5);
  box-shadow:
    0 0 0 3px rgba(0, 204, 255, 0.12),
    0 0 20px rgba(0, 204, 255, 0.08);
}
.auth-forgot {
  align-self: flex-start;
  margin: -4px 0 2px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.auth-forgot:hover {
  text-decoration: underline;
}
.auth-forgot.hidden {
  display: none;
}
.auth-submit {
  position: relative;
  width: 100%;
  margin-top: 4px;
  padding: 15px 22px;
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #050508;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  background: var(--brand-grad);
  box-shadow:
    0 6px 28px rgba(0, 204, 255, 0.35),
    0 6px 28px rgba(204, 51, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}
.auth-submit-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
  animation: welcomeCtaShine 3s ease-in-out infinite;
}
.auth-submit-text,
.auth-submit-arrow {
  position: relative;
}
.auth-submit-arrow {
  font-size: 17px;
  transition: transform 0.2s var(--ease);
}
.auth-submit:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 10px 36px rgba(0, 204, 255, 0.45),
    0 10px 36px rgba(204, 51, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.auth-submit:hover .auth-submit-arrow {
  transform: translateX(4px);
}
.auth-submit:active {
  transform: translateY(0) scale(0.99);
}
.auth-telegram {
  margin: 4px 0 2px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 12px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
}
.telegram-login-wrap {
  display: flex;
  justify-content: center;
  min-height: 44px;
}
.auth-error {
  min-height: 18px;
  text-align: center;
}
@keyframes authBorderSpin {
  to { --auth-border-angle: 360deg; }
}

@media (max-width: 720px) {
  .auth-modal {
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-bottom));
  }
  .auth-card {
    width: min(420px, 100%);
    max-width: 100%;
    border-radius: 24px;
    max-height: min(92vh, calc(100dvh - 32px - var(--safe-bottom)));
    overflow-y: auto;
    padding: 24px 20px calc(20px + var(--safe-bottom));
    margin: auto;
  }
  .auth-logo { width: 64px; }
  .auth-title { font-size: 1.08rem; }
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}
.site-footer a {
  color: var(--cyan, #00ccff);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
.site-footer-sep { opacity: 0.4; }

@media (min-width: 1024px) {
  .welcome-card {
    width: min(380px, 90vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 22px 20px;
  }
  .welcome-logo { width: 88px; height: 88px; }
  .welcome-logo-wrap .welcome-logo { width: 88px; height: 88px; }
  .welcome-title { font-size: 1.15rem; line-height: 1.35; }
  .welcome-perks { gap: 8px; }
  .welcome-hero { margin-bottom: 12px; }
  .welcome-trust { margin-top: 12px; }
}

/* ── STAGE 2 UI POLISH ──────────────────────────────────────────────────── */

/* Desktop topbar navigation (FAQ, Terms, Privacy, Telegram) */
.topbar-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.topbar-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.topbar-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}
.topbar-nav a.topbar-tg-link {
  width: 30px;
  padding: 0;
  color: var(--cyan);
  background: rgba(0, 204, 255, 0.08);
  border-color: rgba(0, 204, 255, 0.2);
}
.topbar-nav a.topbar-tg-link:hover {
  background: rgba(0, 204, 255, 0.16);
  border-color: rgba(0, 204, 255, 0.42);
}
@media (max-width: 900px) {
  .topbar-center,
  .topbar-nav {
    display: none !important;
  }
}

/* Mobile drawer legal & Telegram links */
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mobile-nav-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.mobile-nav-links a:hover {
  color: var(--cyan);
  border-color: var(--border-2);
  background: rgba(0, 204, 255, 0.06);
}

/* Welcome modal icon centering */
.welcome-perk-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcome-perk-icon svg {
  display: block;
  flex-shrink: 0;
}

/* Refined topbar bonus pill & auth CTAs */
.header-bonus-pill {
  height: 36px;
  min-width: 58px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 215, 0, 0.42);
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold);
  box-shadow: var(--shadow-inset), 0 0 12px rgba(255, 215, 0, 0.1);
  animation: none;
}
.header-bonus-pill:hover {
  filter: none;
  background: rgba(255, 215, 0, 0.18);
  border-color: rgba(255, 215, 0, 0.65);
  box-shadow: var(--shadow-inset), 0 0 18px rgba(255, 215, 0, 0.24);
}
.header-bonus-pct {
  font-size: 12.5px;
  font-weight: 800;
}
.header-bonus-lbl {
  font-size: 7.5px;
  letter-spacing: 0.1em;
  opacity: 0.9;
}
#loginBtn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 600;
}
#loginBtn:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.07);
}
#signupBtn {
  height: 36px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 204, 255, 0.7);
  background: linear-gradient(135deg, #00ccff 0%, #38dcff 100%);
  color: #03131c;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(0, 204, 255, 0.25);
}
#signupBtn:hover {
  filter: brightness(1.07);
  box-shadow: 0 4px 16px rgba(0, 204, 255, 0.36);
}

/* Uniform 4-card stats strip */
.stats-row {
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: stretch;
}
.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-inset);
  justify-content: center;
  gap: 4px;
}
.stat-item.stat-all-paid {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 204, 255, 0.1) 0%, rgba(92, 255, 138, 0.07) 100%);
  border: 1px solid rgba(0, 204, 255, 0.32);
}
.stat-val.stat-loading {
  color: var(--muted);
  opacity: 0.45;
  animation: statShimmer 1.3s ease-in-out infinite;
}
@keyframes statShimmer {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.68; }
}

/* Horizontal UP vs DOWN pool split bar inside players-bar */
.players-bar {
  flex-wrap: wrap;
}
.pool-split-wrap {
  flex: 0 0 100%;
  width: 100%;
  margin-bottom: 10px;
}
.pool-split-bar {
  display: flex;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  gap: 2px;
}
.pool-split-up {
  height: 100%;
  background: linear-gradient(90deg, #2fd45a 0%, #5CFF8A 100%);
  border-radius: 999px 0 0 999px;
  transition: width 0.35s var(--ease);
}
.pool-split-down {
  height: 100%;
  background: linear-gradient(90deg, #FF4D6A 0%, #e02040 100%);
  border-radius: 0 999px 999px 0;
  transition: width 0.35s var(--ease);
}

/* Quick stake preset chips */
.stake-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.stake-chip {
  height: 30px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease);
}
.stake-chip:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: rgba(255, 255, 255, 0.06);
}
.stake-chip.active {
  color: var(--cyan);
  border-color: rgba(0, 204, 255, 0.52);
  background: rgba(0, 204, 255, 0.12);
}

/* Refined bet panel spacing & UP/DOWN SVG buttons */
.bet-actions {
  gap: 12px;
}
.big-up,
.big-down {
  padding: 14px 12px;
  gap: 6px;
}
.big-up:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(92, 255, 138, 0.42);
}
.big-down:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 77, 106, 0.42);
}
.bet-icon svg {
  display: block;
}

/* Mobile topbar single-row fix & responsive polish */
@media (max-width: 720px) {
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 10px;
    min-height: 52px;
  }
  .topbar-left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
  }
  .topbar-right {
    flex: 0 0 auto;
    gap: 6px;
  }
  .market-picker {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 175px;
  }
  .market-btn {
    width: auto;
    max-width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 8px;
    gap: 5px;
    font-size: 12px;
  }
  #marketLabel {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    min-width: 0;
  }
  .header-bonus-pill {
    min-width: 44px;
    height: 34px;
    padding: 0 7px;
  }
  .info-row {
    padding-top: 10px;
  }
  .pool-split-wrap {
    margin-bottom: 6px;
  }
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 0 4px;
  }
  .stat-item,
  .stat-item.stat-all-paid {
    padding: 10px;
  }
  .stake-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .topbar-logo img {
    width: 28px;
    height: 28px;
  }
  .market-icon {
    width: 18px;
    height: 18px;
  }
  .market-btn {
    padding: 0 7px;
    gap: 4px;
  }
  .header-bonus-pill {
    min-width: 40px;
    height: 34px;
    padding: 0 6px;
  }
  .header-bonus-pct {
    font-size: 11px;
  }
  .auth-actions {
    gap: 4px;
  }
  .stake-chip {
    height: 28px;
    font-size: 11px;
    padding: 0 3px;
  }
}

/* ── STAGE 3: FREE DEMO MODE ────────────────────────────────────────────── */
.demo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.demo-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.demo-toggle-btn:hover {
  color: var(--text);
  border-color: rgba(0, 204, 255, 0.4);
  background: rgba(0, 204, 255, 0.07);
}
.demo-toggle-btn.active {
  color: var(--cyan);
  border-color: rgba(0, 204, 255, 0.55);
  background: rgba(0, 204, 255, 0.14);
  box-shadow: 0 0 14px rgba(0, 204, 255, 0.18);
}
.demo-toggle-btn.active .demo-dot,
.demo-banner .demo-dot {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 204, 255, 0.85);
}

.demo-balance {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 6px 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 204, 255, 0.42);
  background: rgba(0, 204, 255, 0.1);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-inset), 0 0 14px rgba(0, 204, 255, 0.12);
}
.demo-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border-radius: 4px;
  color: #03131c;
  background: var(--cyan);
  line-height: 1.1;
}
.demo-bal-amt {
  color: var(--text);
  letter-spacing: -0.02em;
}
.demo-reset-btn {
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid rgba(0, 204, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.demo-reset-btn:hover {
  background: rgba(0, 204, 255, 0.18);
  border-color: rgba(0, 204, 255, 0.65);
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(0, 204, 255, 0.12) 0%, rgba(204, 51, 255, 0.08) 100%);
  border: 1px solid rgba(0, 204, 255, 0.32);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.demo-banner-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.demo-switch-btn {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.45);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.demo-switch-btn:hover {
  border-color: rgba(0, 204, 255, 0.55);
  background: rgba(0, 204, 255, 0.12);
}

.welcome-demo-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: 10px;
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 204, 255, 0.42);
  background: rgba(0, 204, 255, 0.08);
  color: var(--cyan);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.12s var(--ease);
}
.welcome-demo-btn:hover {
  background: rgba(0, 204, 255, 0.15);
  border-color: rgba(0, 204, 255, 0.72);
}
.welcome-demo-btn:active {
  transform: scale(0.99);
}

.demo-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--cyan);
  background: rgba(0, 204, 255, 0.12);
  border: 1px solid rgba(0, 204, 255, 0.35);
  vertical-align: middle;
}

.mn-demo-btn.active {
  color: var(--cyan);
  border-color: rgba(0, 204, 255, 0.5);
  background: rgba(0, 204, 255, 0.12);
}

@media (max-width: 720px) {
  .demo-toggle-btn {
    height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }
  .demo-balance {
    height: 34px;
    padding: 0 5px 0 7px;
    gap: 5px;
    font-size: 12px;
  }
  .demo-reset-btn {
    height: 22px;
    padding: 0 6px;
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  body.demo-mode #demoToggleBtn {
    display: none;
  }
}

@media (max-width: 420px) {
  body:not(.demo-mode) #demoToggleBtn {
    display: none;
  }
  .demo-badge {
    display: none;
  }
}

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

/* ── STAGE 5: HIGH-END OBSIDIAN FINTECH UI & QA FIXES ───────────────────── */
:root {
  --bg: #070B12;
  --bg-elevated: #0B111C;
  --bg-panel: #0D1420;
  --bg-card: #111927;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --cyan: #00E5FF;
  --green: #14E386;
  --green-dim: #0EC972;
  --green-bg: rgba(20, 227, 134, 0.14);
  --red: #F45B5B;
  --red-dim: #E5484D;
  --red-bg: rgba(244, 91, 91, 0.14);
}

html,
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 65% 42% at 8% 0%, rgba(0, 229, 255, 0.085), transparent 60%),
    radial-gradient(ellipse 55% 38% at 92% 0%, rgba(20, 227, 134, 0.06), transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(0, 102, 255, 0.045), transparent 60%);
}

/* Topbar glass & CRYPTOGAMING wordmark */
.topbar {
  background: rgba(9, 14, 23, 0.9);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border-bottom: 1px solid var(--border);
}
.topbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.brand-wordmark {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f3f6fb;
  line-height: 1;
  white-space: nowrap;
}
.brand-wordmark span {
  background: linear-gradient(90deg, #00E5FF 0%, #14E386 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.market-btn {
  background: #101826;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
}

/* Framed obsidian chart container */
.chart-wrap {
  background: linear-gradient(180deg, #0C1320 0%, #090E18 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 6px 6px 4px;
}

/* CSS Grid fix for #playersBar — eliminates flex-basis 0% right-edge clipping */
.players-bar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  row-gap: 10px;
  column-gap: 14px;
  align-items: start;
  background: #0E1522;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.pool-split-wrap {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}
.pool-split-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 600;
}
.pool-split-title {
  color: var(--text-secondary);
}
.pool-split-pcts {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}
.pool-pct-up {
  color: var(--green);
  font-weight: 700;
}
.pool-pct-down {
  color: var(--red);
  font-weight: 700;
}
.pool-split-bar {
  height: 6px;
}
.players-side {
  min-width: 0;
  overflow: hidden;
  gap: 4px;
}
.players-divider {
  width: 1px;
  height: 100%;
  min-height: 20px;
  margin: 0;
  background: var(--border);
}

/* Uniform obsidian stat cards */
.stats-row {
  gap: 12px;
  padding: 14px 0;
}
.stat-item {
  background: #0E1522;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 76px;
}
.stat-item.stat-all-paid {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.1) 0%, rgba(20, 227, 134, 0.07) 100%);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 14px;
  padding: 14px 16px;
}
.stat-val {
  font-size: 17px;
  font-weight: 800;
}

/* Right-hand Prediction Slip hierarchy matching desktop reference */
.bet-panel {
  background: #0B111C;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bet-actions {
  order: 1;
  background: #111927;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.bet-panel-head {
  order: 2;
  background: #0E1522;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}
.slip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 700;
  color: #f3f6fb;
  letter-spacing: -0.01em;
}
.bet-summary {
  grid-template-columns: 1.18fr 0.72fr 0.9fr 1.25fr;
  gap: 4px;
  padding: 8px 9px;
}
.bet-summary-lbl {
  font-size: 8.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.bet-summary-val {
  font-size: 11px;
}

/* Vibrant tactile emerald UP & coral DOWN buttons */
.big-up {
  background: linear-gradient(135deg, #1CE88A 0%, #0EC972 100%) !important;
  border: 1px solid rgba(28, 232, 138, 0.7) !important;
  color: #031B10 !important;
  font-weight: 800;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(20, 227, 134, 0.28);
}
.big-down {
  background: linear-gradient(135deg, #F86363 0%, #E5484D 100%) !important;
  border: 1px solid rgba(248, 99, 99, 0.7) !important;
  color: #260608 !important;
  font-weight: 800;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(244, 91, 91, 0.28);
}
.big-up:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 6px 24px rgba(20, 227, 134, 0.45);
}
.big-down:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 6px 24px rgba(244, 91, 91, 0.45);
}

/* 15% Referral Bonus promo card below UP/DOWN */
.slip-referral-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.22);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08) 0%, rgba(17, 25, 39, 0.9) 100%);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.12s var(--ease);
}
.slip-referral-card:hover {
  border-color: rgba(0, 229, 255, 0.48);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.14) 0%, rgba(17, 25, 39, 0.95) 100%);
  transform: translateY(-1px);
}
.slip-ref-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 229, 255, 0.14);
  border: 1px solid rgba(0, 229, 255, 0.32);
  color: var(--cyan);
}
.slip-ref-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.slip-ref-text strong {
  font-size: 12.5px;
  font-weight: 700;
  color: #f3f6fb;
}
.slip-ref-text span {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Compact desktop Welcome Modal so #welcomeDemoBtn stays above 820px fold */
@media (min-width: 721px) {
  .welcome-card {
    padding: 20px 20px 18px !important;
  }
  .welcome-logo-wrap .welcome-logo,
  .welcome-logo {
    width: 74px !important;
    height: 74px !important;
  }
  .welcome-hero {
    margin-bottom: 10px !important;
  }
  .welcome-title {
    margin-bottom: 12px !important;
    font-size: 1.1rem !important;
  }
  .welcome-perks {
    gap: 7px !important;
    margin-bottom: 10px !important;
  }
  .welcome-perk {
    padding: 8px 11px !important;
  }
  .welcome-perk-icon {
    width: 38px !important;
    height: 38px !important;
  }
  .welcome-trust {
    margin: 8px 0 12px !important;
    padding: 8px 12px !important;
  }
  .welcome-cta {
    height: 42px !important;
  }
  .welcome-demo-btn {
    margin-top: 8px !important;
    height: 38px !important;
  }
}

/* Mobile drawer close button */
.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.mobile-nav-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Mobile Bottom Navigation Bar (hidden on desktop) */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(68px + var(--safe-bottom)) !important;
  }
  .bet-panel {
    border-left: none;
    background: transparent;
  }
  .players-bar {
    padding: 10px 12px;
    row-gap: 8px;
    column-gap: 10px;
  }
  .stake-chip {
    border-radius: 999px;
  }
  .big-up,
  .big-down {
    border-radius: 999px !important;
  }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 10px calc(6px + var(--safe-bottom));
    background: rgba(9, 14, 23, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }
  .bnav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 4px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
  }
  .bnav-btn.active {
    color: var(--cyan);
    background: rgba(0, 229, 255, 0.08);
  }
}

@media (max-width: 640px) {
  .brand-wordmark {
    display: none;
  }
}

@media (max-width: 520px) {
  .header-prize {
    display: none !important;
  }
  .market-picker {
    min-width: 112px;
    max-width: 165px;
  }
}

/* ── STAGE 6: AUDIT FIXES (MOBILE LAYOUT, PINNING & POLISH) ────────────────── */

/* 1. Cohesive Obsidian & Cyan primary/ghost actions (replaces old purple gradient) */
button.primary,
.list-empty-actions button.primary {
  background: linear-gradient(135deg, #00E5FF 0%, #24D8FF 100%);
  color: #03131c;
  border: 1px solid rgba(0, 229, 255, 0.7);
  box-shadow: 0 2px 14px rgba(0, 229, 255, 0.28);
  font-weight: 700;
}
button.primary:hover,
.list-empty-actions button.primary:hover {
  filter: brightness(1.07);
  box-shadow: 0 4px 18px rgba(0, 229, 255, 0.4);
}
.list-empty-actions button.ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-2);
  color: var(--text);
}
.list-empty-actions button.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

/* 2. Crisp, legible non-muddy disabled / LOCKED state on Up & Down buttons */
.big-up:disabled,
.big-down:disabled {
  opacity: 0.74;
  filter: saturate(0.84) brightness(0.92);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 3. Balanced Desktop Right Sidebar (Prediction Slip proportions & visual weight) */
@media (min-width: 1025px) {
  .bet-panel {
    padding: 18px 16px;
    gap: 14px;
  }
  .bet-actions {
    padding: 18px 16px;
    gap: 15px;
  }
  .slip-header {
    padding-bottom: 12px;
    font-size: 14px;
  }
  .amount-row {
    min-height: 52px;
    padding: 10px 12px;
  }
  .stake-presets {
    gap: 5px;
  }
  .stake-chip {
    height: 34px;
    padding: 0 2px;
    font-size: 11.5px;
  }
  .big-up,
  .big-down {
    min-height: 62px;
    font-size: 16px;
    padding: 14px 12px;
  }
  .slip-referral-card {
    padding: 14px 13px;
    margin-top: 4px;
  }
}

/* 4. Mobile Layout Order, Compact Play Controls & Bottom Nav Viewport Pinning */
@media (max-width: 720px) {
  /* Let the document scroll naturally so fixed .mobile-bottom-nav stays pinned to viewport bottom */
  html {
    height: auto !important;
  }
  body {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: clip !important;
    padding-bottom: calc(78px + var(--safe-bottom)) !important;
  }
  body.wallet-open {
    overflow: hidden !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 10px calc(6px + var(--safe-bottom));
    background: rgba(9, 14, 23, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }
  .mobile-bottom-nav .bnav-btn {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
  }
  .mobile-bottom-nav .bnav-btn.active {
    color: var(--cyan);
    background: rgba(0, 229, 255, 0.1);
  }

  /* Flatten wrappers via display:contents so direct visual blocks follow mobile hierarchy */
  .layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
    padding: 6px 10px 14px;
    min-height: auto;
  }
  .chart-panel,
  .chart-main,
  .bet-panel {
    display: contents !important;
  }

  /* Target order: Timer & Wins (1) -> Chart (2) -> Pool Bar (3) -> Slip (4) -> Stats (5) -> Dots (6) -> History (7) */
  .info-row {
    order: 1 !important;
    padding: 6px 4px 4px;
    border-bottom: none;
    background: transparent;
  }
  .wins-row {
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center;
    column-gap: 8px;
  }
  .ring-col {
    display: flex !important;
    flex-direction: column;
    align-items: center;
  }
  .ring-timer {
    width: 62px !important;
    height: 62px !important;
  }
  .ring-time-num {
    font-size: 20px !important;
  }
  .ring-time-unit {
    font-size: 8.5px !important;
  }
  .ring-phase {
    font-size: 9.5px !important;
    margin-top: 2px;
  }
  .phase-text {
    font-size: 13px !important;
    margin-top: 3px;
  }
  .phase-sub {
    display: none !important;
  }

  .chart-wrap {
    order: 2 !important;
    width: 100% !important;
    margin: 0 !important;
    height: min(215px, 29vh) !important;
    min-height: 180px !important;
    max-height: 235px !important;
    border-radius: 14px;
  }

  .players-bar {
    order: 3 !important;
    margin: 0 !important;
    padding: 10px 12px;
  }

  .bet-actions {
    order: 4 !important;
    margin: 0 !important;
    padding: 12px !important;
    gap: 10px !important;
    border-radius: 14px;
    background: #111927 !important;
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  }
  .bet-timer,
  .slip-header,
  .bet-summary {
    display: none !important;
  }
  .amount-row {
    min-height: 40px;
    padding: 6px 8px;
  }
  .amount-row input {
    font-size: 17px;
  }
  .stake-chip {
    height: 30px;
    font-size: 11.5px;
    border-radius: 999px;
  }
  .bet-buttons {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .big-up,
  .big-down {
    flex-direction: row !important;
    min-height: 48px !important;
    padding: 10px 14px !important;
    font-size: 15px !important;
    gap: 6px !important;
    border-radius: 999px !important;
  }
  .slip-referral-card {
    padding: 10px 11px;
  }

  .stats-row {
    order: 5 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 4px 0 2px;
    border-bottom: none;
    margin: 0;
  }

  .recent-results {
    order: 6 !important;
    padding: 2px 0;
  }

  .tabs-section {
    order: 7 !important;
    margin-top: 2px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0E1522;
    max-height: none;
    overflow: visible;
  }
  .tabs-section .panel-scroll,
  .tabs-section .lb-scroll {
    max-height: 260px;
  }

  .site-footer {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 10px;
    padding: 12px 12px 14px;
    font-size: 12px;
    border-top: 1px solid var(--border);
    background: rgba(7, 11, 18, 0.92);
  }
}

/* ── STAGE 7: DEEP AUDIT POLISH & LIVE PLAYERS ─────────────────────────────── */

/* Subtle obsidian divider under topbar (replaces old cyan-to-purple neon strip) */
.topbar::after {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.25), transparent);
  opacity: 0.9;
}

/* Live players visible inside #playersBar across Desktop & Mobile */
.players-stakes {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: none;
  margin-top: 6px;
  padding-bottom: 2px;
}
.player-stake {
  min-width: 36px;
  gap: 3px;
}
.player-stake-av {
  width: 32px;
  height: 32px;
}
.player-stake-amt {
  font-size: 10.5px;
}

@media (min-width: 1025px) {
  /* Show Up VS Down players card below Referral Bonus to balance Desktop right sidebar */
  .bet-panel-head {
    display: flex !important;
    order: 2;
    background: #111927;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  }
}

@media (max-width: 720px) {
  .bet-panel-head {
    display: none !important;
  }
  .players-stakes {
    display: flex !important;
    gap: 6px;
    max-height: none;
    margin-top: 4px;
  }
  .player-stake {
    min-width: 30px;
    gap: 2px;
  }
  .player-stake-av {
    width: 26px;
    height: 26px;
  }
  .player-stake-amt {
    font-size: 9.5px;
  }
  .price-tag.start {
    padding: 5px 8px;
    min-width: 68px;
  }
  .price-tag.live {
    padding: 4px 7px;
    min-width: 58px;
  }
  .topbar-right .topbar-tg-link {
    display: none;
  }
}

/* Scope #winFlash strictly inside .chart-wrap so it never covers history or nav */
.chart-wrap {
  position: relative;
}
.win-flash {
  position: absolute;
  inset: 0;
  z-index: 35;
  border-radius: inherit;
  padding: 12px 16px;
}
.win-flash__text {
  font-size: clamp(24px, 5vw, 52px);
}
.win-flash.up {
  background: radial-gradient(ellipse at center, rgba(20, 227, 134, 0.42) 0%, rgba(7, 11, 18, 0.78) 74%);
}
.win-flash.up .win-flash__text {
  color: #14E386;
  text-shadow:
    0 0 22px rgba(20, 227, 134, 0.85),
    0 0 48px rgba(20, 227, 134, 0.4);
}
.win-flash.down {
  background: radial-gradient(ellipse at center, rgba(244, 91, 91, 0.42) 0%, rgba(7, 11, 18, 0.78) 74%);
}
.win-flash.down .win-flash__text {
  color: #F45B5B;
  text-shadow:
    0 0 22px rgba(244, 91, 91, 0.85),
    0 0 48px rgba(244, 91, 91, 0.4);
}

/* Hide SEC unit label when countdown ring displays words like "End" */
.ring-timer.is-word .ring-time-unit,
.bet-timer.is-word .bet-timer-unit {
  display: none;
}

/* Crisp ▲/▼ triangles inside recent outcome dots */
.dots span {
  font-size: 9px;
}

/* Clear locked state & bet limits padding */
.big-up:disabled,
.big-down:disabled {
  opacity: 0.78;
  filter: saturate(0.92);
}
.bet-summary {
  padding: 9px 10px;
  gap: 6px;
}

/* Cohesive Obsidian + Cyan theme on Welcome & Auth modals */
.welcome-overlay,
.auth-modal {
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 229, 255, 0.1), transparent 65%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(20, 227, 134, 0.06), transparent 60%),
    rgba(4, 7, 13, 0.88);
}
.welcome-backdrop-glow,
.auth-backdrop-glow {
  background: radial-gradient(circle, rgba(0, 229, 255, 0.14) 0%, rgba(20, 227, 134, 0.07) 42%, transparent 70%);
}
.welcome-card,
.auth-card {
  background:
    linear-gradient(165deg, rgba(0, 229, 255, 0.07) 0%, transparent 40%),
    linear-gradient(180deg, rgba(16, 24, 38, 0.98) 0%, rgba(9, 14, 23, 0.99) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 32px 80px rgba(0, 0, 0, 0.82),
    0 0 56px rgba(0, 229, 255, 0.1);
}
.welcome-card-border,
.auth-card-border {
  background: linear-gradient(160deg, rgba(0, 229, 255, 0.5), rgba(20, 227, 134, 0.25), rgba(255, 255, 255, 0.08));
  animation: none;
  opacity: 0.75;
}
.welcome-orb--2,
.auth-orb--2 {
  background: rgba(20, 227, 134, 0.14);
}
.welcome-logo-ring,
.auth-logo-ring {
  background:
    linear-gradient(#0b111c, #0b111c) padding-box,
    linear-gradient(135deg, #00E5FF, #14E386) border-box;
}
.welcome-highlight {
  background: linear-gradient(90deg, #00E5FF 0%, #14E386 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.welcome-badge,
.auth-badge,
.auth-tab.active,
.welcome-cta,
.auth-submit {
  background: linear-gradient(135deg, #00E5FF 0%, #24D8FF 100%);
  color: #03131c;
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.welcome-cta:hover,
.auth-submit:hover {
  box-shadow: 0 8px 28px rgba(0, 229, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
