/* BTC-05 — player-facing sats wallet shell. REGTEST only. */
.wallet-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 4, 18, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.wallet-overlay[hidden] { display: none !important; }
.wallet-panel {
  width: min(560px, 100%);
  max-height: min(780px, calc(100dvh - 36px));
  overflow: auto;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20,23,55,.99), rgba(8,11,31,.99));
  box-shadow: 0 30px 90px rgba(0,0,0,.5), inset 0 1px rgba(255,255,255,.06);
  color: #fff;
}
.wallet-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.wallet-kicker {
  display: block;
  margin-bottom: 5px;
  color: #f3ff20;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.wallet-header h2 { margin: 0; font-size: 1.2rem; }
.wallet-header p { margin: 5px 0 0; color: rgba(255,255,255,.5); font-size: .72rem; }
.wallet-close {
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  color: #fff;
  cursor: pointer;
}
.wallet-body { display: grid; gap: 14px; padding: 18px 20px 22px; }
.wallet-balance-card {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 20px;
  background: radial-gradient(circle at 80% 15%, rgba(243,255,32,.12), transparent 45%), rgba(255,255,255,.045);
}
.wallet-balance-label { color: rgba(255,255,255,.48); font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; }
.wallet-balance-value { display: block; margin-top: 6px; font-size: clamp(1.8rem, 6vw, 2.7rem); font-weight: 950; }
.wallet-balance-value small { font-size: .5em; color: rgba(255,255,255,.56); }
.wallet-status-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wallet-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.72);
  font-size: .6rem; font-weight: 800;
}
.wallet-pill.regtest { color: #f3ff20; }
.wallet-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.wallet-action {
  min-height: 52px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}
.wallet-action.primary { background: #f3ff20; color: #111; border-color: #f3ff20; }
.wallet-action:disabled { opacity: .45; cursor: not-allowed; }
.wallet-section {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  overflow: hidden;
}
.wallet-section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: rgba(255,255,255,.035);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.wallet-section-head strong { font-size: .72rem; }
.wallet-section-head span { color: rgba(255,255,255,.4); font-size: .58rem; }
.wallet-activity { list-style: none; margin: 0; padding: 0; }
.wallet-activity li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.05);
  color: rgba(255,255,255,.68);
  font-size: .68rem;
}
.wallet-activity li:first-child { border-top: 0; }
.wallet-empty { padding: 16px 14px; color: rgba(255,255,255,.42); font-size: .68rem; }
.wallet-banner,
.wallet-warning {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(243,255,32,.18);
  border-radius: 14px;
  background: rgba(243,255,32,.05);
  color: rgba(255,255,255,.78);
  font-size: .66rem;
  line-height: 1.45;
}
.wallet-banner-copy { margin: 0; flex: 1 1 auto; min-width: 0; }
.wallet-banner[hidden],
.wallet-warning[hidden] { display: none !important; }
.wallet-banner-dismiss {
  flex: none;
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-family: inherit;
  font-size: .62rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.wallet-banner-dismiss:hover,
.wallet-banner-dismiss:focus-visible {
  background: rgba(255,255,255,.18);
  outline: 2px solid #f3ff20;
  outline-offset: 2px;
}
html[data-wallet-game="true"] #wallet-overlay,
html[data-wallet-game="true"] .wallet-banner,
html[data-wallet-game="true"] .wallet-warning {
  display: none !important;
}
.home-wallet-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-wallet-button::before { content: '⚡'; }
@media (max-width: 620px) {
  .wallet-actions { grid-template-columns: 1fr 1fr; }
  .wallet-panel { border-radius: 20px; }
}
/* QA-5 (4): the wallet always fits a phone viewport. Browsers without dvh drop the min() cap above
   and the panel grew past the screen with its top and bottom rows clipped — give it a vh fallback
   (same pattern as Settings), keep the overlay itself scrollable, and never centre a panel off-screen. */
.wallet-overlay { overflow-y: auto; overscroll-behavior: contain; place-items: safe center; }
.wallet-panel {
  max-height: calc(100vh - 36px);
  max-height: min(780px, calc(100dvh - 36px));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
@media (max-height: 760px) {
  .wallet-overlay { padding: 10px; }
  .wallet-panel { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
  .wallet-header { padding: 14px 16px; }
  .wallet-body { gap: 12px; padding: 14px 16px 18px; }
}
@media (max-width: 380px) {
  .wallet-section-head { flex-wrap: wrap; gap: 4px 10px; }
}

.wallet-store-purchase { display: grid; gap: 9px; padding: 14px; }
.wallet-store-purchase label { font-size: .64rem; font-weight: 850; color: rgba(255,255,255,.72); }
.wallet-store-purchase textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(0,0,0,.2);
  color: #fff;
  font: 600 .64rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.wallet-store-purchase small { color: rgba(255,255,255,.46); font-size: .61rem; line-height: 1.4; }
.wallet-public-id {
  padding: 12px 14px;
  overflow-wrap: anywhere;
  color: rgba(255,255,255,.65);
  font: 600 .62rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
