/* ================================================================
   BLONEY BEARS — Wallet Gate + Mint Modal + Bear Image Variants
   ================================================================ */

/* ── Bear image variants — all based on papabloney.png ─────────
   Each bear looks like Papa Blony but with a distinct genetic tone.
   Filter chain: hue-rotate shifts the colour family; saturate/
   brightness keep the image vivid and readable on dark backgrounds.
─────────────────────────────────────────────────────────────── */
.bear-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transition: filter 0.4s ease, transform 0.4s ease;
}

/* variant-0: Papa Blony — original, no filter */
.bear-img-variant-0 { filter: none; }

/* variant-1: Lady Amber — warm amber-golden line */
.bear-img-variant-1 {
  filter: hue-rotate(15deg) saturate(1.25) brightness(1.05);
}

/* variant-2: Lady Ruby — russet-teal */
.bear-img-variant-2 {
  filter: hue-rotate(155deg) saturate(1.1) brightness(0.92);
}

/* variant-3: Lady Silver — cool silver-lavender */
.bear-img-variant-3 {
  filter: hue-rotate(210deg) saturate(0.65) brightness(1.08);
}

/* variant-4: Briar Honeyfield — olive-green adventurer */
.bear-img-variant-4 {
  filter: hue-rotate(95deg) saturate(1.15) brightness(0.94);
}

/* variant-5: Cinder Ashbloom — dark elder with charcoal tones */
.bear-img-variant-5 {
  filter: hue-rotate(260deg) saturate(0.75) brightness(0.78) contrast(1.08);
}

/* variant-6: Fern Moonfield — warm taupe-purple */
.bear-img-variant-6 {
  filter: hue-rotate(290deg) saturate(1.05) brightness(0.96);
}

/* Bear card image container override — portrait-animation.js handles hover */
.bear-card-img {
  position: relative;
  overflow: visible; /* allow frame to bleed out */
  aspect-ratio: 1 / 1;
  background: #1a1515;
}

/* portrait-animation.js wraps .bear-img — disable old transform on card hover */
.bear-card:hover .bear-card-img .bear-img {
  /* portrait-canvas animation takes over */
}

/* Techoem image override */
.techoem-img.bear-img {
  border-radius: var(--r-lg);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ── Bear Profile page hero image ────────────────────────────── */
.bp-hero-image.bear-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 22px;
}

/* ── Wallet Gate Overlay ──────────────────────────────────────── */
#bbw-wallet-gate {
  position: fixed;
  inset: 0;
  z-index: 9900;
  background: rgba(10, 8, 8, 0.88);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#bbw-wallet-gate.open { opacity: 1; }

#bbw-wallet-gate.closing {
  opacity: 0;
  pointer-events: none;
}

.bbw-gate-inner {
  text-align: center;
  padding: 3rem 2.5rem;
  background: var(--bg-card);
  border-radius: 24px;
  border: 1px solid var(--border-md);
  max-width: 420px;
  width: 90%;
  box-shadow: 0 40px 80px rgba(0,0,0,0.7);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

#bbw-wallet-gate.open .bbw-gate-inner {
  transform: translateY(0) scale(1);
}

.bbw-gate-bear {
  font-size: 4rem;
  margin-bottom: 1.25rem;
  display: block;
  animation: bbFloat 3s ease-in-out infinite;
}

.bbw-gate-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.bbw-gate-sub {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 2rem;
}

.bbw-gate-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  min-height: 44px; /* WCAG 2.5.5 minimum touch target */
  background: var(--amber);
  color: #000;
  border: none;
  border-radius: var(--r-md);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.bbw-gate-btn:hover {
  background: #ffc030;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 166, 35, 0.35);
}

.bbw-gate-fox { font-size: 1.2rem; }

.bbw-gate-ghost {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dashed;
  padding: 0.3rem;
  transition: color 0.2s;
}

.bbw-gate-ghost:hover { color: var(--text-2); }

.bbw-gate-alt { margin-bottom: 1.5rem; }

.bbw-gate-footer {
  font-size: 0.78rem;
  color: var(--text-3);
}

.bbw-gate-footer a {
  color: var(--teal);
  text-decoration: none;
}

.bbw-gate-footer a:hover { text-decoration: underline; }

/* ── Wallet nav button ────────────────────────────────────────── */
.wallet-btn {
  padding: 0.45rem 1rem;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.3);
  color: var(--amber);
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
  font-family: var(--font-mono);
}

.wallet-btn:hover {
  background: rgba(245, 166, 35, 0.22);
  border-color: rgba(245, 166, 35, 0.55);
}

.wallet-btn.connected {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--green);
}

/* ── Mint button (internal) ──────────────────────────────────── */
.btn-mint-sm {
  padding: 0.4rem 0.9rem;
  background: rgba(255, 80, 53, 0.12);
  border: 1px solid rgba(255, 80, 53, 0.3);
  color: var(--coral);
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
}

.btn-mint-sm:hover {
  background: var(--coral);
  color: #fff;
  transform: translateY(-1px);
}

.btn-mint-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── Mint Modal ───────────────────────────────────────────────── */
#bbw-mint-modal {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(10, 8, 8, 0.82);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}

#bbw-mint-modal.open { opacity: 1; }

.bbw-mint-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: 20px;
  max-width: 560px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: min(200px, 35%) 1fr;
  box-shadow: 0 40px 80px rgba(0,0,0,0.65);
  transform: scale(0.94);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  position: relative;
}

#bbw-mint-modal.open .bbw-mint-inner {
  transform: scale(1);
}

.bbw-mint-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s;
  line-height: 1;
  padding: 0.25rem;
}

.bbw-mint-close:hover { color: var(--text-1); }

.bbw-mint-bear-img {
  background: var(--bg-elevated);
  border-radius: 20px 0 0 20px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  align-self: stretch;
}

.bbw-mint-bear-img .bear-img {
  height: 100%;
  object-fit: cover;
}

.bbw-mint-body {
  padding: 1.75rem 1.5rem 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bbw-mint-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--coral);
  background: rgba(255, 80, 53, 0.1);
  border: 1px solid rgba(255, 80, 53, 0.25);
  border-radius: var(--r-pill);
  padding: 0.2rem 0.6rem;
  width: fit-content;
}

.bbw-mint-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
  margin: 0;
}

.bbw-mint-key {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
}

.bbw-mint-price-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.bbw-mint-price {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
}

.bbw-mint-price-sub {
  font-size: 0.72rem;
  color: var(--teal);
  margin-top: 0.2rem;
}

.bbw-mint-includes {
  font-size: 0.72rem;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: right;
}

.bbw-mint-wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

.bbw-mint-wallet-label { color: var(--text-3); }
.bbw-mint-wallet-addr  {
  font-family: var(--font-mono);
  color: var(--green);
  font-weight: 600;
}

.bbw-mint-confirm {
  width: 100%;
  padding: 0.85rem;
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--t);
}

.bbw-mint-confirm:hover:not(:disabled) {
  background: var(--coral-2);
  transform: translateY(-1px);
}

.bbw-mint-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.bbw-mint-disclaimer {
  font-size: 0.72rem;
  color: var(--text-3);
  text-align: center;
}

.bbw-mint-tx {
  text-align: center;
  font-size: 0.8rem;
}

.bbw-mint-tx a { color: var(--teal); }

@media (max-width: 480px) {
  .bbw-mint-inner {
    grid-template-columns: 1fr;
  }
  .bbw-mint-bear-img {
    border-radius: 20px 20px 0 0;
    aspect-ratio: 16 / 9;
  }
  /* gate modal padding reduction on phones */
  .bbw-gate-inner {
    padding: 2rem 1.25rem;
    border-radius: 16px;
  }
  .bbw-gate-title { font-size: 1.5rem; }
  .bbw-gate-sub { font-size: 0.85rem; margin-bottom: 1.5rem; }
}

/* ── Toast notifications ─────────────────────────────────────── */
.bbw-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 99999;
  padding: 0.75rem 1.5rem;
  border-radius: var(--r-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-1);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-md);
  background: var(--bg-elevated);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  max-width: 90vw;
}

.bbw-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bbw-toast-success { border-color: rgba(34, 197, 94, 0.4); color: var(--green); }
.bbw-toast-error   { border-color: rgba(255, 80, 53, 0.4); color: var(--coral); }
.bbw-toast-info    { border-color: var(--border-md); color: var(--text-2); }
