/* Stake-style wallet: header widget + modal. Uses theme vars so light/dark both work. */

/* ---------- coin icon (colored circle with currency glyph, no assets needed) ---------- */
.coin-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  color: #fff; font-weight: 800; font-size: 14px; flex: 0 0 auto;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* ---------- Stake-pattern header wallet (借鉴布局, egame 配色) ----------
   Dark pill [$amount coin-icon v] + joined accent action button. */
.hd-wallet { display: block; }
.mwal-wrap { display: flex; align-items: center; }
.stake-wal { position: relative; display: inline-flex; align-items: stretch; }
.stake-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-right: none;
  border-radius: 12px 0 0 12px; padding: 8px 6px 8px 12px;
  font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.stake-pill:hover { filter: brightness(1.15); }
.stake-amt { letter-spacing: .2px; }
.stake-pill .coin-ic { width: 22px; height: 22px; font-size: 12px; }
.stake-chev { color: var(--muted); flex: none; }
.stake-go {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); border: 1px solid var(--accent);
  border-radius: 0 12px 12px 0; padding: 0 13px; cursor: pointer;
}
.stake-go:hover { filter: brightness(1.12); }
.stake-wal.sm .stake-pill { padding: 6px 4px 6px 10px; font-size: 13px; gap: 6px; border-radius: 10px 0 0 10px; }
.stake-wal.sm .stake-pill .coin-ic { width: 20px; height: 20px; font-size: 11px; }
.stake-wal.sm .stake-go { padding: 0 10px; border-radius: 0 10px 10px 0; }
/* coin dropdown */
.stake-coindrop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  min-width: 190px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.stake-coindrop.up { top: auto; bottom: calc(100% + 6px); }
.stake-coin {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none; color: var(--text); cursor: pointer;
  padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.stake-coin:hover { background: var(--panel2); }
.stake-coin.sel { background: var(--panel2); }
.stake-coin .coin-ic { width: 24px; height: 24px; font-size: 13px; }
.stake-coin .ck { margin-left: auto; color: #00e701; font-weight: 800; }
/* Enhanced dropdown: search + balances + settings */
.stake-coindrop { min-width: 260px; max-height: 380px; display: flex; flex-direction: column; }
.stake-search { padding: 6px; }
.stake-search input {
  width: 100%; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: 13px;
  outline: none; box-sizing: border-box;
}
.stake-search input:focus { border-color: var(--accent); }
.stake-coinlist { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.stake-coin .coin-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.stake-coin .coin-sym { font-weight: 700; }
.stake-coin .coin-name { font-size: 11px; color: var(--muted); font-weight: 400; }
.stake-coin .coin-bal { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 600; }
.stake-coin .ck { margin-left: 8px; }
.stake-settings {
  width: 100%; background: transparent; border: none; border-top: 1px solid var(--border);
  color: var(--muted); padding: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: 0 0 12px 12px; margin-top: 4px;
}
.stake-settings:hover { background: var(--panel2); color: var(--text); }

/* ---------- skeleton loaders (instant modal paint) ---------- */
.wskel {
  border-radius: 10px; margin: 8px 0;
  background: linear-gradient(90deg, var(--panel2) 25%, rgba(255,255,255,.06) 50%, var(--panel2) 75%);
  background-size: 200% 100%;
  animation: wskel-shimmer 1.1s linear infinite;
  min-height: 40px;
}
@keyframes wskel-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- modal shell ---------- */
.wmodal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  width: 560px; max-width: calc(100vw - 32px);
  max-height: 88vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.wmodal-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 0; border-bottom: 1px solid var(--border);
}
.wtabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; padding-bottom: 12px; }
.wtab {
  background: transparent; border: none; color: var(--muted);
  font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 10px;
  cursor: pointer; white-space: nowrap;
}
.wtab:hover { color: var(--text); background: rgba(255,255,255,.05); }
.wtab.active { color: var(--text); background: var(--panel2); }
.wmodal-x {
  background: var(--panel2); border: none; color: var(--muted);
  width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 15px;
  margin-bottom: 12px; flex: 0 0 auto;
}
.wmodal-x:hover { color: var(--text); }
.wmodal-body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---------- overview ---------- */
.wm-total {
  background: linear-gradient(135deg, var(--accent), #341f97);
  border-radius: 14px; padding: 18px; color: #fff; margin-bottom: 14px;
}
.wm-total .lbl { font-size: 12px; opacity: .75; margin-bottom: 4px; }
.wm-total .amt { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.wm-coinrow {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  padding: 10px 4px; cursor: pointer; color: var(--text); text-align: left;
  font-size: 14px;
}
.wm-coinrow:hover { background: rgba(255,255,255,.04); }
.wm-coinrow .nm { flex: 1; min-width: 0; }
.wm-coinrow .nm b { display: block; font-size: 14px; }
.wm-coinrow .nm span { font-size: 12px; color: var(--muted); }
.wm-coinrow .bal { text-align: right; }
.wm-coinrow .bal b { display: block; font-size: 14px; }
.wm-coinrow .bal span { font-size: 12px; color: var(--muted); }
.wm-coinrow.sel { background: rgba(108,92,231,.12); border-radius: 10px; }
.wm-search {
  width: 100%; margin-bottom: 8px; border-radius: 10px;
}
.wm-setrow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid var(--border); font-size: 14px;
}

/* toggle switch */
.wm-switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; cursor: pointer; }
.wm-switch input { opacity: 0; width: 0; height: 0; }
.wm-switch .sl {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--border); transition: .2s;
}
.wm-switch .sl:before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #8a93a8; top: 3px; left: 4px; transition: .2s;
}
.wm-switch input:checked + .sl { background: var(--accent); border-color: var(--accent); }
.wm-switch input:checked + .sl:before { transform: translateX(19px); background: #fff; }

/* ---------- deposit ---------- */
.wm-addrbox {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; margin: 12px 0;
}
.wm-addr {
  font-family: ui-monospace, monospace; font-size: 12.5px; word-break: break-all;
  background: rgba(0,0,0,.25); border-radius: 8px; padding: 10px; margin-bottom: 10px;
  color: var(--text); user-select: all;
}
.wm-qr { display: flex; justify-content: center; margin: 12px 0; }
.wm-qr img {
  width: 200px; height: 200px; border-radius: 12px;
  background: #fff; padding: 8px; border: 1px solid var(--border);
}
.wm-warn {
  background: rgba(255,176,0,.1); border: 1px solid rgba(255,176,0,.35);
  color: #ffb300; border-radius: 10px; padding: 10px 12px;
  font-size: 13px; margin: 12px 0;
}
.wm-note {
  background: rgba(108,92,231,.1); border: 1px solid rgba(108,92,231,.35);
  border-radius: 10px; padding: 12px; font-size: 13px; color: var(--muted);
  margin: 12px 0;
}
.wm-fld { margin: 10px 0; }
.wm-fld label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.wm-fld input, .wm-fld select { width: 100%; border-radius: 10px; }
.wm-fee {
  display: flex; justify-content: space-between; font-size: 13px;
  padding: 6px 2px; color: var(--muted);
}
.wm-fee b { color: var(--text); }
.wm-ok {
  background: rgba(0,200,83,.12); border: 1px solid rgba(0,200,83,.4);
  border-radius: 10px; padding: 12px; font-size: 13px; margin: 12px 0;
}
.wm-err {
  background: rgba(225,112,85,.12); border: 1px solid rgba(225,112,85,.4);
  border-radius: 10px; padding: 12px; font-size: 13px; margin: 12px 0;
}

/* ---------- history status badges ---------- */
.wst {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .4px;
}
.wst-pending { background: rgba(255,176,0,.15); color: #ffb300; border: 1px solid rgba(255,176,0,.4); }
.wst-verifying { background: rgba(41,121,255,.15); color: #5b9dff; border: 1px solid rgba(41,121,255,.4); }
.wst-credited, .wst-done { background: rgba(0,200,83,.15); color: #00c853; border: 1px solid rgba(0,200,83,.4); }
.wst-failed, .wst-rejected { background: rgba(225,112,85,.15); color: #e17055; border: 1px solid rgba(225,112,85,.4); }
.wm-hrow {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.wm-hrow .inf { flex: 1; min-width: 0; }
.wm-hrow .inf b { display: block; font-size: 13px; }
.wm-hrow .inf span { font-size: 11px; color: var(--muted); }
.wm-hrow .amt { text-align: right; font-weight: 700; }
.wm-hrow .amt small { display: block; margin-top: 4px; }

/* ---------- toasts ---------- */
#wtoasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 96px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.wtoast {
  background: #1d2540; color: #e9edf6; border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 18px; font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  animation: wtoast-in .3s ease; max-width: 100%; text-align: center;
}
.wtoast.ok { border-color: #00c853; }
.wtoast.info { border-color: #5b9dff; }
.wtoast.out { opacity: 0; transform: translateY(8px); transition: .4s; }
@keyframes wtoast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes wmodal-in { from { opacity: 0; transform: scale(.95); } }

/* ---------- mobile: centered popup (not bottom sheet) ---------- */
@media (max-width: 720px) {
  .hd-wallet { display: none !important; }
  #wmodal-back { align-items: center; justify-content: center; padding: 16px; }
  .wmodal {
    width: 100%; max-width: 480px; border-radius: 20px;
    max-height: 90vh; max-height: 90dvh;
    animation: wmodal-in .25s ease;
  }
  .wmodal-body { padding: 14px 14px calc(20px + env(safe-area-inset-bottom)); }
  .wm-total .amt { font-size: 26px; }
  #wtoasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (min-width: 721px) {
  #mwal-wrap { display: none !important; }
}
/* Slim mobile header: logo icon only, no wordmark */
@media (max-width: 768px) {
  .mlogo span { display: none; }
}
@keyframes wsheet-up { from { transform: translateY(40px); opacity: .6; } }

/* 自定义币种下拉 */
.wm-dd { position: relative; }
.wm-dd-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #fff; font-size: 15px;
}
.wm-dd-btn:hover { background: rgba(255,255,255,0.1); }
.wm-dd-arrow { margin-left: auto; opacity: 0.6; }
.wm-dd-menu {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  margin-top: 6px; max-height: 280px; overflow-y: auto;
  background: #1e2440; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.wm-dd-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: none; border-radius: 8px; cursor: pointer;
  background: transparent; color: #fff; font-size: 14px; text-align: left;
}
.wm-dd-item:hover { background: rgba(255,255,255,0.08); }
.wm-dd-item.sel { background: rgba(99,102,241,0.2); }
.wm-dd-item .nm { flex: 1; display: flex; flex-direction: column; }
.wm-dd-item .nm b { font-size: 14px; }
.wm-dd-item .nm span { font-size: 12px; opacity: 0.6; }
.wm-dd-item .bal { font-size: 13px; opacity: 0.8; }

/* EGC rewards card (2026-10-19) */
.wm-egc { margin-top: 14px; padding: 14px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(139,92,246,.12));
  border: 1px solid rgba(139,92,246,.25); }
.wm-egc .lbl { font-size: 12px; color: var(--muted, #9aa3c0); font-weight: 700; letter-spacing: .3px; }
.wm-egc .amt { font-size: 24px; font-weight: 800; margin: 4px 0 10px; }
.wm-egc-sym { font-size: 13px; font-weight: 700; color: #a78bfa; }
.wm-egc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wm-egc-row span { font-size: 12px; color: var(--muted, #9aa3c0); }
