/* ===========================================================================
   Lights Out Neon — guscio comune del sito
   ===========================================================================
   Stessa impalcatura di Pocket Games (barra alta con lingua, blocchi a due
   colonne, footer, testo lungo), con l'aspetto dell'app: notte blu-viola,
   celle spente grafite, luce ciano che brilla. Il gioco (/play) non passa di
   qui. Le regole di una sola pagina restano nel <style> della pagina.
   =========================================================================== */

@font-face {
  font-family: 'Chakra Petch';
  src: url('/fonts/chakra-petch-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('/fonts/chakra-petch-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* --- Token ----------------------------------------------------------------
   Presi da neon_classic dell'app (lib/core/theme/neon_themes.dart): sfondo
   #0A0A14, cella spenta #1E1E2D con bordo #323246, luce #00FFFF, accenti
   magenta e viola. Solo scuro: e' l'identita' del gioco, una luce accesa
   nel buio. Un tema chiaro spegnerebbe proprio l'effetto da mostrare.
-------------------------------------------------------------------------- */
:root {
  color-scheme: dark;
  --bg: oklch(0.145 0.022 285);
  --bg-deep: oklch(0.115 0.02 285);
  --surface: oklch(0.235 0.028 285);
  --surface-2: oklch(0.285 0.032 285);
  --line: oklch(0.335 0.036 285);
  --fg: oklch(0.965 0.008 220);
  --muted: oklch(0.76 0.028 250);
  --brand: oklch(0.905 0.155 195);        /* la luce: #00FFFF */
  --brand-dim: oklch(0.62 0.11 195);
  --on-brand: oklch(0.17 0.03 230);
  --pink: oklch(0.7 0.29 330);            /* accentSecondary */
  --violet: oklch(0.5 0.26 295);          /* accentTertiary */
  --amber: oklch(0.86 0.16 85);           /* stelle e aiuti nell'app */
  --glow: 0 0 22px oklch(0.905 0.155 195 / 0.55), 0 0 2px oklch(0.905 0.155 195 / 0.9);
  --shadow: 0 18px 40px -18px oklch(0.05 0.03 285 / 0.9);

  --ring: 3px solid var(--brand);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --pad: clamp(1rem, 5vw, 3rem);
  --gap-section: clamp(4.5rem, 12vw, 8.5rem);
  --display: 'Chakra Petch', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  position: relative;
  margin: 0;
  background:
    radial-gradient(60rem 40rem at 85% -10%, oklch(0.3 0.12 285 / 0.45), transparent 70%),
    radial-gradient(50rem 36rem at -10% 35%, oklch(0.32 0.1 220 / 0.22), transparent 70%),
    var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.68;
  overflow-x: hidden;
}

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--fg); }
:focus-visible { outline: var(--ring); outline-offset: 3px; border-radius: 4px; }

body > header { position: relative; z-index: 10; }

.wrap { width: min(72rem, 100%); margin-inline: auto; padding-inline: var(--pad); }

/* --- Blocchi a due colonne (come Pocket Games) --------------------------- */
.split { display: grid; gap: clamp(1.5rem, 5vw, 3.5rem); }
@media (min-width: 62rem) {
  .split { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); align-items: start; }
  .split > header { position: sticky; top: 2rem; }
}

/* --- Barra alta ----------------------------------------------------------- */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-block: clamp(1rem, 3vw, 1.5rem);
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
}
.mark img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.mark:hover { color: var(--brand); }

.menu { display: flex; flex-wrap: wrap; gap: clamp(0.25rem, 2vw, 0.75rem); margin-right: auto; margin-left: clamp(0.5rem, 3vw, 2rem); }
.menu a {
  padding: 0.45rem 0.6rem;
  border-radius: var(--r-sm);
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}
.menu a:hover, .menu a[aria-current="page"] { color: var(--brand); }
@media (max-width: 34rem) {
  .menu { order: 3; width: 100%; margin: 0; justify-content: center; }
}

/* --- Selettore lingua ----------------------------------------------------- */
.lang { position: relative; z-index: 30; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.35rem 0.7rem 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 180ms ease;
}
.lang-btn:hover { border-color: var(--brand); }
.lang-btn span { display: flex; }
.lang-btn svg { width: 26px; height: 18px; border-radius: 3px; display: block; }
.lang-btn .caret { width: 11px; height: 11px; opacity: 0.6; }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 12rem;
  padding: 0.4rem;
  margin: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  display: none;
}
.lang-menu[data-open] { display: block; }
.lang-menu button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 44px;
  padding: 0.4rem 0.6rem;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.lang-menu button:hover { background: var(--surface-2); }
.lang-menu button[aria-current="true"] { color: var(--brand); font-weight: 700; }
.lang-menu svg { width: 24px; height: 16px; border-radius: 3px; flex: none; }

/* --- Bottoni -------------------------------------------------------------
   Il bottone primario e' una cella accesa: ciano pieno con alone. Il
   secondario e' una cella spenta, grafite col bordo.
-------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0 1.4rem;
  border: 0;
  border-radius: var(--r-md);
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  box-shadow: var(--glow);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}
.btn:hover { color: var(--on-brand); transform: translateY(-2px); box-shadow: 0 0 34px oklch(0.905 0.155 195 / 0.7), 0 0 2px var(--brand); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn[hidden] { display: none; }

.btn.ghost {
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.btn.ghost:hover { color: var(--brand); box-shadow: 0 0 0 1px var(--brand-dim) inset; }

/* --- Footer --------------------------------------------------------------- */
body > footer {
  margin-top: var(--gap-section);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
}
.f-links { display: flex; flex-wrap: wrap; gap: 0 1.75rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.f-links a { display: inline-block; min-height: 44px; line-height: 44px; font-weight: 600; font-size: 0.9375rem; }
.f-links a[aria-current="page"] { color: var(--muted); text-decoration: none; cursor: default; }
.f-note { margin: 0; color: var(--muted); font-size: 0.875rem; max-width: 60ch; }

/* Tre colonne: Gioca, Informazioni, Prova anche (l'altra app, in evidenza).
   Sul telefono le prime due affiancate e la scheda dell'app sotto, larga. */
.f-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2rem; margin-bottom: 2rem; }
.f-head { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.f-cols .f-links { display: block; margin: 0; }
.f-cols .f-links a { min-height: 40px; line-height: 40px; }
.f-app {
  display: flex; align-items: center; gap: 0.875rem; margin-top: 0.5rem; padding: 0.875rem;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  color: inherit; text-decoration: none;
}
.f-app:hover { border-color: var(--brand); }
.f-app img { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.f-app b { display: block; font-size: 1rem; }
.f-app b + span { display: block; margin-top: 0.125rem; color: var(--muted); font-size: 0.875rem; line-height: 1.4; }
@media (max-width: 40rem) {
  .f-cols { grid-template-columns: 1fr 1fr; }
  .f-cols > :last-child { grid-column: 1 / -1; }
}

/* --- Testo lungo: guida e pagine legali ---------------------------------- */
.prose { width: min(72rem, 100%); margin-inline: auto; padding-inline: var(--pad); padding-bottom: 2rem; }
.prose h1, .prose h2, .prose h3 { font-family: var(--display); font-weight: 700; text-wrap: balance; }
.prose h1 {
  margin: clamp(1rem, 4vw, 2rem) 0 0.5rem;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--brand);
  text-shadow: 0 0 28px oklch(0.905 0.155 195 / 0.45);
}
.prose .split { margin-top: clamp(2.5rem, 6vw, 4rem); }
.prose h2 { margin: 0; font-size: clamp(1.5rem, 3.6vw, 2.125rem); line-height: 1.1; }
.prose h3 { margin: 1.8rem 0 0; font-size: clamp(1.15rem, 2.4vw, 1.35rem); line-height: 1.2; }
.prose .split-body > :first-child { margin-top: 0; }
.prose p { margin: 0.7rem 0 0; max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.4rem; max-width: 68ch; }
.prose li { margin: 0.4rem 0; }
.prose .lede { font-size: clamp(1.0625rem, 2.2vw, 1.1875rem); color: var(--muted); text-wrap: pretty; }
.prose .last-updated { color: var(--muted); font-size: 0.9375rem; }
.prose .contact { font-weight: 700; }
.prose strong { font-weight: 700; color: var(--fg); }
.prose code { background: var(--surface); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }
.legal-note { color: var(--muted); font-size: 0.9375rem; }

/* --- Mini-griglie della guida ---------------------------------------------
   <div class="mini" data-grid="110/101/011" data-tap="0,0;2,2">: righe
   separate da /, 1 = accesa; data-tap = celle da toccare (riga,colonna da 0).
   Le disegna site.js.
-------------------------------------------------------------------------- */
.mini {
  display: inline-grid;
  gap: 5px;
  padding: 8px;
  border-radius: 12px;
  background: var(--bg-deep);
  box-shadow: 0 0 0 1px var(--line);
}
.mini i {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.mini.sm i { width: 22px; height: 22px; border-radius: 5px; }
.mini i.on { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 12px oklch(0.905 0.155 195 / 0.5); }
.mini i.tap { outline: 3px solid var(--pink); outline-offset: 2px; }
