/* KoUgo — foglio di stile unico, nessuna dipendenza esterna.
   Scuro con accenti al neon. Le animazioni usano solo transform e opacity: sono
   le due proprietà che il browser anima sulla scheda grafica senza ridisegnare
   la pagina, ed è ciò che tiene lo scorrimento fluido anche su un portatile
   stanco. */

:root {
  --bg: #07090f;
  --bg2: #0b0f18;
  --surface: rgba(255, 255, 255, .045);
  --surface2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .12);
  --fg: #e9f0f7;
  --muted: #94a3b8;
  --neon: #48f2a0;
  --neon2: #6ea8ff;
  --neon3: #d67aff;
  --danger: #ff6b6b;
  --ink: #04120b;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .55);
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0; color: var(--fg); background: var(--bg);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* trama di fondo: due righe di gradiente, niente immagini da scaricare */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 46px 100%,
    radial-gradient(1200px 700px at 70% -10%, rgba(110,168,255,.10), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg) 60%);
  mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--neon); color: var(--ink); padding: .5rem .9rem; border-radius: 999px; }

/* ---- navigazione flottante ---- */
.topnav {
  position: fixed; top: 1rem; left: 50%; translate: -50% 0; z-index: 50;
  display: flex; align-items: center; gap: .4rem;
  max-width: calc(100vw - 1.5rem); padding: .4rem .5rem;
  background: rgba(10, 14, 22, .72); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(150%);
  transition: transform .35s cubic-bezier(.2,.8,.25,1), opacity .35s;
}
.topnav.hidden { transform: translateY(-160%); opacity: 0; }
.mark { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .7rem; font-weight: 800; letter-spacing: -.01em; }
.mark-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--neon); box-shadow: 0 0 12px var(--neon); animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1 } 50% { transform: scale(.7); opacity: .6 } }
.mark-name { background: linear-gradient(100deg, var(--fg), var(--neon)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.anchors { display: flex; gap: .1rem; overflow-x: auto; scrollbar-width: none; }
.anchors::-webkit-scrollbar { display: none; }
.anchors a {
  position: relative; padding: .4rem .75rem; border-radius: 999px;
  color: var(--muted); font-size: .9rem; white-space: nowrap; transition: color .2s, background .2s;
}
.anchors a:hover { color: var(--fg); background: var(--surface); }
.anchors a.on { color: var(--fg); }
.anchors a.on::after {
  content: ""; position: absolute; left: 50%; bottom: .18rem; translate: -50% 0;
  width: 16px; height: 2px; border-radius: 2px; background: var(--neon); box-shadow: 0 0 10px var(--neon);
}
.staff {
  display: inline-flex; align-items: center; gap: .35rem; margin-left: .2rem;
  padding: .4rem .8rem; border-radius: 999px; font-size: .9rem;
  border: 1px solid var(--line); color: var(--muted); transition: color .2s, border-color .2s, transform .2s;
}
.staff:hover { color: var(--neon); border-color: var(--neon); transform: translateY(-1px); }
@media (max-width: 780px) { .anchors { display: none; } }

/* ---- eroe ---- */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 7rem 1rem 5rem; overflow: hidden; }
.hero-in { position: relative; z-index: 2; text-align: center; max-width: 60rem; }
.hero-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; z-index: 0; filter: saturate(1.1); }
.aurora { position: absolute; inset: -20% -10%; z-index: 1; filter: blur(70px); opacity: .55; }
.aurora i {
  position: absolute; display: block; width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  border-radius: 50%; will-change: transform;
}
.aurora i:nth-child(1) { background: radial-gradient(circle, var(--neon), transparent 62%); top: -8%; left: 4%; animation: drift1 22s ease-in-out infinite; }
.aurora i:nth-child(2) { background: radial-gradient(circle, var(--neon2), transparent 62%); top: 12%; right: 2%; animation: drift2 27s ease-in-out infinite; }
.aurora i:nth-child(3) { background: radial-gradient(circle, var(--neon3), transparent 62%); bottom: -14%; left: 32%; animation: drift3 31s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate3d(0,0,0) scale(1) } 50% { transform: translate3d(8vw,6vh,0) scale(1.15) } }
@keyframes drift2 { 0%,100% { transform: translate3d(0,0,0) scale(1.05) } 50% { transform: translate3d(-7vw,8vh,0) scale(.9) } }
@keyframes drift3 { 0%,100% { transform: translate3d(0,0,0) scale(.95) } 50% { transform: translate3d(5vw,-7vh,0) scale(1.2) } }

.eyebrow { color: var(--neon); font-size: .82rem; letter-spacing: .22em; text-transform: uppercase; margin: 0 0 1rem; }
.title { font-size: clamp(3rem, 13vw, 9rem); line-height: .92; margin: 0; letter-spacing: -.04em; font-weight: 800; }
.shine {
  background: linear-gradient(100deg, var(--fg) 10%, var(--neon) 40%, var(--neon2) 60%, var(--fg) 90%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sweep 9s linear infinite;
}
@keyframes sweep { to { background-position: -300% 0 } }
/* le lettere entrano una dopo l'altra, ritardo impostato dal JavaScript */
.title .ch { display: inline-block; opacity: 0; transform: translateY(.5em) rotate(6deg); animation: drop .7s cubic-bezier(.2,.8,.25,1) forwards; }
@keyframes drop { to { opacity: 1; transform: none } }
.lead { font-size: clamp(1.1rem, 2.6vw, 1.6rem); margin: 1.2rem 0 .4rem; color: var(--fg); }
.blurb { color: var(--muted); max-width: 44rem; margin: .4rem auto 0; }
.cta { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.scroller { position: absolute; bottom: 1.6rem; left: 50%; translate: -50% 0; color: var(--muted); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(8px) } }

/* ---- pulsanti ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 1px solid var(--line);
  font: inherit; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--fg);
  transition: transform .18s cubic-bezier(.2,.8,.25,1.3), box-shadow .2s, border-color .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--neon); }
.btn.primary {
  background: linear-gradient(120deg, var(--neon), var(--neon2)); color: var(--ink); border-color: transparent;
  box-shadow: 0 10px 34px rgba(72, 242, 160, .28);
}
.btn.primary:hover { box-shadow: 0 16px 44px rgba(72, 242, 160, .42); }
.btn.ghost { background: transparent; }
.btn.tiny { padding: .3rem .7rem; font-size: .8rem; font-weight: 500; }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 107, .4); }

/* ---- fasce e griglie ---- */
.band { position: relative; padding: clamp(4rem, 9vw, 7.5rem) 1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; }
.wrap.narrow { max-width: 46rem; }
.h2 { font-size: clamp(1.9rem, 4.6vw, 3rem); letter-spacing: -.03em; margin: 0 0 .3rem; line-height: 1.1; }
.h2::after { content: ""; display: block; width: 3.2rem; height: 3px; margin-top: .9rem; border-radius: 3px; background: linear-gradient(90deg, var(--neon), transparent); }
.sub { color: var(--muted); margin: .2rem 0 2.4rem; font-size: 1.05rem; }
.para { margin: 0 0 1rem; color: #cbd5e1; }
.grid { display: grid; gap: 1rem; }
.grid.members { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.games { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.servers { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem; overflow: hidden;
}

/* ---- comparsa allo scorrimento ----
   Si nasconde solo se il JavaScript è vivo (classe js sulla radice): senza,
   il contenuto resta visibile invece di sparire per sempre. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.8,.25,1), transform .7s cubic-bezier(.2,.8,.25,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- inclinazione al passaggio del mouse ---- */
.tilt { transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.8,.25,1), border-color .3s, box-shadow .35s; }
.tilt:hover { border-color: rgba(72, 242, 160, .45); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.tilt.reveal.in:hover { transition-duration: .12s; }

/* ---- membri ---- */
.member-top { display: flex; align-items: center; gap: .9rem; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; background: linear-gradient(135deg, var(--neon), var(--neon2)) border-box; }
.avatar.none { display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; color: var(--ink); background: linear-gradient(135deg, var(--neon), var(--neon2)); }
.name { margin: 0; font-size: 1.15rem; letter-spacing: -.01em; }
.role { margin: .1rem 0 0; color: var(--neon); font-size: .85rem; font-weight: 600; }
.bio { color: var(--muted); font-size: .92rem; margin: .9rem 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .9rem 0 0; }
.tag { font-size: .74rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: .6rem; margin: .9rem 0 0; }
.links a { font-size: .85rem; color: var(--neon2); }
.links a:hover { text-decoration: underline; }

/* ---- giochi ---- */
.game { display: block; padding: 0; min-height: 260px; }
.game .glow { position: absolute; inset: -1px; background: radial-gradient(400px 200px at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent, var(--neon)) 26%, transparent), transparent 70%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.game:hover .glow { opacity: 1; }
.game .cover { width: 100%; height: 160px; object-fit: cover; transition: transform .5s cubic-bezier(.2,.8,.25,1); }
.game:hover .cover { transform: scale(1.06); }
.game-body { display: block; padding: 1.1rem 1.2rem 1.3rem; position: relative; }
.game .more { display: inline-flex; align-items: center; gap: .4rem; margin-top: .9rem; color: var(--accent, var(--neon)); font-weight: 600; font-size: .9rem; }
.game:hover .more .ico { transform: translateX(4px); }
.game .more .ico { transition: transform .25s; }

/* ---- server ---- */
.addr { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .8rem 0; }
.addr code { background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 8px; padding: .3rem .6rem; font-size: .9rem; }
.rules { border-left: 2px solid var(--line); padding-left: .8rem; margin-top: .8rem; }

/* ---- moduli ---- */
.form { display: flex; flex-direction: column; gap: .9rem; margin-top: 2rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--fg); background: rgba(0,0,0,.35);
  border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px rgba(72,242,160,.15); }
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
@media (max-width: 620px) { .row2, .row3 { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }
.ok-msg, .err-msg { margin-top: 1rem; padding: .8rem 1rem; border-radius: 12px; font-size: .92rem; }
.ok-msg { border: 1px solid var(--neon); background: rgba(72,242,160,.12); }
.err-msg { border: 1px solid var(--danger); background: rgba(255,107,107,.12); }

/* ---- piede ---- */
.footer { border-top: 1px solid var(--line); padding: 2.5rem 1rem; margin-top: 2rem; }
.footer-in { max-width: var(--wrap); margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.foot-name { margin: 0; font-weight: 800; }
.socials { display: flex; gap: 1rem; flex-wrap: wrap; }
.socials a { color: var(--muted); font-size: .92rem; }
.socials a:hover { color: var(--neon); }

/* ---- pannello ---- */
body.admin { background: var(--bg2); }
body.admin::before { display: none; }
.abar { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); }
.ame { display: flex; align-items: center; gap: .7rem; }
.anav { display: flex; gap: .2rem; flex-wrap: wrap; padding: .7rem 1.2rem; border-bottom: 1px solid var(--line); }
.anav a { padding: .35rem .8rem; border-radius: 999px; color: var(--muted); font-size: .92rem; }
.anav a:hover { background: var(--surface); color: var(--fg); }
.anav a.on { background: var(--surface2); color: var(--fg); }
.awrap { max-width: 1400px; margin: 0 auto; padding: 1.5rem 1.2rem 5rem; }
.awrap h1 { font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 .3rem; }
.awrap .card { margin: 1.2rem 0; }
.acard { max-width: 26rem; margin: 4rem auto; display: flex; flex-direction: column; gap: .9rem; }
.acard h1 { margin: 0; }
.pill { background: var(--neon); color: var(--ink); border-radius: 999px; padding: 0 .4rem; font-size: .75rem; }
.tablewrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.atable { width: 100%; border-collapse: collapse; font-size: .88rem; }
.atable th { text-align: left; font-weight: 600; color: var(--muted); padding: .6rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.atable td { padding: .45rem .5rem; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
.atable tr.new { background: rgba(72,242,160,.04); }
.atable tr.done { opacity: .5; }
.atable input, .atable select, .atable textarea { padding: .4rem .5rem; border-radius: 8px; font-size: .88rem; }
.atable .msg { max-width: 28rem; white-space: pre-wrap; }
.w4 { width: 4rem; } .w6 { width: 6rem; } .w8 { width: 8rem; } .w10 { width: 10rem; } .w12 { width: 12rem; }
.inline { display: inline-flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.check { flex-direction: row; align-items: center; gap: .5rem; }
.check input { width: auto; }
.grid.tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: .2rem; text-align: center; padding: 1.2rem; transition: transform .2s, border-color .2s; }
.tile:hover { transform: translateY(-3px); border-color: var(--neon); }
.tile b { font-size: 2rem; line-height: 1; }
.tile span { color: var(--muted); font-size: .85rem; }
.grid.media { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.shot { margin: 0; padding: .6rem; }
.shot img { border-radius: 10px; aspect-ratio: 1; object-fit: cover; background: rgba(0,0,0,.3); }
.shot figcaption { font-size: .74rem; margin: .4rem 0; word-break: break-all; color: var(--muted); }

/* chi soffre il movimento non lo subisce */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .js .reveal { opacity: 1; transform: none; }
}
