/* Wallet */
.wallet {
  position:fixed;
  top:max(20px, env(safe-area-inset-top, 0px));
  right:max(20px, env(safe-area-inset-right, 0px));
  font-size:11px; text-transform:uppercase; letter-spacing:0.05em;
  z-index:100;
}
.wallet button {
  margin:0; padding:0; border:none; text-transform:lowercase;
  background:none; color:var(--fg); opacity:0.5;
  font-size:11px; font-weight:400; letter-spacing:0.05em;
  text-decoration:underline; text-underline-offset:3px;
}
.wallet button:hover { background:none; opacity:1; }
.wallet button.connected { opacity:0.7; font-weight:600; text-transform:none; text-decoration:none; }

/* Wallet modal */
.wallet-modal-overlay {
  display:none; position:fixed; top:0; left:0; right:0; bottom:0;
  background:var(--modal-overlay); backdrop-filter:blur(4px);
  z-index:2000; justify-content:center; align-items:flex-start;
  padding:20px; padding-top:max(60px, env(safe-area-inset-top, 60px));
  overflow-y:auto; -webkit-overflow-scrolling:touch;
}
.wallet-modal-overlay.active { display:flex; }
body.modal-open { overflow:hidden; }
.wallet-modal {
  background:var(--modal-bg); border:1px solid var(--modal-border);
  padding:20px; width:100%; max-width:380px;
  max-height:calc(100vh - 80px); max-height:calc(100dvh - 80px);
  display:flex; flex-direction:column; overflow:hidden;
}
.wallet-modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; flex-shrink:0; }
.wallet-modal-title { font-size:14px; text-transform:uppercase; letter-spacing:0.1em; }
.wallet-modal-close {
  background:none; border:none; color:var(--fg); font-size:24px;
  cursor:pointer; line-height:1; padding:8px; margin:-8px;
  opacity:0.4; transition:opacity 0.15s;
}
.wallet-modal-close:hover { opacity:1; }
.wallet-modal-body { overflow-y:auto; -webkit-overflow-scrolling:touch; }
.wallet-option {
  display:flex; align-items:center; gap:12px; padding:14px 16px;
  background:var(--modal-bg); border:1px solid var(--border); color:var(--fg);
  cursor:pointer; margin-bottom:8px; transition:background 0.15s, color 0.15s;
}
.wallet-option:hover { background:var(--btn-bg); color:var(--btn-fg); }
.wallet-option:active { opacity:0.7; }
.wallet-option-icon { font-size:1.5rem; }
.wallet-option-name { font-weight:600; font-size:14px; }
.wallet-option.disconnect { border-color:#f00; color:#f00; justify-content:center; margin-top:4px; }
.wallet-option.disconnect:hover { background:#f00; color:#fff; }

/* Mobile */
@media (max-width: 600px) {
  .wallet { top:16px; right:16px; }
  .wallet button { font-size:11px; }
  .wallet-modal-overlay { padding:0; padding-top:0; align-items:flex-end; }
  .wallet-modal { max-width:100%; margin:0; border-left:none; border-right:none; border-bottom:none; max-height:85vh; max-height:85dvh; padding:16px; padding-bottom:max(16px, env(safe-area-inset-bottom)); }
  .wallet-option { padding:14px 16px; }
}
