/* Tema preso dal logo di Ufotizio (assets/ufotizio.png): i suoi verdi,
   contorni neri spessi e ombre piene come nel disegno, fondo verde con grana
   leggera. Sul fondo il testo è scuro, su intestazione e schede è chiaro. */
:root {
  --bg: #23c483; --bg2: #3eeea6; --bg3: #109e66; --panel: #00683f;
  --ink: #0d0f0e; --text: #f5f7f6; --muted: #bfe9d4; --soft: #134a33; --ombra: rgba(0, 0, 0, .35);
  --grana: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 17px/1.5 Fredoka, system-ui, sans-serif;
  background: var(--grana), radial-gradient(circle at 85% 100%, var(--bg2), var(--bg) 55%, var(--bg3)) fixed; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; color: var(--text);
  background: var(--panel) var(--grana); border-bottom: 4px solid var(--ink); }
header .logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 26px; text-decoration: none; letter-spacing: .5px;
  text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink); }
header .logo img { width: 46px; height: 46px; border-radius: 12px; border: 3px solid var(--ink); }
#account { display: flex; align-items: center; gap: 10px; color: var(--muted); }
header .menu { margin-left: auto; display: flex; align-items: center; gap: 8px; }
header .menu a { color: var(--text); font-weight: 600; text-decoration: none; padding: 4px 10px; }
header .menu a:hover { text-decoration: underline; }
header .lingua { background: transparent; color: var(--text); box-shadow: none; padding: 4px 12px; }
header .menu a.lingua { border: 3px solid var(--ink); border-radius: 999px; }
/* Finché lingua.js non ha scritto i testi nella lingua giusta la pagina non
   si vede (al più per 2 secondi, se lo script non parte). */
html:not(.pronto) body { animation: mostra 0s 2s forwards; visibility: hidden; }
@keyframes mostra { to { visibility: visible; } }
a { color: var(--ink); }
button, .button, #account a { background: var(--text); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 16px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; box-shadow: 3px 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
button:hover, .button:hover, #account a:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
button:active, .button:active, #account a:active { transform: translate(3px, 3px); box-shadow: none; }
main { max-width: 1100px; margin: 0 auto; padding: 28px 16px 48px; }
/* Home: Ufotizio che fluttua e saluta da un fumetto. */
.benvenuto { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; }
.benvenuto img { width: 120px; height: 120px; flex: none; border-radius: 24px; border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ombra); animation: fluttua 3s ease-in-out infinite; }
@keyframes fluttua { 50% { transform: translateY(-6px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .benvenuto img { animation: none; } }
.fumetto { position: relative; background: var(--text); border: 4px solid var(--ink); border-radius: 22px; padding: 16px 20px; box-shadow: 6px 6px 0 var(--ombra); }
.fumetto::before { content: ""; position: absolute; left: -24px; top: 38px; border: 10px solid transparent; border-right: 14px solid var(--ink); }
.fumetto::after { content: ""; position: absolute; left: -14px; top: 41px; border: 7px solid transparent; border-right: 9px solid var(--text); }
.ciao { font-size: 26px; line-height: 1.25; margin: 0 0 6px; }
.info { color: var(--soft); margin: 0; }
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.game { background: var(--panel) var(--grana); border: 4px solid var(--ink); border-radius: 20px; overflow: hidden; color: var(--text); text-decoration: none;
  box-shadow: 8px 8px 0 var(--ombra); transition: transform .12s, box-shadow .12s; }
.game:hover { transform: translate(-3px, -3px) rotate(-.5deg); box-shadow: 11px 11px 0 var(--ombra); }
.game img { width: 100%; display: block; aspect-ratio: 630 / 500; object-fit: cover; border-bottom: 4px solid var(--ink); }
.game div { padding: 12px 18px 16px; }
.game h2 { margin: 0 0 4px; font-size: 24px; text-shadow: 2px 2px 0 var(--ink); }
.game p { margin: 0; color: var(--muted); }
.play { display: flex; flex-direction: column; gap: 12px; }
.play iframe { width: 100%; aspect-ratio: 16 / 9; border: 4px solid var(--ink); background: #000; border-radius: 14px; box-shadow: 8px 8px 0 var(--ombra); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--soft); }
form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
form button { align-self: flex-start; }
input { padding: 10px 14px; border-radius: 12px; border: 3px solid var(--ink); background: var(--text); color: var(--ink); font: inherit; }
#exit-fullscreen { display: none; }
/* Schermo intero (vedi play.js): il gioco copre la pagina; in verticale si
   ruota, così si gioca sempre in orizzontale. */
body.full { overflow: hidden; }
body.full .play iframe { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; z-index: 10; }
body.full #exit-fullscreen { display: block; position: fixed; top: 8px; left: 8px; z-index: 11; padding: 4px 10px; opacity: 0.6; }
@media (orientation: portrait) {
  body.full .play iframe { inset: auto; top: 0; left: 100vw; width: 100vh; width: 100dvh; height: 100vw; transform-origin: top left; transform: rotate(90deg); }
  body.full #exit-fullscreen { top: auto; bottom: 8px; left: auto; right: 8px; transform: rotate(90deg); }
}
/* Pagina itch.io del gioco (vedi itch.js). */
.itch { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.itch h2 { margin: 0; font-size: 26px; }
.itch .tagline { font-size: 19px; margin: 0; }
.itch .shots { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.itch .shots img { height: 220px; border-radius: 12px; border: 3px solid var(--ink); scroll-snap-align: start; flex: none; }
.itch .description { background: var(--panel) var(--grana); color: var(--text); border: 4px solid var(--ink); border-radius: 20px; padding: 8px 20px; box-shadow: 8px 8px 0 var(--ombra); }
.itch .description a { color: var(--bg2); }
.itch .description h3 { font-size: 18px; margin: 18px 0 6px; color: var(--bg2); }
.itch .description ul { padding-left: 20px; }
.itch .description li { margin-bottom: 6px; }
.itch .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.itch .tags li { background: var(--panel); color: var(--muted); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; font-size: 14px; }
/* Home: le ultime voci del devlog. */
.novita { margin-top: 40px; }
.novita h2 { margin: 0 0 8px; font-size: 26px; }
.novita ul { margin: 0 0 16px; padding-left: 20px; }
.novita li { margin-bottom: 6px; }
.novita time, .voce .quando { color: var(--soft); }
.button { display: inline-block; }
/* Pagina di un gioco: titolo, cosa si può fare (vedi testi.js). */
.titolo-gioco { margin: 0; font-size: 30px; }
.scheda { background: var(--panel) var(--grana); color: var(--text); border: 4px solid var(--ink); border-radius: 20px; padding: 8px 20px; box-shadow: 8px 8px 0 var(--ombra); margin-top: 12px; }
.scheda h2 { font-size: 22px; margin: 16px 0 6px; color: var(--bg2); }
.scheda ul { padding-left: 20px; margin: 0; }
.scheda li { margin-bottom: 6px; }
/* Devlog: una scheda per voce (vedi devlog.js). */
.devlog h1 { margin: 0 0 4px; font-size: 34px; }
.devlog > .info { margin: 0 0 24px; }
.voce { background: var(--text) var(--grana); border: 4px solid var(--ink); border-radius: 20px; padding: 6px 20px 10px; box-shadow: 6px 6px 0 var(--ombra); margin-bottom: 24px; scroll-margin-top: 16px; }
.voce .quando { margin: 10px 0 0; font-size: 15px; }
.voce h2 { margin: 2px 0 6px; font-size: 22px; }
.voce ul { padding-left: 20px; margin: 0; }
.voce li { margin-bottom: 4px; }
footer { text-align: center; padding: 8px 16px 32px; color: var(--soft); font-size: 15px; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
footer p { margin: 6px 0 0; }
body.full footer { display: none; }
@media (max-width: 560px) {
  header .logo span { display: none; }
  .benvenuto { flex-direction: column; align-items: stretch; }
  .benvenuto img { align-self: center; width: 96px; height: 96px; }
  .fumetto::before { left: 50%; top: -24px; margin-left: -10px; border: 10px solid transparent; border-bottom: 14px solid var(--ink); }
  .fumetto::after { left: 50%; top: -14px; margin-left: -7px; border: 7px solid transparent; border-bottom: 9px solid var(--text); }
  .ciao { font-size: 22px; }
}
