/* ============ NovaTrade — dark trading theme ============ */

:root {
  --bg: #0b0f19;
  --bg-2: #10182a;
  --panel: #141c30;
  --panel-2: #1a2440;
  --border: #232f4e;
  --text: #e7ecf5;
  --muted: #8493b3;
  --accent: #2f7cf6;
  --up: #0ecb81;
  --up-hover: #12e392;
  --down: #f6465d;
  --down-hover: #ff5d72;
  --gold: #f7b32b;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-size: 14px;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea {
  font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
textarea { line-height: 1.6; resize: vertical; }
/* native dropdown arrow + dark popup list */
select { appearance: none; -webkit-appearance: none; color-scheme: dark; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238493b3' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ============ Auth ============ */
.auth-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 700px at 70% -10%, #16224a 0%, var(--bg) 55%);
  z-index: 50;
}
.auth-bg {
  position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background-image:
    linear-gradient(rgba(60,90,160,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60,90,160,.12) 1px, transparent 1px);
  background-size: 44px 44px;
}
.auth-card {
  position: relative; width: 400px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 32px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.auth-logo { font-size: 30px; font-weight: 800; letter-spacing: 1px; text-align: center; }
.auth-logo span { color: var(--accent); }
.auth-tagline { color: var(--muted); text-align: center; margin: 8px 0 24px; font-size: 13px; line-height: 1.5; }
.auth-tabs { display: flex; background: var(--bg-2); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.auth-tab { flex: 1; padding: 9px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.auth-tab.active { background: var(--accent); color: #fff; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.auth-error {
  background: rgba(246,70,93,.12); border: 1px solid rgba(246,70,93,.4);
  color: #ff8fa0; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
.btn-primary {
  width: 100%; padding: 12px; border-radius: 10px; background: var(--accent);
  color: #fff; font-weight: 700; font-size: 15px; transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.auth-note { margin-top: 18px; text-align: center; color: var(--muted); font-size: 12.5px; }
.auth-note b { color: var(--up); }

.forgot-link {
  display: block; margin: -4px 0 4px auto; color: var(--accent);
  font-size: 12.5px; font-weight: 600; padding: 2px 0;
}
.forgot-link:hover { text-decoration: underline; }

/* OTP step */
.otp-info { text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.6; margin-bottom: 16px; }
.otp-info b { color: var(--text); }
.otp-dev {
  background: rgba(247,179,43,.1); border: 1px solid rgba(247,179,43,.35); color: var(--gold);
  border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px; line-height: 1.5;
}
.otp-input {
  text-align: center; font-size: 24px; font-weight: 800; letter-spacing: 12px;
  font-variant-numeric: tabular-nums;
}
.otp-actions { display: flex; justify-content: space-between; margin: 4px 0 14px; }
.otp-actions button { color: var(--accent); font-size: 13px; font-weight: 600; padding: 4px 2px; }
.otp-actions button:disabled { color: var(--muted); cursor: default; }
.otp-actions button:not(:disabled):hover { text-decoration: underline; }

/* ============ Layout ============ */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.body { display: flex; flex: 1; min-height: 0; }

/* ============ Topbar ============ */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  position: relative; z-index: 20;
}
.logo { font-weight: 800; font-size: 18px; letter-spacing: .5px; margin-right: 6px; }
.logo span { color: var(--accent); }
.topbar-spacer { flex: 1; }

.asset-btn {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px;
  transition: border-color .15s;
}
.asset-btn:hover { border-color: var(--accent); }
.asset-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px var(--up); }
.asset-btn-payout { color: var(--up); font-size: 12px; font-weight: 700; }
.live-badge {
  background: rgba(246,70,93,.14); color: var(--down);
  font-size: 10px; font-weight: 800; letter-spacing: .6px;
  padding: 2px 7px; border-radius: 6px; animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
/* OTC = synthetic instrument, open 24/7. Deliberately styled differently
   from the LIVE badge so real market data is never confused with it. */
.otc-badge {
  background: rgba(247,179,43,.16); color: #f7b32b;
  font-size: 10px; font-weight: 800; letter-spacing: .6px;
  padding: 2px 7px; border-radius: 6px;
}
.asset-btn svg { color: var(--muted); }

.balance-box {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 10px; cursor: pointer;
}
.balance-label { font-size: 10px; color: var(--gold); font-weight: 800; letter-spacing: .5px; }
.balance-label.live { color: var(--up); }
.balance-amount { font-weight: 700; font-size: 15px; }
.balance-box > svg { color: var(--muted); }
.balance-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 240px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 50px rgba(0,0,0,.5); padding: 6px; cursor: default;
}
.balance-option {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.balance-option:hover { background: rgba(255,255,255,.04); }
.bo-name { font-size: 13px; font-weight: 600; }
.bo-amount { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bo-check { color: var(--up); font-weight: 700; }
.balance-reset {
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px;
  color: var(--accent); font-weight: 600; font-size: 13px;
}
.balance-reset:hover { background: rgba(47,124,246,.1); }
.balance-actions { display: flex; gap: 6px; padding: 6px 6px 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.balance-actions button { flex: 1; padding: 9px; border-radius: 8px; font-weight: 700; font-size: 12.5px; }
.ba-deposit { background: var(--up); color: #04121c; }
.ba-deposit:hover { background: var(--up-hover); }
.ba-withdraw { border: 1px solid var(--border); color: var(--text); }
.ba-withdraw:hover { border-color: var(--accent); }

.btn-deposit {
  background: var(--up); color: #04121c; font-weight: 800; font-size: 13px;
  padding: 10px 18px; border-radius: 10px; transition: background .15s;
}
.btn-deposit:hover { background: var(--up-hover); }
.btn-withdraw {
  border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 13px;
  padding: 9px 16px; border-radius: 10px;
}
.btn-withdraw:hover { border-color: var(--accent); }

.user-box { position: relative; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #7b4ff6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; cursor: pointer; user-select: none;
}
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 220px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 50px rgba(0,0,0,.5); padding: 12px;
}
.um-name { font-weight: 700; }
.um-email { color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.user-menu hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.user-menu button {
  display: block; width: 100%; text-align: left; padding: 8px 10px;
  border-radius: 8px; font-size: 13px; font-weight: 600;
}
.user-menu button:hover { background: rgba(255,255,255,.05); }
.user-menu button.danger { color: var(--down); }

/* ============ Rail ============ */
.rail {
  width: 68px; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding-top: 10px; gap: 4px;
}
.rail-btn {
  width: 56px; padding: 9px 0 7px; border-radius: 10px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn span { font-size: 10px; font-weight: 600; }
.rail-btn:hover { color: var(--text); background: rgba(255,255,255,.04); }
.rail-btn.active { color: var(--accent); background: rgba(47,124,246,.12); }

/* ============ Chart ============ */
.chart-area { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 6px;
}
.tf-group {
  display: flex; gap: 4px; background: var(--panel); border-radius: 9px; padding: 3px;
  overflow-x: auto; scrollbar-width: none; /* 7 buttons: scroll on narrow screens */
  min-width: 0; /* allow shrinking inside the flex row so it scrolls instead of overflowing */
}
.tf-group::-webkit-scrollbar { display: none; }
.tf-btn { flex-shrink: 0; }
.tf-btn { padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tf-btn:hover { color: var(--text); }
.tf-btn.active { background: var(--accent); color: #fff; }
.chart-asset-info { display: flex; align-items: center; gap: 12px; }
.chart-price { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart-price.up { color: var(--up); }
.chart-price.down { color: var(--down); }
.chart-wrap { flex: 1; position: relative; min-height: 0; }
#chart { position: absolute; inset: 0; }

/* Countdown to the current candle's close. Sits over the chart, top-right,
   and must never swallow clicks meant for the chart underneath. */
.candle-timer {
  /* Left-aligned on purpose: the right edge belongs to the price scale, and
     overlaying it hides the topmost price label. */
  position: absolute; top: 10px; left: 12px; z-index: 3; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  background: rgba(13, 20, 33, .82); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 9px; backdrop-filter: blur(4px);
}
.candle-timer .ct-label {
  font-size: 9px; font-weight: 800; letter-spacing: .7px; color: var(--muted);
}
.candle-timer .ct-value {
  font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums;
  min-width: 42px; text-align: right; color: var(--text);
}
.candle-timer .ct-bar {
  display: block; width: 46px; height: 4px; border-radius: 3px;
  background: rgba(255,255,255,.12); overflow: hidden;
}
.candle-timer .ct-bar i {
  display: block; height: 100%; width: 100%; border-radius: 3px;
  background: var(--up); transition: width .2s linear;
}
/* Final stretch of the candle — the moment that decides short trades */
.candle-timer.ending .ct-value { color: var(--down); }
.candle-timer.ending .ct-bar i { background: var(--down); }
@media (max-width: 560px) {
  .candle-timer { top: 6px; left: 8px; padding: 4px 8px; gap: 6px; }
  .candle-timer .ct-label { display: none; }
  .candle-timer .ct-bar { width: 32px; }
}
.mobile-trades-btn {
  display: none; background: var(--panel); border: 1px solid var(--border);
  padding: 7px 12px; border-radius: 9px; font-size: 12px; font-weight: 700;
}

/* ============ Trade panel ============ */
.panel {
  width: 300px; background: var(--panel); border-left: 1px solid var(--border);
  padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto;
}
.panel-asset { display: flex; justify-content: space-between; align-items: baseline; }
.pa-name { font-weight: 800; font-size: 16px; }
.pa-payout { color: var(--muted); font-size: 12px; }
.pa-payout b { color: var(--up); font-size: 14px; }

.control label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 6px; letter-spacing: .3px; text-transform: uppercase; }
.stepper {
  display: flex; align-items: stretch; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; height: 46px;
}
.stepper button {
  width: 46px; font-size: 22px; color: var(--muted); flex-shrink: 0;
  transition: background .1s;
}
.stepper button:hover { background: rgba(255,255,255,.06); color: var(--text); }
.stepper-value {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.stepper-value .cur { color: var(--muted); margin-right: 2px; font-weight: 600; }
.stepper-value input {
  background: none; border: none; width: 76px; text-align: center;
  font-weight: 800; font-size: 17px; padding: 0;
}

.profit-preview {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; display: flex; align-items: baseline; gap: 8px;
}
.pp-label { color: var(--muted); font-size: 12px; flex: 1; }
.pp-value { font-weight: 800; font-size: 17px; color: var(--up); }
.pp-pct { color: var(--up); font-size: 12px; font-weight: 700; }

.btn-up, .btn-down {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px; border-radius: 12px; font-size: 17px; font-weight: 800; color: #fff;
  transition: transform .06s, background .15s;
}
.btn-up { background: var(--up); color: #03130b; }
.btn-up:hover { background: var(--up-hover); }
.btn-down { background: var(--down); }
.btn-down:hover { background: var(--down-hover); }
.btn-up:active, .btn-down:active { transform: scale(.97); }
.btn-up:disabled, .btn-down:disabled { opacity: .5; cursor: not-allowed; }

/* ============ Trades list ============ */
.trades { flex: 1; display: flex; flex-direction: column; min-height: 160px; }
.trades-tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 3px; border-radius: 9px; margin-bottom: 8px; }
.trades-tab { flex: 1; padding: 7px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--muted); }
.trades-tab.active { background: var(--panel-2); color: var(--text); }
.badge {
  background: var(--accent); color: #fff; border-radius: 9px; font-size: 10px;
  padding: 1px 6px; margin-left: 3px;
}
.trades-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.trade-item {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; display: flex; align-items: center; gap: 10px; font-size: 12.5px;
}
.trade-arrow { font-size: 15px; }
.trade-arrow.up { color: var(--up); }
.trade-arrow.down { color: var(--down); }
.trade-mid { flex: 1; min-width: 0; }
.trade-asset { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trade-sub { color: var(--muted); font-size: 11px; margin-top: 1px; }
.trade-right { text-align: right; }
.trade-amt { font-weight: 700; }
.trade-result { font-size: 11.5px; font-weight: 700; margin-top: 1px; }
.trade-result.won { color: var(--up); }
.trade-result.lost { color: var(--down); }
.trade-result.draw { color: var(--muted); }
.trade-countdown { color: var(--gold); font-weight: 700; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.trades-empty { color: var(--muted); text-align: center; padding: 24px 8px; font-size: 12.5px; }

/* ============ Modals ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4,8,18,.7); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 40;
}
.modal {
  width: 440px; max-width: calc(100vw - 28px); max-height: 82vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { font-size: 17px; }
.modal-close { color: var(--muted); font-size: 15px; padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: rgba(255,255,255,.06); color: var(--text); }
.modal-sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; line-height: 1.5; }
.modal-search { margin-bottom: 12px; }
.modal .btn-primary { margin-top: 4px; }

.quick-amounts { display: flex; gap: 8px; margin-bottom: 14px; }
.quick-amounts button {
  flex: 1; padding: 9px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; font-weight: 700; font-size: 13px;
}
.quick-amounts button:hover { border-color: var(--accent); }

.asset-list { display: flex; flex-direction: column; gap: 2px; }
.asset-group-label {
  font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .6px;
  text-transform: uppercase; padding: 10px 8px 4px;
}
.asset-row {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 9px; cursor: pointer;
}
.asset-row:hover { background: rgba(255,255,255,.05); }
.asset-row.active { background: rgba(47,124,246,.14); }
.asset-row-name { flex: 1; font-weight: 600; }
.asset-row-price { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.asset-row-payout { color: var(--up); font-weight: 800; font-size: 13px; width: 44px; text-align: right; }

.leaderboard { display: flex; flex-direction: column; gap: 4px; }
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  background: var(--bg-2); border-radius: 9px;
}
.lb-rank { width: 24px; font-weight: 800; color: var(--muted); }
.lb-row:nth-child(1) .lb-rank { color: var(--gold); }
.lb-row:nth-child(2) .lb-rank { color: #c8d3e8; }
.lb-row:nth-child(3) .lb-rank { color: #d98e4a; }
.lb-name { flex: 1; font-weight: 600; }
.lb-profit { color: var(--up); font-weight: 800; font-variant-numeric: tabular-nums; }
.lb-row.lb-you { background: rgba(47,124,246,.16); border: 1px solid var(--accent); }
.lb-row.lb-you .lb-name { color: var(--accent); }

/* Your standing box on top of the leaderboard (Quotex-style) */
.lb-standing {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px;
}
.lb-me-avwrap { position: relative; flex-shrink: 0; }
.lb-me-av {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7b4ff6);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff;
}
.lb-me-flag {
  position: absolute; bottom: -3px; right: -4px; font-size: 14px;
  background: var(--bg-2); border-radius: 50%; line-height: 1; padding: 1px;
}
.lb-me-info { flex: 1; min-width: 0; }
.lb-me-name { font-weight: 700; font-size: 14px; }
.lb-me-pos { color: var(--muted); font-size: 12px; margin-top: 2px; }
.lb-me-pos b { color: var(--text); }
.lb-me-pnl { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.lb-me-pnl.up { color: var(--up); }
.lb-me-pnl.down { color: var(--down); }

.tx-list { display: flex; flex-direction: column; gap: 6px; }
.tx-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--bg-2); border-radius: 9px; font-size: 13px;
}
.tx-type { flex: 1; font-weight: 700; text-transform: capitalize; }
.tx-time { color: var(--muted); font-size: 12px; }
.tx-amt { font-weight: 800; }
.tx-amt.pos { color: var(--up); }
.tx-amt.neg { color: var(--down); }
.tx-badge {
  background: rgba(247,179,43,.16); color: var(--gold); font-size: 10px; font-weight: 800;
  padding: 1px 6px; border-radius: 5px; text-transform: uppercase; letter-spacing: .4px; margin-left: 6px;
}

/* Binance Pay deposit box */
.binance-pay {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; margin-bottom: 14px;
}
.bp-title { margin-bottom: 8px; font-size: 13.5px; font-weight: 800; }
.bp-steps ol { margin: 0 0 4px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.bp-steps li { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.bp-steps li b { color: var(--text); }
.bp-qr { text-align: center; margin-top: 12px; }
.bp-qr img {
  width: 210px; max-width: 70%; height: auto; border-radius: 12px;
  background: #fff; padding: 10px; display: inline-block;
}
.bp-qr-missing {
  padding: 40px 12px; color: var(--muted); font-size: 12.5px;
  border: 1px dashed var(--border); border-radius: 12px;
}
.bp-qr-cap { display: block; margin-top: 8px; color: var(--gold); font-size: 12px; font-weight: 700; }

.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }

/* Deposit "being confirmed" banner */
.dep-banner {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  background: rgba(247,179,43,.1); border: 1px solid rgba(247,179,43,.35);
  color: var(--gold); border-radius: 10px; padding: 11px 13px; font-size: 12.5px; line-height: 1.5;
}
.dep-banner-spin {
  width: 15px; height: 15px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid rgba(247,179,43,.35); border-top-color: var(--gold);
  animation: qr-rot .8s linear infinite;
}
.promo-hint { color: var(--up); font-weight: 700; font-size: 11px; }
.wd-bonus-warn {
  background: rgba(246,70,93,.1); border: 1px solid rgba(246,70,93,.32); color: #ff9daa;
  border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.5; margin-bottom: 14px;
}
.wd-bonus-warn b { color: #ffc2ca; }

/* QR loading spinner */
.qr-spin {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 120px; color: var(--muted); font-size: 12.5px;
}
.qr-spin span {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: qr-rot .8s linear infinite;
}
@keyframes qr-rot { to { transform: rotate(360deg); } }

/* USDT BEP20 deposit */
.usdt-warn {
  background: rgba(246,70,93,.1); border: 1px solid rgba(246,70,93,.3); color: #ff9daa;
  border-radius: 8px; padding: 8px 11px; font-size: 12px; margin-top: 10px; line-height: 1.5;
}
.usdt-warn b { color: #ffc2ca; }
.usdt-address-row {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px;
}
.usdt-address-row code {
  flex: 1; font-size: 12px; word-break: break-all; color: var(--text);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}
.usdt-address-row button {
  background: var(--accent); color: #fff; font-weight: 700; font-size: 12px;
  padding: 7px 13px; border-radius: 7px; flex-shrink: 0;
}
.usdt-address-row button:hover { filter: brightness(1.12); }

/* Payment method tiles */
.pm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.pm-grid-3 { grid-template-columns: repeat(3, 1fr); }
.pm-grid-3 .pm-tile { padding: 12px 6px 10px; }
.pm-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 8px 12px; position: relative; transition: border-color .12s, background .12s;
}
.pm-tile:not(.disabled):hover { border-color: var(--accent); }
.pm-tile.active { border-color: var(--accent); background: rgba(47,124,246,.08); }
.pm-tile.disabled { opacity: .55; cursor: not-allowed; }
.pm-icon { height: 28px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pm-usdt {
  width: 28px; height: 28px; border-radius: 50%; background: #26a17b; color: #fff;
  font-weight: 800; font-size: 17px; line-height: 1;
}
.pm-icon-sm { width: 20px; height: 20px; font-size: 13px; display: inline-flex; vertical-align: -4px; }
.pm-name { font-weight: 700; font-size: 12.5px; }
.pm-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .4px; padding: 2px 7px; border-radius: 5px;
  background: rgba(140,160,200,.14); color: var(--muted);
}
.pm-tag-bep { background: rgba(240,185,11,.15); color: #f0b90b; }
.pm-tag-trc { background: rgba(194,54,49,.18); color: #ff7a75; }
.pm-soon {
  font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  background: rgba(247,179,43,.15); color: var(--gold); padding: 2px 7px; border-radius: 5px;
}

.modal-back {
  color: var(--muted); font-size: 17px; padding: 2px 10px 4px; border-radius: 7px; margin-right: 2px;
}
.modal-back:hover { background: rgba(255,255,255,.06); color: var(--text); }
#binance-pay-modal .modal-head h3, #crypto-modal .modal-head h3 { flex: 1; }

/* Admin panel */
.modal-wide { width: 680px; }
.admin-tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 3px; border-radius: 9px; margin-bottom: 14px; }
.admin-tab { flex: 1; padding: 8px; border-radius: 7px; font-size: 13px; font-weight: 700; color: var(--muted); }
.admin-tab.active { background: var(--panel-2); color: var(--text); }
.admin-pane { max-height: 62vh; overflow-y: auto; }
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.user-row .ar-stats { color: var(--muted); font-size: 11px; margin-top: 3px; }
.ar-bal { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ar-bal b { color: var(--text); font-size: 13px; }
.bl-label { font-size: 9px; font-weight: 800; letter-spacing: .4px; }
.ar-bal div:first-child .bl-label { color: var(--up); }
.admin-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px;
}
.ar-type { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.ar-type.deposit { background: rgba(14,203,129,.14); color: var(--up); }
.ar-type.withdrawal { background: rgba(246,70,93,.14); color: var(--down); }
.ar-mid { flex: 1; min-width: 180px; }
.ar-user { font-weight: 700; font-size: 13px; }
.ar-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; word-break: break-all; }
.ar-amt { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.ar-actions { display: flex; gap: 6px; }
.ar-approve {
  background: var(--up); color: #03130b; font-weight: 800; font-size: 12px;
  padding: 8px 14px; border-radius: 8px;
}
.ar-approve:hover { background: var(--up-hover); }
.ar-reject {
  border: 1px solid rgba(246,70,93,.5); color: var(--down); font-weight: 700; font-size: 12px;
  padding: 7px 12px; border-radius: 8px;
}
.ar-reject:hover { background: rgba(246,70,93,.12); }
.ar-approve:disabled, .ar-reject:disabled { opacity: .5; cursor: wait; }

.help-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; line-height: 1.5; }
.up-text { color: var(--up); font-weight: 800; }
.down-text { color: var(--down); font-weight: 800; }

/* ============ Toasts ============ */
.toasts {
  position: fixed; top: 68px; right: 16px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--panel-2); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 12px 16px; min-width: 240px; max-width: 320px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); font-size: 13px;
  animation: toast-in .25s ease;
}
.toast.win { border-left-color: var(--up); }
.toast.loss { border-left-color: var(--down); }
.toast.error { border-left-color: var(--down); }
.toast b { display: block; margin-bottom: 2px; font-size: 13.5px; }
.toast.win b { color: var(--up); }
.toast.loss b { color: var(--down); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}
.toast.out { animation: toast-out .25s ease forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ============ Mobile ============ */
@media (max-width: 900px) {
  .rail { display: none; }
  .btn-withdraw { display: none; }
  .mobile-trades-btn { display: inline-flex; align-items: center; gap: 4px; }

  .topbar { height: 52px; gap: 8px; padding: 0 10px; }
  .logo { font-size: 15px; margin-right: 0; }
  .asset-btn { padding: 7px 10px; gap: 6px; font-size: 13px; min-width: 0; }
  .asset-btn-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26vw; }
  .balance-box { padding: 5px 9px; gap: 6px; }
  .balance-amount { font-size: 13px; }
  .btn-deposit { padding: 9px 13px; font-size: 12px; }
  .avatar { width: 32px; height: 32px; font-size: 13px; }

  /* stack: chart on top, trade controls docked below */
  .body { flex-direction: column; }
  .chart-area { flex: 1; min-height: 0; }
  .chart-head { padding: 8px 10px 4px; }
  .tf-btn { padding: 5px 9px; font-size: 11px; }
  .chart-price { font-size: 15px; }

  .panel {
    width: 100%; flex: none; border-left: none; border-top: 1px solid var(--border);
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    overflow: visible;
  }
  .panel-asset { grid-column: 1 / -1; }
  .pa-name { font-size: 14px; }
  .stepper { height: 42px; }
  .stepper button { width: 40px; font-size: 19px; }
  .stepper-value { font-size: 15px; }
  .stepper-value input { font-size: 15px; width: 60px; }
  .control label { margin-bottom: 4px; font-size: 10px; }
  .profit-preview { grid-column: 1 / -1; padding: 7px 12px; }
  .pp-value { font-size: 15px; }
  .btn-up { grid-column: 2; grid-row: 4; }
  .btn-down { grid-column: 1; grid-row: 4; }
  .btn-up, .btn-down { padding: 13px; font-size: 15px; border-radius: 11px; }

  /* trades list becomes a slide-up sheet toggled by the Trades button */
  .trades { display: none; }
  body.trades-open .trades {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: var(--panel); border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0; padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
    max-height: 62vh; min-height: 240px;
    box-shadow: 0 -18px 50px rgba(0,0,0,.55);
  }
  .modal { padding: 16px; }
  .toasts { top: 58px; right: 10px; left: 10px; align-items: flex-end; }
}

@media (max-width: 560px) {
  .logo { display: none; }
  .asset-btn-payout { display: none; }
  .balance-label { display: none; }
  .chart-price { display: none; } /* the chart's own price label covers this */
  .chart-head { gap: 8px; }
  .chart-asset-info { flex-shrink: 0; }
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* Admin: send-notice composer */
.ar-notice {
  border: 1px solid rgba(47,124,246,.5); color: #6ea8ff; font-weight: 700; font-size: 12px;
  padding: 7px 12px; border-radius: 8px;
}
.ar-notice:hover { background: rgba(47,124,246,.12); }
.ar-notice:disabled { opacity: .5; cursor: wait; }

#notice-modal { width: 520px; }
/* Recipient chip: avatar + name + email, same language as the user rows */
.notice-to {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 13px; margin-bottom: 16px;
}
.notice-to .nt-av {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.notice-to .nt-name { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.notice-to .nt-email { font-size: 12px; color: var(--muted); line-height: 1.3; }
.field-label {
  display: block; font-size: 11px; font-weight: 800; letter-spacing: .6px;
  color: var(--muted); margin: 0 0 7px; text-transform: uppercase;
}
.field-label .fl-hint {
  font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); opacity: .8;
}
#notice-template { margin-bottom: 16px; }
/* The message box: roomy, monospaced-ish line height, clearly readable */
#notice-message {
  min-height: 132px; font-size: 13.5px; line-height: 1.65; padding: 12px 13px;
  margin-bottom: 6px;
}
.notice-foot {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 11.5px; line-height: 1.5; margin: 0 0 14px;
}
.notice-preview-note {
  background: rgba(47,124,246,.08); border: 1px solid rgba(47,124,246,.28);
  border-radius: 9px; padding: 10px 12px; margin-bottom: 16px;
  color: #9db8e8; font-size: 12px; line-height: 1.55;
}
@media (max-width: 560px) {
  #notice-modal { width: 100%; }
  #notice-message { min-height: 118px; }
}

/* Reduced stake cap while an asset's price feed is lagging */
.amt-cap-note {
  margin-top: 7px; font-size: 11.5px; line-height: 1.45; font-weight: 600;
  color: var(--gold); background: rgba(247,179,43,.1);
  border: 1px solid rgba(247,179,43,.3); border-radius: 7px; padding: 6px 9px;
}
