:root {
  --bg: #020409;
  --bg2: #0a0f1a;
  --bg3: #0f1625;
  --bg4: #141c2e;
  --border: #1a2236;
  --border2: #1e2a40;
  --gold: #e6a817;
  --gold2: #f5c842;
  --blue: #4a9eff;
  --text: #e2e8f0;
  --text2: #64748b;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; min-height: 100vh; overflow-x: hidden; }

/* PARTICLES */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.particle { position: absolute; border-radius: 50%; animation: pfloat linear infinite; opacity: 0; }
@keyframes pfloat {
  0%   { transform: translateY(100vh) translateX(0); opacity: 0; }
  10%  { opacity: .4; }
  90%  { opacity: .1; }
  100% { transform: translateY(-5vh) translateX(var(--dx, 0)); opacity: 0; }
}

/* NAVBAR */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 64px;
  background: rgba(2,4,9,.96); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(230,168,23,.2);
  box-shadow: 0 4px 20px rgba(230,168,23,.05);
}
.nav-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.nav-logo img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; box-shadow: 0 0 12px rgba(230,168,23,.3); }
.nav-logo span { font-weight: 800; font-size: 1rem; color: var(--text); letter-spacing: .03em; }
.nav-links { display: flex; gap: 0; list-style: none; }
.nav-links a {
  position: relative; padding: .4rem .9rem; border-radius: 6px;
  color: var(--text2); text-decoration: none; font-size: .83rem;
  transition: color .2s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: .9rem; right: .9rem;
  height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold2));
  transform: scaleX(0); transition: transform .25s;
}
.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--gold); }
.nav-right { display: flex; align-items: center; gap: .6rem; }
.nav-socials { display: flex; gap: .35rem; }
.nav-social {
  width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); text-decoration: none; transition: all .2s;
}
.nav-social:hover { border-color: var(--gold); color: var(--gold); background: rgba(230,168,23,.07); }
#btn-login {
  display: none; align-items: center; gap: .4rem;
  padding: .4rem 1rem; border-radius: 7px;
  background: #5865f2; color: #fff;
  font-weight: 600; font-size: .8rem; border: none; cursor: pointer; transition: all .2s;
}
#btn-login:hover { background: #4752c4; }
#user-bar { display: none; align-items: center; gap: .55rem; }
.u-av { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--gold); }
.u-nm { font-size: .78rem; }
.u-pt { color: var(--gold); font-weight: 700; font-size: .78rem; }
.u-out { background: none; border: 1px solid var(--border2); color: var(--text2); padding: .25rem .5rem; border-radius: 5px; cursor: pointer; font-size: .7rem; transition: all .2s; }
.u-out:hover { border-color: #e74c3c; color: #e74c3c; }

/* PAGE */
.page-wrap { position: relative; z-index: 1; padding-top: 64px; }
.section-inner { max-width: 1100px; margin: 0 auto; padding: 4rem 2rem; }
.section-head { margin-bottom: 3rem; text-align: center; }
.section-title {
  font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #e2e8f0 40%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 1rem; font-family: Georgia, serif;
}
.section-divider {
  width: 8rem; height: 3px; margin: 0 auto 1rem;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.section-sub { color: var(--text2); font-size: 1rem; }

/* RANK GROUP — stile AtlantisAziende */
.rank-group { margin-bottom: 4rem; }
.rank-separator {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  margin-bottom: 2rem;
}
.rank-sep-line {
  flex: 1; height: 2px; max-width: 200px;
  background: linear-gradient(90deg, transparent, rgba(230,168,23,.7));
}
.rank-sep-line.right { background: linear-gradient(90deg, rgba(230,168,23,.7), transparent); }
.rank-badge-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 2rem; border-radius: 16px; border: 2px solid;
  background: rgba(2,4,9,.8); backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.rank-badge-icon { font-size: 1.5rem; }
.rank-badge-name { font-size: 1.4rem; font-weight: 800; font-family: Georgia, serif; letter-spacing: .05em; }

/* MEMBER CARDS */
.members-flex { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
.member-card {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: 1.5rem; width: 170px;
  border-radius: 24px;
  background: rgba(15,22,37,.6); border: 1px solid rgba(255,255,255,.05);
  transition: all .3s; cursor: default;
  position: relative; overflow: hidden;
}
.member-card::before {
  content: ''; position: absolute; inset: 0; border-radius: 24px;
  opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at 50% 30%, var(--glow, rgba(230,168,23,.15)) 0%, transparent 70%);
}
.member-card:hover { border-color: rgba(230,168,23,.3); background: rgba(15,22,37,.9); transform: translateY(-3px); }
.member-card:hover::before { opacity: 1; }
.member-skin-wrap { position: relative; }
.member-skin-img {
  width: 96px; height: 96px; border-radius: 16px; object-fit: cover;
  border: 1px solid rgba(255,255,255,.1);
  transition: border-color .3s;
  image-rendering: pixelated;
}
.member-card:hover .member-skin-img { border-color: rgba(230,168,23,.4); }
.member-skin-glow {
  position: absolute; inset: 0; border-radius: 16px; opacity: 0;
  transition: opacity .3s;
  background: radial-gradient(circle, var(--glow, rgba(230,168,23,.5)) 0%, transparent 70%);
  filter: blur(12px); z-index: -1;
}
.member-card:hover .member-skin-glow { opacity: .6; }
.member-no-skin {
  width: 96px; height: 96px; border-radius: 16px;
  background: var(--bg3); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem; opacity: .4;
}
.member-name { font-weight: 600; font-size: .9rem; text-align: center; color: #e2e8f0; line-height: 1.3; }

/* NEWS */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.nc {
  background: rgba(15,22,37,.6); border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius); padding: 1.3rem 1.4rem;
  cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column; gap: .6rem;
}
.nc:hover { border-color: rgba(230,168,23,.2); transform: translateY(-2px); background: rgba(15,22,37,.9); }
.nc-meta { display: flex; gap: .9rem; font-size: .76rem; color: var(--text2); }
.nc-title { font-size: .9rem; font-weight: 600; line-height: 1.4; }
.nc-excerpt { color: var(--text2); font-size: .82rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nc-rm { color: var(--gold); font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: .3rem; margin-top: auto; transition: gap .2s; }
.nc:hover .nc-rm { gap: .55rem; }
.nc-img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; }

/* PROJECTS */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.pc { background: rgba(15,22,37,.6); border: 1px solid rgba(255,255,255,.05); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all .2s; }
.pc:hover { transform: translateY(-2px); border-color: rgba(230,168,23,.2); }
.pc-img { width: 100%; height: 145px; object-fit: cover; }
.pc-body { padding: 1rem 1.1rem; }
.pc-title { font-weight: 700; font-size: .9rem; margin-bottom: .35rem; }
.pc-desc { color: var(--text2); font-size: .8rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.status-badge { display: inline-block; padding: .1rem .5rem; border-radius: 4px; font-size: .65rem; font-weight: 700; margin-bottom: .45rem; }
.s-in_corso    { background: rgba(46,204,113,.1); color: #2ecc71; }
.s-completato  { background: rgba(74,158,255,.1); color: #4a9eff; }
.s-pianificato { background: rgba(230,168,23,.1); color: var(--gold); }

/* SHOP */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.shc { background: rgba(15,22,37,.6); border: 1px solid rgba(255,255,255,.05); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: all .2s; }
.shc:hover { border-color: rgba(230,168,23,.2); transform: translateY(-2px); }
.shc-img { width: 100%; height: 145px; object-fit: cover; }
.shc-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.shc-name { font-weight: 700; font-size: .9rem; }
.shc-desc { color: var(--text2); font-size: .8rem; flex: 1; line-height: 1.5; }
.shc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; }
.shc-price { font-size: 1.05rem; font-weight: 700; color: var(--gold); }
.shc-old { font-size: .72rem; color: var(--text2); text-decoration: line-through; margin-left: .25rem; }
.disc-b { background: rgba(230,168,23,.1); color: var(--gold); font-size: .65rem; padding: .08rem .32rem; border-radius: 3px; font-weight: 700; }
.btn-buy { padding: .4rem .9rem; border-radius: 6px; background: var(--gold); color: #060a10; font-weight: 700; font-size: .78rem; border: none; cursor: pointer; transition: all .2s; }
.btn-buy:hover { background: var(--gold2); }
.btn-buy:disabled { opacity: .3; cursor: not-allowed; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.3rem; border-radius: 8px; font-weight: 600; font-size: .85rem; cursor: pointer; border: none; text-decoration: none; transition: all .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: #060a10; }
.btn-gold:hover { background: var(--gold2); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border2); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* MODALS */
.mo { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.88); backdrop-filter: blur(6px); display: none; align-items: flex-start; justify-content: center; padding: 2rem 1rem; overflow-y: auto; }
.mo.open { display: flex; }
.mb { background: var(--bg2); border: 1px solid var(--border2); border-radius: 18px; width: 100%; max-width: 680px; position: relative; margin: auto; animation: min .24s ease-out; }
@keyframes min { from { opacity: 0; transform: scale(.97) translateY(10px); } to { opacity: 1; transform: none; } }
.mcl { position: absolute; top: .9rem; right: .9rem; background: var(--bg3); border: 1px solid var(--border2); color: var(--text2); width: 32px; height: 32px; border-radius: 50%; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; z-index: 1; }
.mcl:hover { border-color: #e74c3c; color: #e74c3c; }
.mhi { width: 100%; max-height: 300px; object-fit: cover; border-radius: 18px 18px 0 0; }
.mcon { padding: 1.8rem; }
.mmeta { font-size: .78rem; color: var(--text2); margin-bottom: .8rem; display: flex; gap: .9rem; flex-wrap: wrap; }
.mtitle { font-size: 1.4rem; font-weight: 800; margin-bottom: .9rem; line-height: 1.3; }
.mbody { color: var(--text2); line-height: 1.85; font-size: .92rem; white-space: pre-wrap; }
.mact { display: flex; gap: .65rem; margin-top: 1.3rem; padding-top: 1.3rem; border-top: 1px solid var(--border); }
.btn-del { padding: .45rem 1.1rem; border-radius: 6px; background: rgba(192,57,43,.12); color: #e74c3c; border: 1px solid rgba(192,57,43,.25); font-weight: 600; font-size: .8rem; cursor: pointer; transition: all .2s; }
.btn-del:hover { background: rgba(192,57,43,.22); }

/* MC MODAL */
.mc-modal { position: fixed; inset: 0; z-index: 250; background: rgba(0,0,0,.88); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 1rem; }
.mc-modal.open { display: flex; }
.mcb { background: var(--bg2); border: 1px solid var(--border2); border-radius: 16px; padding: 1.8rem; width: 100%; max-width: 390px; }
.mcb h2 { color: var(--gold); margin-bottom: .35rem; font-size: 1.1rem; }
.mcb p { color: var(--text2); font-size: .85rem; margin-bottom: 1.2rem; line-height: 1.6; }
.field { width: 100%; background: var(--bg3); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); padding: .62rem .95rem; font-size: .88rem; outline: none; transition: border-color .15s; margin-bottom: .55rem; }
.field:focus { border-color: var(--blue); }
.ferr { color: #e74c3c; font-size: .8rem; margin-bottom: .5rem; display: none; }

/* TOAST */
#toast { position: fixed; bottom: 1.6rem; right: 1.6rem; z-index: 300; background: var(--bg2); border: 1px solid var(--border2); border-radius: 8px; padding: .6rem 1rem; font-size: .82rem; transform: translateY(70px); opacity: 0; transition: all .28s; pointer-events: none; }
#toast.show { transform: none; opacity: 1; }

/* FADE IN */
.fade-in { opacity: 0; transform: translateY(20px); transition: all .55s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* FOOTER */
footer { border-top: 1px solid rgba(230,168,23,.1); padding: 3rem 2rem; position: relative; z-index: 1; text-align: center; }
footer a { color: var(--text2); text-decoration: none; transition: color .2s; }
footer a:hover { color: var(--gold); }

/* STATUTO */
.statuto-card { background: rgba(15,22,37,.6); border: 1px solid rgba(255,255,255,.05); border-radius: 14px; padding: 1.5rem; display: flex; align-items: center; gap: 1.25rem; margin-bottom: 2.5rem; cursor: pointer; transition: all .2s; text-decoration: none; color: inherit; }
.statuto-card:hover { border-color: rgba(230,168,23,.3); transform: translateY(-1px); }

@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  .nav-links { display: none; }
  .section-inner { padding: 3rem 1rem; }
  .members-flex { gap: .75rem; }
  .member-card { width: 140px; padding: 1rem; }
}
