/* ============================================================
   VegasBet — Crypto Deposit (Phase 4.6.5)
   Dark + purple palette only (NO blue). No inline styles.
   Selectors namespaced under .crypto-deposit / .cd-*.

   /profile/deposit now offers TWO methods. This file owns the page
   shell — grid, panel, steps, the method selector and the crypto
   flow. The bank-card flow's own pieces live in card-deposit.css
   (.cdm-*), which loads after this one.
   ============================================================ */

.crypto-deposit {
  margin-top: 8px;
}

/* ── Coming-soon panel (mock mode) ──────────────────────────── */
.cd-coming-soon {
  background: linear-gradient(180deg, #1c1c22, #161619);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 20px;
  padding: 48px 24px;
  text-align: center;
  max-width: 520px;
  margin: 24px auto;
}

.cd-coming-soon-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-dim);
  border: 1px solid var(--border);
}

.cd-coming-soon-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  fill: none;
}

.cd-coming-soon-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.cd-coming-soon-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ── Layout grid ────────────────────────────────────────────── */
.cd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
}

.cd-col {
  min-width: 0;
}

/* ── Selector panel (left column card) ──────────────────────── */
.cd-panel {
  background: linear-gradient(180deg, #1c1c22, #161619);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 20px;
  padding: 26px;
}

/* ── Steps + labels ─────────────────────────────────────────── */
.cd-step {
  margin-bottom: 22px;
}

.cd-step--last,
.cd-step:last-child {
  margin-bottom: 0;
}

.cd-step-label {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
}

/* ── Deposit-method panes (crypto | bank card) ──────────────── */
/* Both flows are in the DOM at once; card-deposit.js toggles `hidden` on the
   panes. `.cd-pane` deliberately has NO author `display` rule so the UA
   `[hidden]{display:none}` still wins — the footgun documented on
   `.cd-tag-row` below. Do not give it one without the `[hidden]` override. */
.cd-pane[hidden] { display: none; }

/* ── Method buttons (step 1) ────────────────────────────────── */
.cd-method-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cd-method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 92px;
  padding: 16px 12px;
  background: #111114;
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.cd-method-btn:hover {
  border-color: rgba(168, 85, 247, 0.45);
  transform: translateY(-2px);
}

.cd-method-btn.active {
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.14);
  box-shadow: inset 0 0 24px rgba(168, 85, 247, 0.08);
}

.cd-method-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text-primary);
}

.cd-method-btn.active .cd-method-name {
  color: #fff;
}

.cd-method-icons {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overlapping coin chips, newest on the left (like a stacked wallet). */
.cd-method-coin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: -6px;
  border: 2px solid #111114;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cd-method-btn.active .cd-method-coin {
  border-color: #1a1620;
}

.cd-method-coin img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cd-method-more {
  margin-left: 10px;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  background: var(--purple-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
}

/* Card-scheme marks (static/img/pay/*.svg). Rendered straight on the dark
   card, which is each brand's own dark-background usage: Mastercard keeps its
   colours, the Visa and Apple Pay marks are the white variants. */
.cd-method-icons--cards {
  gap: 9px;
}

.cd-method-scheme {
  height: 18px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.22s ease;
}

.cd-method-btn.active .cd-method-scheme,
.cd-method-btn:hover .cd-method-scheme {
  opacity: 1;
}

/* Mastercard's circles read smaller than a wordmark at the same height. */
.cd-method-scheme--mastercard {
  height: 21px;
}

/* ── Coin buttons (step 2) ──────────────────────────────────── */
.cd-coin-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cd-coin-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  background: #111114;
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease;
  text-align: left;
  min-width: 0;
}

.cd-coin-btn:hover {
  border-color: rgba(168, 85, 247, 0.45);
  transform: translateY(-2px);
}

.cd-coin-btn.active {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(124, 58, 237, 0.14);
}

.cd-coin-badge {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  background: var(--purple);
}

/* Real coin logo overlays the fallback letter; if it 404s the letter shows. */
.cd-coin-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Brand tints for recognisability (kept muted; UI chrome stays purple). */
.cd-coin-badge--btc  { background: #f7931a; color: #2a1602; }
.cd-coin-badge--eth  { background: #6f7390; }
.cd-coin-badge--bnb  { background: #f0b90b; color: #2a2102; }
.cd-coin-badge--trx  { background: #ef4444; }
.cd-coin-badge--sol  { background: #a855f7; }
.cd-coin-badge--ton  { background: #8884aa; color: #1a1830; }
.cd-coin-badge--xrp  { background: #8884aa; color: #1a1830; }
.cd-coin-badge--usdt { background: #10b981; color: #06281d; }
.cd-coin-badge--usdc { background: #8884aa; color: #1a1830; }

.cd-coin-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cd-coin-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd-coin-symbol {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* ── Network buttons (step 3) ───────────────────────────────── */
.cd-network-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cd-network-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 18px;
  background: #111114;
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.22s ease, background 0.22s ease;
  text-align: left;
}

.cd-network-btn:hover {
  border-color: rgba(168, 85, 247, 0.45);
}

.cd-network-btn.active {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(124, 58, 237, 0.10);
  box-shadow: inset 0 0 20px rgba(168, 85, 247, 0.06);
}

.cd-network-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.cd-network-symbol {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: var(--purple-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
}

/* ── Status text (network list) ─────────────────────────────── */
.cd-loading,
.cd-empty,
.cd-error {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 12px 0;
}

.cd-error {
  color: var(--red);
}

/* ── Address card ───────────────────────────────────────────── */
.cd-address-card {
  background: linear-gradient(180deg, #1c1c22, #161619);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 20px;
  overflow: hidden;
}

.cd-address-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.cd-address-card-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.cd-selected-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
}

.cd-address-card-body {
  padding: 20px 18px;
}

/* ── QR ─────────────────────────────────────────────────────── */
.cd-qr {
  width: 200px;
  height: 200px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 18px;
  background: #ffffff;            /* white quiet zone — required for scannability */
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cd-qr svg {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;    /* keep the QR modules crisp when scaled */
}

.cd-qr-fallback {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Pay label + address row ────────────────────────────────── */
.cd-pay-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 12px;
}

.cd-address-row,
.cd-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #111114;
  border: 1px solid rgba(124, 58, 237, 0.20);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

/* An author `display` beats the UA `[hidden]{display:none}` rule by cascade
   origin, so this row stayed on screen for every coin as an EMPTY
   "Destination Tag (required)" plaque even though the JS set hidden=true.
   (Same footgun as .sport-empty in matches.css and .pay-modal-overlay in
   agent-payouts.css — check for it whenever a toggled element has a display
   rule.) */
.cd-tag-row[hidden] { display: none; }

.cd-address-text,
.cd-tag-value {
  flex: 1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: var(--text-primary);
  word-break: break-all;
  min-width: 0;
}

.cd-tag-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.cd-tag-warn {
  font-size: 12px;
  line-height: 1.5;
  color: var(--gold);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin: 0 0 12px;
}

.cd-copy-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cd-copy-btn:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: var(--accent);
}

.cd-copy-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--accent);
  fill: none;
}

/* ── Info text + rows ───────────────────────────────────────── */
.cd-info-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 14px 0;
}

.cd-info-rows {
  display: flex;
  flex-direction: column;
}

.cd-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--border-subtle);
}

.cd-info-row-label {
  font-size: 12px;
  color: var(--text-muted);
}

.cd-info-row-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.cd-address-msg {
  margin-top: 14px;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.cd-address-msg--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red);
}

/* ── History ────────────────────────────────────────────────── */
.cd-history {
  margin-top: 32px;
}

.cd-history-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 18px;
}

.cd-history-loading,
.cd-history-error,
.cd-history-empty {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 14px 0;
}

.cd-history-error {
  color: var(--red);
}

.cd-history-table-wrap {
  overflow-x: auto;
  background: linear-gradient(180deg, #1c1c22, #161619);
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 18px;
}

.cd-history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.cd-history-table th,
.cd-history-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.cd-history-table th {
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 11px;
}

.cd-history-table td {
  color: var(--text-primary);
}

.cd-history-table tbody tr:last-child td {
  border-bottom: none;
}

.cd-num {
  font-family: 'Courier New', Courier, monospace;
}

/* Asset cell: the coin logo next to its symbol (same badge as the coin list,
   a size down). The network sub-line only shows on the phone card, where the
   Network column is folded into this cell. */
.cd-h-coin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cd-h-coin .cd-coin-badge {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.cd-h-coin-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cd-h-sym {
  font-weight: 700;
  color: var(--text-primary);
}

.cd-h-net-sub {
  display: none;
}

.cd-history-table td.cd-h-status,
.cd-history-table td.cd-h-date {
  white-space: nowrap;
}

/* ── Status badges ──────────────────────────────────────────── */
.cd-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.cd-status--credited {
  color: var(--green);
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.cd-status--confirmed {
  color: var(--accent);
  background: var(--purple-dim);
  border-color: var(--border);
}

.cd-status--seen {
  color: var(--gold);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

.cd-status--awaiting_rate {
  color: var(--orange);
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.3);
}

.cd-status--orphaned {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ── Test-mode block (dev only) ─────────────────────────────── */
.cd-testmode {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.cd-testmode-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .cd-grid {
    grid-template-columns: 1fr;
  }
}

/* ── History on a phone: one card per deposit ──────────────────
     [T] TRX                         CREDITED
         TRON
     AMOUNT                    CREDITED (USD)
     2000 TRX                         $648.81
     ─────────────────────────────────────────
     Confirmations: 20    23.09.2026 14:02:11
   The table's 640px min-width used to hold the whole profile column that
   wide the moment a first deposit filled it (owner report 2026-09-23). The
   figures keep their labels (td[data-label], set by crypto-deposit.js)
   because the header row is gone here. */
@media (max-width: 640px) {
  .cd-panel {
    padding: 20px 16px;
  }

  .cd-history-title {
    font-size: 18px;
    margin-bottom: 14px;
  }

  .cd-history-table-wrap {
    overflow: visible;
    background: none;
    border: none;
    border-radius: 0;
  }

  .cd-history-table {
    display: block;
    min-width: 0;
  }

  .cd-history-table thead {
    display: none;
  }

  .cd-history-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* No column gap: the right-hand cells pad themselves instead, so the
     divider above the last line runs unbroken across both halves. */
  .cd-history-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "asset  status"
      "amount usd"
      "conf   date";
    row-gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #1c1c22, #161619);
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: 16px;
  }

  .cd-history-table th,
  .cd-history-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: none;
  }

  .cd-history-table td.cd-h-net { display: none; }

  .cd-history-table td.cd-h-asset  { grid-area: asset; }
  .cd-history-table td.cd-h-status {
    grid-area: status;
    justify-self: end;
    align-self: center;
    padding-left: 10px;
  }
  .cd-history-table td.cd-h-amount { grid-area: amount; overflow-wrap: anywhere; }
  .cd-history-table td.cd-h-usd    { grid-area: usd; padding-left: 10px; text-align: right; }

  /* Last line: small and muted, under a divider — the bookkeeping, not
     the headline. The confirmations cell prints "Confirmations: 20". */
  .cd-history-table td.cd-h-conf,
  .cd-history-table td.cd-h-date {
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    font-size: 11.5px;
    color: var(--text-secondary);
  }
  .cd-history-table td.cd-h-conf { grid-area: conf; font-family: inherit; }
  .cd-history-table td.cd-h-conf::before { content: attr(data-label) ': '; }
  .cd-history-table td.cd-h-date {
    grid-area: date;
    padding-left: 10px;
    text-align: right;
  }

  .cd-history-table td.cd-h-amount::before,
  .cd-history-table td.cd-h-usd::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .cd-history-table td.cd-h-amount,
  .cd-history-table td.cd-h-usd {
    font-size: 13.5px;
    font-weight: 700;
  }

  .cd-h-coin { gap: 12px; }
  .cd-h-coin .cd-coin-badge { width: 32px; height: 32px; font-size: 14px; }
  .cd-h-sym { font-size: 14px; }
  .cd-h-net-sub {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 420px) {
  .cd-coin-list,
  .cd-method-list {
    grid-template-columns: 1fr;
  }
}
