/* ==========================================================================
   rbdev.cc — design system
   Nero caldo + oro zafferano. Tema scuro di default, chiaro con il toggle.
   ========================================================================== */

/* ---------- Font (self-hosted) ---------- */
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-var.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

/* ---------- Token ---------- */
:root {
  --ink: #141210;          /* fondo: nero caldo, non assoluto */
  --surface: #1d1a16;      /* card e pannelli */
  --surface-2: #26221c;
  --line: #342f27;         /* bordi sottili */
  --text: #eee7da;         /* crema */
  --muted: #a39a8a;
  --gold: #e3a92f;         /* zafferano / ambra */
  --gold-deep: #b8801a;
  --gold-soft: rgba(227, 169, 47, .12);
  --on-gold: #1a1308;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 18px;
  --wrap: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --ink: #f3eee4;
  --surface: #fbf8f2;
  --surface-2: #ece5d8;
  --line: #ddd3c2;
  --text: #1a1713;
  --muted: #6b6255;
  --gold: #b8801a;         /* più scuro: contrasto leggibile su fondo chiaro */
  --gold-deep: #94660f;
  --gold-soft: rgba(184, 128, 26, .1);
  --on-gold: #1a1308;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
/* Grana leggerissima: dà calore al nero senza costare nulla. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: .2em; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold); color: var(--on-gold); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; letter-spacing: -.01em; margin: 0; }
em { font-style: italic; }
h1 em, h2 em { color: var(--gold); }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .8125rem; letter-spacing: .02em; }
.muted { color: var(--muted); }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--gold); color: var(--on-gold); padding: .5rem 1rem; border-radius: 8px;
}
.skip:focus { top: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }

.brand { display: inline-flex; align-items: baseline; gap: .15rem; text-decoration: none; font-size: 1.6rem; line-height: 1; }
.brand:hover { color: inherit; }
.brand-mark { font-family: var(--serif); font-style: italic; color: var(--gold); }
.brand-word { font-family: var(--sans); font-weight: 700; font-size: .62em; letter-spacing: .04em; text-transform: uppercase; }

.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a {
  position: relative; padding: .45rem .75rem; border-radius: 999px;
  text-decoration: none; font-size: .9375rem; font-weight: 500; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface); }

/* Selettore lingua: <details> nativo, funziona anche senza JavaScript. */
.lang-switch { position: relative; flex: none; }
.lang-switch summary {
  display: grid; place-items: center; height: 40px; min-width: 44px; padding: 0 .7rem;
  border: 1px solid var(--line); border-radius: 999px; list-style: none; cursor: pointer;
  font: 600 .75rem/1 var(--mono); letter-spacing: .08em; color: var(--text);
  transition: border-color .2s, color .2s;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover, .lang-switch[open] summary { border-color: var(--gold); color: var(--gold); }
.lang-switch ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 160px;
  margin: 0; padding: .4rem; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .6);
}
.lang-switch a { display: block; padding: .55rem .8rem; border-radius: 9px; text-decoration: none; font-size: .9375rem; }
.lang-switch a:hover { background: var(--surface-2); color: var(--text); }
.lang-switch a[aria-current] { color: var(--gold); font-weight: 600; }

.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); border-radius: 50%; background: transparent;
  color: var(--text); cursor: pointer;
  transition: border-color .2s, transform .4s var(--ease);
}
.theme-toggle:hover { border-color: var(--gold); transform: rotate(20deg); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; grid-area: 1 / 1; }
.theme-toggle .icon-moon { fill: currentColor; stroke: none; }
:root:not([data-theme="light"]) .icon-moon,
:root[data-theme="light"] .icon-sun { display: none; }

/* ---------- Pulsanti, tag ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.35rem; border-radius: 999px;
  font: 600 .9375rem/1 var(--sans); text-decoration: none;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background-color .2s, border-color .2s, color .2s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--gold); color: var(--on-gold); }
.btn--primary:hover { color: var(--on-gold); background: var(--gold-deep); box-shadow: 0 10px 30px -10px var(--gold); }
.btn--ghost { border-color: var(--line); color: var(--text); background: transparent; cursor: pointer; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

.tag {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  font: 500 .6875rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line);
}
.tag--gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, transparent); background: var(--gold-soft); }

.eyebrow {
  margin: 0 0 1.5rem; font: 500 .75rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: .75rem;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(4.5rem, 12vw, 9rem) 0 clamp(3.5rem, 8vw, 6rem); }
.hero-glow {
  position: absolute; z-index: -1; pointer-events: none;
  width: 70vmax; height: 70vmax; right: -25vmax; top: -35vmax;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--gold) 22%, transparent), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(-6vmax, 5vmax) scale(1.08); } }

.hero-title { font-size: clamp(2.9rem, 8.5vw, 6.5rem); text-wrap: balance; }
/* La parte in corsivo va sempre a capo: è il "colpo d'occhio" del titolo. */
.hero-title em { display: block; }
.hero-text { max-width: 46ch; margin: 1.75rem 0 0; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.25rem; }

/* ---------- Sezioni ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.25rem; }
.section-title { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.link-more { font-size: .9375rem; font-weight: 600; text-decoration: none; color: var(--muted); }
.link-more:hover { color: var(--gold); }

/* ---------- Feed aggiornamenti ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item {
  display: grid; grid-template-columns: 10.5rem 1fr; gap: 1.5rem;
  padding: 1.5rem 0; border-top: 1px solid var(--line);
}
.feed-item:last-child { border-bottom: 1px solid var(--line); }
.feed-meta { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding-top: .3rem; color: var(--muted); }
.feed-title { font-size: 1.6rem; }
.feed-title a { text-decoration: none; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease), color .2s; }
.feed-title a:hover { background-size: 100% 1px; }
.feed-text { margin: .4rem 0 0; color: var(--muted); max-width: 62ch; }
.feed-item--note .feed-text { color: var(--text); font-size: 1.0625rem; margin-top: 0; }
.feed-app { display: inline-block; margin-top: .6rem; font-size: .875rem; font-weight: 600; color: var(--gold); text-decoration: none; }

/* ---------- Griglia e card ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.25rem; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  box-shadow: 0 22px 50px -28px color-mix(in srgb, var(--gold) 60%, transparent);
}
.card-link { display: flex; flex-direction: column; height: 100%; padding: 1.5rem; text-decoration: none; color: inherit; }
.card-link:hover { color: inherit; }

.app-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.app-icon { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; }
.app-icon--mono {
  display: grid; place-items: center;
  font: italic 400 1.9rem/1 var(--serif); color: var(--on-gold);
  background: linear-gradient(140deg, var(--gold), var(--gold-deep));
}
.app-card-title { font-size: 1.85rem; }
.app-card-text { margin: .5rem 0 1.5rem; color: var(--muted); font-size: .975rem; }
.app-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; color: var(--muted); }
.arrow { font-size: 1.25rem; transition: transform .3s var(--ease), color .2s; }
.card:hover .arrow { transform: translateX(4px); color: var(--gold); }

/* ---------- Testo lungo (Markdown) ---------- */
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose a { color: var(--gold); }
.prose a:hover { color: var(--gold-deep); }
.prose code { font-family: var(--mono); font-size: .875em; padding: .1em .35em; border-radius: 5px; background: var(--surface-2); }
.prose pre { overflow-x: auto; padding: 1rem 1.25rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.prose pre code { padding: 0; background: none; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 2px solid var(--gold); font-family: var(--serif); font-style: italic; font-size: 1.35em; line-height: 1.35; }
.prose img { border-radius: 12px; border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---------- Intestazione delle pagine interne ---------- */
.page-head { padding: clamp(3.5rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3rem); }
.page-title { font-size: clamp(2.6rem, 7vw, 4.75rem); }
.lead { max-width: 52ch; margin: 1rem 0 0; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); }
.back { display: inline-block; margin-bottom: 1.75rem; font-size: .9375rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--gold); }
.empty { color: var(--muted); font-style: italic; }
.section--flush, .page-head + .section[id] { padding-top: 0; }
.wrap--text { width: min(100% - 32px, 720px); }

.pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.pill {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 999px;
  font-weight: 600; font-size: .9375rem; text-decoration: none;
  transition: border-color .2s, color .2s, background-color .2s;
}
.pill .mono { color: var(--gold); }
.pill:hover { border-color: var(--gold); color: var(--text); background: var(--gold-soft); }
section[id] { scroll-margin-top: 80px; }

/* ---------- Pagina app ---------- */
.app-hero-inner { display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2rem); }
.app-icon--lg { width: clamp(84px, 14vw, 120px); height: clamp(84px, 14vw, 120px); border-radius: 26%; flex: none; font-size: clamp(2.5rem, 5vw, 3.5rem); }
.app-hero-tags { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.app-hero .lead { margin-top: .5rem; }
.btn--store svg { width: 18px; height: 18px; flex: none; }

/* Badge degli store: due righe, "Disponibile su / Google Play" */
.store-badge {
  display: inline-flex; align-items: center; gap: .7rem;
  padding: .55rem 1.15rem .55rem .95rem; border-radius: 14px;
  background: var(--text); color: var(--ink); text-decoration: none;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s, background-color .2s;
}
.store-badge:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 30px -10px var(--gold); }
.store-badge svg { width: 24px; height: 24px; flex: none; }
.store-badge-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store-badge-text small { font-size: .6875rem; font-weight: 500; opacity: .75; }
.store-badge-text strong { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }

/* Icone piattaforme nelle card */
.platforms { display: inline-flex; gap: .4rem; margin-left: auto; margin-right: .75rem; }
.platform { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.platform svg { width: 14px; height: 14px; }
.card:hover .platform { color: var(--gold); }

.shots { padding-bottom: 1rem; }
.shots-track {
  display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 1rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.shot { flex: 0 0 auto; scroll-snap-align: start; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); transition: border-color .2s, transform .35s var(--ease); }
.shot:hover { border-color: var(--gold); transform: translateY(-3px); }
.shot img { height: clamp(320px, 52vh, 520px); width: auto; }

.app-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.app-desc { font-size: 1.0625rem; max-width: 62ch; }
.app-desc > p:first-child { font-size: 1.2rem; }
.side-title { font-size: 1.9rem; margin-bottom: 1.25rem; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; border-left: 1px solid var(--line); }
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item::before {
  content: ""; position: absolute; left: calc(-1.25rem - 4.5px); top: .45rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--line);
}
.timeline-item:first-child::before { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.timeline-head { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.timeline-version { color: var(--gold); font-weight: 600; }
.timeline-notes { margin-top: .35rem; font-size: .9375rem; color: var(--muted); }

/* ---------- Elenco aggiornamenti ---------- */
.post-list { border-top: 1px solid var(--line); }
.post-row { border-bottom: 1px solid var(--line); }
.post-row-link {
  display: grid; grid-template-columns: 10.5rem 1fr auto; gap: 1.5rem; align-items: start;
  padding: 1.75rem 0; text-decoration: none; color: inherit;
}
.post-row-link:hover { color: inherit; }
.post-row-meta { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding-top: .35rem; color: var(--muted); }
.post-row-title { font-size: clamp(1.6rem, 3vw, 2.1rem); transition: color .2s; }
.post-row-link:hover .post-row-title { color: var(--gold); }
.post-row-text { margin: .4rem 0 0; color: var(--muted); max-width: 60ch; }
.post-row-cover { width: 150px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- Articolo ---------- */
.article-head { padding-bottom: 2rem; }
.article-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; color: var(--muted); }
.article-meta a.tag { text-decoration: none; }
.article-title { font-size: clamp(2.4rem, 6vw, 4rem); }
.article-cover { margin-bottom: 3rem; }
.article-cover img { width: 100%; max-height: 560px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.article-body { font-size: 1.125rem; line-height: 1.75; padding-bottom: 3rem; }
.article-body h2 { font-size: 2.1rem; margin: 2.5rem 0 .75rem; }
.article-body h3 { font-size: 1.6rem; margin: 2rem 0 .5rem; }
.article-body img { margin: 2rem 0; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 2rem 0 4rem; border-top: 1px solid var(--line); }
.pager-link { display: flex; flex-direction: column; gap: .35rem; font-family: var(--serif); font-size: 1.35rem; line-height: 1.2; text-decoration: none; }
.pager-link .mono { font-family: var(--mono); }
.pager-link--next { grid-column: 2; text-align: right; align-items: flex-end; }

/* ---------- Pagine libere (es. Privacy Policy) ---------- */
.page-updated { margin: 1.25rem 0 0; }
/* Sezioni numerate "01 / 08": il totale arriva dal generatore in --sections. */
.prose--numbered { counter-reset: sec; }
.prose--numbered h2 {
  counter-increment: sec;
  margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line);
}
.prose--numbered h2:first-child { margin-top: 0; }
.prose--numbered h2::before {
  content: counter(sec, decimal-leading-zero) " / " var(--sections);
  display: block; margin-bottom: .75rem;
  font: 500 .75rem/1 var(--mono); letter-spacing: .14em; color: var(--gold);
}

/* Modulo richieste privacy */
.request { padding-bottom: 5rem; scroll-margin-top: 80px; }
.request-card { padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.request-title { font-size: clamp(2rem, 5vw, 2.6rem); margin-bottom: .75rem; }
.request-card > p { margin: 0 0 1.75rem; }
.request-form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .45rem; }
.field-label { font-size: .875rem; font-weight: 600; color: var(--muted); }
.request-form input:not([type="checkbox"]), .request-form select, .request-form textarea {
  width: 100%; padding: .8rem .95rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--ink); color: var(--text);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
.request-form textarea { resize: vertical; }
.request-form :is(input, select, textarea):focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .9375rem; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: .2rem; flex: none; accent-color: var(--gold); }
.request-form .btn { justify-self: start; border: 0; cursor: pointer; }
.request-form .btn[disabled] { opacity: .6; cursor: wait; }
.request-status { margin: 0; min-height: 1.5em; font-weight: 600; }
.request-status.is-ok { color: var(--gold); }
.request-status.is-error { color: #e0705a; }
/* Campo trappola per i bot: fuori dallo schermo, non "display:none" (alcuni bot lo saltano). */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Pagina "Gioca" ---------- */
.is-bare { overflow: hidden; }
.play { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.play-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 16px; border-bottom: 1px solid var(--line); }
.play-bar .back { margin: 0; }
.btn--sm { padding: .5rem .9rem; font-size: .875rem; }
.play-frame { flex: 1; width: 100%; min-width: 0; border: 0; background: #000; }

/* ---------- Pubblicità ----------
   Spazi AdSense: sopra e sotto le pagine, nei separatori tra le sezioni, ai lati
   (solo dove c'è spazio) e nella pagina Gioca. Un'unità che Google lascia vuota,
   o bloccata da un ad blocker, non lascia buchi. */
.ad-inner { display: grid; justify-items: center; gap: .45rem; }
.ad-label { font: 500 .625rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ad-ins { display: block; width: 100%; min-height: 90px; }

.ad--top .ad-inner, .ad--bottom .ad-inner, .ad--separator .ad-inner { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.ad--top { padding-top: 1.5rem; }
.ad--bottom { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.ad--separator { padding: 2rem 0; border-top: 1px solid var(--line); }
.ad--separator + .section { border-top: 1px solid var(--line); }
.post-list > .ad--separator { padding: 1.75rem 0; border-top: 0; border-bottom: 1px solid var(--line); }
.post-list > .ad--separator .ad-inner { width: 100%; }

/* Ai lati: colonne fisse 160×600 al centro dei margini, solo se non coprono i contenuti. */
.ad--side { display: none; }
.ad--side .ad-ins { width: 160px; height: 600px; min-height: 0; }
@media (min-width: 1520px) and (min-height: 720px) {
  .ad--left, .ad--right { display: block; position: fixed; top: 92px; z-index: 10; }
  .ad--left { left: calc((100vw - var(--wrap)) / 4 - 80px); }
  .ad--right { right: calc((100vw - var(--wrap)) / 4 - 80px); }
}

/* Pagina Gioca: colonne ai lati del gioco e banner sotto, staccati dai comandi. */
.play-main { display: flex; flex: 1; min-height: 0; }
.play .ad--side { align-self: center; padding: 0 48px; }
@media (min-width: 1280px) and (min-height: 700px) {
  .play .ad--side { display: block; }
}
.ad--game { padding: .75rem 16px; border-top: 1px solid var(--line); }
.ad--game .ad-ins { min-height: 50px; max-width: 728px; }
/* In fondo, così vale su tutte le regole sopra. */
.ad:has(ins[data-ad-status="unfilled"]), .ads-blocked .ad { display: none; }

/* ---------- Lightbox screenshot ---------- */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(10, 9, 7, .88); backdrop-filter: blur(4px); }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 14px; }
.lightbox-close {
  position: absolute; top: -14px; right: -14px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: var(--gold); color: var(--on-gold); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lightbox[open] { animation: zoom-in .3s var(--ease); }
@keyframes zoom-in { from { opacity: 0; transform: scale(.96); } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-size: .9375rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.footer-brand { margin: 0; font-weight: 600; }
.footer-brand .brand-mark { font-size: 1.3em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }

/* ---------- Animazioni allo scroll ----------
   Solo se il JS è attivo (classe .js su <html>): senza JS tutto resta visibile. */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Tablet / mobile ---------- */
@media (max-width: 860px) {
  .app-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .post-row-link { grid-template-columns: 1fr; gap: .6rem; }
  .post-row-meta { flex-direction: row; align-items: center; gap: .75rem; padding-top: 0; }
  .post-row-cover { width: 100%; aspect-ratio: 16 / 9; order: -1; }
  .app-hero-inner { align-items: flex-start; }
  .shot img { height: 360px; }
  .pager { grid-template-columns: 1fr; }
  .pager-link--next { grid-column: 1; }
  body { font-size: 1rem; }
  .header-inner { gap: .75rem; height: 60px; }
  .nav { gap: 0; }
  .nav a { padding: .4rem .55rem; font-size: .875rem; }
  .theme-toggle { width: 36px; height: 36px; }
  .lang-switch summary { height: 36px; min-width: 40px; padding: 0 .55rem; }
  .feed-item { grid-template-columns: 1fr; gap: .6rem; }
  .feed-meta { flex-direction: row; align-items: center; gap: .75rem; padding-top: 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
