@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
button, .wager-btn, .submit-btn, .sell-btn, .ct-amt-btn, .ct-start-btn, .ct-stop-btn { touch-action: manipulation; }

/* Thin stylish scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent; }

:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a28;
  --card: rgba(20, 20, 35, 0.8);
  --card-border: rgba(255,255,255,0.06);
  --teal: #00FFA3;
  --teal2: #14F195;
  --purple: #9945FF;
  --purple2: #7B3FE4;
  --text: #e0e0e8;
  --text-dim: #8888a0;
  --red: #ff4466;
  --green: #00dd77;
  --gradient: linear-gradient(135deg, var(--teal), var(--purple));
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Stars background */
#stars-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Auth Screen */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.auth-box {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 48px;
  text-align: center;
  width: 380px;
}

.auth-box h1 {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 28px;
  margin-bottom: 8px;
}

.auth-box p {
  color: var(--text-dim);
  margin-bottom: 24px;
  font-size: 14px;
}

.auth-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s;
}

.auth-input:focus {
  border-color: var(--teal);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  background: var(--gradient);
  border: none;
  border-radius: 10px;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.auth-btn:hover { opacity: 0.9; }

.auth-error {
  color: var(--red);
  margin-top: 12px;
  font-size: 13px;
  min-height: 20px;
}

/* Landing Page */
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 32px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  padding: 24px;
}

.dash-card {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 320px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.dash-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  padding: 1px;
  background: var(--gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
}

.dash-card:hover::before { opacity: 1; }
.dash-card:hover { transform: translateY(-4px); }

.dash-card .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.dash-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.dash-card p {
  color: var(--text-dim);
  font-size: 14px;
}

/* Main Dashboard Layout */
.dashboard {
  position: relative;
  z-index: 1;
  padding: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}
.logo-snap {
  background: linear-gradient(135deg, #ff8a00, #ffb347);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-wick {
  background: linear-gradient(135deg, #a855f7, #d8b4fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-version {
  font-size: 9px;
  color: var(--text-dim);
  font-weight: 400;
  -webkit-text-fill-color: var(--text-dim);
  vertical-align: super;
  margin-left: 2px;
}

.header-balance {
  color: var(--text-dim);
  font-size: 14px;
}

.header-balance span { color: var(--teal); font-weight: 600; }

.price-ticker {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.price-main {
  font-size: 24px;
  font-weight: 700;
  transition: color 0.3s;
}

.price-main.up { color: var(--green); }
.price-main.down { color: var(--red); }

.price-exchanges {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-dim);
}

.price-exchanges .ex-price {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.price-exchanges .ex-name { font-weight: 500; text-transform: uppercase; font-size: 9px; }

/* Grid Layout */
.grid {
  display: grid;
  gap: 16px;
}

.grid-btc {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
}

.card {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-balance {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0;
}

/* Market Cards */
.market-card {
  display: flex; flex-direction: column;
  transition: transform 0.4s ease, opacity 0.4s ease;
  overflow: hidden;
}
.market-card.slide-out-left { transform: translateX(-110%); }
.market-card.slide-into-current { transform: translateX(calc(-100% - 16px)); }
.market-card.slide-no-transition { transition: none; }

/* Card Trades (inline history per candle) */
.card-trades {
  margin-top: 0;
  max-height: 120px;
  overflow-y: auto;
  font-size: 11px;
  color: var(--text-dim);
  padding-top: 2px;
}
.card-trades:empty { display: none; }
.card-trade-row {
  display: grid;
  grid-template-columns: 50px 40px 1fr 70px 80px;
  padding: 2px 0;
  gap: 4px;
  align-items: center;
}
.card-trade-row span { text-align: center; }
.card-trade-row span:nth-child(3) { text-align: left; }
.card-trade-row .trade-action { font-weight: 600; text-align: left; }
.card-trade-row .trade-action.buy { color: var(--text); }
.card-trade-row .trade-action.sell { color: var(--text); }
.card-trade-row .trade-action.redeem { color: var(--accent); }
.card-trade-row.trade-header { color: var(--text-dim); font-size: 9px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 3px; margin-bottom: 2px; }
.text-dim { color: var(--text-dim); }

/* Top Holders */
.holders-toggle {
  padding: 4px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.holders-toggle:hover { color: var(--text); }
.holders-arrow {
  font-size: 10px;
  transition: transform 0.2s;
  display: inline-block;
}
.holders-arrow.open { transform: rotate(90deg); }
.holders-panel {
  max-height: 400px;
  overflow-y: auto;
}
.holders-refresh-btn {
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  margin-left: auto;
  line-height: 1;
  transition: color 0.2s;
}
.holders-refresh-btn:hover { color: var(--text); }
.holders-refresh-btn.spinning { animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.holders-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.holders-col {
  min-width: 0;
  overflow: hidden;
}
.holders-col-title {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}
.holders-list {
  font-size: 10px;
  color: var(--text-dim);
}
.holder-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.holder-row .holder-rank {
  color: var(--text-dim);
  width: 18px;
  flex-shrink: 0;
}
.holder-row .holder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.holder-row .holder-amt {
  font-weight: 600;
  color: var(--text);
  margin-left: 6px;
  white-space: nowrap;
}
.holder-row.holder-header { font-size: 9px; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 3px; margin-bottom: 2px; }
.holder-row.holder-header .holder-name, .holder-row.holder-header .holder-amt, .holder-row.holder-header .holder-rank { color: var(--text-dim); font-weight: 500; }

/* Estimated Balance */
.card-balance-est {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  margin-left: 4px;
  display: inline-block;
  min-width: 100px;
  text-align: left;
}
.card-balance-est.positive { color: var(--teal); }
.card-balance-est.negative { color: var(--red); }

/* CLR Button */
.clr-btn {
  background: rgba(255,59,48,0.15) !important;
  color: var(--red) !important;
  border-color: rgba(255,59,48,0.3) !important;
}

.market-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.candle-card-label {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #f7931a;
}

/* Polymarket-style candle header */
.candle-header-poly {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.candle-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  flex-shrink: 0;
}
.candle-header-info {
  flex: 1;
  min-width: 0;
}
.candle-header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.candle-header-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

.market-time {
  font-size: 15px;
  font-weight: 600;
}
.market-slug { font-size: 10px; margin-top: 2px; }
.slug-link { color: var(--text-dim); text-decoration: none; }
.slug-link:hover { color: var(--accent); text-decoration: underline; }

.pie-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.pie-wrap canvas { display: block; }

.pie-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  pointer-events: none;
}

.market-prices {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.market-price-item {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.market-price-item .label { color: var(--text-dim); font-size: 11px; }
.market-price-item .val { font-weight: 600; font-size: 16px; }
.market-prices-lg .market-price-item .val { font-size: 22px; font-weight: 700; }
.val-row { display: flex; align-items: baseline; gap: 6px; }
.val-delta { font-size: 15px; font-weight: 700; white-space: nowrap; }
.market-prices-lg .market-price-item .label { font-size: 12px; }
.up-color { color: var(--teal); }
.down-color { color: var(--red); }
.market-price-item .val.up-color { color: var(--teal); }
.market-price-item .val.down-color { color: var(--red); }

/* Betting Controls */

.wager-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.wager-row.compact { margin-top: 12px; }
.wager-row.compact .wager-btn { padding: 6px 10px; font-size: 12px; }
.wager-row.compact .wager-input { width: 60px; padding: 6px 8px; font-size: 12px; }

.wager-btn {
  padding: 10px 18px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.wager-btn:hover { border-color: var(--teal); }
.wager-btn:active, .wager-btn.tapped {
  background: var(--gradient);
  color: #000;
  border-color: transparent;
}

.wager-input {
  width: 100px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.wager-input:focus { border-color: var(--teal); }
.wager-input::placeholder { color: var(--text-dim); opacity: 0.6; font-size: 11px; }

.wager-input-wrap {
  position: relative;
  width: 100%;
}
.wager-input-wrap .wager-input {
  width: 100%;
  padding-right: 110px;
}
.wager-win-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green);
  opacity: 0.5;
  font-size: 14px;
  pointer-events: none;
  white-space: nowrap;
}

.bet-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.bet-btn {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 1px;
}

/* Dual bet panels side by side */
.bet-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.bet-panel {
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.up-panel {
  background: rgba(0, 255, 163, 0.06);
  border: 1px solid rgba(0, 255, 163, 0.15);
}

.down-panel {
  background: rgba(255, 68, 102, 0.06);
  border: 1px solid rgba(255, 68, 102, 0.15);
}

.panel-bidask {
  font-size: 11px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.3px;
  min-height: 16px;
}
.up-panel .panel-bidask { color: var(--green); }
.down-panel .panel-bidask { color: var(--red); }
.panel-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
}

.panel-price {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
  letter-spacing: 0;
}
.panel-price-lg {
  font-size: 26px;
  font-weight: 700;
  opacity: 1;
}

.bet-panel .wager-row {
  flex-wrap: wrap;
  justify-content: center;
}

.bet-panel .wager-input {
  width: 100%;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  padding: 12px 14px;
}

.max-btn {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  font-weight: 600 !important;
}

.max-btn.active {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Submit BET buttons */
.submit-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.submit-btn:active { transform: scale(0.97); }

.up-submit {
  background: linear-gradient(135deg, #00aa70 0%, #008855 50%, #006640 100%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 15px rgba(0, 255, 163, 0.3);
}

.up-submit:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(0, 255, 163, 0.45);
}

.down-submit {
  background: linear-gradient(135deg, #cc2244 0%, #aa1a35 50%, #881228 100%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 15px rgba(255, 68, 102, 0.3);
}

.down-submit:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(255, 68, 102, 0.45);
}

.submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* Legacy bet-btn (keep for flash animations) */
.bet-btn:active { transform: scale(0.97); }

.bet-btn.up {
  background: linear-gradient(135deg, #00FFA3, #00cc88);
  color: #000;
}

.bet-btn.down {
  background: linear-gradient(135deg, #9945FF, #7B3FE4);
  color: #fff;
}

.bet-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

@keyframes livePulse {
  0%, 100% { background: rgba(0, 230, 118, 0.05); }
  50% { background: rgba(0, 230, 118, 0.25); }
}
tr.live-row { animation: livePulse 2s ease-in-out infinite; }
tr.live-row:hover { background: rgba(0, 230, 118, 0.30) !important; }

@keyframes liveTextPulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 6px rgba(255, 68, 102, 0.6); }
  50% { opacity: 0.35; text-shadow: 0 0 14px rgba(255, 68, 102, 1); }
}
.live-indicator {
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  animation: liveTextPulse 2s ease-in-out infinite;
}

@keyframes flashGreen {
  0% { box-shadow: 0 0 0 0 rgba(0,255,163,0.6); }
  100% { box-shadow: 0 0 30px 10px rgba(0,255,163,0); }
}

@keyframes flashRed {
  0% { box-shadow: 0 0 0 0 rgba(255,68,102,0.6); }
  100% { box-shadow: 0 0 30px 10px rgba(255,68,102,0); }
}

/* Toast notifications inside candle cards */
.toast-container {
  position: relative;
  width: 100%;
}

.toast {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  animation: toastIn 0.3s ease, toastOut 0.4s ease 2.6s forwards;
}

.toast.success {
  background: rgba(0, 255, 163, 0.15);
  border: 1px solid rgba(0, 255, 163, 0.4);
  color: #00ffa3;
}

.toast.error {
  background: rgba(255, 68, 102, 0.15);
  border: 1px solid rgba(255, 68, 102, 0.4);
  color: #ff4466;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Sell Controls */
.sell-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.sell-btn {
  padding: 8px 16px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: transparent;
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.sell-btn:hover {
  background: var(--red);
  color: #fff;
}

/* Limit Order */
.limit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.limit-input {
  width: 80px;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.limit-submit {
  padding: 8px 16px;
  background: var(--bg3);
  border: 1px solid var(--teal);
  border-radius: 8px;
  color: var(--teal);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.limit-submit:hover { background: var(--teal); color: #000; }

/* Position Display */
.position-info {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg2);
  border-radius: 10px;
  font-size: 13px;
}

.position-info .pos-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.position-info .pos-label { color: var(--text-dim); }
.position-info .pos-val { font-weight: 500; }
.position-info .pos-val.positive { color: var(--green); }
.position-info .pos-val.negative { color: var(--red); }

/* Big Road */
.bigroad-container {
  grid-column: 1 / -1;
  overflow: visible;
}

.bigroad-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding-top: 50px;
  margin-top: -50px;
}

.bigroad {
  display: inline-grid;
  gap: 2px;
  min-width: 100%;
}

.bigroad-cell {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  position: relative;
  cursor: pointer;
}

.bigroad-cell.up { background: var(--teal); border-color: var(--teal); }
.bigroad-cell.down { background: var(--red); border-color: var(--red); }
.bigroad-cell.push { background: #555; border-color: #666; }
.bigroad-cell.pending { opacity: 0.3; }

/* Streak header dot */
.bigroad-streak-hdr {
  width: 18px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}
.bigroad-streak-hdr::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #222;
  border: 1px solid #555;
}
.bigroad-streak-hdr:hover .tooltip { display: block; }

.tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.95);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  margin-bottom: 6px;
  line-height: 1.4;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
}

.bigroad-cell .tooltip,
.bigroad-streak-hdr .tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.95);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  margin-bottom: 6px;
  line-height: 1.4;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
}

.bigroad-cell:hover .tooltip,
.bigroad-streak-hdr:hover .tooltip {
  display: block;
}

.bigroad-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.bigroad-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 11px;
  color: var(--text-dim);
}
.bigroad-stats-left { justify-content: flex-start; }
.bigroad-stats-right { justify-content: flex-end; }
.bigroad-stats .stat-val { color: var(--text); font-weight: 600; }

.flip-help {
  cursor: help;
  font-size: 14px;
  color: var(--text-dim);
  position: relative;
  display: inline-flex;
  align-items: center;
}
.flip-help:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.95);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: normal;
  width: 260px;
  line-height: 1.5;
  z-index: 9999;
  border: 1px solid rgba(255,255,255,0.1);
  pointer-events: none;
}

/* Stop Loss */
.stoploss-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

.toggle.on { background: var(--teal); border-color: var(--teal); }

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s;
}

.toggle.on::after { transform: translateX(20px); }

.sl-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}

.sl-field label { color: var(--text-dim); width: 100px; }

.sl-input {
  width: 80px;
  padding: 8px 10px;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.sl-pnl {
  font-size: 22px;
  font-weight: 700;
  margin: 16px 0;
}

.sl-pnl.positive { color: var(--green); }
.sl-pnl.negative { color: var(--red); }

/* Global Auto SL in header */
.header-autosl {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.header-autosl-label {
  font-size: 11px;
  color: var(--text-dim);
}
.sl-mode-btns {
  display: inline-flex;
  gap: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--card-border);
}
.sl-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.sl-mode-btn.active {
  background: var(--teal);
  color: #000;
}
.sl-mode-btn:hover:not(.active) {
  background: rgba(255,255,255,0.08);
}
.toggle-sm {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-sm::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.2s, background 0.2s;
}
.toggle-sm.active {
  background: var(--green);
  border-color: var(--green);
}
.toggle-sm.active::after {
  transform: translateX(14px);
  background: #fff;
}
.sl-input-sm {
  width: 76px;
  padding: 6px 12px;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  text-align: center;
}

/* Per-side Auto SL in bet panels */
.panel-autosl {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 0;
}
.autosl-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}
.autosl-status {
  font-size: 10px;
  color: var(--text-dim);
  margin-left: auto;
}

.emergency-btn {
  width: 100%;
  padding: 12px;
  background: var(--red);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.emergency-btn:hover { opacity: 0.85; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: #0a0a12;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 0 40px rgba(0,0,0,0.8), 0 0 2px rgba(255,255,255,0.1);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
}
@keyframes modal-spin { to { transform: rotate(360deg); } }
.modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  color: var(--text-dim);
  font-size: 13px;
  gap: 10px;
}
.modal-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: modal-spin 0.7s linear infinite;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-dim);
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.15); }
.holder-modal-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; margin-right: 12px; }
.fav-star { font-size: 22px; cursor: pointer; color: var(--text-dim); transition: color 0.2s; user-select: none; }
.fav-star:hover { color: #f5c518; }
.fav-star.active { color: #f5c518; }
.holder-poly-link { font-size: 16px; color: var(--text-dim); text-decoration: none; font-weight: 700; }
.holder-poly-link:hover { color: var(--accent); }
.fav-grid { display: flex; flex-direction: column; font-size: 11px; }
.fav-header { display: grid; grid-template-columns: 14px 16px minmax(60px,1fr) 100px 100px 60px 36px; gap: 0 4px; }
.fav-header span { padding: 4px 0 3px; font-size: 9px; font-weight: 600; color: var(--text-dim); letter-spacing: 0.5px; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.06); }
.fav-header .fav-h-col { text-align: center; }
.fav-header .fav-h-actions { text-align: right; }
.fav-row { display: grid; grid-template-columns: 14px 16px minmax(60px,1fr) 100px 100px 60px 36px; gap: 0 4px; cursor: pointer; align-items: center; }
.fav-row > * { padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.fav-row:hover > * { color: var(--text); }
.fav-row .fav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-decoration-style: dotted; }
.fav-col { text-align: center; font-size: 10px; font-weight: 600; white-space: nowrap; color: var(--text-dim); }
.fav-actions { text-align: right; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.fav-row .fav-remove { color: var(--text-dim); cursor: pointer; font-size: 14px; }
.fav-row .fav-remove:hover { color: var(--red); }
.fav-ago { font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.fav-drag { color: var(--text-dim); cursor: grab; font-size: 10px; user-select: none; display: flex; align-items: center; opacity: 0.4; }
.fav-drag:hover { opacity: 1; }
.fav-dot { font-size: 12px; display: flex; align-items: center; user-select: none; }
.fav-row.fav-dragging { opacity: 0.3; }
.fav-row.fav-drag-over { border-top: 2px solid var(--teal); }
.fav-touch-clone { background: var(--bg2); border-radius: 6px; padding: 4px 8px; }
.fav-color-picker { position: absolute; top: 100%; left: 0; z-index: 100; background: var(--bg3); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 6px; display: flex; gap: 4px; flex-wrap: wrap; width: 130px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.fav-color-opt { width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform 0.15s; }
.fav-color-opt:hover { transform: scale(1.2); border-color: #fff; }
.fav-color-none { background: var(--bg2); border: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--text-dim); }
/* Copy Trade */
.ct-config { display: flex; flex-direction: column; gap: 8px; }
.ct-row { display: flex; align-items: center; gap: 8px; }
.ct-label { font-size: 10px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; min-width: 52px; }
.ct-select { flex: 1; background: var(--bg2); color: var(--text); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 6px 8px; font-size: 12px; outline: none; }
.ct-select:focus { border-color: var(--accent); }
.ct-amount-row { display: flex; gap: 4px; align-items: center; flex: 1; }
.ct-input { width: 70px; background: var(--bg2); color: var(--text); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 6px 8px; font-size: 12px; outline: none; }
.ct-input:focus { border-color: var(--accent); }
.ct-amt-btn { background: var(--bg3); color: var(--text-dim); border: 1px solid rgba(255,255,255,0.08); border-radius: 4px; padding: 4px 8px; font-size: 11px; cursor: pointer; }
.ct-amt-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.ct-target-row { display: flex; gap: 10px; }
.ct-radio { font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 3px; cursor: pointer; }
.ct-radio input { accent-color: var(--accent); }
.ct-start-btn { background: linear-gradient(135deg, var(--teal), #0d9488); color: #fff; border: none; border-radius: 6px; padding: 8px 0; font-size: 12px; font-weight: 600; cursor: pointer; letter-spacing: 0.5px; margin-top: 2px; }
.ct-start-btn:hover { filter: brightness(1.15); }
.ct-start-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ct-status { display: flex; flex-direction: column; gap: 6px; }
.ct-active-info { font-size: 11px; color: var(--text); padding: 6px 8px; background: rgba(20,184,166,0.1); border: 1px solid rgba(20,184,166,0.25); border-radius: 6px; }
.ct-active-info .ct-wallet-name { font-weight: 600; color: var(--teal); }
.ct-active-info .ct-amt { color: var(--green); font-weight: 600; }
.ct-log { max-height: 160px; overflow-y: auto; font-size: 10px; color: var(--text-dim); display: flex; flex-direction: column; gap: 2px; }
.ct-log-entry { padding: 3px 6px; border-radius: 4px; background: rgba(255,255,255,0.03); border-left: 2px solid var(--text-dim); }
.ct-log-entry.ct-log-buy { border-left-color: var(--teal); color: var(--text); }
.ct-log-entry.ct-log-error { border-left-color: var(--red); color: var(--red); }
.ct-log-entry.ct-log-wait { border-left-color: var(--yellow); }
.ct-stop-btn { background: var(--red); color: #fff; border: none; border-radius: 6px; padding: 6px 0; font-size: 11px; font-weight: 600; cursor: pointer; }
.ct-stop-btn:hover { filter: brightness(1.15); }
.ct-mg-row { display: flex; align-items: center; gap: 8px; }
.ct-mg-label { font-size: 12px; color: var(--text-dim); }
.ct-mg-settings { padding: 4px 0 4px 8px; border-left: 2px solid var(--teal); margin-left: 4px; }
.ct-mg-hint { font-size: 10px; color: var(--text-dim); opacity: 0.7; }
.ct-mg-status { font-size: 12px; padding: 6px 8px; margin: 4px 0; border-radius: 6px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.ct-mg-status .mg-level { color: var(--teal); font-weight: 700; }
.ct-mg-status .mg-pnl-pos { color: var(--green); }
.ct-mg-status .mg-pnl-neg { color: var(--red); }
.card-section-box { border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; margin-top: 8px; padding: 6px 8px; background: rgba(255,255,255,0.02); }
.card-section-title { font-size: 9px; font-weight: 600; color: var(--text-dim); letter-spacing: 1.2px; padding: 2px 0 4px; }
.fav-in-candle { font-size: 11px; color: var(--text-dim); padding: 2px 0; }
.fav-candle-row { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.fav-in-candle:empty { display: none; }
.fav-candle-label { color: gold; font-size: 11px; }
.fav-candle-name { color: var(--text); text-decoration: underline; text-decoration-style: dotted; }
.fav-avg-price { opacity: 0.5; font-size: 0.9em; }
.sell-status {
  font-size: 10px;
  color: var(--text-dim);
  padding: 3px 6px;
  margin-top: 2px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  font-family: monospace;
  max-height: 60px;
  overflow-y: auto;
}
.sell-status.error { color: var(--red); }
.modal-body { font-size: 12px; }

.holder-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.holder-history-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--card-border);
  font-size: 10px;
  text-transform: uppercase;
}
.holder-history-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.holder-pnl-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}

/* Trade History */
.history-container { grid-column: 1 / -1; }

.trade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.trade-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--card-border);
}

.trade-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.trade-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.panel-sell-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.panel-sell-row .sell-btn {
  flex: 1;
}

.panel-pos {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
}

.panel-pos .pos-shares-val { color: var(--text); font-weight: 600; }
.panel-pos .pos-avg-val { color: var(--text); font-weight: 600; }
.panel-pos .pos-pnl-val { font-weight: 600; }

.candle-history-totals {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  margin-top: 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
}

.pager-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
}
.pager-btn:hover:not(:disabled) { background: rgba(255,255,255,0.15); }
.pager-btn:disabled { opacity: 0.3; cursor: default; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge.buy { background: rgba(0,255,163,0.15); color: var(--teal); }
.badge.sell { background: rgba(255,68,102,0.15); color: var(--red); }
.badge.up { background: rgba(0,255,163,0.15); color: var(--teal); }
.badge.down { background: rgba(255,68,102,0.15); color: var(--red); }

/* NHL Dashboard */
.nhl-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.nhl-game-card {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.3s;
}

.nhl-game-card:hover { border-color: var(--purple); }

.nhl-matchup {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.nhl-odds {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.nhl-outcome {
  flex: 1;
  text-align: center;
  padding: 8px;
  background: var(--bg2);
  border-radius: 8px;
  font-size: 13px;
}

.nhl-outcome .outcome-name { color: var(--text-dim); font-size: 11px; }
.nhl-outcome .outcome-price { font-weight: 600; font-size: 18px; margin-top: 4px; }

.nhl-bet-row {
  display: flex;
  gap: 8px;
}

.nhl-bet-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.nhl-bet-btn:hover { opacity: 0.85; }
.nhl-bet-btn.yes { background: var(--teal); color: #000; }
.nhl-bet-btn.no { background: var(--purple); color: #fff; }

/* Nav back */
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: color 0.2s;
}

.nav-back:hover { color: var(--text); }

/* Hidden utility */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  /* Layout — lock to viewport width */
  .dashboard { padding: 10px; max-width: 100vw; overflow-x: hidden; }
  .grid { gap: 12px; max-width: 100%; }
  .grid-btc { grid-template-columns: 1fr; }
  .card { max-width: 100%; overflow-x: hidden; }
  .bet-controls { grid-column: 1; }
  .bigroad-container { grid-column: 1; overflow: hidden; }
  .history-container { grid-column: 1; }

  /* Landing */
  .landing { gap: 16px; flex-direction: column; align-items: center; }
  .dash-card { width: 90%; max-width: 320px; padding: 32px 24px; }

  /* ── Header ── */
  .header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .header-left {
    flex-wrap: wrap;
    gap: 6px 16px;
    width: 100%;
    align-items: center;
  }
  .header-logo { font-size: 18px; }
  .header-balance { font-size: 15px; font-weight: 600; }
  .header-autosl { margin-top: 0; }
  .header-autosl .sl-input-sm { width: 52px; font-size: 14px; padding: 6px 8px; }
  .price-ticker {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
    align-items: center;
    overflow: hidden;
  }
  .price-main { font-size: 22px; font-weight: 700; }
  .price-exchanges { gap: 10px; font-size: 11px; }
  .price-exchanges .ex-price { gap: 3px; }

  /* ── Cards ── */
  .card { padding: 16px 14px; border-radius: 14px; }
  .card-title { font-size: 13px; margin-bottom: 14px; font-weight: 600; letter-spacing: 0.5px; }

  /* ── Candle header (Polymarket style) ── */
  .candle-header-poly { gap: 10px; margin-bottom: 12px; }
  .candle-logo { width: 40px; height: 40px; }
  .candle-header-title { font-size: 15px; }
  .candle-header-sub { font-size: 12px; }
  .market-header-row { margin-bottom: 4px; }
  .market-slug { font-size: 11px; opacity: 0.5; margin-top: 2px; }
  .market-prices-lg { gap: 24px; margin: 16px 0; }
  .market-prices-lg .market-price-item .label { font-size: 13px; margin-bottom: 4px; opacity: 0.6; }
  .market-prices-lg .market-price-item .val { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
  .val-delta { font-size: 17px; font-weight: 700; }
  .pie-wrap { transform: scale(1.1); }

  /* ── Bet Panels — stack vertically on mobile ── */
  .bet-panels { grid-template-columns: 1fr; gap: 14px; }
  .bet-panel { padding: 14px; border-radius: 12px; gap: 10px; }
  .panel-label { font-size: 14px; margin-bottom: 2px; }
  .panel-price-lg { font-size: 32px; font-weight: 700; }

  /* Wager buttons — full width row */
  .wager-row.compact { gap: 6px; flex-wrap: wrap; overflow: hidden; }
  .wager-row.compact .wager-btn {
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    min-height: 44px;
    flex: 1 1 0;
    min-width: 0;
    border-radius: 8px;
  }
  .wager-row.compact .wager-input { width: 64px; padding: 10px 6px; font-size: 14px; }
  .bet-panel .wager-input {
    font-size: 22px;
    padding: 14px 12px;
    border-radius: 10px;
  }

  /* BET buttons — big, bold, tappable */
  .submit-btn {
    padding: 16px 12px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 2px;
    min-height: 54px;
    border-radius: 12px;
  }

  /* Sell buttons */
  .sell-btn {
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    min-height: 46px;
    border-radius: 8px;
  }
  .panel-sell-row { gap: 8px; }

  /* Position display */
  .panel-pos { font-size: 13px; padding: 8px 10px; border-radius: 8px; }
  .panel-autosl { gap: 6px; flex-wrap: wrap; }
  .sl-input-sm { width: 64px; padding: 8px 10px; font-size: 14px; border-radius: 6px; }

  /* Sell status */
  .sell-status { font-size: 11px; }

  /* ── Big Road ── */
  .bigroad-title-row { flex-direction: column; gap: 6px; align-items: flex-start; }
  .bigroad-stats { font-size: 11px; gap: 4px 10px; }
  .bigroad-stats-right { justify-content: flex-start; }
  .bigroad-cell { width: 18px; height: 18px; }
  .bigroad-streak-hdr { width: 18px; height: 13px; font-size: 8px; }
  .tooltip, .bigroad-cell .tooltip, .bigroad-streak-hdr .tooltip {
    font-size: 16px;
    padding: 10px 14px;
    border-radius: 10px;
    line-height: 1.5;
  }

  /* ── Trade table (Candle P&L) ── */
  .trade-table { font-size: 12px; }
  .trade-table th { padding: 10px 6px; font-size: 10px; }
  .trade-table td { padding: 10px 6px; }
  .candle-history-totals { padding: 12px; font-size: 13px; flex-wrap: wrap; gap: 8px; }

  /* ── Favorites ── */
  .fav-header { grid-template-columns: 16px minmax(50px,1fr) 70px 70px 28px; gap: 0 4px; }
  .fav-header span { font-size: 10px; }
  .fav-header span:nth-child(1),
  .fav-header span:nth-child(2) { display: none; }
  .fav-row { grid-template-columns: 16px minmax(50px,1fr) 70px 70px 28px; gap: 0 4px; }
  .fav-row > *:nth-child(1) { display: none; }
  .fav-row > * { padding: 12px 0; }
  .fav-col { font-size: 13px; }
  .fav-name { font-size: 14px !important; }
  .fav-row .fav-remove { font-size: 18px; }

  /* ── Copy Trade ── */
  .ct-row { flex-wrap: wrap; }
  .ct-label { min-width: 44px; font-size: 10px; }
  .ct-amount-row { flex-wrap: wrap; }
  .ct-amt-btn { padding: 8px 12px; font-size: 12px; min-height: 36px; }
  .ct-start-btn { padding: 12px 0; font-size: 14px; }
  .ct-stop-btn { padding: 10px 0; font-size: 13px; }
  .ct-log { max-height: 120px; }

  /* Card sections */
  .card-trade-row { grid-template-columns: 44px 36px 1fr 60px 70px; font-size: 11px; }

  /* ── Modals ── */
  .modal-box { width: 95%; max-width: none; padding: 16px; border-radius: 14px; max-height: 90vh; overflow-x: hidden; }
  .modal-box canvas { max-width: 100% !important; height: auto !important; }
  .modal-title { font-size: 16px; }
  .modal-close { width: 40px; height: 40px; font-size: 22px; }
  .holder-history-table { font-size: 14px; }
  .holder-history-table th { padding: 8px 6px; font-size: 12px; }
  .holder-history-table td { padding: 8px 6px; }
  .holder-pnl-summary { font-size: 15px; gap: 12px; flex-wrap: wrap; }

  /* Nav */
  .nav-back { font-size: 14px; margin-bottom: 10px; }
}

/* ── Small phones (≤480px) ── */
@media (max-width: 480px) {
  .dashboard { padding: 8px; }
  .grid { gap: 10px; }

  /* Header compact */
  .header { padding: 10px 12px; gap: 8px; }
  .header-logo { font-size: 16px; }
  .header-balance { font-size: 14px; }
  .price-main { font-size: 20px; }
  .price-exchanges { gap: 8px; font-size: 10px; }

  /* Candle header */
  .candle-header-poly { gap: 8px; margin-bottom: 10px; }
  .candle-logo { width: 36px; height: 36px; border-radius: 6px; }
  .candle-header-title { font-size: 14px; }
  .candle-header-sub { font-size: 11px; }
  .market-prices-lg { gap: 18px; margin: 12px 0; }
  .market-prices-lg .market-price-item .val { font-size: 22px; }
  .val-delta { font-size: 15px; }

  /* Bet panels */
  .panel-price-lg { font-size: 28px; }
  .wager-row.compact .wager-btn { font-size: 13px; min-height: 42px; }
  .bet-panel .wager-input { font-size: 20px; padding: 12px 10px; }
  .submit-btn { font-size: 16px; padding: 14px 10px; min-height: 52px; }
  .sell-btn { font-size: 14px; min-height: 44px; }

  /* Favorites - hide less important columns */
  .fav-header { grid-template-columns: 14px 16px minmax(40px,1fr) 60px 28px; }
  .fav-header span:nth-child(5),
  .fav-header span:nth-child(6) { display: none; }
  .fav-row { grid-template-columns: 14px 16px minmax(40px,1fr) 60px 28px; }
  .fav-row > *:nth-child(5),
  .fav-row > *:nth-child(6) { display: none; }

  /* Modal */
  .modal-box { padding: 14px; }

  /* Trade table: hide shares column */
  .trade-table { font-size: 11px; }
  .trade-table th:nth-child(3),
  .trade-table td:nth-child(3) { display: none; }
  .trade-table th { padding: 8px 4px; }
  .trade-table td { padding: 8px 4px; }

  /* Bigroad */
  .bigroad-cell { width: 16px; height: 16px; }
  .bigroad-streak-hdr { width: 16px; height: 11px; }
  .bigroad-stats { font-size: 10px; }

  /* Card section history rows */
  .card-trade-row { grid-template-columns: 44px 36px 1fr 60px; }
  .card-trade-row span:nth-child(5) { display: none; }

  /* Copy trade */
  .ct-input { width: 60px; }
  .ct-select { font-size: 11px; }
}
