/* TikForge Games — hub del sottodominio games.tikforge.net.
   Autonomo di proposito, come game.css: NON carica css/styles.css del sito.
   Quel foglio è 2700 righe e le card dei giochi lì dentro sono tutte scoped a
   "body.page-home", quindi riusarle qui vorrebbe dire ereditare anche header/
   hero/nav della home (e i loro script). Qui basta la stessa palette e gli
   stessi font: il sottodominio deve leggersi come TikForge, non essere una
   copia della home. */

:root{
  color-scheme: dark;
  --bg: #050208;
  --bg-panel: #100918;
  --bg-panel-2: #150C20;
  --blue: #A855F7;
  --red: #7C1FD4;
  --ink: #F1E7FF;
  --muted: #B6A0CF;
  --line: rgba(214,190,245,0.10);
  --radius: 16px;
}

*{ box-sizing: border-box; margin: 0; padding: 0; }

body{
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito Sans', system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

h1, h2, h3{ font-family: 'Baloo 2', system-ui, sans-serif; font-weight: 700; letter-spacing: -0.01em; }
a{ color: inherit; text-decoration: none; }
::selection{ background: var(--blue); color: #0E0518; }

a:focus-visible,
summary:focus-visible{
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap{ width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 420px){ .wrap{ padding: 0 18px; } }

/* Bagliore d'ambiente: lo stesso viola del gioco, così passare dall'hub alla
   partita non è uno stacco di temperatura. Decorativo, quindi fuori dal flusso
   e non selezionabile. */
body::before{
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(60% 42% at 50% 0%, rgba(168,85,247,0.20), transparent 70%),
    radial-gradient(48% 34% at 88% 12%, rgba(124,31,212,0.16), transparent 72%);
  pointer-events: none;
  z-index: 0;
}
.site-header, .hub, .site-footer{ position: relative; z-index: 1; }

/* Stub di scelta lingua (game/index.html): si vede solo per l'istante prima
   che il redirect scatti, o per sempre se il redirect fallisce — in quel caso
   il link deve restare leggibile e cliccabile, non un testo nero su nero. */
body.redirect-page{
  min-height: 100vh; align-items: center; justify-content: center;
  padding: 24px; text-align: center; color: var(--muted);
}
body.redirect-page a{ color: var(--blue); font-weight: 700; }
body.redirect-page a:hover{ text-decoration: underline; }

/* ------------------------------------------------------------------ header */

.site-header{ padding: 22px 0; border-bottom: 1px solid var(--line); }
.site-header .wrap{ display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.logo{ display: inline-flex; align-items: center; gap: 10px; font-family: 'Baloo 2', system-ui, sans-serif; font-weight: 700; font-size: 18px; }
.logo img{ width: 26px; height: 26px; border-radius: 7px; }
.logo:hover{ color: var(--blue); }

.header-tools{ display: flex; align-items: center; gap: 12px; }

.header-link{
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  transition: color .2s ease, border-color .2s ease;
}
.header-link:hover{ color: var(--ink); border-color: var(--blue); }
@media (max-width: 520px){ .header-link{ display: none; } }

/* Selettore lingua: <details> puro, nessun JavaScript — l'hub non ne carica
   affatto, a differenza delle pagine del sito. */
.lang{ position: relative; }
.lang summary{
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  transition: color .2s ease, border-color .2s ease;
}
.lang summary::-webkit-details-marker{ display: none; }
.lang summary:hover{ color: var(--ink); border-color: var(--blue); }
.lang summary::after{ content: '▾'; font-size: 11px; opacity: .7; }
.lang-list{
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 148px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--bg-panel-2); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.55);
}
.lang-list a{
  padding: 9px 12px; border-radius: 8px;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
}
.lang-list a:hover{ background: rgba(168,85,247,0.14); color: var(--ink); }
.lang-list a[aria-current="true"]{ color: var(--ink); background: rgba(168,85,247,0.10); }

/* --------------------------------------------------------------------- hub */

.hub{ flex: 1; padding: clamp(48px, 9vw, 88px) 0 clamp(56px, 9vw, 96px); }

.hub-kicker{
  display: inline-block; margin-bottom: 14px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(168,85,247,0.12); border: 1px solid rgba(168,85,247,0.28);
  color: var(--blue); font-size: 11.5px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.hub-title{ font-size: clamp(30px, 5.4vw, 46px); line-height: 1.12; }
.hub-sub{ margin-top: 14px; max-width: 560px; color: var(--muted); font-size: 16px; }

.games-grid{
  margin-top: clamp(34px, 5vw, 52px);
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}

.game-card{
  display: flex; flex-direction: column;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}
a.game-card:hover{
  transform: translateY(-4px);
  border-color: rgba(168,85,247,0.42);
  box-shadow: 0 20px 44px rgba(0,0,0,.5);
}

.game-card-media{
  position: relative; height: 168px; overflow: hidden;
  background: linear-gradient(168deg, #2A1140 0%, #150C20 58%, #0B0512 100%);
}

/* Miniatura disegnata in CSS invece che con uno screenshot: nessun file da
   tenere allineato al gioco quando cambia la palette, e niente immagine in più
   da scaricare prima di poter cliccare "Gioca". */
/* Colonna appoggiata in basso: la torre deve poggiare sul "terreno" della card,
   non fluttuare in cima. I blocchi sono in ordine DOM dall'alto verso il basso
   (il primo è quello in volo, l'ultimo la base più larga), così l'ordine di
   lettura del markup corrisponde a quello che si vede. */
.thumb-stack{
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  gap: 3px; padding-bottom: 24px;
}
.thumb-stack i{
  display: block; height: 13px; border-radius: 3px; flex: none;
  box-shadow: 0 3px 0 rgba(0,0,0,0.28);
}
/* Il blocco in volo: staccato dagli altri e illuminato, come la piattaforma in
   arrivo durante una partita. */
.thumb-stack i:nth-child(1){
  width: 64px; background: #F0ABFC; margin-bottom: 15px;
  transform: translateX(14px);
  box-shadow: 0 0 22px rgba(240,171,252,0.55), 0 3px 0 rgba(0,0,0,0.28);
}
.thumb-stack i:nth-child(2){ width: 76px;  background: #C084FC; transform: translateX(-3px); }
.thumb-stack i:nth-child(3){ width: 92px;  background: #A855F7; transform: translateX(9px); }
.thumb-stack i:nth-child(4){ width: 104px; background: #9333EA; transform: translateX(-5px); }
.thumb-stack i:nth-child(5){ width: 118px; background: #7C3AED; transform: translateX(7px); }
.thumb-stack i:nth-child(6){ width: 128px; background: #6D28D9; }
@media (prefers-reduced-motion: no-preference){
  a.game-card:hover .thumb-stack i:nth-child(1){ transform: translateX(-6px); transition: transform .5s cubic-bezier(.2,1.2,.4,1); }
}

.game-card-badge{
  position: absolute; top: 12px; left: 12px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(8,3,14,0.72); border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}

.game-card-body{ padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-card-body h2{ font-size: 18px; }
.game-card-body p{ color: var(--muted); font-size: 13.5px; }
.game-card-cta{
  margin-top: auto; padding-top: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--blue); font-size: 13.5px; font-weight: 800;
  transition: gap .22s ease, color .22s ease;
}
a.game-card:hover .game-card-cta{ gap: 12px; color: #C084FC; }

/* Card segnaposto: stesso ingombro di una vera, così la griglia non si
   sbilancia finché i giochi sono pochi. Non è un <a>: non porta da nessuna
   parte, quindi non deve essere focalizzabile né cliccabile. */
.game-card.is-soon{ border-style: dashed; opacity: .62; }
.game-card.is-soon .game-card-media{ background: linear-gradient(168deg, #1A1026 0%, #120A1C 100%); }
.game-card.is-soon .game-card-cta{ color: var(--muted); }
.soon-mark{
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: 38px; font-weight: 700; opacity: .35;
}

/* ------------------------------------------------------------------ footer */

.site-footer{ padding: 26px 0 34px; border-top: 1px solid var(--line); }
.site-footer .wrap{ display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.footer-copy{ color: var(--muted); font-size: 12.5px; opacity: .8; }
.footer-links{ display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a{ color: var(--muted); font-size: 12.5px; }
.footer-links a:hover{ color: var(--ink); }

/* ---------- MANUTENZIONE (js/maintenance.js) ----------
   Schermata a tutto schermo quando è fermo tutto TikForge o solo i giochi.
   Lo stato arriva da GET /api/maintenance, scritto dal bot Discord con
   /manutenzione. Stessa resa visiva di .maint-* in css/styles.css, ma
   autonoma (l'hub non carica quel foglio, vedi nota in testa al file). */
.btn{
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-weight: 700; font-size: 14.5px;
  padding: 12px 24px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn-primary{ background: var(--blue); color: #F1E7FF; box-shadow: 0 0 20px rgba(168,85,247,0.32); }
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,0.35), 0 0 34px rgba(168,85,247,0.55); }
.btn-outline{ background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover{ transform: translateY(-2px); border-color: var(--red); box-shadow: 0 0 22px rgba(124,31,212,0.3); }

.maint-screen{
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(720px 420px at 50% 18%, rgba(139,92,246,0.22), transparent 62%),
    rgba(5,2,8,0.97);
  backdrop-filter: blur(6px);
}
.maint-box{
  max-width: 560px; text-align: center;
  border: 1px solid rgba(168,85,247,0.28); border-radius: 28px; padding: 44px 38px;
  background: linear-gradient(168deg, rgba(30,21,48,0.94), rgba(13,10,20,0.97));
  box-shadow: 0 44px 96px -40px rgba(124,58,237,0.6);
}
.maint-badge{
  display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,176,32,0.14); border: 1px solid rgba(255,176,32,0.4);
  font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #FFB020;
}
.maint-box h1{
  margin: 18px 0 12px; font-family: 'Baloo 2', sans-serif;
  font-size: clamp(26px, 4vw, 36px); letter-spacing: -0.02em; color: var(--ink);
}
.maint-box p{ font-size: 15px; line-height: 1.7; color: var(--muted); }
.maint-reason{
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 14px !important; color: #8B81A3 !important;
}
.maint-actions{ display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
