/* ── Font & Icone globali ────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&family=JetBrains+Mono:wght@400;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css');

/* ============================================================
   DESIGN TOKENS
============================================================ */
:root {
  --text-xs: clamp(.75rem, .7rem + .25vw, .875rem);
  --text-sm: clamp(.875rem, .8rem + .35vw, 1rem);
  --text-base: clamp(1rem, .95rem + .25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + .75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(1.75rem, 1rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2rem, 1rem + 4vw, 4.5rem);

  --space-1: .25rem; --space-2: .5rem;  --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.25rem;--space-6: 1.5rem; --space-8: 2rem;   --space-10: 2.5rem;
  --space-12: 3rem;  --space-16: 4rem;  --space-20: 5rem;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body:    "Space Grotesk", "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "Courier New", monospace;

  --radius-sm: .375rem; --radius-md: .5rem;  --radius-lg: .75rem;
  --radius-xl: 1rem;    --radius-2xl: 1.5rem; --radius-full: 9999px;
  --transition: 220ms cubic-bezier(.25,.46,.45,.94);

  --color-bg:             #0a0a0f;
  --color-surface:        #0f0f1a;
  --color-surface-2:      #141428;
  --color-surface-off:    #1a1a35;
  --color-surface-off2:   #1f1f42;
  --color-divider:        #2a2a55;
  --color-border:         #332266;

  --color-text:           #e8e0ff;
  --color-text-muted:     #9980cc;
  --color-text-faint:     #5544aa;

  --color-primary:        #9b59ff;
  --color-primary-hover:  #b47aff;
  --color-primary-glow:   rgba(155,89,255,.35);
  --color-primary-subtle: rgba(155,89,255,.12);

  --color-accent:         #00e5ff;
  --color-success:        #00ff88;
  --color-error:          #ff4466;
  --color-warning:        #ffaa00;

  --shadow-lg:   0 12px 40px rgba(0,0,0,.6);
  --shadow-glow: 0 0 30px var(--color-primary-glow), 0 0 60px rgba(155,89,255,.15);
  --shadow-glow-sm: 0 0 12px var(--color-primary-glow);

  --content-wide: 1200px;
  --content-default: 960px;
}

/* ============================================================
   RESET
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-padding-top: var(--space-16);
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
h1,h2,h3,h4,h5,h6 { text-wrap: balance; line-height: 1.15; }
p, li { text-wrap: pretty; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--color-primary-subtle); color: var(--color-text); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Sfondo CSS condiviso: griglia e bande in movimento, senza immagini esterne. */
body {
  position: relative;
  isolation: isolate;
  background: #100d1b;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: -2;
  background-image:
    repeating-linear-gradient(90deg, rgba(155,89,255,.045) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(0,229,255,.035) 0 1px, transparent 1px 72px),
    linear-gradient(118deg, transparent 0 35%, rgba(155,89,255,.08) 46%, transparent 58%);
  background-size: 72px 72px, 72px 72px, 220% 220%;
  animation: ggBackgroundDrift 28s linear infinite;
  opacity: .8;
}
body::after {
  z-index: -1;
  background:
    repeating-linear-gradient(135deg, transparent 0 46px, rgba(255,255,255,.018) 47px 48px, transparent 49px 94px),
    linear-gradient(90deg, rgba(8,6,18,.22), rgba(8,6,18,.58));
  background-size: 180px 180px, 100% 100%;
  animation: ggScanDrift 34s ease-in-out infinite alternate;
  opacity: .85;
}

@keyframes ggBackgroundDrift {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: 72px 72px, -72px 36px, 100% 40%; }
}
@keyframes ggScanDrift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 180px -90px, 0 0; }
}

@media (max-width: 720px) {
  body::before { opacity: .55; }
  body::after { opacity: .9; }
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-surface); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ============================================================
   BACKGROUND
============================================================ */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(155,89,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155,89,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.bg-orb {
  position: fixed; border-radius: 50%; filter: blur(80px);
  pointer-events: none; z-index: 0;
  animation: orbFloat 10s cubic-bezier(.45,.05,.55,.95) infinite;
}
.bg-orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(155,89,255,.15) 0%, transparent 70%); top: -100px; left: -100px; }
.bg-orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(0,229,255,.08) 0%, transparent 70%); bottom: -80px; right: -80px; animation-delay: -5s; }
.bg-orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(155,89,255,.1) 0%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -3s; }
@keyframes orbFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-24px) scale(1.04); } }
.bg-orb-3 { animation: orbFloat3 10s cubic-bezier(.45,.05,.55,.95) infinite; animation-delay: -3s; }
@keyframes orbFloat3 { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,calc(-50% - 24px)) scale(1.04); } }

/* ============================================================
   LAYOUT
============================================================ */
.page-wrapper {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}

/* ============================================================
   BANNER MANUTENZIONE/OFFLINE (gestito da status.js)
============================================================ */
#__maintBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: .65rem 1rem;
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  transition: transform .3s ease;
}

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
  position: sticky;
  top: 0; /* verrà sovrascritto da JS quando c'è il banner */
  z-index: 9999;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: rgba(10,10,15,.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-divider);
  transition: top .3s ease; /* animazione fluida quando appare il banner */
}
.navbar-logo {
  display: flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-lg); color: var(--color-text);
  flex-shrink: 0;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow-sm);
  overflow: hidden; flex-shrink: 0;
}
.logo-icon img { width: 36px; height: 36px; object-fit: cover; }
.logo-text span { color: var(--color-primary); }
.navbar-nav {
  display: flex; align-items: center; gap: var(--space-6);
  list-style: none;
}
.navbar-nav a {
  font-size: var(--text-sm); color: var(--color-text-muted);
  transition: color var(--transition); font-weight: 500;
}
.navbar-nav a:hover { color: var(--color-text); }
.navbar-right { display: flex; align-items: center; gap: var(--space-3); }
.navbar-status {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); color: var(--color-success);
  font-family: var(--font-mono);
  padding: var(--space-1) var(--space-3);
  background: rgba(0,255,136,.08);
  border: 1px solid rgba(0,255,136,.2);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  flex-shrink: 0;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .7; } }
.navbar-hamburger {
  display: none; color: var(--color-text-muted); padding: var(--space-2);
  border-radius: var(--radius-md); transition: color var(--transition);
}
.navbar-hamburger:hover { color: var(--color-text); }

/* ============================================================
   MOBILE MENU
============================================================ */
.mobile-menu {
  display: none;
  position: sticky;
  top: 65px; /* verrà sovrascritto da JS quando c'è il banner */
  z-index: 9998;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-5) var(--space-6);
  transition: top .3s ease;
}
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.mobile-menu a {
  display: block; padding: var(--space-3) var(--space-4);
  color: var(--color-text-muted); font-weight: 500;
  border-radius: var(--radius-lg);
  transition: color 200ms cubic-bezier(.25,.46,.45,.94),
              background 200ms cubic-bezier(.25,.46,.45,.94);
}
.mobile-menu a:hover { color: var(--color-text); background: var(--color-surface-off); }

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm); font-weight: 600;
  font-family: var(--font-body);
  transition: background 220ms cubic-bezier(.25,.46,.45,.94),
              box-shadow  220ms cubic-bezier(.25,.46,.45,.94),
              transform   180ms cubic-bezier(.34,1.56,.64,1),
              border-color 220ms cubic-bezier(.25,.46,.45,.94);
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; min-height: 44px;
  will-change: transform;
}
.btn-primary {
  background: var(--color-primary); color: #fff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow-sm);
}
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-discord {
  background: #5865F2; color: #fff; border-color: #5865F2;
  box-shadow: 0 0 12px rgba(88,101,242,.4);
}
.btn-discord .fa-discord { color: #fff; }
.btn-google .fa-google { color: #4285f4; }
.btn-discord:hover { background: #6e78f5; box-shadow: 0 0 24px rgba(88,101,242,.6); transform: translateY(-2px); }
.btn-discord:active { transform: translateY(0) scale(.98); }
.btn-google {
  background: var(--color-surface-off); color: var(--color-text);
  border-color: var(--color-border);
}
.btn-google:hover { background: var(--color-surface-off2); border-color: rgba(255,255,255,.3); transform: translateY(-2px); }
.btn-google:active { transform: translateY(0) scale(.98); }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--text-base); border-radius: var(--radius-xl); }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ============================================================
   HERO
============================================================ */

/* ============================================================
   FINE STILI GLOBALI
   Gli stili della homepage sono in home.css (Feature #39)
   ============================================================ */

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE GLOBALE — navbar + layout per tutte le pagine
   Queste regole stanno in style.css perché ogni pagina lo carica
   ══════════════════════════════════════════════════════════════ */

/* ── Navbar mobile (900px) ─────────────────────────────────── */
@media (max-width: 900px) {
  /* Nascondi nav links desktop, mostra hamburger */
  .navbar-nav  { display: none; }
  .navbar-hamburger { display: flex !important; }

  /* Previeni overflow orizzontale */
  body, html { overflow-x: hidden; max-width: 100vw; }

  .navbar {
    padding: .6rem 1rem;
    overflow: hidden;
  }

  /* Account btn: solo icona su tablet/mobile */
  .navbar-account-btn span { display: none; }
  .navbar-account-btn { padding: .38rem .45rem; min-width: 34px; justify-content: center; }

  /* Navbar right: gap ridotto */
  .navbar-right { gap: var(--space-2); }

  /* Banners sotto navbar */
  #__globalMaintBanner,
  #__siteNoticeBanner {
    position: sticky !important;
    top: 0 !important;
    z-index: 90 !important;
    font-size: .78rem !important;
    padding: .4rem .75rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Layout generale */
  main, .page-main, .legal-main, .bugs-main {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  /* Chat */
  .chat-sidebar { display: none !important; }
  .chat-main { width: 100% !important; border-radius: 0 !important; }

  /* Legal */
  .legal-container { padding: 0 !important; max-width: 100% !important; }
  .legal-hero { padding: 2rem 1rem 1.5rem !important; }
  .legal-contact-grid { grid-template-columns: 1fr !important; }
  .legal-section { padding: 1.5rem 1rem !important; }

  /* Footer */
  .footer-links { flex-wrap: wrap; gap: .5rem; justify-content: center; }
  .footer-inner { flex-direction: column; text-align: center; gap: 1rem; }
}

@media (max-width: 600px) {
  .navbar { padding: .5rem .75rem; }
  .logo-text { font-size: .9rem; }

  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.15rem !important; }

  .btn-lg { padding: .6rem 1.1rem !important; font-size: .88rem !important; }
}

/* ══════════════════════════════════════════════════════════════
   COOKIE BANNER & BLOCKED — disponibili su tutte le pagine
   ══════════════════════════════════════════════════════════════ */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--color-surface-2, #141428);
  border-top: 1px solid var(--color-border, rgba(255,255,255,.08));
  padding: 1.25rem 1.5rem;
  box-shadow: 0 -4px 30px rgba(0,0,0,.5);
  transform: translateY(100%);
  transition: transform .5s cubic-bezier(.34,1.2,.64,1);
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cookie-text { flex: 1; min-width: 200px; }
.cookie-text h3 { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; display: flex; align-items: center; gap: .5rem; }
.cookie-text p  { font-size: .88rem; color: var(--color-text-muted); line-height: 1.6; }
.cookie-text a  { color: var(--color-primary); text-decoration: underline; }
.cookie-actions { display: flex; gap: .75rem; flex-shrink: 0; flex-wrap: wrap; }
.cookie-reject {
  background: transparent; color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: .5rem 1rem; border-radius: 8px;
  font-size: .88rem; font-weight: 600; min-height: 44px; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.cookie-reject:hover { border-color: var(--color-error); color: var(--color-error); }
.cookie-accept {
  background: var(--color-primary); color: #fff;
  border: 1px solid var(--color-primary);
  padding: .5rem 1.25rem; border-radius: 8px;
  font-size: .88rem; font-weight: 600; min-height: 44px; cursor: pointer;
  transition: background .2s;
}
.cookie-accept:hover { background: var(--color-primary-hover, #b47aff); }

.cookie-blocked {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(10,10,15,.97);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem; gap: 1.25rem;
}
.cookie-blocked.visible { display: flex; }
.cookie-blocked-icon { color: var(--color-error); width: 56px; height: 56px; }
.cookie-blocked h2 { font-size: 1.5rem; font-weight: 700; }
.cookie-blocked p  { font-size: 1rem; color: var(--color-text-muted); max-width: 40ch; }

.cookie-float-btn {
  position: fixed; bottom: 24px; right: 24px; z-index: 400;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--color-surface-2, #141428);
  border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  transition: transform .2s;
}
.cookie-float-btn:hover { transform: scale(1.1); }

@media (max-width: 600px) {
  .cookie-banner { padding: 1rem; }
  .cookie-inner  { gap: .75rem; }
  .cookie-float-btn { bottom: 80px; right: 12px; } /* sopra input chat */
}

/* ══════════════════════════════════════════════════════════════
   ICON SIZES GLOBALI — sostituisce tutti gli style="width/height"
   sulle icone Lucide usate in tutto il sito
   ══════════════════════════════════════════════════════════════ */
[data-lucide] { display: inline-block; vertical-align: middle; flex-shrink: 0; }
#offlineModal .offline-modal-close-icon { width: 20px; height: 20px; }
#offlineModal .offline-modal-status-icon { width: 28px; height: 28px; color: var(--color-error); }
#offlineModal .offline-modal-discord-icon { width: 16px; height: 16px; }

/* Taglie standard */
.icon-xs  { width: 11px; height: 11px; }
.icon-sm  { width: 13px; height: 13px; }
.icon-sm2 { width: 14px; height: 14px; }
.icon-md  { width: 15px; height: 15px; }
.icon-md2 { width: 16px; height: 16px; }
.icon-nav { width: 18px; height: 18px; }
.icon-lg  { width: 20px; height: 20px; }
.icon-xl  { width: 22px; height: 22px; }
.icon-2xl { width: 32px; height: 32px; }
.icon-3xl { width: 40px; height: 40px; }
.icon-cookie { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }
.icon-muted { opacity: .3; }

/* Colori semantici icone */
.icon-primary { color: var(--color-primary); }
.icon-success { color: var(--color-success); }
.icon-warning { color: var(--color-warning); }
.icon-discord { color: #7289da; }
.icon-twitch  { color: #9146ff; }
.icon-error   { color: var(--color-error); }

/* ══════════════════════════════════════════════════════════════
   FOOTER GLOBALE — usato da footer-loader.js in tutte le pagine
   ══════════════════════════════════════════════════════════════ */
footer {
  padding: var(--space-8, 2rem) var(--space-6, 1.5rem);
  border-top: 1px solid var(--color-divider, #2a2a55);
  text-align: center;
}
.footer-inner {
  max-width: var(--content-wide, 1200px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4, 1rem);
}
.footer-links {
  display: flex;
  gap: var(--space-6, 1.5rem);
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  font-size: var(--text-sm, .875rem);
  color: var(--color-text-muted);
  transition: color var(--transition, 220ms);
}
.footer-links a:hover { color: var(--color-primary); }
.footer-copy {
  font-size: var(--text-xs, .75rem);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}
.footer-social {
  display: flex;
  gap: var(--space-3, .75rem);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-surface-2);
  color: var(--color-primary);
  border: 1px solid var(--color-divider);
  font-size: 1rem;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform .15s;
}
.footer-social-link:hover {
  color: var(--color-accent);
  background: var(--color-primary-subtle);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}
.footer-social-twitch { color: #b27aff; }
.footer-social-tiktok { color: #6ee7ff; }
.footer-social-instagram { color: #f48bff; }
.footer-social-discord { color: var(--color-primary); }
.footer-social-contact { color: #c38cff; }
.footer-social-email { color: var(--color-accent); }
.footer-add-bot {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem 1.1rem;
  background: var(--color-primary);
  color: #fff;
  border: 1px solid var(--color-primary-hover);
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  box-shadow: var(--shadow-glow-sm);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.footer-add-bot .fa-discord { color: var(--color-primary); }
.footer-add-bot:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-glow); }

@media (max-width: 768px) {
  footer { padding: var(--space-6, 1.5rem) var(--space-4, 1rem); }
  .footer-links { gap: var(--space-4, 1rem); }
  .footer-inner { flex-direction: column; text-align: center; gap: 1rem; }
}
@media (max-width: 600px) {
  .footer-links { flex-wrap: wrap; gap: .5rem; justify-content: center; }
}

/* ── Navbar mobile auth btn ─────────────────────────────────── */
.btn-mobile-auth-full {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
}


/* ── Copy tooltip feedback ──────────────────────────────── */
.copy-tooltip {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--color-surface, #1a1a2e);
  color: var(--color-success, #00c878);
  border: 1px solid var(--color-success, #00c878);
  padding: .35rem .9rem; border-radius: 8px;
  font-size: .78rem; font-weight: 600;
  opacity: 0; transition: opacity .2s, transform .2s;
  pointer-events: none; z-index: 99999; white-space: nowrap;
}
.copy-tooltip.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Hover feedback su elementi cliccabili/copiabili ─────── */
[data-copy] { cursor: pointer; }
[data-copy]:hover { opacity: .8; }

/* ── Account Modal — responsive ────────────────────────── */

/* Overlay / backdrop */
#__accountModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-sizing: border-box;
}

/* Card principale */
.acct-modal-box {
  background: var(--color-surface-2, #13111a);
  border: 1px solid var(--color-divider, #2a2740);
  border-radius: 18px;
  width: 100%;
  max-width: 440px;
  max-height: 90dvh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.55);
  box-sizing: border-box;
  /* Scrollbar sottile */
  scrollbar-width: thin;
  scrollbar-color: var(--color-divider,#2a2740) transparent;
}
.acct-modal-box::-webkit-scrollbar { width: 4px; }
.acct-modal-box::-webkit-scrollbar-thumb { background: var(--color-divider,#2a2740); border-radius: 2px; }

/* Header del modal */
.acct-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem .85rem;
  border-bottom: 1px solid var(--color-divider, #2a2740);
  position: sticky;
  top: 0;
  background: var(--color-surface-2, #13111a);
  z-index: 1;
}
.acct-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text, #fff);
}
.acct-close-btn {
  background: none;
  border: none;
  color: var(--color-text-muted, #888);
  cursor: pointer;
  padding: .3rem;
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
  transition: color .2s, background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
}
.acct-close-btn:hover { color: var(--color-text,#fff); background: var(--color-surface-off,rgba(255,255,255,.07)); }

/* Body */
.acct-body {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Label sezione */
.acct-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted, #888);
  margin-bottom: .55rem;
}

/* Account collegati */
.acct-accounts-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.acct-linked-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .85rem;
  border-radius: 10px;
  background: var(--color-surface, #1a1730);
  border: 1px solid var(--color-divider, #2a2740);
  transition: border-color .2s;
  min-width: 0;
}
.acct-linked-item:not(.acct-not-linked):hover { border-color: var(--color-primary,#7c5aff); }
.acct-linked-item.acct-not-linked { opacity: .8; }

.acct-provider-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.acct-discord { background: rgba(88,101,242,.18); color: #5865f2; }
.acct-google  { background: rgba(66,133,244,.12); color: #4285f4; }

.acct-info {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.acct-info-text { min-width: 0; overflow: hidden; }
.acct-avatar-img {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.acct-avatar-placeholder {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-primary, #7c5aff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700; flex-shrink: 0;
}
.acct-username {
  font-size: .88rem; font-weight: 600;
  color: var(--color-text, #fff);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.acct-id {
  font-size: .68rem;
  color: var(--color-text-muted, #888);
  font-family: var(--font-mono, monospace);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.acct-link-btn {
  margin-left: auto;
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 600;
  padding: .3rem .6rem;
  border-radius: 6px;
  border: 1px solid var(--color-primary, #7c5aff);
  color: var(--color-primary, #7c5aff);
  background: rgba(124,90,255,.08);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s;
}
.acct-link-btn:hover { background: rgba(124,90,255,.18); }

/* Limiti giornalieri */
.acct-limits-box {
  background: var(--color-surface, #1a1730);
  border: 1px solid var(--color-divider, #2a2740);
  border-radius: 10px;
  padding: .9rem 1rem;
}
.acct-limits-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .45rem;
  gap: .5rem;
}
.acct-limits-label { font-size: .83rem; color: var(--color-text-muted, #aaa); }
.acct-limits-value { font-size: .95rem; font-weight: 700; color: var(--color-text, #fff); white-space: nowrap; }
.acct-progress-track {
  height: 6px; border-radius: 3px;
  background: var(--color-divider, #2a2740);
  overflow: hidden;
}
.acct-progress-fill {
  height: 100%; border-radius: 3px;
  transition: width .4s ease;
}
.acct-limits-sub {
  margin-top: .4rem;
  font-size: .76rem;
  color: var(--color-text-muted, #888);
}

/* Riga data registrazione */
.acct-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: var(--color-text-muted, #888);
  padding-top: .15rem;
  border-top: 1px solid var(--color-divider, #2a2740);
  gap: .5rem;
}
.acct-meta-val { color: var(--color-text, #ccc); font-weight: 500; text-align: right; }

/* Bottone Logout */
.acct-logout-btn {
  width: 100%;
  padding: .65rem;
  background: rgba(255,68,102,.08);
  border: 1px solid rgba(255,68,102,.25);
  border-radius: 10px;
  color: #ff4466;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  transition: background .2s, border-color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.acct-logout-btn:hover { background: rgba(255,68,102,.16); border-color: rgba(255,68,102,.45); }

/* Pulsante Account in navbar */
.navbar-account-btn {
  padding: .4rem .75rem;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--color-divider, #2a2740);
  color: var(--color-text-muted, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 500;
  transition: background .2s, color .2s, border-color .2s;
  white-space: nowrap;
}
.navbar-account-btn:hover {
  background: var(--color-surface, #1a1730);
  color: var(--color-text, #fff);
  border-color: var(--color-primary, #7c5aff);
}

/* ── Responsive Account Modal ──────────────────────────── */
@media (max-width: 600px) {
  /* Modal full-bottom-sheet su mobile */
  #__accountModal {
    align-items: flex-end;
    padding: 0;
  }
  .acct-modal-box {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 88dvh;
  }
  .acct-header { padding: 1rem 1rem .75rem; }
  .acct-body { padding: 1rem; gap: 1rem; }
}

@media (max-width: 900px) {
  /* Su mobile nascondi testo "Account" nel pulsante navbar, mostra solo icona */
  .navbar-account-btn span { display: none; }
  .navbar-account-btn { padding: .4rem .5rem; }
}

/* Ruolo banner (shared con chat modal) */
.acct-role-banner {
  display: flex; align-items: center; gap: .45rem;
  padding: .55rem .85rem; border-radius: 8px;
  font-size: .82rem; font-weight: 700;
}
.acct-role-std  { background: var(--color-surface,#1a1730); color: var(--color-text-muted,#888); border: 1px solid var(--color-divider,#2a2740); }
.acct-role-vip  { background: rgba(124,90,255,.1); color: var(--color-primary,#7c5aff); border: 1px solid rgba(124,90,255,.3); }

/* Righe limite (shared con chat modal) */
.acct-limit-row { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.acct-limit-label { display:flex; align-items:center; gap:.35rem; font-size:.82rem; color:var(--color-text-muted,#aaa); min-width:0; }
.acct-limit-icon  { font-size:.9rem; flex-shrink:0; }
.acct-limit-val   { font-size:.88rem; font-weight:700; color:var(--color-text,#fff); white-space:nowrap; flex-shrink:0; }
.acct-limit-cooldown .acct-limit-val { color:var(--color-primary,#7c5aff); }

/* Meta grid (shared) */
.acct-meta-grid { display:flex; flex-direction:column; gap:.4rem; padding-top:.15rem; border-top:1px solid var(--color-divider,#2a2740); }

/* ============================================================
   UI REFRESH — dark ink, teal actions, readable surfaces
============================================================ */
:root {
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 3rem;
  --color-bg: #0a0a0f;
  --color-surface: #0f0f1a;
  --color-surface-2: #141428;
  --color-surface-off: #1a1a35;
  --color-surface-off2: #1f1f42;
  --color-divider: #2a2a55;
  --color-border: #332266;
  --color-text: #e8e0ff;
  --color-text-muted: #9980cc;
  --color-text-faint: #5544aa;
  --color-primary: #9b59ff;
  --color-primary-hover: #b47aff;
  --color-primary-glow: rgba(155,89,255,.28);
  --color-primary-subtle: rgba(155,89,255,.12);
  --color-accent: #00e5ff;
  --color-success: #00ff88;
  --color-warning: #ffaa00;
  --color-error: #ff4466;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --radius-2xl: 8px;
  --shadow-glow: 0 8px 24px rgba(0,0,0,.24);
  --shadow-glow-sm: 0 4px 14px rgba(0,0,0,.18);
}

body {
  background: #100d1b;
  color: var(--color-text);
  background-attachment: fixed;
}
.bg-grid { display: none !important; }
.bg-orb { display: none !important; }
.cookie-blocked { display: none !important; }
.navbar {
  background: rgba(10,17,23,.96);
  border-bottom-color: var(--color-divider);
  backdrop-filter: none;
}
.logo-icon {
  background: var(--color-surface-off2);
  border: 1px solid var(--color-border);
  box-shadow: none;
  border-radius: var(--radius-md);
}
.logo-text span, .navbar-nav a:hover, .navbar-nav a.active { color: var(--color-primary) !important; }
.gradient-text {
  background: none !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: currentColor !important;
}
.btn { border-radius: var(--radius-md) !important; box-shadow: none !important; }
.btn-primary, .btn-hero-primary {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}
.btn-primary:hover, .btn-hero-primary:hover {
  background: var(--color-primary-hover) !important;
  border-color: var(--color-primary-hover) !important;
  transform: translateY(-1px);
}
.btn-secondary, .btn-hero-discord {
  background: var(--color-surface-2) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}
.btn-secondary:hover, .btn-hero-discord:hover { border-color: var(--color-primary) !important; color: var(--color-primary) !important; }
/* I loghi brand arrivano dalla libreria Font Awesome; nascondi solo gli SVG legacy. */
svg.inline-brand-icon,
.btn-hero-discord > svg { display: none !important; }
.fa-discord { color: #fff; }
.btn-discord .fa-discord,
.btn-hero-discord .fa-discord { color: #fff !important; }
.footer-social-link.footer-social-discord .fa-discord,
.footer-add-bot .fa-discord { color: var(--color-primary) !important; }
.fa-google { color: #4285f4; }
.card, .page-card, .feature-card, .blog-card, .blog-post-card, .bug-card,
.legal-body, .legal-box, .legal-contact-card, .legal-right-card {
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
}
.feature-card:hover, .blog-card:hover, .blog-post-card:hover, .bug-card:hover,
.page-card:hover, .legal-contact-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-glow-sm) !important;
}
input, textarea, select { border-radius: var(--radius-md) !important; }
table { border-color: var(--color-divider); }
code, pre { border-radius: var(--radius-md) !important; }

/* Reveal piu morbidi durante lo scroll, senza penalizzare dispositivi lenti. */
.reveal {
  opacity: 0;
  transform: translateY(34px) scale(.985);
  filter: blur(1px);
  transition:
    opacity .72s cubic-bezier(.22,.61,.36,1),
    transform .72s cubic-bezier(.22,.61,.36,1),
    filter .72s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform, filter;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}
.feature-card, .blog-card, .page-card, .blog-post-card, .bug-card {
  transition: transform .32s cubic-bezier(.22,.61,.36,1), border-color .24s ease, box-shadow .32s ease;
}

/* Public content pages */
.page-wrapper > main:not(#main-content), .legal-main, .bugs-main,
.blog-list-section, .blog-hero, .about-main, .how-main, .admin-docs-main {
  background: transparent;
}
.page-wrapper main h1, .page-wrapper main h2, .page-wrapper main h3 { color: var(--color-text); }
.section-label, .blog-tag, .legal-badge, .legal-hero-badge { color: var(--color-primary) !important; }
.legal-wrapper, .bugs-main, .blog-list-inner, .blog-hero-inner { max-width: var(--content-wide); }
.legal-body, .legal-box, .legal-contact-card, .legal-right-card, .bug-card,
.blog-post-card { background: var(--color-surface) !important; border-color: var(--color-divider) !important; }
.legal-section, .legal-table-wrapper, .legal-table-wrap { border-color: var(--color-divider) !important; }
.legal-section a, .legal-table a, .legal-toc-list a { color: var(--color-accent); }
.blog-filters-inner, .blog-filters button, .bug-filter-btn { border-color: var(--color-divider) !important; }
.blog-filters button.active, .bug-filter-btn.active { background: var(--color-primary) !important; color: #fff !important; }

@media (max-width: 700px) {
  .navbar { padding-inline: var(--space-4); }
  .navbar-nav { gap: var(--space-3); }
  .navbar-nav a { font-size: var(--text-xs); }
  .section-title { font-size: var(--text-xl); }
}

@media (prefers-reduced-motion: reduce) {
  body { background-attachment: scroll; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

/* Desktop: scala piu leggibile senza alterare la densita mobile. */
@media (min-width: 1100px) {
  :root {
    --text-xs: .86rem;
    --text-sm: .98rem;
    --text-base: 1.08rem;
    --text-lg: 1.28rem;
    --text-xl: 1.7rem;
    --text-2xl: 2.2rem;
  }
  body { font-size: 1.08rem; }
  .navbar { min-height: 72px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
}

/* Sfondo homepage stabile: un solo movimento lento, senza repaint aggressivi. */
body.home-page {
  background-color: #0d0b17;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(124, 90, 255, .14), transparent 32rem),
    radial-gradient(circle at 82% 76%, rgba(79, 190, 255, .10), transparent 30rem),
    linear-gradient(135deg, #0d0b17 0%, #101323 52%, #0c111c 100%);
  background-attachment: fixed;
}
body.home-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .24;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  animation: homeGridDrift 42s linear infinite;
  will-change: background-position;
}
body.home-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(13,11,23,.12), rgba(13,11,23,.62));
}
@keyframes homeGridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 64px 64px, 64px 64px; }
}
body.home-page .bg-grid,
body.home-page .bg-orb { display: none !important; }

@media (min-width: 1440px) {
  body { font-size: 1.12rem; }
  .navbar { padding-inline: clamp(32px, 4vw, 96px); }
}

@media (prefers-reduced-motion: reduce) {
  body.home-page::before { animation: none; }
}
