:root{
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.60);

  --accent: #8B5CF6;
  --accent-soft: rgba(139,92,246,.12);
  --accent-mid: rgba(139,92,246,.20);
  --accent-strong: rgba(139,92,246,.28);
  --accent-glow: rgba(139,92,246,.22);

  --good: #2FE3AC;
  --bad: #EC397A;
  --sidebar-w: 260px;
}

*{ box-sizing: border-box; font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial; }

body{
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1000px 700px at 80% 20%, rgba(139,92,246,.28), transparent 60%),
    radial-gradient(900px 600px at 25% 10%, rgba(139,92,246,.08), transparent 55%),
    #000;
}


.layout{ display:flex; min-height:100vh; }


.sidebar{
  width: var(--sidebar-w);
  border-right: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(14px);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.brand{ display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.logoMark{
  width:30px;height:30px;border-radius:10px;
  background: rgba(139,92,246,.18);
  border: 1px solid rgba(139,92,246,.25);
}
.brandText{ font-weight:900; font-size:18px; }

.nav{ display:flex; flex-direction:column; gap:6px; margin: 10px 0 18px; }
.navItem{
  text-decoration:none;
  color: rgba(255,255,255,.82);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.navItem:hover{ border-color: rgba(255,255,255,.10); background: rgba(255,255,255,.03); }
.navItem.active{
  background: var(--accent-soft);
  border-color: var(--accent-mid);
  color: var(--accent);
}

.sideTitle{
  font-size: 11px;
  letter-spacing: .12em;
  color: rgba(255,255,255,.45);
  margin-bottom: 10px;
}

.muted{ color: var(--muted); font-size:12px; }
.tiny{ font-size:11px; }

.tickerList{ display:flex; flex-direction:column; gap:10px; }
.tickerRow{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
  cursor:pointer;
  color: rgba(255,255,255,.88);
}
.tickerRow:hover{ border-color: rgba(139,92,246,.25); background: rgba(139,92,246,.06); }
.tickerRow.active{
  border-color: var(--accent-strong);
  background: rgba(139,92,246,.10);
  color: var(--accent);
}
.tickerRow.active .px{ color: rgba(139,92,246,.95); }
.coin{
  width:26px;height:26px;border-radius:50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
}
.sym{ font-weight:900; }
.px{ font-weight:900; color: rgba(255,255,255,.86); }

.main{ flex:1; display:flex; flex-direction:column; }


.tradeSymBadge{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  overflow:hidden;
}

.tradeSymBadge img{
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.tokenIconImg{
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}


.siteLogo{
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.brandName{
  font-weight: 700;
  letter-spacing: 0.2px;
}

.topbar{
  position: relative;
  z-index: 5000;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(14px);
}

.search{ flex:1; max-width:520px; }
.search input{
  width:100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: var(--text);
  outline:none;
}

.topRight{ display:flex; gap:10px; align-items:center; }

.pill{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
}

.btn{
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
}
.btn:hover{ border-color: rgba(255,255,255,.28); }


.content{
  position: relative;
  z-index: 1;
  display:grid;
  grid-template-columns: 1.65fr .75fr;
  gap:14px;
  padding:14px;
}
@media (max-width:1150px){ .content{ grid-template-columns:1fr; } }

.panel{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  border-radius: 16px;
  overflow: hidden;
}

.panelRight{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  border-radius: 16px;
  padding: 14px;
  position: relative;
}

.panelHead{ margin-bottom:10px; }
.h{ font-weight:900; }


.chartStage{
  position: relative;
  z-index: 1;
  aspect-ratio: 16 / 12;
  width: 100%;
  max-height: 72vh;
  padding: 16px;
  background: linear-gradient(90deg,
    rgba(0,0,0,.60) 0%,
    rgba(0,0,0,.50) 55%,
    rgba(139,92,246,.18) 100%
  );
}

#chart{
  width:100%;
  height:100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.35);
  display:block;
}

#gridOverlay{
  position:absolute;
  inset: 16px;
  border-radius: 14px;
  overflow:hidden;
  pointer-events:auto;
  will-change: transform;
}

.gridOverlayInner{
  width:100%;
  height:100%;
  display:grid;
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(12, 1fr);
}

.gridCell{
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 11px;
  color: rgba(255,255,255,.35);
  border-right: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
  user-select:none;
  cursor:pointer;
  position: relative;
  transition: background .10s ease, color .10s ease, opacity .18s ease, box-shadow .12s ease;
  min-width:0;
  min-height:0;
}
.gridCell:hover{ background: rgba(139,92,246,.06); color: rgba(139,92,246,.90); }


.gridCell.betActive{
  background: rgba(139,92,246,.14) !important;
  border: 1px solid rgba(139,92,246,.55) !important;
  color: rgba(245,240,255,.96) !important;
  box-shadow:
    0 0 0 1px rgba(139,92,246,.22),
    0 0 18px rgba(139,92,246,.22),
    0 10px 26px rgba(0,0,0,.40);
}
.gridCell.betWon{
  background: rgba(47,227,172,0.88) !important;
  border: 1px solid rgba(47,227,172,0.95) !important;
  color: #062a1e !important;
  box-shadow:
    0 0 0 1px rgba(47,227,172,.35),
    0 0 18px rgba(47,227,172,.22),
    0 10px 26px rgba(0,0,0,.40);
}
.gridCell.betLost{
  background: rgba(236,57,122,0.78) !important;
  border: 1px solid rgba(236,57,122,0.95) !important;
  color: #2a000e !important;
  box-shadow:
    0 0 0 1px rgba(236,57,122,.35),
    0 0 18px rgba(236,57,122,.20),
    0 10px 26px rgba(0,0,0,.40);
}

.gridCell .betCellInner{
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:6px;
  text-align:center;
}
.gridCell .betAmt{ font-weight:950; font-size:16px; line-height:1; }
.gridCell .betMult{ font-weight:800; font-size:12px; opacity:.92; }


.priceTag{
  position:absolute;
  left: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(14px);
}
.priceBig{ font-weight:950; font-size:18px; color: rgba(255,255,255,.94); }

.betPanel{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.22);
}

.betPanelLeft{
  display:flex;
  align-items:center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.betTitle{
  font-weight: 900;
  letter-spacing: .02em;
  color: rgba(255,255,255,.88);
  min-width: 110px;
}

.betAmountRow{
  display:flex;
  align-items:center;
  gap: 8px;
}

.betDollar{ color: rgba(255,255,255,.65); font-weight:800; }

#betAmount{
  width: 92px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: var(--text);
  font-weight: 900;
  outline:none;
}

.betSliderWrap{
  flex: 1;
  min-width: 220px;
}

#betSlider{ width: 100%; }

.betMinMax{
  display:flex;
  justify-content:space-between;
  color: rgba(255,255,255,.45);
  font-size: 11px;
  margin-top: 6px;
}

.betPanelRight{
  display:flex;
  align-items:center;
  gap: 12px;
}

.betMeta{
  display:flex;
  flex-direction:column;
  gap: 4px;
  align-items:flex-end;
  text-align:right;
}

.betBalancePill{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(139,92,246,.10);
  min-width: 140px;
  text-align:right;
}
.betBalValue{
  font-weight: 950;
  color: rgba(139,92,246,.95);
  margin-top: 3px;
}


.footer{
  text-align:center;
  padding: 18px;
  color: rgba(255,255,255,.35);
  font-size:12px;
}


.walletWrap{ position: relative; display:inline-block; z-index: 6000; }
.walletMenu{
  position:absolute;
  right:0;
  top:48px;
  width: 360px;
  background: rgba(10,10,10,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  border-radius: 14px;
  padding: 14px;
  z-index: 6500;
  backdrop-filter: blur(10px);
  pointer-events:auto;
}
.walletMenu.hidden{ display:none; }

.walletMenuHead{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px; }
.wmTitle{ font-weight:700; font-size:14px; }
.wmAddr{ font-size:12px; opacity:0.8; word-break:break-all; text-align:right; max-width: 220px; }

.wmSection{ margin-top: 12px; }
.wmLabel{ font-size:12px; opacity:0.85; margin-bottom: 6px; }
.wmRow{ display:flex; gap: 8px; }
.wmInput{
  flex:1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 10px;
  color:#fff;
  outline:none;
  pointer-events:auto;
}
.wmHint{ margin-top:6px; font-size:11px; opacity:0.6; line-height:1.3; }

.wmBtn{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color:#fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor:pointer;
  white-space:nowrap;
  pointer-events:auto;
}
.wmBtn:hover{ background: rgba(255,255,255,0.10); }

.wmBtnGold{
  background: rgba(139,92,246,0.16);
  border-color: rgba(139,92,246,0.28);
}
.wmBtnGold:hover{ background: rgba(139,92,246,0.24); }

.wmBtnDanger{
  width:100%;
  margin-top: 10px;
  background: rgba(255,0,60,0.12);
  border-color: rgba(255,0,60,0.22);
}
.wmBtnDanger:hover{ background: rgba(255,0,60,0.18); }

.wmDivider{
  height:1px;
  background: rgba(255,255,255,0.08);
  margin: 12px 0;
}

.wmBalances{ justify-content:space-between; }
.wmBal{
  flex:1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px;
}
.wmBalLabel{ font-size:11px; opacity:0.65; }
.wmBalVal{ font-size:14px; font-weight:700; margin-top:4px; }

.toastHost{
  position: fixed;
  left: 16px;
  bottom: 16px;
  display:flex;
  flex-direction: column;
  gap:10px;
  z-index: 99999;
  pointer-events:none;
}
.toast{
  min-width: 240px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.10);
  color:#fff;
  box-shadow: 0 12px 38px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  opacity:0;
  transform: translateY(8px);
  animation: toastIn .18s ease forwards;
}
.toast .tTitle{ font-weight:700; font-size:13px; }
.toast .tMsg{ font-size:12px; opacity:0.85; margin-top:4px; line-height:1.25; }
.toast.good{ border-color: rgba(0,255,120,0.25); }
.toast.warn{ border-color: rgba(139,92,246,0.30); }
.toast.bad{ border-color: rgba(255,0,60,0.25); }

@keyframes toastIn{ to{ opacity:1; transform: translateY(0); } }


.chartLoading{
  position:absolute;
  inset:0;
  background: rgba(10,10,10,0.72);
  border-radius: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 50;
  opacity:0;
  pointer-events:none;
  transition: opacity .35s ease;
}
.chartLoading.hidden{ opacity:0; pointer-events:none; }
.chartLoading:not(.hidden){ opacity:1; pointer-events:auto; }

.chartLoadingInner{
  text-align:center;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
}
.chartLoadingTitle{ font-weight:800; margin-top:10px; }
.chartLoadingSub{ margin-top:4px; font-size:12px; opacity:.7; }
.spinner{
  width:26px;height:26px;border-radius:50%;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: rgba(139,92,246,0.9);
  margin: 0 auto;
  animation: spin .9s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }


.betsDisabled{
  position:absolute;
  inset: 54px 12px 12px 12px;
  border-radius: 16px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 20;
}
.betsDisabled.hidden{ display:none; }

.panelRight.disabled{ filter: grayscale(.55); opacity: .80; }


.bets{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.betsEmpty{
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
  color: rgba(255,255,255,.65);
  font-size: 12px;
}
.betRow{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
}
.betRow.open{ border-color: rgba(139,92,246,.22); }
.betRow.won{ border-color: rgba(47,227,172,.35); }
.betRow.lost{ border-color: rgba(236,57,122,.35); }

.betRowTop{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.betPair{ font-weight:950; color: rgba(255,255,255,.90); }
.betStatus{ font-size:11px; color: rgba(255,255,255,.62); }

.betRowMid{
  margin-top: 8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.betMeta{ font-size:12px; color: rgba(255,255,255,.74); font-weight:750; }
.betPnl{ font-size:12px; font-weight:950; color: rgba(255,255,255,.86); }
.betRow.won .betPnl{ color: rgba(47,227,172,.95); }
.betRow.lost .betPnl{ color: rgba(236,57,122,.95); }

@keyframes betRowFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(10px);
  }
}

.betRow.fadeOut {
  animation: betRowFadeOut 700ms ease forwards;
  pointer-events: none;
}

.tickerRow.lockedSwitch{
  opacity: 0.45;
  cursor: not-allowed;
}
.tickerRow.lockedSwitch:hover{
  border-color: rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
}


.profileContent{
  grid-template-columns: 1fr;
}

.profileWrap{
  max-width: 1050px;
  margin: 0 auto;
}

.profileHeaderCard{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
}

.profileIdentity{
  display:flex;
  align-items:center;
  gap: 14px;
  min-width: 0;
}

.profileAvatar{
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.10);
}

.profileName{
  font-weight: 950;
  font-size: 20px;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.profileHeadlineStats{
  display:flex;
  gap: 18px;
  align-items:flex-end;
}

.profileStatRight{
  text-align:right;
  min-width: 150px;
}

.profileBig{
  font-weight: 950;
  font-size: 22px;
  margin-top: 4px;
}

.profileBig.good{ color: rgba(47,227,172,.95); }
.profileBig.bad{ color: rgba(236,57,122,.95); }

.profileStatsGrid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px){
  .profileHeaderCard{ flex-direction: column; align-items:flex-start; }
  .profileHeadlineStats{ width:100%; justify-content:space-between; }
  .profileStatRight{ text-align:left; }
  .profileStatsGrid{ grid-template-columns: 1fr; }
}

.profileMiniCard{
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
}

.profileMiniBig{
  font-weight: 950;
  font-size: 22px;
  margin-top: 6px;
}

.profileRecent{
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
}

.profileRecentHead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.profileTradesList{
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.tradeGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 900px){
  .tradeGrid{
    grid-template-columns: 1fr;
  }
}

.tradePager{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  margin-top: 6px;
}

.tradePagerInfo{
  font-size: 12px;
  color: rgba(255,255,255,60);
}

.btnSmall{
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.btnSmall:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}

.tradeRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
}

.tradeLeft{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}

.tradeSymBadge{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 950;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.88);
  flex: 0 0 auto;
}

.tradeMain{
  min-width: 0;
}

.tradeTitle{
  font-weight: 900;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.tradeSub{
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

.tradeRight{
  text-align:right;
  flex: 0 0 auto;
}

.tradePnl{
  font-weight: 950;
}

.tradePnl.good{ color: rgba(47,227,172,.95); }
.tradePnl.bad{ color: rgba(236,57,122,.95); }

.tradeMeta{
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

.view.hidden{ display:none; }
.view{ animation: viewIn 160ms ease; }
@keyframes viewIn{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform: translateY(0); }
}

input[type="range"]{
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(
    to right,
    rgba(139,92,246,0.95) 0%,
    rgba(139,92,246,0.95) var(--range-progress, 50%),
    rgba(255,255,255,0.25) var(--range-progress, 50%),
    rgba(255,255,255,0.25) 100%
  );
  border-radius: 6px;
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track{
  height: 6px;
  background: transparent;
  border-radius: 6px;
}
input[type="range"]::-moz-range-track{
  height: 6px;
  background: transparent;
  border-radius: 6px;
}

input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, #a78bfa, #8b5cf6);
  border: 1px solid rgba(0,0,0,0.4);
  cursor: pointer;
  margin-top: -2px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.25);
}

input[type="range"]::-moz-range-thumb{
  width: 18px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, #a78bfa, #8b5cf6);
  border: 1px solid rgba(0,0,0,0.4);
  cursor: pointer;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.25);
}

input[type="range"]:hover::-webkit-slider-thumb{
  background: linear-gradient(180deg, #c4b5fd, #a78bfa);
}
input[type="range"]:active::-webkit-slider-thumb{
  transform: scale(0.96);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

input[type="number"]{
  -moz-appearance: textfield;
  appearance: textfield;
}

.topbar{
  justify-content: flex-end;
}

.tickerRow.comingSoon {
  opacity: 0.55;
  cursor: not-allowed;
}
.tickerRow.comingSoon:hover {
  transform: none !important;
}

.tickerIconPlaceholder{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}


.tickerRow.comingSoon{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  opacity: 0.9;
  cursor: not-allowed;
}

.tickerRow.comingSoon .tickerLeft{
  display: flex;
  align-items: center;
  gap: 10px;
}

.tickerRow.comingSoon .tickerBadge{
  margin-left: auto;
}

.tickerRow.comingSoon:hover{
  transform: none !important;
}

.tickerIconImg{
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.tickerSymbolRow{
  display: flex;
  align-items: center;
  gap: 8px;
}

.tickerBadge{
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.80);
  text-transform: uppercase;
}

.sidebarLinks{
  margin-top: 14px;
  display: flex;
  gap: 10px;
  padding: 0 12px 14px 12px;
}
.sidebarLinkBtn{
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-weight: 700;
}
.sidebarLinkBtn:hover{
  background: rgba(255,255,255,0.07);
}

.sidebarFooter{
  padding: 12px;
  display: flex;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.12);
  backdrop-filter: blur(6px);
}

.sidebarFooterBtn{
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  font-weight: 700;
}

.sidebarFooterBtn:hover{
  background: rgba(255,255,255,0.08);
}


.sidebarContent {
  flex: 1;
  overflow: auto;
}

@media (max-width: 900px){
  html, body{
    height: 100%;
    overflow-x: hidden;
  }

  .layout{
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .main{
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
  }

  .topbar{
    position: sticky;
    top: 0;
    z-index: 2000;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(12,12,12,0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .mobileMenuBtn{
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .topTitle{
    justify-self: center;
    font-weight: 800;
    letter-spacing: 0.16em;
    font-size: 13px;
    color: rgba(255,255,255,0.92);
    text-transform: uppercase;
  }

  .topRight{
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .sidebar{
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(86vw, 340px);
    transform: translateX(-105%);
    transition: transform 240ms ease;
    z-index: 2100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 14px;
    background: rgba(10,10,10,0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 18px 60px rgba(0,0,0,0.65);
  }
  body.sidebarOpen .sidebar{
    transform: translateX(0);
  }
  body.sidebarOpen::before{
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 2050;
  }

  .sidebarFooter{
    position: sticky;
    bottom: 0;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, rgba(10,10,10,0), rgba(10,10,10,0.95) 40%, rgba(10,10,10,0.98));
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 10px;
  }
  .sidebarFooterBtn{
    flex: 1;
    text-align: center;
  }

  #panelRight{
    display: none !important;
  }

  .content{
    padding: 12px;
    gap: 12px;
  }

  .panel{
    width: 100%;
    max-width: 100%;
  }

  .chartStage{
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 320px;
    max-height: 78vh;
    overflow: hidden;
  }

  #chart{
    width: 100% !important;
    height: 100% !important;
    display: block;
  }

  #gridOverlay{
    position: absolute;
    inset: 0;
  }

  #gridOverlay .gridOverlayInner{
    display: grid !important;
    grid-template-columns: repeat(12, 1fr) !important;
    grid-template-rows: repeat(12, 1fr) !important;
    width: 100%;
    height: 100%;
    gap: 6px;
    padding: 10px;
    box-sizing: border-box;
  }

  #gridOverlay .gridCell[data-vcol="12"],
  #gridOverlay .gridCell[data-vcol="13"],
  #gridOverlay .gridCell[data-vcol="14"],
  #gridOverlay .gridCell[data-vcol="15"]{
    display: none !important;
  }

  #gridOverlay .gridCell{
    border-radius: 12px;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  #gridOverlay .gridCell .betCellInner{
    display: grid;
    gap: 2px;
    text-align: center;
  }

  .priceTag{
    left: 14px;
    bottom: 14px;
    transform: none;
    max-width: 70%;
  }
  .priceBig{
    font-size: 18px;
  }

  .betPanel{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .betPanelLeft{
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }
  .betTitle{
    margin: 0 !important;
    white-space: nowrap;
  }
  .betAmountRow{
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
  }
  #betAmount{
    width: 86px !important;
  }

  .betSliderWrap{
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0 !important;
  }
  .betSliderWrap input[type="range"]{
    width: 100%;
  }

  .betPanelLeft .betSliderWrap{
    order: 2;
    width: 100%;
  }

  .betPanelRight{
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .betBalancePill{
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .betMeta{
    order: 3;
    width: 100%;
    text-align: center !important;
  }
  #status, #pair{
    display: inline-block;
    width: 100%;
  }

  .walletMenu{
    right: 0;
    left: auto;
    width: min(92vw, 420px);
    max-height: calc(100dvh - 74px);
    overflow: auto;
  }

  .footer{
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px){
  .chartStage{
    min-height: 300px;
    max-height: 72vh;
  }
  #gridOverlay .gridOverlayInner{
    gap: 5px;
    padding: 9px;
  }
  #gridOverlay .gridCell{
    border-radius: 11px;
    font-size: 11px;
  }
}

@media (max-width: 380px){
  .topbar{
    padding: 8px 10px;
    grid-template-columns: 42px 1fr auto;
  }
  .priceBig{
    font-size: 17px;
  }
}

.mobileMenuBtn {
  display: none !important;
}

.topTitle {
  display: none !important;
}

@media (max-width: 900px) {

  .mobileMenuBtn {
    display: grid !important;
  }

  .topTitle {
    display: block !important;
  }
}


@media (max-width: 900px) {

  .chartStage {
    height: 62vh !important;
    min-height: 460px !important;
  }

  .gridOverlay {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .gridOverlayInner {
    display: grid !important;
    grid-template-columns: repeat(16, 1fr);
    grid-auto-rows: 1fr;
    aspect-ratio: 16 / 12;
    width: 100%;
    max-width: 100%;
  }

  .gridCell {
    aspect-ratio: 1 / 1;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .gridCell::before,
  .gridCell::after {
    content: none !important;
    display: none !important;
  }

  .betSliderWrap {
    display: none !important;
  }
}

.betPending{
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
  opacity: 0.9;
  text-transform: uppercase;
}

#gridOverlay.gridOverlayWrap{
  position: absolute;
  inset: 16px;
  border-radius: 14px;
  overflow: hidden;
}

.mobilePlaceholder{
  display: none;
}

@media (max-width: 900px){

  #chart{
    display: none !important;
  }

  #gridOverlay .gridOverlayInner{
    opacity: 0 !important;
    pointer-events: none !important;
  }


  #mobilePlaceholder.mobilePlaceholder{
    display: block !important;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1000;
    pointer-events: none;
  }

  #chartLoading{
    display: none !important;
  }

  .betPanel{
    opacity: 0.35;
    filter: grayscale(1);
    pointer-events: none;
  }

  #panelRight{
    opacity: 0.35;
    filter: grayscale(1);
    pointer-events: none;
  }
}

.leaderboardPlaceholder{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

.leaderboardCard{
  text-align: center;
  padding: 36px 32px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(139,92,246,0.18), transparent 60%),
    rgba(0,0,0,0.35);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.55),
    inset 0 0 0 1px rgba(255,255,255,0.04);
  max-width: 460px;
  width: 100%;
}

.leaderboardIcon{
  font-size: 44px;
  margin-bottom: 14px;
  filter: drop-shadow(0 6px 14px rgba(139,92,246,0.35));
}

.leaderboardTitle{
  font-weight: 950;
  font-size: 22px;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.leaderboardBadge{
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(139,92,246,0.95);
  border: 1px solid rgba(139,92,246,0.35);
  background: rgba(139,92,246,0.12);
  margin-bottom: 14px;
}

.leaderboardSub{
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,0.65);
}

.toast.info{ border-color: rgba(139,92,246,0.30); }

.leaderboardContent{
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.lbTop3{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.lbTop3 .lbCardBig{
  grid-column: 1 / -1;
}
.lbCard{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(10px);
}
.lbCardHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.lbIdent{
  display:flex;
  align-items:center;
  gap: 12px;
}
.lbAvatar{
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,0.10);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 18px;
}
.lbName{
  font-weight: 700;
  font-size: 18px;
}
.lbSub{
  font-size: 12px;
  opacity: 0.75;
}
.lbPnl{
  font-weight: 800;
  font-size: 18px;
}
.lbPnl.pos{ color: #34d399; }
.lbPnl.neg{ color: #fb7185; }

.lbStats{
  margin-top: 14px;
  display:flex;
  gap: 18px;
  align-items:center;
  flex-wrap: wrap;
}
.lbStat{
  min-width: 120px;
}
.lbStat .k{
  font-size: 12px;
  opacity: 0.75;
}
.lbStat .v{
  font-size: 16px;
  font-weight: 700;
}
.lbBar{
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  overflow:hidden;
  margin-top: 8px;
}
.lbBar > div{
  height: 100%;
  background: rgba(52,211,153,0.9);
}

.lbListCard{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  overflow: hidden;
}
.lbListHead{
  padding: 14px 16px;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.lbScroll{
  max-height: calc(100vh - 320px);
  overflow-y: auto;
}

.lbTable{
  display:flex;
  flex-direction: column;
}
.lbRow{
  display:grid;
  grid-template-columns: 70px 1fr 160px 120px 120px;
  gap: 10px;
  padding: 12px 16px;
  align-items:center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.lbRowHead{
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(20, 10, 40, 0.85);
  backdrop-filter: blur(10px);
  font-size: 12px;
  opacity: 0.85;
}
.lbRow .right{ text-align: right; }
.lbUserCell{
  display:flex;
  flex-direction: column;
  gap: 2px;
}
.lbUserCell .u1{ font-weight: 700; }
.lbUserCell .u2{ font-size: 12px; opacity: 0.75; }

@media (max-width: 900px){
  .lbTop3{ grid-template-columns: 1fr; }
  .lbRow{
    grid-template-columns: 55px 1fr 120px 90px 90px;
  }
}

@media (min-width: 901px){

  html, body{
    height: 100%;
  }

  body{
    overflow: hidden;
  }

  .layout{
    height: 100vh;
    overflow: hidden;
  }

  .sidebar{
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
  }

  .main{
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .topbar{
    position: sticky;
    top: 0;
    z-index: 50;
    flex: 0 0 auto;
  }

  .view{
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .viewScroll{
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 18px;
  }

  .footer{
    flex: 0 0 auto;
  }
}

@media (max-width: 900px){

  html, body{
    height: auto;
  }

  body{
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .layout{
    height: auto;
    min-height: 100svh;
    overflow: visible;
    display: block;
  }

  .main{
    height: auto;
    min-height: 100svh;
    overflow: visible;
    display: block;
  }

  .sidebar{
    position: fixed;
  }

  .view{
    flex: none;
    min-height: auto;
    overflow: visible;
  }

  .viewScroll{
    height: auto;
    overflow: visible;
    padding: 12px;
  }

  .lbScroll{
    max-height: none;
    overflow: visible;
  }

  .lbRowHead{
    position: static;
  }

  .footer{
    position: relative;
  }
}

@media (max-width: 900px){

  body.lbShell{
    overflow: hidden;
    height: 100%;
  }

  body.lbShell .layout{
    height: 100dvh;
    overflow: hidden;
  }

  body.lbShell .main{
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  body.lbShell .topbar{
    position: sticky;
    top: 0;
    z-index: 2000;
    flex: 0 0 auto;
  }

  body.lbShell .view{
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  body.lbShell #viewLeaderboard{
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  body.lbShell #viewLeaderboard .viewScroll{
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
  }

  body.lbShell #viewLeaderboard .lbScroll{
    max-height: none;
    overflow: visible;
  }

  body.lbShell #viewLeaderboard .lbRowHead{
    position: static;
  }
}