/* ===== Wallet (play-money deposit) =====
   Slate-blue wallet modal. Loaded on every page with a header balance via wallet.js. */
:root {
  --wallet-bg: #1a2c38;
  --wallet-bg-deep: #0f212e;
  --wallet-bg-raised: #213743;
  --wallet-border: #2f4553;
  --wallet-text: #ffffff;
  --wallet-text-dim: #b1bad3;
  --wallet-blue: #1475e1;
  --wallet-blue-hover: #1d86fb;
  --wallet-green: #00e701;
}

/* Header button attached to the balance pill */
.wallet-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  min-height: 38px;
  border: none;
  border-radius: 8px;
  background: var(--wallet-blue);
  color: #fff;
  font: 600 0.9rem var(--font-family, inherit);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.wallet-btn:hover { background: var(--wallet-blue-hover); }
.wallet-btn:active { transform: scale(0.97); }
.wallet-btn .ic { width: 18px; height: 18px; }

/* Overlay + modal */
.wallet-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.wallet-overlay.open { opacity: 1; pointer-events: auto; }

.wallet-modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--wallet-bg);
  color: var(--wallet-text);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  font-family: var(--font-family, inherit);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}
.wallet-overlay.open .wallet-modal { transform: none; }

.wallet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.wallet-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.wallet-title .ic { color: var(--wallet-text-dim); }
.wallet-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--wallet-text-dim);
  cursor: pointer;
}
.wallet-close:hover { color: #fff; background: var(--wallet-bg-raised); }

.wallet-body { padding: 0 20px 20px; }

/* Segmented tabs */
.wallet-tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 20px;
  background: var(--wallet-bg-deep);
  border-radius: 999px;
}
.wallet-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--wallet-text);
  font: 600 0.875rem var(--font-family, inherit);
  cursor: pointer;
  transition: background 0.15s ease;
}
.wallet-tab:hover { background: var(--wallet-bg-raised); }
.wallet-tab.active { background: var(--wallet-border); }

.wallet-panel { display: none; }
.wallet-panel.active { display: block; }

/* Form fields */
.wallet-label {
  display: block;
  margin: 0 0 6px;
  color: var(--wallet-text-dim);
  font-size: 0.8rem;
  font-weight: 600;
}
.wallet-field { margin-bottom: 16px; position: relative; }

.wallet-select {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--wallet-border);
  border-radius: 6px;
  background: var(--wallet-bg-deep);
  color: #fff;
  font: 600 0.9rem var(--font-family, inherit);
  text-align: left;
  cursor: pointer;
}
.wallet-select:hover, .wallet-select[aria-expanded="true"] { border-color: #557086; }
.wallet-select .coin-name { flex: 1; }
.wallet-select .coin-code { color: var(--wallet-text-dim); font-weight: 500; }
.wallet-select .ic { color: var(--wallet-text-dim); transition: transform 0.15s ease; }
.wallet-select[aria-expanded="true"] .ic { transform: rotate(180deg); }

.wallet-coin-icon { width: 20px; height: 20px; flex: 0 0 auto; display: block; }

.wallet-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: none;
}
.wallet-menu.open { display: block; }
.wallet-menu li button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--wallet-bg-deep);
  font: 600 0.875rem var(--font-family, inherit);
  cursor: pointer;
  text-align: left;
}
.wallet-menu li button:hover, .wallet-menu li button.selected { background: #e6ecf2; }
.wallet-menu .coin-name { flex: 1; }
.wallet-menu .coin-value { color: #557086; font-weight: 500; font-variant-numeric: tabular-nums; }

.wallet-readonly {
  padding: 12px;
  border: 2px solid var(--wallet-border);
  border-radius: 6px;
  background: var(--wallet-bg-deep);
  color: var(--wallet-text-dim);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Amount card */
.wallet-amount-card {
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 6px;
  background: var(--wallet-bg-raised);
  text-align: center;
}
.wallet-amount-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.wallet-amount-main .wallet-coin-icon { width: 24px; height: 24px; }
.wallet-amount-sub {
  margin-top: 4px;
  color: var(--wallet-text-dim);
  font-size: 0.85rem;
}
.wallet-mint { height: 1em; width: 1em; vertical-align: -2px; }
.wallet-plus-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 231, 1, 0.12);
  color: var(--wallet-green);
  font-size: 0.75rem;
  font-weight: 700;
}

.wallet-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 6px;
  background: var(--wallet-blue);
  color: #fff;
  font: 600 0.95rem var(--font-family, inherit);
  cursor: pointer;
  transition: background 0.15s ease;
}
.wallet-primary:hover:not(:disabled) { background: var(--wallet-blue-hover); }
.wallet-primary:disabled {
  background: var(--wallet-border);
  color: var(--wallet-text-dim);
  cursor: not-allowed;
  font-variant-numeric: tabular-nums;
}

.wallet-note {
  display: flex;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--wallet-text-dim);
  font-size: 0.78rem;
  line-height: 1.45;
}
.wallet-note .ic { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }

.wallet-error {
  margin: 12px 0 0;
  color: #ff4d4d;
  font-size: 0.85rem;
  text-align: center;
}

/* Processing + success states */
.wallet-state { text-align: center; padding: 12px 0 4px; }
.wallet-state h3 { margin: 16px 0 4px; font-size: 1.1rem; }
.wallet-state p { margin: 0; color: var(--wallet-text-dim); font-size: 0.875rem; }

.wallet-spinner-coin {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 8px auto 0;
}
.wallet-spinner-coin::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--wallet-border);
  border-top-color: var(--wallet-blue);
  animation: wallet-spin 0.9s linear infinite;
}
.wallet-spinner-coin img {
  position: absolute;
  inset: 14px;
  width: 44px;
  height: 44px;
}
@keyframes wallet-spin { to { transform: rotate(360deg); } }

.wallet-confirms {
  margin: 20px auto 0;
  max-width: 280px;
}
.wallet-confirms-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--wallet-text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.wallet-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--wallet-bg-deep);
  overflow: hidden;
}
.wallet-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--wallet-blue);
  transition: width 0.5s ease;
}

.wallet-success-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 8px auto 0;
  border-radius: 50%;
  background: rgba(0, 231, 1, 0.12);
  color: var(--wallet-green);
  animation: wallet-pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.wallet-success-mark .ic { width: 36px; height: 36px; stroke-width: 2.5; }
.wallet-success-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--wallet-green);
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.wallet-success-amount .wallet-coin-icon { width: 22px; height: 22px; }
.wallet-state .wallet-primary { margin-top: 20px; }
@keyframes wallet-pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* Withdraw tab */
.wallet-empty {
  padding: 24px 8px 8px;
  text-align: center;
}
.wallet-empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--wallet-bg-raised);
  color: var(--wallet-text-dim);
}
.wallet-empty-icon .ic { width: 30px; height: 30px; }
.wallet-empty h3 { margin: 0 0 6px; font-size: 1rem; }
.wallet-empty p { margin: 0; color: var(--wallet-text-dim); font-size: 0.875rem; line-height: 1.5; }

@media (max-width: 600px) {
  .wallet-btn .wallet-btn-label { display: none; }
  .wallet-btn { padding: 0 10px; }
  .wallet-overlay { align-items: flex-end; padding: 0; }
  .wallet-modal { max-width: none; max-height: 90vh; border-radius: 12px 12px 0 0; }
  .wallet-head, .wallet-body { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .wallet-spinner-coin::before { animation-duration: 2s; }
  .wallet-success-mark { animation: none; }
}
