/* ================================================================
   XOA™ GLOBAL DESIGN SYSTEM — x.ai inspired, dark-modern
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colors */
  --bg:          #000000;
  --bg-1:        #0a0a0a;
  --bg-2:        #111111;
  --bg-card:     rgba(255,255,255,0.03);
  --bg-card-hi:  rgba(255,255,255,0.06);
  --border:      rgba(255,255,255,0.08);
  --border-hi:   rgba(255,255,255,0.15);
  --border-gold: rgba(255,200,50,0.6);
  --text:        #ffffff;
  --text-2:      rgba(255,255,255,0.7);
  --text-3:      rgba(255,255,255,0.4);
  --text-4:      rgba(255,255,255,0.2);
  --gold:        #f5c842;
  --gold-dim:    rgba(245,200,66,0.15);
  --accent:      rgba(255,255,255,0.9);
  --green:       #4ade80;
  --red:         #f87171;
  --discord:     #5865F2;

  /* Fonts */
  --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing & shape */
  --nav-h:       64px;
  --max:         1200px;
  --r:           8px;
  --r-lg:        16px;
  --r-xl:        24px;

  /* Transitions */
  --t:           0.2s ease;
  --t-slow:      0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: auto; font-size: 16px; }
@media (prefers-reduced-motion: reduce), (pointer: coarse) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Google Fonts import via @import in HTML */
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── Page transition ── */
/* Page transition overlay — DISABLED (was causing blank-page bugs) */
#pt { display: none !important; }

/* ── Noise ── */
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ── Starfield ── */
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ── Gradient glows ── */
.glow {
  position: absolute; border-radius: 50%;
  filter: blur(120px); pointer-events: none;
}
.glow-purple { background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%); }
.glow-blue   { background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%); }
.glow-white  { background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%); }

/* ── Typography ── */
.t-xs   { font-size: 0.72rem; }
.t-sm   { font-size: 0.85rem; }
.t-base { font-size: 1rem; }
.t-lg   { font-size: 1.125rem; }
.t-xl   { font-size: 1.25rem; }
.t-2xl  { font-size: 1.5rem; }
.t-3xl  { font-size: 2rem; }
.t-4xl  { font-size: clamp(2rem, 4vw, 3rem); }
.t-5xl  { font-size: clamp(2.5rem, 5vw, 4rem); }
.t-6xl  { font-size: clamp(3rem, 6vw, 5.5rem); }
.w-300  { font-weight: 300; }
.w-400  { font-weight: 400; }
.w-500  { font-weight: 500; }
.w-600  { font-weight: 600; }
.w-700  { font-weight: 700; }
.muted  { color: var(--text-2); }
.dim    { color: var(--text-3); }
.mono   { font-family: var(--font-mono); }
.upper  { text-transform: uppercase; letter-spacing: 0.1em; }
.center { text-align: center; }

.grad {
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.grad-gold {
  background: linear-gradient(135deg, #f5c842, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons (silver glassmorphism) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 22px; border-radius: var(--r);
  font-size: 0.875rem; font-weight: 500; font-family: var(--font);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer; text-decoration: none;
  white-space: nowrap;
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.06) 100%);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(255,255,255,0.04),
    0 1px 3px rgba(0,0,0,0.3);
  overflow: hidden;
}
/* Top edge highlight (silver lit edge) */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(225,230,245,0.45) 0%,
    rgba(180,190,210,0.10) 35%,
    rgba(255,255,255,0.0) 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.25s ease;
}
.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.25);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.10) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(255,255,255,0.06),
    0 6px 22px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.08);
}
.btn:hover::before {
  opacity: 1;
  background: linear-gradient(135deg,
    rgba(245,248,255,0.65) 0%,
    rgba(190,200,220,0.25) 30%,
    rgba(255,255,255,0.10) 50%,
    rgba(190,200,220,0.25) 70%,
    rgba(245,248,255,0.65) 100%);
  background-size: 200% 200%;
  animation: btn-shimmer 2.8s ease-in-out infinite;
}
.btn:active { transform: translateY(0); }

@keyframes btn-shimmer {
  0%, 100% { background-position: 0% 0%; }
  50%      { background-position: 100% 100%; }
}

.btn-sm  { padding: 7px 16px; font-size: 0.8rem; }
.btn-lg  { padding: 14px 32px; font-size: 0.95rem; border-radius: 10px; }
.btn-xl  { padding: 15px 36px; font-size: 1.02rem; border-radius: 12px; }

/* Variants — primary actions get a brighter silver */
.btn-white {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(235,238,245,0.85) 50%, rgba(245,248,255,0.92) 100%);
  border-color: rgba(255,255,255,0.4);
  color: #0a0a0a;
  font-weight: 600;
}
.btn-white::before {
  background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.4) 35%, rgba(255,255,255,0.1) 70%);
}
.btn-white:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(245,248,255,0.92) 50%, rgba(255,255,255,0.98) 100%);
  border-color: rgba(255,255,255,0.6);
  color: #000;
}

/* Ghost — same look as default .btn (we kept .btn already glass). Override to be slightly more transparent. */
.btn-ghost {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.04) 100%);
  border-color: rgba(255,255,255,0.10);
  color: var(--text-2);
}
.btn-ghost:hover { color: #fff; }

/* Gold — keep gold accent but with the same lit-edge treatment */
.btn-gold {
  background:
    linear-gradient(180deg, rgba(245,200,66,0.95) 0%, rgba(224,168,0,0.85) 100%);
  color: #0a0a0a; font-weight: 600;
  border-color: rgba(245,200,66,0.5);
}
.btn-gold::before {
  background: linear-gradient(135deg, rgba(255,235,180,0.7) 0%, rgba(245,200,66,0.2) 35%, transparent 70%);
}
.btn-gold:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,235,180,0.4),
    0 6px 24px rgba(245,200,66,0.35),
    0 0 0 1px rgba(245,200,66,0.2);
}

/* Discord — keep brand color but with glass treatment on hover edge */
.btn-discord {
  background: linear-gradient(180deg, #5865f2 0%, #4752c4 100%);
  color: #fff;
  border-color: rgba(88,101,242,0.5);
}
.btn-discord:hover { background: linear-gradient(180deg, #6770ff 0%, #5865f2 100%); }

.btn-danger {
  background: rgba(239,68,68,0.10);
  border-color: rgba(239,68,68,0.3);
  color: #f87171;
}
.btn-danger:hover { background: rgba(239,68,68,0.18); }

.btn-full { width: 100%; }

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  transition: background var(--t), border-color var(--t);
}
.nav.scrolled {
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; height: 100%;
  padding: 0 24px; display: flex; align-items: center; gap: 32px;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; font-weight: 600; letter-spacing: -0.01em;
  flex-shrink: 0;
  text-decoration: none;
  color: #fff;
}
.nav-logo .nav-logo-mark {
  width: 30px; height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.08));
}
.nav-logo .nav-logo-word {
  height: 22px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.08));
}
.nav-logo .nav-logo-tm {
  font-size: 0.6em; opacity: 0.55;
  align-self: flex-start;
  margin-top: 2px;
}
/* Hide tagline span if any leftover */
.nav-logo span:not(.nav-logo-tm) { display: none; }
.nav-logo img { object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link {
  padding: 6px 12px; border-radius: 6px;
  font-size: 0.85rem; color: var(--text-2);
  transition: color var(--t), background var(--t);
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,0.07); }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Hamburger ── */
.ham {
  display: none; flex-direction: column; gap: 4px;
  padding: 8px; border: 0; background: transparent;
  cursor: pointer; z-index: 210; position: relative;
}
.ham span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text-2); transition: all 0.3s ease;
  transform-origin: center;
}
.ham.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.ham.open span:nth-child(2) { opacity: 0; }
.ham.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Backdrop behind drawer */
.mob-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 195;
  pointer-events: none;
}
.mob-backdrop.open {
  opacity: 1; visibility: visible;
  pointer-events: auto;
}

/* Right-side drawer */
.mob-nav {
  display: flex; flex-direction: column;
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(320px, 85vw);
  padding: calc(var(--nav-h) + 18px) 22px 32px;
  background: rgba(15,15,16,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255,255,255,0.08);
  z-index: 205;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}
.mob-nav.open { transform: translateX(0); }

.mob-link {
  padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.96rem; color: var(--text-2);
  transition: color 0.2s, padding-left 0.2s;
  display: flex; align-items: center; justify-content: space-between;
}
.mob-link:hover, .mob-link:focus {
  color: #fff;
  padding-left: 8px;
}
.mob-link::after {
  content: '→';
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
}
.mob-link:hover::after { opacity: 1; transform: translateX(0); }

/* ── Sections ── */
section { position: relative; z-index: 2; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section-pad { padding: 100px 0; }
.section-pad-sm { padding: 60px 0; }
.section-label {
  font-size: 0.72rem; font-family: var(--font-mono);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 12px;
}
.section-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; line-height: 1.15; margin-bottom: 16px; }
.section-sub { font-size: 1rem; color: var(--text-2); max-width: 520px; line-height: 1.7; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color var(--t), transform var(--t);
}
.card:hover { border-color: var(--border-hi); }
.card-pad { padding: 28px; }
.card-pad-lg { padding: 36px; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); }
.divider-v { width: 1px; background: var(--border); }

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 0.72rem; font-family: var(--font-mono);
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--border-hi); color: var(--text-3);
  background: rgba(255,255,255,0.02);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 2s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── Reveal ── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--t-slow), transform 0.6s var(--t-slow); }
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.3s; }
.reveal.d4 { transition-delay: 0.4s; }
.reveal.d5 { transition-delay: 0.5s; }
.reveal.vis { opacity: 1; transform: translateY(0); }

/* ── Popup ── */
.popup-overlay {
  position: fixed; inset: 0;
  background: rgba(8,8,10,0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 24px;
}
.popup-overlay.open { opacity: 1; pointer-events: all; }
.popup-box {
  position: relative;
  background: linear-gradient(180deg, rgba(20,20,22,0.94), rgba(15,15,17,0.96));
  border: 1px solid rgba(255,255,255,0.10);
  color: #DDDDE6;
  border-radius: 18px;
  padding: 32px 30px 28px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 30px 80px rgba(0,0,0,0.6);
  isolation: isolate;
}
/* Silver-glass lit edge */
.popup-box::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(225,230,245,0.40) 0%,
    rgba(180,190,210,0.10) 40%,
    rgba(255,255,255,0) 75%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.popup-overlay.open .popup-box { transform: none; }
.popup-box h3 {
  font-size: 1.3rem; font-weight: 600;
  letter-spacing: -0.02em; color: #fff;
  margin-bottom: 12px;
}
.popup-box p {
  font-size: 0.92rem;
  color: rgba(221,221,230,0.7);
  margin-bottom: 26px;
  line-height: 1.65;
}
.popup-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem; color: rgba(221,221,230,0.6);
  transition: all 0.15s ease;
}
.popup-close:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border-color: rgba(255,255,255,0.18);
}
.popup-box .btn-discord { color: #fff; }

/* ── Footer ── */
footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--border);
  padding: 64px 24px 40px;
}
.footer-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 48px;
  padding-bottom: 48px; margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.footer-brand p { font-size: 0.85rem; color: var(--text-3); margin-top: 12px; max-width: 240px; line-height: 1.6; }
.footer-socials { display: flex; gap: 10px; margin-top: 20px; }
.footer-social {
  width: 34px; height: 34px; border-radius: var(--r);
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; color: var(--text-3); font-size: 0.85rem;
  transition: all var(--t);
}
.footer-social:hover { border-color: var(--border-hi); color: #fff; background: var(--bg-card); }
.footer-col h4 { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 16px; }
.footer-col a { display: block; font-size: 0.85rem; color: var(--text-3); margin-bottom: 10px; transition: color var(--t); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  font-size: 0.75rem; color: var(--text-4); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.footer-disco {
  padding: 10px 20px; border-top: 1px solid var(--border);
  text-align: center; font-size: 0.75rem; color: var(--text-4);
  font-family: var(--font-mono); letter-spacing: 0.05em;
  max-width: var(--max); margin: 24px auto 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  .ham { display: flex; margin-left: auto; }
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .container { padding: 0 18px; }
  .section-pad { padding: 70px 0; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .section-pad { padding: 56px 0; }
  .nav-inner { padding: 0 16px !important; }
}

/* ─── Upgrade button (golden glow) ───────────────── */
.btn-upgrade-glow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 0.82rem; font-weight: 600;
  background: linear-gradient(135deg, #f5c842, #e0a800);
  color: #000;
  border: 1px solid rgba(245,200,66,0.5);
  cursor: pointer;
  transition: all var(--t);
  position: relative;
  box-shadow: 0 0 0 0 rgba(245,200,66,0), 0 4px 16px rgba(245,200,66,0.25);
  animation: gold-pulse 2.5s ease-in-out infinite;
}
.btn-upgrade-glow:hover {
  box-shadow: 0 0 0 4px rgba(245,200,66,0.15), 0 6px 24px rgba(245,200,66,0.45);
  transform: translateY(-1px);
}
@keyframes gold-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,200,66,0.4), 0 4px 16px rgba(245,200,66,0.25); }
  50% { box-shadow: 0 0 0 6px rgba(245,200,66,0), 0 4px 20px rgba(245,200,66,0.45); }
}

/* Icon-only button (gift, etc) */
.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t);
}
.icon-btn:hover {
  border-color: var(--border-hi);
  color: #fff;
  background: rgba(255,255,255,0.04);
}

/* Discord banner */
.discord-banner {
  position: relative;
  padding: 32px 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, rgba(88,101,242,0.12), rgba(88,101,242,0.02));
  overflow: hidden;
}
.discord-banner-bg {
  position: absolute; top: -150px; right: -150px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(88,101,242,0.25), transparent 70%);
  pointer-events: none;
}
.discord-banner-inner {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  position: relative;
}
.discord-banner-icon {
  width: 56px; height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #5865F2, #4752c4);
  display: flex; align-items: center; justify-content: center;
}
.discord-banner-text { flex: 1; min-width: 240px; }
.discord-banner-text h3 {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

/* Refer popup */
.refer-popup-box {
  max-width: 520px !important;
  width: 92vw;
  padding: 28px 28px 28px !important;
  text-align: left !important;
}
.refer-tabs {
  display: inline-flex;
  gap: 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  margin-bottom: 18px;
}
.refer-tab {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(221,221,230,0.55);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: all var(--t);
}
.refer-tab.active {
  background: rgba(255,255,255,0.10);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.refer-tab:not(.active):hover { color: #fff; }

.refer-hero {
  position: relative;
  padding: 28px 24px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1a1a1a, #0a0a0a);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  overflow: hidden;
  margin-bottom: 22px;
  color: #fff;
}
.refer-hero-bg {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 8px 8px;
  pointer-events: none;
  opacity: 0.6;
}
.refer-hero h2 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  position: relative;
  margin-bottom: 6px;
  color: #fff;
}
.refer-sub {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 18px;
  position: relative;
}
.refer-bar {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
}
.refer-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5eead4, rgba(94,234,212,0.3));
  border-radius: 999px;
  position: relative;
}
.refer-bar-labels {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.7);
  position: relative;
}

.refer-section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(0,0,0,0.6);
  margin-bottom: 14px;
  font-family: var(--font);
}
.refer-list, .refer-rules {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 14px;
  margin: 0;
}
.refer-list li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 0.92rem;
  color: rgba(0,0,0,0.85);
  line-height: 1.5;
}
.refer-icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  color: rgba(0,0,0,0.7);
}
.refer-rules li {
  font-size: 0.86rem;
  color: rgba(0,0,0,0.75);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}
.refer-rules li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.7em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
}
.refer-rules li strong { color: rgba(0,0,0,0.95); }

@media (max-width: 600px) {
  .icon-btn { width: 32px; height: 32px; }
  .discord-banner { padding: 24px 22px; }
  .discord-banner-inner { gap: 14px; }
  .refer-popup-box { padding: 22px 20px !important; }
}

/* ─── PWA window-controls-overlay titlebar ──────────────────── */
:root.pwa-wco { /* room left for native window controls */ }

.pwa-titlebar {
  position: fixed; top: 0; left: 0; right: 0;
  height: env(titlebar-area-height, 36px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  padding-left: env(titlebar-area-x, 12px);
  padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 12px);
  background: rgba(15,15,16,0.92);
  backdrop-filter: blur(20px);
  -webkit-app-region: drag; /* drag the OS window with this bar */
  z-index: 9999;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.78rem; color: #DDDDE6;
  user-select: none;
}
:root.pwa-wco body { padding-top: env(titlebar-area-height, 36px); }

.pwa-tb-left, .pwa-tb-right {
  display: flex; align-items: center; gap: 8px;
  -webkit-app-region: no-drag;
}
.pwa-tb-logo { width: 18px; height: 18px; border-radius: 4px; object-fit: contain; }
.pwa-tb-name { font-weight: 600; }
.pwa-tb-name sup { font-size: 0.55em; opacity: 0.55; }

.pwa-tb-btn {
  width: 28px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0;
  color: rgba(221,221,230,0.7);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}
.pwa-tb-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.pwa-tb-close:hover {
  background: #e81123;
  color: #fff;
}

:root.pwa-hidden body > *:not(.pwa-titlebar) {
  opacity: 0.05;
  filter: blur(8px);
  transition: opacity 0.3s, filter 0.3s;
  pointer-events: none;
}

/* PWA standalone tweaks (no WCO — just app mode) */
@media all and (display-mode: standalone) {
  /* Hide install button when running as PWA */
  #pwa-install-btn { display: none !important; }
}

/* ─── Loading splash — DISABLED to prevent blank-page bugs ─── */
#vex-splash { display: none !important; }
#vex-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.vex-splash-logo {
  width: 84px; height: 84px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
  position: relative;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(20px);
  animation: vex-splash-pulse 2s ease-in-out infinite;
}
.vex-splash-logo img {
  width: 56px; height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(255,255,255,0.2));
}
.vex-splash-bar {
  width: 180px; height: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.vex-splash-bar::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,0.6) 40%,
    rgba(255,255,255,0.9) 50%,
    rgba(255,255,255,0.6) 60%,
    transparent);
  animation: vex-splash-shimmer 1.4s ease-in-out infinite;
}
.vex-splash-text {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
@keyframes vex-splash-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.0); }
  50%      { transform: scale(1.04); box-shadow: 0 0 30px rgba(255,255,255,0.06); }
}
@keyframes vex-splash-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .vex-splash-logo, .vex-splash-bar::before { animation: none; }
}
