/* ═══════════════════════════════════════════
   RITUAL BELIEVER NFT — Styles
   Linked from index.html
═══════════════════════════════════════════ */

  :root {
    --bg: #04020d;
    --bg2: #080418;
    --purple: #a855f7;
    --purple-dim: rgba(168,85,247,0.15);
    --purple-border: rgba(168,85,247,0.3);
    --purple-glow: rgba(168,85,247,0.08);
    --text: #f0e8ff;
    --text-dim: rgba(240,232,255,0.5);
    --mono: 'DM Mono', monospace;
    --display: 'Syne', sans-serif;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--display);
    min-height: 100vh;
    overflow-x: hidden;
  }

  #neural-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
  .page { position: relative; z-index: 1; }

  /* ── NAV ── */
  nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(4,2,13,0.75);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--purple-border);
  }

  .nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 18px; font-weight: 800; letter-spacing: -0.02em;
    color: var(--text); text-decoration: none;
  }

  .nav-logo .logo-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--purple);
    animation: blink 2s ease-in-out infinite;
  }

  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

  .nav-links {
    display: flex; gap: 1.5rem; align-items: center;
    font-family: var(--mono); font-size: 12px;
    color: var(--text-dim);
  }
  .nav-links a { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
  .nav-links a:hover { color: var(--purple); }

  /* ── NAV WALLET BUTTON ── */
  .btn-wallet-nav {
    font-family: var(--mono); font-size: 12px;
    padding: 8px 18px; border-radius: 999px;
    border: 1px solid var(--purple-border);
    background: var(--purple-dim); color: var(--purple);
    cursor: pointer; transition: all 0.2s;
    letter-spacing: 0.04em;
    display: flex; align-items: center; gap: 7px;
  }
  .btn-wallet-nav:hover { background: rgba(168,85,247,0.3); border-color: var(--purple); color: var(--text); }
  .btn-wallet-nav.connected { border-color: rgba(52,211,153,0.5); color: #34d399; background: rgba(52,211,153,0.08); }
  .btn-wallet-nav.connected svg circle { fill: #34d399; }

  #customDisconnectBtn {
    display: none; font-family: var(--mono); font-size: 11px;
    padding: 6px 12px; border-radius: 999px;
    border: 1px solid rgba(248,113,113,0.3);
    background: rgba(248,113,113,0.08); color: #f87171;
    cursor: pointer; transition: all 0.2s; letter-spacing: 0.04em;
  }
  #customDisconnectBtn.show { display: flex; align-items: center; gap: 5px; }
  #customDisconnectBtn:hover { background: rgba(248,113,113,0.18); }

  /* ── WC BACKDROP / MODAL ── */
  #wcBackdrop {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(10px);
    display: none; align-items: center; justify-content: center;
  }
  #wcBackdrop.open { display: flex; }

  #wcModal {
    background: #0a0520;
    border: 1px solid var(--purple-border);
    border-radius: 24px; width: 92%; max-width: 400px;
    box-shadow: 0 0 80px rgba(124,58,237,0.3);
    overflow: hidden;
  }

  .wc-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem 0;
  }
  .wc-title { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
  .wc-close {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(168,85,247,0.1); border: 1px solid var(--purple-border);
    color: var(--text-dim); font-size: 15px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
  }
  .wc-close:hover { background: rgba(168,85,247,0.2); color: var(--text); }

  .wc-sub {
    font-family: var(--mono); font-size: 10px; color: var(--text-dim);
    letter-spacing: 0.08em; padding: 6px 1.5rem 1rem;
  }

  #wcWalletBtns { padding: 0 1rem 0.5rem; display: flex; flex-direction: column; gap: 8px; }

  .wc-wallet-btn {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px; width: 100%;
    background: rgba(168,85,247,0.04);
    border: 1px solid rgba(168,85,247,0.13); border-radius: 14px;
    cursor: pointer; transition: all 0.2s; color: var(--text); text-align: left;
  }
  .wc-wallet-btn:hover { background: rgba(168,85,247,0.12); border-color: var(--purple); transform: translateX(3px); }

  .wc-wallet-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
  }
  .wc-wallet-icon img { width: 26px; height: 26px; object-fit: contain; }

  .wc-wallet-info { flex: 1; min-width: 0; }
  .wc-wallet-name { font-family: var(--display); font-size: 14px; font-weight: 700; }
  .wc-wallet-desc { font-family: var(--mono); font-size: 10px; color: var(--text-dim); margin-top: 2px; }

  .wc-wallet-tag {
    font-family: var(--mono); font-size: 9px; padding: 3px 8px; border-radius: 999px;
    border: 1px solid rgba(168,85,247,0.3); color: rgba(168,85,247,0.7); letter-spacing: 0.05em;
    flex-shrink: 0;
  }
  .wc-wallet-tag.green { border-color: rgba(52,211,153,0.4); color: #34d399; background: rgba(52,211,153,0.08); }

  .wc-installed-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #34d399;
    flex-shrink: 0; box-shadow: 0 0 6px #34d399;
  }

  .wc-no-wallet {
    padding: 12px 14px; margin-bottom: 6px;
    background: rgba(248,113,113,0.07); border: 1px solid rgba(248,113,113,0.2); border-radius: 12px;
    font-family: var(--mono); font-size: 11px; color: #fca5a5; line-height: 1.7;
  }

  /* WalletConnect row */
  .wc-footer {
    padding: 0.75rem 1rem 1.25rem;
    display: flex; align-items: center; gap: 10px;
  }
  .wc-footer::before { content:''; flex:1; height:1px; background: rgba(168,85,247,0.12); }
  .wc-footer::after  { content:''; flex:1; height:1px; background: rgba(168,85,247,0.12); }
  .wc-wc-btn {
    font-family: var(--mono); font-size: 10px; padding: 6px 14px; border-radius: 999px;
    border: 1px solid rgba(168,85,247,0.25); background: transparent;
    color: rgba(168,85,247,0.6); cursor: pointer; transition: all 0.2s; letter-spacing: 0.05em;
  }
  .wc-wc-btn:hover { background: var(--purple-dim); color: var(--purple); }

  /* Connecting view */
  #wcConnView { display: none; padding: 2rem 1.5rem 1.5rem; text-align: center; }
  #wcConnView.active { display: block; }
  #wcSpinner {
    width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
    animation: wcPulse 1.4s ease-in-out infinite;
  }
  @keyframes wcPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.08);opacity:0.8} }
  #wcConnName { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
  #wcConnMsg  { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

  /* wallet status bar (below network info) */
  .wallet-status { font-family: var(--mono); font-size: 10px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
  .wallet-status .status-dot { width: 6px; height: 6px; border-radius: 50%; background: #4b5563; }
  .wallet-status.connected .status-dot { background: #34d399; box-shadow: 0 0 6px #34d399; }

  /* ── HERO ── */
  .hero {
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 6rem 1.5rem 3rem;
    text-align: center;
  }

  .hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
    color: rgba(168,85,247,0.7);
    border: 1px solid var(--purple-border);
    background: var(--purple-dim);
    padding: 6px 16px; border-radius: 999px;
    margin-bottom: 2rem; text-transform: uppercase;
  }
  .hero-badge .pulse { width: 6px; height: 6px; border-radius: 50%; background: #a855f7; animation: blink 1.5s infinite; }

  h1 {
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 800; line-height: 1.0; letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 30%, #c084fc 70%, #7c3aed 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  }

  .hero-sub {
    font-family: var(--mono); font-size: 14px; color: var(--text-dim);
    max-width: 480px; line-height: 1.8; margin-bottom: 3rem;
  }

  /* ── MAIN SECTION ── */
  .mint-section {
    padding: 2rem 1.5rem 5rem;
    display: flex; justify-content: center;
  }

  .mint-container {
    width: 100%; max-width: 500px;
    display: flex; flex-direction: column; gap: 16px;
  }

  .card {
    background: rgba(8,4,24,0.85);
    border: 1px solid var(--purple-border);
    border-radius: 20px; padding: 1.75rem;
    backdrop-filter: blur(20px);
    position: relative; overflow: hidden;
  }
  .card::before {
    content: '';
    position: absolute; top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--purple), transparent);
  }

  /* ── NFT PREVIEW ── */
  .nft-preview {
    width: 100%; aspect-ratio: 1;
    border-radius: 14px; overflow: hidden;
    position: relative; border: 1px solid var(--purple-border);
    margin-bottom: 1.25rem;
  }

  #avatar-canvas { width: 100%; height: 100%; display: block; }

  .nft-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 12px 14px;
    background: linear-gradient(transparent, rgba(4,2,13,0.9));
    display: flex; align-items: flex-end; justify-content: space-between;
  }

  .nft-label { font-family: var(--mono); font-size: 10px; color: rgba(168,85,247,0.7); letter-spacing: 0.08em; }
  .nft-id { font-family: var(--mono); font-size: 10px; color: rgba(168,85,247,0.5); }

  /* ── MODE TOGGLE ── */
  .mode-toggle {
    display: flex; gap: 6px; margin-bottom: 1rem;
    background: rgba(168,85,247,0.05);
    border: 1px solid rgba(168,85,247,0.15);
    border-radius: 12px; padding: 5px;
  }

  .mode-btn {
    flex: 1; padding: 9px 12px;
    border-radius: 9px; border: 1px solid transparent;
    background: transparent; color: var(--text-dim);
    font-family: var(--mono); font-size: 11px;
    cursor: pointer; transition: all 0.2s; letter-spacing: 0.04em;
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }
  .mode-btn.active {
    background: rgba(168,85,247,0.2);
    border-color: var(--purple-border); color: var(--purple);
  }
  .mode-btn:hover:not(.active) { color: var(--text); background: rgba(168,85,247,0.08); }

  /* ── USERNAME INPUT ── */
  .input-group { display: flex; gap: 8px; margin-bottom: 1rem; }

  .x-input {
    flex: 1; background: rgba(168,85,247,0.05);
    border: 1px solid var(--purple-border); border-radius: 10px;
    padding: 11px 14px; color: var(--text);
    font-family: var(--mono); font-size: 13px; outline: none;
    transition: border-color 0.2s;
  }
  .x-input::placeholder { color: rgba(168,85,247,0.3); }
  .x-input:focus { border-color: var(--purple); background: rgba(168,85,247,0.08); }

  .gen-btn {
    padding: 11px 16px; background: rgba(168,85,247,0.15);
    border: 1px solid var(--purple-border); border-radius: 10px;
    color: var(--purple); font-family: var(--mono); font-size: 12px;
    cursor: pointer; transition: all 0.2s; white-space: nowrap; letter-spacing: 0.03em;
  }
  .gen-btn:hover { background: rgba(168,85,247,0.3); color: var(--text); }

  /* ── PHOTO UPLOAD SECTION ── */
  #photo-section { display: none; }

  .upload-area {
    border: 2px dashed rgba(168,85,247,0.3);
    border-radius: 14px; padding: 2rem;
    text-align: center; cursor: pointer;
    transition: all 0.3s; margin-bottom: 1rem;
    background: rgba(168,85,247,0.03);
    position: relative;
  }
  .upload-area:hover, .upload-area.dragover {
    border-color: var(--purple);
    background: rgba(168,85,247,0.08);
    transform: scale(1.01);
  }

  .upload-area input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
  }

  .upload-icon { font-size: 32px; margin-bottom: 8px; }
  .upload-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
  .upload-sub { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }

  .filter-row {
    display: flex; gap: 8px; margin-bottom: 1rem; flex-wrap: wrap;
  }

  .filter-btn {
    font-family: var(--mono); font-size: 10px;
    padding: 6px 12px; border-radius: 999px;
    border: 1px solid rgba(168,85,247,0.2);
    background: transparent; color: var(--text-dim);
    cursor: pointer; transition: all 0.2s; letter-spacing: 0.04em;
  }
  .filter-btn.active { background: var(--purple-dim); border-color: var(--purple); color: var(--purple); }
  .filter-btn:hover:not(.active) { background: rgba(168,85,247,0.05); color: var(--text); }

  /* ── PROFILE ROW ── */
  .profile-row {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 1.25rem; padding: 12px;
    background: rgba(168,85,247,0.04);
    border: 1px solid rgba(168,85,247,0.12); border-radius: 12px;
  }

  .avatar-mini {
    width: 42px; height: 42px; border-radius: 50%;
    border: 1.5px solid var(--purple-border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px;
    background: rgba(124,58,237,0.2); color: var(--purple);
    flex-shrink: 0; font-family: var(--mono);
    overflow: hidden;
  }

  .avatar-mini img { width: 100%; height: 100%; object-fit: cover; }

  .profile-info .pname { font-size: 15px; font-weight: 700; color: var(--text); }
  .profile-info .phandle { font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 1px; }

  .ritual-tag {
    margin-left: auto; font-family: var(--mono); font-size: 9px;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(124,58,237,0.15); border: 1px solid rgba(168,85,247,0.3);
    color: var(--purple); letter-spacing: 0.08em;
  }

  /* ── DETECTED BOX ── */
  .detected {
    text-align: center; padding: 16px; margin-bottom: 1.25rem;
    border: 1px solid rgba(168,85,247,0.2); border-radius: 12px;
    background: rgba(124,58,237,0.06);
  }
  .detected-label {
    font-family: var(--mono); font-size: 9px; letter-spacing: 0.15em;
    color: rgba(168,85,247,0.5); text-transform: uppercase; margin-bottom: 6px;
  }
  .detected-text {
    font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em;
    background: linear-gradient(135deg, #c084fc, #a855f7, #7c3aed);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  }

  /* ── STATS ── */
  .stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 1.25rem;
  }
  .stat-box {
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 10px 8px; text-align: center;
  }
  .stat-label { font-family: var(--mono); font-size: 9px; color: rgba(168,85,247,0.45); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
  .stat-val { font-family: var(--mono); font-size: 13px; font-weight: 500; color: #e9d5ff; }

  /* ── LINK PILLS ── */
  .link-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.25rem; }
  .link-pill {
    font-family: var(--mono); font-size: 10px; padding: 5px 12px; border-radius: 999px;
    border: 1px solid rgba(168,85,247,0.2); background: rgba(124,58,237,0.05);
    color: rgba(168,85,247,0.7); text-decoration: none; transition: all 0.2s; letter-spacing: 0.04em;
  }
  .link-pill:hover { background: rgba(124,58,237,0.2); border-color: var(--purple); color: var(--purple); }

  /* ── BUTTONS ── */
  .btn-mint {
    width: 100%; padding: 16px;
    background: linear-gradient(135deg, #7c3aed, #a855f7, #7c3aed);
    background-size: 200% 100%; border: none; border-radius: 12px;
    color: #fff; font-family: var(--display); font-size: 16px; font-weight: 800;
    letter-spacing: 0.02em; cursor: pointer; transition: all 0.3s;
    margin-bottom: 8px; position: relative; overflow: hidden;
  }
  .btn-mint:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 8px 30px rgba(124,58,237,0.4); }
  .btn-mint:active { transform: translateY(0); }
  .btn-mint:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

  .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }

  .btn-secondary {
    padding: 12px; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
    color: rgba(255,255,255,0.65); font-family: var(--display); font-size: 13px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.2s;
  }
  .btn-secondary:hover { background: rgba(255,255,255,0.07); color: #fff; border-color: rgba(255,255,255,0.15); }

  .btn-again {
    width: 100%; padding: 11px; background: transparent;
    border: 1px solid rgba(168,85,247,0.25); border-radius: 10px;
    color: rgba(168,85,247,0.6); font-family: var(--mono); font-size: 12px;
    cursor: pointer; transition: all 0.2s; letter-spacing: 0.04em;
  }
  .btn-again:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-dim); }

  /* ── STATUS LOG ── */
  .tx-log {
    font-family: var(--mono); font-size: 11px; color: var(--text-dim);
    line-height: 1.7; padding: 12px 14px;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px; min-height: 44px; word-break: break-all;
  }
  .tx-log .success { color: #34d399; }
  .tx-log .error { color: #f87171; }
  .tx-log .info { color: var(--purple); }
  .tx-log .link { color: #60a5fa; text-decoration: underline; cursor: pointer; }

  /* ── NETWORK INFO ── */
  .network-info {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 10px; color: var(--text-dim);
    padding: 8px 12px; background: rgba(168,85,247,0.04);
    border: 1px solid rgba(168,85,247,0.12); border-radius: 8px;
  }
  .net-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; flex-shrink: 0; }
  .net-dot.off { background: #4b5563; }

  footer {
    text-align: center; padding: 2rem;
    font-family: var(--mono); font-size: 10px; color: rgba(168,85,247,0.3);
    letter-spacing: 0.08em; border-top: 1px solid rgba(168,85,247,0.1);
  }
  footer a { color: rgba(168,85,247,0.5); text-decoration: none; }
  footer a:hover { color: var(--purple); }

  /* ── TOAST ── */
  .toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(124,58,237,0.95); color: #fff;
    padding: 10px 24px; border-radius: 999px;
    font-family: var(--mono); font-size: 13px; z-index: 9999;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    backdrop-filter: blur(10px); border: 1px solid rgba(168,85,247,0.5);
    white-space: nowrap;
  }
  .toast.show { transform: translateX(-50%) translateY(0); }

  @keyframes spin { to { transform: rotate(360deg); } }
  .spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.7s linear infinite;
    vertical-align: middle; margin-right: 6px;
  }

  @media (max-width: 480px) {
    nav { padding: 0.75rem 1rem; }
    .nav-links { display: none; }
    h1 { font-size: 2.2rem; }
  }
