/* ============================================================
   WALLET.CSS — Web3 header + connect modal
   Uses the same --Y/--R/--G/--B/--P/--V palette and glass card
   language as the rest of Bark Battle (see css/main.css).
   ============================================================ */

/* ---------- Header section ---------- */
.wallet-header-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}

.wallet-token-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  color: var(--Y);
}

.wallet-token-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 50%;
}

.wallet-connect-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--Y), #ffb800);
  color: #1a1200;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 2px 10px rgba(255, 230, 0, 0.25);
}

.wallet-connect-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(255, 230, 0, 0.35);
}

.wallet-connect-btn:active {
  transform: translateY(0);
}

.wallet-connect-btn.wallet-connected {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--W);
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}

.wallet-connect-btn.wallet-connected:hover {
  border-color: var(--G);
  filter: none;
}

.wallet-connect-btn:disabled {
  cursor: wait;
  opacity: 0.85;
  filter: none;
  transform: none;
}

.wallet-spinner-btn {
  width: 11px;
  height: 11px;
  border-width: 2px;
  border-top-color: #1a1200;
  vertical-align: -1px;
  margin-right: 2px;
}

/* ---------- Modal overlay ---------- */
.wallet-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.wallet-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.wallet-modal {
  width: min(360px, 92vw);
  border-radius: 20px;
  background: linear-gradient(
    160deg,
    rgba(30, 30, 34, 0.92),
    rgba(15, 15, 18, 0.92)
  );
  border: 1px solid var(--panel-bd);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(20px);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.wallet-modal-overlay.open .wallet-modal {
  transform: translateY(0) scale(1);
}

.wallet-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.wallet-modal-title {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.wallet-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.wallet-modal-close:hover {
  background: var(--card);
  color: var(--W);
}

.wallet-modal-body {
  padding: 16px 20px 20px;
}

/* ---------- Wallet options list ---------- */
.wallet-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
  color: var(--W);
  text-align: left;
}

.wallet-option:hover:not(:disabled) {
  border-color: var(--Y);
  transform: translateY(-1px);
  background: rgba(255, 230, 0, 0.06);
}

.wallet-option:disabled,
.wallet-option-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wallet-option-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.wallet-option-name {
  flex: 1;
  font-weight: 700;
  font-size: 14px;
}

.wallet-option-status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.wallet-modal-error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 45, 45, 0.12);
  border: 1px solid rgba(255, 45, 45, 0.35);
  color: #ff9c9c;
  font-size: 12px;
  font-weight: 600;
}

.wallet-modal-footnote {
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.4);
}

.wallet-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--Y);
  border-radius: 50%;
  animation: wallet-spin 0.7s linear infinite;
}

@keyframes wallet-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Connected panel inside modal ---------- */
.wallet-connected-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
  text-align: center;
}

.wallet-connected-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: linear-gradient(135deg, rgba(255, 230, 0, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid var(--border);
}

.wallet-connected-address {
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.wallet-connected-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--Y);
  font-weight: 800;
  font-size: 13px;
}

.wallet-disconnect-btn {
  margin-top: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 45, 45, 0.35);
  background: rgba(255, 45, 45, 0.08);
  color: #ff9c9c;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.wallet-disconnect-btn:hover {
  background: rgba(255, 45, 45, 0.16);
}

/* ---------- Toasts ---------- */
.wallet-toast-container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 10500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.wallet-toast {
  max-width: min(320px, 80vw);
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(30, 30, 34, 0.95), rgba(15, 15, 18, 0.95));
  border: 1px solid var(--panel-bd);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: var(--W);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.wallet-toast-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .wallet-token-balance {
    padding: 5px 9px;
    font-size: 12px;
  }
  .wallet-connect-btn {
    padding: 7px 12px;
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .wallet-header-section {
    gap: 6px;
    margin-left: 4px;
  }
  .wallet-token-balance span:last-child {
    display: none; /* hide "BARK" label, keep icon + amount */
  }
  .wallet-connect-btn.wallet-connected {
    padding: 7px 10px;
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .wallet-token-balance {
    padding: 5px 8px;
  }
  .wallet-connect-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* ============================================================
   REWARD WALLET ADDITIONS (no-connect payout-address UI)
   Reuses the wallet-modal / wallet-connect-btn / toast styles above.
   ============================================================ */
.reward-points-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  font-weight: 800; font-size: 13px; color: var(--Y);
  white-space: nowrap;
}
.reward-points-chip #reward-points-amount { color: var(--W); }

.reward-modal-intro {
  margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--W);
}
.reward-safe-note {
  background: rgba(0, 255, 135, .08);
  border: 1px solid rgba(0, 255, 135, .35);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 14px;
  font-size: 12.5px; line-height: 1.45; color: #b8ffd9;
}
.reward-input-label {
  display: block; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: rgba(255,255,255,.6); margin-bottom: 6px;
}
.reward-addr-input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(0,0,0,.35); border: 1px solid var(--border);
  color: var(--W); font-size: 14px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  outline: none; transition: border-color .15s ease;
}
.reward-addr-input:focus { border-color: var(--Y); }
.reward-modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 14px; align-items: center;
}
.reward-save-btn { padding: 11px 20px; }
.reward-clear-btn {
  background: transparent; border: 1px solid var(--border);
  color: rgba(255,255,255,.65); border-radius: 999px;
  padding: 10px 16px; font-weight: 700; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.reward-clear-btn:hover { border-color: var(--R); color: var(--R); }
.reward-modal-foot {
  margin: 12px 0 0; font-size: 11.5px; color: rgba(255,255,255,.45); text-align: center;
}

/* ============================================================
   REVIEW & ACCEPT GATE (Terms + Privacy) — shown once, the first
   time a player saves a Reward Wallet address.
   ============================================================ */
.tos-gate-overlay{
  /* Must sit above .wallet-modal-overlay (z-index:10000) since this gate
     is shown on top of the still-open Reward Wallet modal. */
  position: fixed; inset: 0; z-index: 10100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(4,4,8,.78); backdrop-filter: blur(6px);
  animation: tos-gate-fade .15s ease-out;
}
@keyframes tos-gate-fade{ from{ opacity:0; } to{ opacity:1; } }
.tos-gate-card{
  width: 100%; max-width: 440px; background: #14141c;
  border: 1px solid var(--border); border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
}
.tos-gate-banner{
  height: 110px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(255,230,0,.22), transparent 70%);
  border-bottom: 1px solid var(--border);
}
.tos-gate-logo{ width: 56px; height: 56px; border-radius: 15px; }
.tos-gate-body{ padding: 22px 22px 24px; }
.tos-gate-title-row{ display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tos-gate-title{
  font-family: 'Luckiest Guy', sans-serif; font-size: 1.3rem; margin: 0; color: var(--W);
}
.tos-gate-required{
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--Y); border: 1px solid rgba(255,230,0,.35); border-radius: 6px; padding: 3px 8px;
}
.tos-gate-sub{
  color: rgba(255,255,255,.6); font-size: 13.5px; line-height: 1.55; margin: 0 0 16px;
}
.tos-gate-row{
  display: flex; align-items: center; gap: 11px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 11px;
  padding: 13px 14px; margin-bottom: 10px; cursor: pointer; font-size: 13.5px; color: var(--W);
}
.tos-gate-row a{ color: var(--Y); }
.tos-gate-check{ width: 18px; height: 18px; accent-color: var(--Y); flex: 0 0 auto; }
.tos-gate-actions{ display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.tos-gate-actions .wallet-connect-btn:disabled{ opacity: .45; cursor: not-allowed; }
.tos-gate-cancel{
  background: none; border: 0; color: rgba(255,255,255,.5); font-weight: 700;
  font-size: 13.5px; cursor: pointer;
}
.tos-gate-cancel:hover{ color: rgba(255,255,255,.8); }
