:root {
  --bg-0: #07090d;
  --bg-1: #0c1117;
  --bg-2: #11161f;
  --card: rgba(20, 26, 36, 0.72);
  --card-solid: #141a24;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e9edf3;
  --muted: #7d8896;
  --muted-2: #5b6573;
  --green: #2dd47a;
  --green-soft: #25b768;
  --green-glow: rgba(45, 212, 122, 0.35);
  --green-fill: rgba(45, 212, 122, 0.13);
  --red: #ff5d72;
  --red-soft: #e84860;
  --red-glow: rgba(255, 93, 114, 0.35);
  --red-fill: rgba(255, 93, 114, 0.13);
  --gold: #ffd54a;
  --gold-2: #f8b620;
  --accent: var(--gold);
  --shadow-1: 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
html, body { width: 100%; }
body { background:
  radial-gradient(1200px 600px at 80% -10%, rgba(255, 213, 74, 0.06), transparent 60%),
  radial-gradient(900px 500px at 0% 110%, rgba(45, 212, 122, 0.05), transparent 60%),
  linear-gradient(180deg, var(--bg-0), var(--bg-1));
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(255, 213, 74, 0.05), transparent 70%);
}

button, input, select { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.green { color: var(--green); }
.red { color: var(--red); }

/* ============================== TOPBAR ============================== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 10px 24px;
  gap: 24px;
  background: rgba(10, 13, 18, 0.78);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}
.topbar-left {
  display: flex; align-items: center; gap: 18px;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-weight: 800; font-size: 18px;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.01em;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}
.brand .logo {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1c1402; border-radius: 10px;
  font-weight: 900; font-size: 17px;
  box-shadow: 0 6px 18px rgba(255, 213, 74, 0.25);
}
.nav-toggle {
  display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  width: 38px; height: 38px;
  margin-left: 4px;
  order: 99;
}
.nav-toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: background 0.15s;
}
.nav-toggle:hover span { background: var(--accent); }

.market-picker {
  display: flex; align-items: center; gap: 10px;
  justify-self: center;
}
.market-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 9px 16px;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.market-btn:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--accent); }
.market-btn:active { transform: translateY(1px); }
.market-icon {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1c1402;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}
.caret { color: var(--muted); font-size: 11px; margin-left: 2px; }

.auth-actions {
  display: flex; align-items: center; gap: 8px;
  justify-self: end;
}
.balance {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 213, 74, 0.08), rgba(255, 213, 74, 0.02));
  border: 1px solid rgba(255, 213, 74, 0.18);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.bal-icon { color: var(--accent); }

button {
  cursor: pointer;
  border: 0;
  font-weight: 600;
}
button.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1300;
  padding: 9px 18px; border-radius: 10px;
  font-weight: 800; font-size: 13px;
  box-shadow: 0 6px 18px rgba(255, 213, 74, 0.22);
  transition: transform 0.06s, box-shadow 0.2s;
}
button.primary:hover { box-shadow: 0 8px 22px rgba(255, 213, 74, 0.32); }
button.primary:active { transform: translateY(1px); }

button.ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 14px; border-radius: 10px;
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s;
}
button.ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--border-strong); }

.icon-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  width: 38px; height: 38px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text);
}
.btn-icon { margin-right: 4px; }

/* ============================== LAYOUT ============================== */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  padding: 16px;
  width: 100%;
  align-items: start;
}

/* ============================== CHART PANEL ============================== */
.chart-panel {
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  box-shadow: var(--shadow-2);
}

.info-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding-bottom: 8px;
}
.info-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  align-items: baseline;
}
.info-block.right { text-align: right; }
.info-block.right { grid-template-columns: 1fr auto; }
.info-block .val { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.info-block .small { color: var(--muted); }
.info-center { text-align: center; }
.ratio {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  font-size: 30px; font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}
.ratio .green { text-shadow: 0 0 22px var(--green-glow); }
.ratio .red { text-shadow: 0 0 22px var(--red-glow); }
.ratio-labels {
  display: flex; justify-content: space-between;
  margin-top: 2px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0 18%;
}
.vs-mini {
  width: 42px; height: 42px;
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(255, 213, 74, 0.25), inset 0 0 12px rgba(255, 213, 74, 0.1);
}
.bars { display: flex; align-items: end; gap: 2.5px; height: 20px; }
.bars span { width: 3px; background: var(--accent); border-radius: 2px; }
.bars .b1 { height: 40%; }
.bars .b2 { height: 100%; }
.bars .b3 { height: 65%; }

.round-status {
  position: absolute; left: 28px; top: 138px;
  z-index: 3; pointer-events: none;
}
.round-status > div:first-child {
  font-weight: 800; font-size: 19px;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.01em;
}

.chart-wrap {
  position: relative;
  height: clamp(320px, 46vh, 460px);
  margin-top: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, var(--green-fill) 0%, var(--green-fill) 49.7%,
                           transparent 49.7%, transparent 50.3%,
                           var(--red-fill) 50.3%, var(--red-fill) 100%);
}
.chart-wrap::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  z-index: 2;
  opacity: 0.7;
  box-shadow: 0 0 12px rgba(255, 213, 74, 0.4);
}
.chart-wrap::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 60px 40px;
  pointer-events: none;
  z-index: 1;
}
.chart-wrap canvas {
  position: relative; z-index: 2;
  width: 100% !important;
  height: 100% !important;
}

.price-tag {
  position: absolute;
  padding: 7px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1300;
  font-weight: 800; font-size: 13px;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  z-index: 3;
  font-variant-numeric: tabular-nums;
  font-family: 'Space Grotesk', monospace;
}
.price-tag.start { left: 10px; bottom: 50%; transform: translateY(50%); }
.price-tag.live { right: 10px; top: 28%; }
.price-tag .muted { color: rgba(28, 20, 2, 0.7); }

.stats-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stats-row .dots { display: flex; gap: 5px; margin-left: auto; }
.stats-row .dots span {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.stats-row .dots .up {
  background: var(--green-fill); color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 122, 0.4);
}
.stats-row .dots .down {
  background: var(--red-fill); color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(255, 93, 114, 0.4);
}

.tabs { display: flex; gap: 24px; padding: 12px 0 6px; }
.tab {
  background: transparent; border: 0; color: var(--muted);
  padding: 8px 0; font-weight: 700; font-size: 14px;
  position: relative; transition: color 0.15s;
}
.tab.active { color: var(--text); }
.tab.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2.5px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  border-radius: 2px;
}
.tab-panel { padding-top: 12px; }
.tab-panel.hidden { display: none; }
.list-empty {
  text-align: center; color: var(--muted);
  padding: 32px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
}
.lb-filters { display: flex; gap: 8px; margin-bottom: 10px; }
.lb-filters select {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px;
  font-size: 13px;
}
.lb-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lb-table { width: 100%; border-collapse: collapse; min-width: 460px; }
.lb-table th, .lb-table td {
  padding: 10px 6px; text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.lb-table th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.lb-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ============================== BET PANEL ============================== */
.bet-panel {
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-2);
}
.prize-pool {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(255, 213, 74, 0.08), rgba(255, 213, 74, 0.02));
  border: 1px solid rgba(255, 213, 74, 0.16);
  padding: 12px; border-radius: var(--radius-sm);
}
.prize-icon { font-size: 28px; line-height: 1; }
.prize-pool .big {
  font-size: 22px; font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  font-variant-numeric: tabular-nums;
}
.prize-timer { text-align: right; }
.timer {
  font-weight: 900; font-size: 22px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

.vs-bar {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 10px;
  background: linear-gradient(90deg, var(--green-fill), transparent 50%, var(--red-fill));
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 700;
  border: 1px solid var(--border);
}
.vs-up { color: var(--green); font-weight: 800; }
.vs-down { color: var(--red); text-align: right; font-weight: 800; }
.vs-mid {
  color: var(--accent); font-size: 12px; font-weight: 900;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  background: rgba(255, 213, 74, 0.12);
  border-radius: 6px;
}

.traders-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.traders-col {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 10px;
  min-height: 110px;
  border: 1px solid var(--border);
}
.traders-col.up { border-left: 2px solid var(--green); }
.traders-col.down { border-left: 2px solid var(--red); }
.traders-head {
  font-size: 11px; font-weight: 700; margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.traders-list { display: flex; flex-wrap: wrap; gap: 5px; }
.trader-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 4px 9px; border-radius: 14px;
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.trader-chip .av {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1300;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 9px;
}

.bet-input { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.bet-label {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 13px;
}
.amount-row {
  display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px; gap: 8px;
  transition: border-color 0.15s;
}
.amount-row:focus-within { border-color: var(--accent); }
.amount-row input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; color: var(--text);
  font-size: 20px; font-weight: 800;
  outline: none;
  font-variant-numeric: tabular-nums;
  font-family: 'Space Grotesk', sans-serif;
}
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
.usdt-icon {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1300;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}
.mini {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 10px; border-radius: 7px;
  font-size: 12px; font-weight: 700;
  transition: background 0.15s, border-color 0.15s;
}
.mini:hover { background: rgba(255, 213, 74, 0.1); border-color: var(--accent); color: var(--accent); }

.quick-amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.quick-amounts button {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 0; border-radius: 8px;
  font-size: 12px; font-weight: 700;
  transition: all 0.15s;
}
.quick-amounts button:hover { background: rgba(255, 213, 74, 0.1); border-color: var(--accent); color: var(--accent); }

.bet-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-up, .big-down {
  border: 0;
  padding: 18px 12px;
  font-size: 17px; font-weight: 900;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.08s, filter 0.2s, box-shadow 0.2s;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
}
.big-up {
  background: linear-gradient(135deg, var(--green), var(--green-soft));
  color: #02331a;
  box-shadow: 0 8px 22px rgba(45, 212, 122, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.big-down {
  background: linear-gradient(135deg, var(--red), var(--red-soft));
  color: #380816;
  box-shadow: 0 8px 22px rgba(255, 93, 114, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.big-up .arrow, .big-down .arrow { font-size: 19px; font-weight: 900; }
.big-up:hover, .big-down:hover { filter: brightness(1.08); }
.big-up:active, .big-down:active { transform: translateY(1px); }
.big-up:disabled, .big-down:disabled {
  opacity: 0.4; cursor: not-allowed; filter: grayscale(0.4);
  box-shadow: none;
}

/* ============================== MOBILE NAV ============================== */
.mobile-nav {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(7, 9, 13, 0.85);
  backdrop-filter: blur(16px);
  padding: 16px;
}
.mobile-nav-inner {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 60px;
  box-shadow: var(--shadow-2);
}
.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);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.18s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--card-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 400px; max-width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.4, 1.2);
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card.wide { width: 560px; }
.modal-head {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.tab-btn {
  background: transparent; color: var(--muted);
  font-weight: 700; font-size: 14px;
  padding: 6px 0;
  position: relative;
}
.tab-btn.active { color: var(--text); }
.tab-btn.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -8px;
  height: 2.5px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}
.close {
  position: absolute; right: 10px; top: 8px;
  background: transparent; color: var(--muted);
  font-size: 26px; line-height: 1;
  padding: 4px 10px; border-radius: 8px;
}
.close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.modal-body {
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.modal-body input, .modal-body select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  outline: none; font-size: 14px;
  transition: border-color 0.15s;
}
.modal-body input:focus { border-color: var(--accent); }
.modal-body button.big { padding: 12px; font-size: 15px; }
.error { color: var(--red); font-size: 12px; min-height: 16px; }

.qr-row {
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 12px; border-radius: var(--radius-sm);
}
.copy-btn {
  background: rgba(255, 213, 74, 0.1);
  border: 1px solid rgba(255, 213, 74, 0.3);
  color: var(--accent);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 11px; font-weight: 700;
}
.copy-btn:hover { background: rgba(255, 213, 74, 0.2); }
.code-line {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-size: 12px;
  word-break: break-all;
}
.deposit-note { font-size: 11px; color: var(--muted); line-height: 1.5; }

.market-menu {
  position: absolute;
  background: var(--card-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  z-index: 40;
  min-width: 220px;
  padding: 6px;
  animation: pop 0.16s ease-out;
}
.market-menu .item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.market-menu .item:hover { background: rgba(255, 213, 74, 0.08); }
.market-menu .item.disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================== TOAST ============================== */
.toast {
  position: fixed; bottom: calc(20px + var(--safe-bottom)); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-solid);
  border: 1px solid var(--border-strong);
  padding: 12px 18px; border-radius: 10px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  font-size: 13px; font-weight: 600;
  pointer-events: none;
  box-shadow: var(--shadow-2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); box-shadow: 0 8px 22px var(--green-glow); }
.toast.error { border-color: var(--red); box-shadow: 0 8px 22px var(--red-glow); }

/* ============================== ADMIN ============================== */
.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(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-1);
}
.admin-card .big {
  font-size: 22px; font-weight: 800; margin-top: 4px;
  font-family: 'Space Grotesk', sans-serif;
  font-variant-numeric: tabular-nums;
}
.admin-section {
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-1);
  overflow-x: auto;
}
.admin-section h3 { margin: 0 0 14px; font-weight: 700; }
.admin-section table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
.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-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-section .row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 12px;
}
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.admin-section input[type=number], .admin-section input[type=text], .admin-section select, .admin-section input:not([type=checkbox]) {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}

/* ============================== RESPONSIVE ============================== */
@media (max-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .topbar { padding: 10px 18px; gap: 16px; }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    padding-bottom: calc(28px + var(--safe-bottom));
    min-height: auto;
  }
  .bet-panel { position: static; }
  .chart-wrap { min-height: 280px; }
  .info-row { grid-template-columns: 1fr; row-gap: 8px; text-align: center; }
  .info-block.right { text-align: center; }
  .info-block.left, .info-block.right {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
    align-items: baseline; text-align: left;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
  }
  .info-block .val { font-size: 14px; margin: 0; }
  .info-block .small { margin: 0; }
  .info-block.right { text-align: left; }
}

@media (max-width: 720px) {
  body { font-size: 13px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .brand-text { display: none; }
  .market-picker { flex: 1; justify-content: center; }
  .market-btn { padding: 7px 10px; font-size: 13px; }

  /* Hide all secondary auth buttons - go in mobile nav */
  .auth-actions #walletBtn,
  .auth-actions #referralBtn,
  .auth-actions #logoutBtn,
  .auth-actions #signupBtn,
  .auth-actions #loginBtn { display: none !important; }
  .balance { padding: 5px 9px; font-size: 12px; }
  .balance .small { display: none; }

  .chart-panel { padding: 12px; border-radius: 12px; }
  .chart-wrap { height: 280px; }
  .ratio { font-size: 22px; gap: 10px; }
  .vs-mini { width: 34px; height: 34px; }
  .ratio-labels { padding: 0 6%; }
  .round-status { left: 14px; top: 110px; }
  .round-status > div:first-child { font-size: 15px; }
  .price-tag { font-size: 11px; padding: 5px 8px; }

  .stats-row { font-size: 11px; gap: 10px; }
  .stats-row > div:not(.dots) { flex: 1 1 45%; }

  .lb-table { min-width: 380px; font-size: 11px; }

  .bet-panel { padding: 12px; border-radius: 12px; gap: 10px; }
  .prize-pool { padding: 10px; }
  .prize-pool .big { font-size: 18px; }
  .timer { font-size: 18px; }
  .big-up, .big-down { padding: 16px 8px; font-size: 16px; }
  .amount-row input { font-size: 18px; }
  .quick-amounts button { padding: 9px 0; }

  /* Modals: full-width bottom sheet feel */
  .modal { padding: 0; align-items: flex-end; }
  .modal-card, .modal-card.wide {
    width: 100%; max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 92vh; overflow-y: auto;
    padding-bottom: var(--safe-bottom);
  }
}

@media (max-width: 480px) {
  .market-btn span:not(.market-icon):not(.caret) { font-size: 13px; }
  .info-block .val { font-size: 13px; }
  .traders-row { gap: 6px; }
  .traders-col { padding: 8px; min-height: 90px; }
  .quick-amounts { grid-template-columns: repeat(5, 1fr); }
  .quick-amounts button { font-size: 11px; padding: 8px 0; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
