/* VoxelPopuli — Espansioni e Storia (bozza 03/11/2026). Stesso sistema del sito (notte-verde, un accento verde erba).
   L'unico elemento nuovo è il RIQUADRO DELL'ESPANSIONE: disegnato come il riquadro che Minecraft mostra passando
   sopra un oggetto (fondo viola-nero, bordo a sfumatura viola, angoli tagliati di un pixel, nome colorato per rarità).
   Il colore del nome dice lo stato: oro = l'ultima uscita, azzurro = uscita, grigio = in arrivo. */
:root {
  --tt-bg: #120a1c; --tt-edge-a: #5b33e6; --tt-edge-b: #2a1470; --tt-out: #07040c;
  --tt-new: #ffcf57; --tt-out-name: #74e6e6; --tt-soon: #9ca3a8;
  --tt-text: #d4dbe0; --tt-mute: #9aa3aa; --tt-lore: #c7a6ff;
  --slot: #8b8b8b; --slot-hi: #ffffff; --slot-lo: #373737;
}

/* SITO A PIÙ PAGINE: il menu del sito è fisso in cima; le pagine interne lasciano il suo spazio, la home ha già l'apertura */
.pg:not(.pg-home) main { padding-top: var(--nav-h); }
.nav li a[aria-current="page"], .live-pill[aria-current="page"] { color: var(--ink); background: var(--acc-soft); }
/* la striscia della bozza: in fondo allo schermo, non copre i titoli (si toglie alla pubblicazione) */
.xp-draft { position: sticky; bottom: 0; z-index: 30; margin: 0; padding: 8px 16px; text-align: center; font-size: 13px; color: #1a1408; background: var(--warn); font-weight: 600; }

.xp-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(24px, 4vw, 40px); }
.xp-hero h1 { font-size: clamp(40px, 6.2vw, 76px); font-weight: 700; letter-spacing: -0.03em; margin-top: 14px; }
.xp-kicker { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--ink-3); margin-bottom: 16px; }

/* la targhetta «Beta perenne»: un'etichetta da prototipo, non un bottone */
.beta-tag { display: inline-block; font-family: var(--pixel); font-size: 10px; line-height: 1; color: var(--acc); padding: 7px 10px 6px; border: 1px dashed color-mix(in srgb, var(--acc) 60%, transparent); border-radius: 4px; }

section.xp-latest { padding-top: 0; }
.xp-beta { padding-top: 0; }
.xp-beta .btn { margin-top: 22px; }
.xp-beta h2 { font-size: clamp(22px, 2.4vw, 28px); }
.xp-story-cta .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.xp-story-cta h2 { font-size: clamp(22px, 2.6vw, 32px); max-width: 30ch; }

/* ---------- IL RIQUADRO DELL'ESPANSIONE ---------- */
.tt {
  /* tre strati come nel gioco: bordo esterno scuro (2px, angoli tagliati), bordo interno a sfumatura viola (2px), fondo */
  --cut: 2px; --edge-a: var(--tt-edge-a); --edge-b: var(--tt-edge-b);
  position: relative; color: var(--tt-text); padding: 16px 18px 18px;
  border: 4px solid transparent;
  background:
    linear-gradient(var(--tt-bg), var(--tt-bg)) padding-box,
    linear-gradient(180deg, var(--edge-a), var(--edge-b)) 2px 2px / calc(100% - 4px) calc(100% - 4px) no-repeat border-box,
    linear-gradient(var(--tt-out), var(--tt-out)) border-box;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
.tt header { display: flex; gap: 14px; align-items: flex-start; }
.tt-id { font-family: var(--pixel); font-size: 9px; line-height: 1.6; color: var(--tt-mute); letter-spacing: .02em; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.tt-badge { font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--tt-bg); background: var(--tt-out-name); padding: 1px 8px; border-radius: 3px; }
.tt-name { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--tt-out-name); margin-top: 6px; }
.tt-when { font-family: var(--mono); font-size: 12px; color: var(--tt-mute); margin-top: 4px; }
.tt-sub { margin-top: 14px; font-size: 16px; color: #fff; }
.tt-lines { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 7px; font-size: 15px; }
.tt-lines li { padding-left: 20px; position: relative; }
.tt-lines li::before { content: "+"; position: absolute; left: 2px; top: -1px; font-family: var(--mono); font-weight: 700; color: var(--acc); }
.tt-lore { margin-top: 16px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--tt-edge-a) 45%, transparent); font-style: italic; font-size: 15px; color: var(--tt-lore); }
.tt-lore span { display: block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--tt-mute); margin-bottom: 4px; }

/* la casella d'inventario con la testa di chi l'ha vissuta */
.slot { flex: none; width: 44px; height: 44px; padding: 4px; background: var(--slot); box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi); }
.slot img { width: 36px; height: 36px; image-rendering: pixelated; }

/* stati */
.tt-nuova .tt-name { color: var(--tt-new); }
.tt-nuova .tt-badge { background: var(--tt-new); }
.tt-in_arrivo { --edge-a: #4a4f55; --edge-b: #2b2f33; }
.tt-in_arrivo .tt-name { color: var(--tt-soon); }
.tt-in_arrivo .tt-sub { color: var(--tt-mute); font-size: 15px; }

.tt-big { padding: 22px 24px 24px; }
.tt-big .tt-name { font-size: clamp(28px, 3.4vw, 40px); }
.tt-big .tt-sub { font-size: 19px; }
.tt-big .tt-lines { font-size: 16px; gap: 9px; }
.tt-big .slot { width: 60px; height: 60px; padding: 6px; }
.tt-big .slot img { width: 48px; height: 48px; }
/* (03/11, Mirko: "width 100% per l'espansione in primo piano") larga quanto la pagina: a sinistra chi è, il nome e
   cosa si è visto nel villaggio, a destra le novità; le righe restano corte da leggere */
@media (min-width: 900px) {
  .tt-big { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: "head lines" "sub lines" "lore lines" "more lines"; grid-template-rows: auto auto auto 1fr; column-gap: clamp(28px, 4vw, 56px); padding: 28px 32px 30px; align-items: start; }
  .tt-big > header { grid-area: head; }
  .tt-big > .tt-sub { grid-area: sub; font-size: 22px; line-height: 1.4; }
  .tt-big > .tt-lines { grid-area: lines; margin-top: 4px; padding-left: clamp(24px, 3vw, 40px); border-left: 1px solid color-mix(in srgb, var(--tt-edge-a) 45%, transparent); }
  .tt-big > .tt-lore { grid-area: lore; }
  .tt-big > .tt-more { grid-area: more; align-self: end; }
  .tt-big .tt-name { font-size: clamp(34px, 3.6vw, 48px); }
}

.tt-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 22px; align-items: start; }
.tt-grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }

/* l'oggetto si «solleva» come quando ci passi sopra col mouse nel gioco */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tt { transition: transform .18s var(--ease-out); }
  .tt:hover { transform: translateY(-3px); --edge-a: #7a57ff; }
  .tt-in_arrivo:hover { --edge-a: #5d636a; }
}

/* ---------- STORIA ---------- */
.st-prologue { padding-top: 0; }
.st-letter { max-width: 64ch; display: grid; gap: 18px; font-size: 19px; line-height: 1.65; color: var(--ink); }
.st-letter p:first-child::first-letter { font-family: var(--pixel); font-size: 34px; float: left; line-height: 1; margin: 6px 12px 0 0; color: var(--acc); }
.st-sig { color: var(--ink-3); font-size: 16px; }
.st-sig::before { content: "— "; }

/* la linea del tempo, come la schermata dei progressi: una cornice per ogni tappa, unite da una linea */
.adv { list-style: none; margin: 30px 0 0; padding: 0; position: relative; max-width: 760px; }
.adv::before { content: ""; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); }
.adv li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 18px; padding: 0 0 26px; }
.adv .frame { width: 28px; height: 28px; margin-top: 2px; background: var(--bg-3); box-shadow: inset 0 0 0 2px var(--line-2), inset 0 0 0 4px var(--bg-3), inset 0 0 0 6px var(--ink-3); position: relative; z-index: 1; }
.adv .era .frame { box-shadow: inset 0 0 0 2px var(--acc), inset 0 0 0 4px var(--bg-3), inset 0 0 0 6px var(--acc); }
.adv .now .frame { box-shadow: inset 0 0 0 2px var(--tt-new), inset 0 0 0 4px var(--bg-3), inset 0 0 0 14px var(--tt-new); }
.adv .when { font-size: 13px; color: var(--ink-3); }
.adv h3 { font-size: 20px; margin-top: 2px; }
.adv li p:last-child { color: var(--ink-2); margin-top: 6px; max-width: 60ch; }
.adv .era h3 { color: var(--acc); }

/* cosa abbiamo misurato: il numero misurato è il contenuto */
.me-grid { margin-top: 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.me { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 20px 22px; display: grid; gap: 10px; align-content: start; }
.me-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.me-num .num { font-size: 44px; font-weight: 600; line-height: 1; color: var(--acc); letter-spacing: -0.02em; }
.me-unit { color: var(--ink-2); font-size: 15px; }
.me h3 { font-size: 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.me-when { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink-3); }
.me p { color: var(--ink-2); font-size: 15px; }
.me .me-lesson { color: var(--ink); border-top: 1px solid var(--line); padding-top: 10px; }
.me .me-lesson b { color: var(--acc); font-weight: 600; margin-right: 4px; }

.st-asof { font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-left: 8px; }
.nu { margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.nu div { background: var(--bg-2); padding: 18px 18px 20px; display: flex; flex-direction: column-reverse; gap: 6px; }
.nu dt { color: var(--ink-2); font-size: 14px; }
.nu dd { margin: 0; font-size: 30px; color: var(--ink); font-weight: 600; }


@media (max-width: 640px) {
  .tt { padding: 14px 14px 16px; }
  .tt-big { padding: 16px 14px 18px; }
  .st-letter { font-size: 17px; }
  .me-num .num { font-size: 38px; }
}

/* ---------- SITO A PIÙ PAGINE: home corta e pagine interne ---------- */
.pg-h1 { font-size: clamp(40px, 6.2vw, 76px); font-weight: 700; letter-spacing: -0.03em; }
.pg-aside { margin-top: 14px; color: var(--ink-3); font-size: 15px; }
.pg-aside a { color: var(--acc); }
.tt-more { margin-top: 16px; }
.tt-more a { color: var(--tt-new); font-weight: 600; text-decoration: none; }
.tt-more a::after { content: " →"; }
.tt-more a:hover { text-decoration: underline; }

.home-exp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 22px; }

/* le porte verso le pagine: semplici, ognuna dice dove porta e cosa ci trovi */
.door-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.door { display: grid; gap: 8px; align-content: start; padding: 20px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.door h3 { font-size: 21px; }
.door h3::after { content: " →"; color: var(--acc); }
.door p { color: var(--ink-2); font-size: 15px; }
.door-meta { color: var(--ink-3); font-size: 13px; }
.door .heads { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.door .heads img { width: 28px; height: 28px; image-rendering: pixelated; border-radius: 4px; background: var(--bg-3); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .door { transition: border-color .18s var(--ease-out), transform .18s var(--ease-out); }
  .door:hover { border-color: var(--acc); transform: translateY(-2px); }
}

/* ---------- STORIA: Simo che saluta e le vecchie foto appese ---------- */
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/vendor/fonts/Caveat-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/vendor/fonts/Caveat-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
.hand { font-family: 'Caveat', var(--font); font-weight: 500; letter-spacing: 0; }

.st-pro-grid { display: grid; grid-template-columns: minmax(0, 64ch) minmax(0, 1fr); gap: 24px 48px; align-items: center; }
.st-simo { margin: 0; justify-self: center; display: grid; justify-items: center; gap: 4px; }
/* skinview3d scrive larghezza e altezza sull'elemento: !important per poterlo rimpicciolire su mobile */
.st-simo canvas { width: 300px !important; max-width: 100%; height: auto !important; aspect-ratio: 300 / 420; cursor: grab; }
.st-simo figcaption { font-size: 24px; color: var(--ink-2); transform: rotate(-3deg); }

.st-tl-grid { display: grid; grid-template-columns: minmax(0, 760px) minmax(0, 1fr); gap: 32px 56px; align-items: start; }
/* il filo con le foto: resta in vista mentre scorri la linea del tempo */
.line { position: sticky; top: calc(var(--nav-h) + 48px); margin-top: 26px; padding: 34px 6px 0; display: flex; gap: 22px; justify-content: center; align-items: flex-start; }
.line::before { content: ""; position: absolute; left: -14px; right: -14px; top: 0; height: 30px; border-bottom: 2px solid color-mix(in srgb, var(--ink-3) 70%, transparent); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.snap { position: relative; margin: 0; flex: 1 1 0; max-width: 230px; background: #f1ece2; padding: 9px 9px 0; box-shadow: 0 14px 28px -10px rgba(0, 0, 0, .7), 0 2px 4px rgba(0, 0, 0, .35); transform-origin: 50% 0; }
.snap img { width: 100%; height: auto; display: block; background: #1a1a1a; }
.snap figcaption { color: #3a3226; font-size: 21px; line-height: 1.05; text-align: center; padding: 9px 4px 12px; }
.snap-0 { transform: rotate(-5deg); }
.snap-1 { transform: rotate(4deg); margin-top: 22px; }
/* la molletta di legno */
.peg { position: absolute; top: -26px; left: 50%; width: 12px; height: 34px; margin-left: -6px; border-radius: 3px; z-index: 2;
  background: linear-gradient(90deg, #c49a5e 0 44%, #8c6538 44% 56%, #c49a5e 56%); box-shadow: 0 2px 3px rgba(0, 0, 0, .45); }

@media (max-width: 1100px) {
  .st-tl-grid { grid-template-columns: 1fr; }
  .line { position: relative; top: 0; margin-top: 8px; }
}
@media (max-width: 860px) {
  .st-pro-grid { grid-template-columns: 1fr; }
  .st-simo { order: -1; justify-self: end; margin-bottom: -28px; }
  .st-simo canvas { width: 170px !important; }
  .st-simo figcaption { font-size: 20px; }
}
@media (max-width: 480px) {
  .line { gap: 14px; }
  .snap figcaption { font-size: 18px; }
}

/* ---------- IL LIBRO DEL VILLAGGIO (03/11, Mirko: "un libro che si apre con le leggi fatto in 3D") ----------
   Un libro scritto del gioco: copertina di cuoio a pixel, angoli d'oro, pagine di pergamena con "Pagina N di M" in alto
   a destra come nella schermata del libro; il testo dei cittadini è scritto a mano. Tutto CSS 3D, niente WebGL. */
.lb { --pw: min(430px, 44vw); --ph: calc(var(--pw) * 1.36); --ink-b: #2e2316; --ink-r: #7d2c14; --ink-m: #6f5f45; --paper: #efe4c6; --paper-2: #e2d3ab;
  --book-ease: cubic-bezier(.22, .68, .18, 1); position: relative; margin-top: 18px; }
@media (max-width: 759px) { .lb { --pw: min(400px, calc(100vw - 48px)); } }
.lb-stage { perspective: 2400px; display: flex; justify-content: center; padding: 34px 0 26px; outline: none; border-radius: var(--r); touch-action: pan-y; }
.lb-stage:focus-visible { box-shadow: 0 0 0 2px var(--acc); }
.lb-book { position: relative; width: calc(var(--pw) * 2); height: var(--ph); transform-style: preserve-3d; transition: transform 1.25s var(--book-ease); }
.lb-book.is-closed { transform: translateX(calc(var(--pw) * -0.5)) rotateX(18deg) rotateZ(-4deg) scale(.92); }
.lb-book.is-opening, .lb-book.is-open { transform: rotateX(6deg); }
@media (max-width: 759px) {
  .lb-book { width: var(--pw); }
  .lb-book.is-closed { transform: rotateX(16deg) rotateZ(-3deg) scale(.9); }
  .lb-left { display: none; }
}
/* la pergamena */
.lb-paper, .lb-page { background-color: var(--paper); color: var(--ink-b); }
.lb-page { position: absolute; top: 0; width: var(--pw); height: var(--ph); }
.lb-left { left: 0; border-radius: 7px 2px 2px 7px; background-image: linear-gradient(to left, rgba(70, 44, 10, .26), rgba(70, 44, 10, 0) 10%), linear-gradient(to right, rgba(70, 44, 10, .1), rgba(70, 44, 10, 0) 4%);
  box-shadow: -2px 2px 0 -1px var(--paper-2), -4px 4px 0 -2px #d6c49a, -6px 6px 0 -3px #c9b585, 0 26px 50px rgba(0, 0, 0, .5); }
.lb-right { left: var(--pw); border-radius: 2px 7px 7px 2px; background-image: linear-gradient(to right, rgba(70, 44, 10, .26), rgba(70, 44, 10, 0) 10%), linear-gradient(to left, rgba(70, 44, 10, .1), rgba(70, 44, 10, 0) 4%);
  box-shadow: 2px 2px 0 -1px var(--paper-2), 4px 4px 0 -2px #d6c49a, 6px 6px 0 -3px #c9b585, 0 26px 50px rgba(0, 0, 0, .5); }
@media (max-width: 759px) { .lb-right { left: 0; border-radius: 3px 7px 7px 3px; } }
.lb-book.is-closed .lb-left { visibility: hidden; }
.lb-num { position: absolute; top: calc(var(--pw) * .055); right: calc(var(--pw) * .075); font-family: var(--pixel); font-size: 8px; line-height: 1; color: var(--ink-m); }
.lb-body { position: absolute; top: calc(var(--pw) * .12); bottom: calc(var(--pw) * .08); left: calc(var(--pw) * .095); right: calc(var(--pw) * .085); overflow: hidden; display: flex; flex-direction: column; gap: calc(var(--pw) * .032); }
.lb-hand { font-family: 'Caveat', var(--font); font-weight: 500; font-size: max(18px, calc(var(--pw) * .054)); line-height: 1.22; letter-spacing: 0; color: var(--ink-b); }
.lb-e h4 { font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-r); }
.lb-e h4 small { font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--ink-m); margin-left: 4px; }
.lb-meta { font-size: 11.5px; color: var(--ink-m); line-height: 1.35; margin-top: 2px; }
.lb-rule .lb-meta { margin-top: 3px; }
.lb-trad ul { margin: 4px 0 0; padding-left: 1.1em; }
.lb-trad li::marker { content: "– "; color: var(--ink-m); }
.lb-ch { border-bottom: 1px solid rgba(46, 35, 22, .25); padding-bottom: calc(var(--pw) * .03); }
.lb-ch > p:first-child { font-family: var(--pixel); font-size: 9px; color: var(--ink-r); }
.lb-ch h3 { font-size: max(19px, calc(var(--pw) * .055)); font-weight: 700; letter-spacing: -0.01em; color: var(--ink-b); margin-top: 8px; }
.lb-ch .lb-intro { margin-top: 8px; color: #4b3b26; }
.lb-ch-cont { border: 0; padding: 0; }
.lb-ch-cont p:first-child { font-family: var(--font); font-size: 11.5px; font-weight: 600; color: var(--ink-m); }
.lb-title { font-family: var(--pixel); font-size: max(13px, calc(var(--pw) * .036)); line-height: 1.5; color: var(--ink-r); }
.lb-toc { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.lb-since { margin-top: auto; text-align: center; font-family: var(--pixel); font-size: 8px; line-height: 1.6; color: var(--ink-m); }
.lb-toc button { width: 100%; display: flex; align-items: baseline; gap: 8px; padding: 9px 6px; border: 0; border-top: 1px dashed rgba(46, 35, 22, .3); background: none; color: var(--ink-b); font: 600 14.5px/1.3 var(--font); text-align: left; cursor: pointer; border-radius: 4px; }
.lb-toc button span { font-family: var(--pixel); font-size: 8px; color: var(--ink-r); flex: none; min-width: 112px; white-space: nowrap; }
.lb-toc button b { margin-left: auto; font-weight: 500; color: var(--ink-m); }
.lb-toc button:hover { background: rgba(125, 44, 20, .08); }
.lb-toc button:focus-visible { outline: 2px solid var(--ink-r); outline-offset: 1px; }
.lb-endpage { justify-content: center; align-items: center; text-align: center; }
.lb-endpage p { color: var(--ink-m); }
.lb-page:not(:empty) { cursor: pointer; }

/* la copertina: cuoio a pixel (texture disegnata dallo script), quattro angoli d'oro, etichetta col titolo */
.lb-cover { position: absolute; left: var(--pw); top: 0; width: var(--pw); height: var(--ph); padding: 0; border: 0; background: none; cursor: pointer; transform-origin: left center; transform-style: preserve-3d; transition: transform 1.25s var(--book-ease); z-index: 5; }
@media (max-width: 759px) { .lb-cover { left: 0; } }
.lb-book.is-opening .lb-cover { transform: rotateY(-180deg); }
@media (max-width: 759px) { .lb-cover { transition: transform 1.25s var(--book-ease), opacity .5s ease-in .7s; } .lb-book.is-opening .lb-cover { opacity: 0; } }
.lb-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.lb-front { inset: -7px -9px -7px -2px; background-color: #5b3417; background-size: 48px 48px; image-rendering: pixelated; border-radius: 3px 9px 9px 3px;
  box-shadow: inset 7px 0 0 #3d220e, inset 9px 0 0 #6d4422, inset 0 0 0 2px rgba(0, 0, 0, .35), 5px 4px 0 -2px #e9ddbb, 10px 8px 0 -4px #d4c194, 0 30px 60px rgba(0, 0, 0, .55); }
.lb-back { transform: rotateY(180deg); border-radius: 7px 2px 2px 7px; background-image: linear-gradient(to left, rgba(70, 44, 10, .26), rgba(70, 44, 10, 0) 10%); }
.lb-corner { position: absolute; width: 14px; height: 14px; background: #e2b04a; box-shadow: inset -3px -3px 0 #a87a22, inset 3px 3px 0 #f6d47c; }
.lb-corner.c1 { top: 8px; left: 14px; } .lb-corner.c2 { top: 8px; right: 8px; } .lb-corner.c3 { bottom: 8px; left: 14px; } .lb-corner.c4 { bottom: 8px; right: 8px; }
.lb-label { position: absolute; left: 16%; right: 12%; top: 28%; padding: 18px 14px 16px; background: #efe4c6; color: #3a2a17; text-align: center; display: grid; gap: 10px;
  box-shadow: 0 0 0 3px #3d220e, 0 0 0 5px #e2b04a, 0 6px 0 5px rgba(0, 0, 0, .25); }
.lb-t { font-family: var(--pixel); font-size: max(11px, calc(var(--pw) * .034)); line-height: 1.6; color: var(--ink-r); }
.lb-s { font-size: 12px; font-weight: 600; color: #6f5f45; line-height: 1.35; }
.lb-cover:focus-visible { outline: none; } .lb-cover:focus-visible .lb-front { box-shadow: inset 7px 0 0 #3d220e, 0 0 0 3px var(--acc), 0 30px 60px rgba(0, 0, 0, .55); }

/* il foglio che gira */
.lb-leaf { position: absolute; left: var(--pw); top: 0; width: var(--pw); height: var(--ph); transform-origin: left center; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.45, .05, .25, 1); z-index: 6; pointer-events: none; }
.lb-leaf.is-single { left: 0; transition: transform .8s cubic-bezier(.45, .05, .25, 1), opacity .45s ease-in .35s; }
.lb-leaf.is-back, .lb-leaf.turn { transform: rotateY(-180deg); }
.lb-leaf.is-back.turn { transform: rotateY(0deg); }
.lb-leaf.is-single.turn:not(.is-back) { opacity: 0; }
.lb-leaf.is-single.is-back { opacity: 0; } .lb-leaf.is-single.is-back.turn { opacity: 1; transition-delay: 0s; }
.lb-lf { border-radius: 2px 7px 7px 2px; background-image: linear-gradient(to right, rgba(70, 44, 10, .26), rgba(70, 44, 10, 0) 10%); }
.lb-lb { transform: rotateY(180deg); border-radius: 7px 2px 2px 7px; background-image: linear-gradient(to left, rgba(70, 44, 10, .26), rgba(70, 44, 10, 0) 10%); }
.lb-leaf .lb-face::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(to right, rgba(40, 24, 6, .45), rgba(40, 24, 6, 0) 70%); opacity: 0; pointer-events: none; }
.lb-leaf.turn .lb-face::after { animation: lb-shade .8s cubic-bezier(.45, .05, .25, 1); }
@keyframes lb-shade { 0% { opacity: 0 } 50% { opacity: 1 } 100% { opacity: 0 } }
.lb-measure { position: absolute; left: -10000px; top: 0; visibility: hidden; pointer-events: none; }

/* i comandi sotto il libro: pulsanti di pietra come quelli del gioco */
.lb-ctrl { display: flex; align-items: center; justify-content: center; gap: 18px; }
.lb-btn { width: 48px; height: 40px; border: 0; padding: 0 0 3px; cursor: pointer; font: 400 18px/1 var(--pixel); color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
  background: #727272; box-shadow: inset 0 0 0 2px #000, inset 2px 2px 0 2px #a8a8a8, inset -2px -4px 0 2px #4d4d4d; }
.lb-btn:hover:not(:disabled) { background: #7e8aa8; box-shadow: inset 0 0 0 2px #fff, inset 2px 2px 0 2px #b3bfe0, inset -2px -4px 0 2px #56607a; }
.lb-btn:disabled { cursor: default; color: #a0a0a0; text-shadow: none; background: #2e2e2e; box-shadow: inset 0 0 0 2px #000, inset 0 0 0 4px #3c3c3c; }
.lb-btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.lb-count { min-width: 12em; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.lb-note { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .lb-book, .lb-cover, .lb-leaf { transition: none !important; } .lb-leaf .lb-face::after { animation: none !important; } }

/* la pagina del villaggio: il libro, poi il governo con i voti come blocchi di lana */
.vil-book .lede { max-width: 62ch; }
@media (min-width: 861px) { .gov .grid > .mayor3d { position: sticky; top: calc(var(--nav-h, 64px) + 24px); } }
.mayor3d { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: center; padding: 16px 20px 16px 10px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.mayor3d canvas { width: 140px; height: 200px; display: block; }
.mayor3d .t { color: var(--ink-3); font-size: 13px; }
.mayor3d h3 { font-size: 26px; margin: 2px 0 6px; }
.mayor3d .term { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.votes { margin-top: 16px; display: grid; gap: 12px; }
.vote { padding: 16px 18px; border-radius: var(--r-s); background: var(--bg-2); border: 1px solid var(--line); }
.vote .q { font-size: 15px; color: var(--ink); }
.vote .meta { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }
.vote .meta b { color: var(--acc); font-weight: 600; }
.vote .rows { margin-top: 12px; display: grid; gap: 8px; }
.vote .row { display: grid; grid-template-columns: minmax(70px, max-content) 1fr; gap: 12px; align-items: center; font-size: 13px; color: var(--ink-2); }
.vote .row.win { color: var(--ink); font-weight: 600; }
.vote .row .who { display: flex; align-items: center; gap: 6px; }
.vote .row .who img { width: 18px; height: 18px; image-rendering: pixelated; border-radius: 3px; }
.wool { display: flex; flex-wrap: wrap; gap: 3px; }
.wool i { width: 16px; height: 16px; display: block; background: var(--w, #9d9d97); box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .28), inset 2px 2px 0 rgba(255, 255, 255, .18); image-rendering: pixelated; }
.wool i.y { --w: #5ea918; } .wool i.n { --w: #a12722; } .wool i.a { --w: #8e8e86; } .wool i.c { --w: #3aafd9; }
.wool i.off { background: none; box-shadow: inset 0 0 0 1px var(--line-2); }
@media (prefers-reduced-motion: no-preference) { .vote.in-view .wool i { animation: wool-in .32s var(--ease-out) both; animation-delay: calc(var(--k) * 40ms); } }
@keyframes wool-in { from { transform: translateY(-8px) scale(.6); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- L'ALBERO DI FAMIGLIA (03/11, Mirko: "non si capisce Fiamma + Pip") ---------- */
.bonds svg .ln-sp, .bonds-legend .ln-sp { stroke: var(--acc); stroke-width: 2.5; fill: none; }
.bonds svg .ln-late, .bonds-legend .ln-late { stroke: var(--acc); stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .6; fill: none; }
.bonds svg .ln-eng { stroke: var(--acc); stroke-width: 1.8; stroke-dasharray: 7 5; fill: none; }
.bonds svg .ln-ex { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 5 6; fill: none; opacity: .7; }
.bonds svg .ln-cop, .bonds-legend .ln-cop { stroke: var(--ink-3); stroke-width: 1.5; fill: none; }
.bonds svg .ln-kid, .bonds-legend .ln-kid { stroke: var(--ink-3); stroke-width: 1.5; fill: none; stroke-linejoin: round; }
.bonds svg .ring circle, .bonds-legend .ring circle { fill: var(--bg-2); stroke: var(--acc); stroke-width: 2; }
.bonds svg .ring-late { opacity: .55; }
.bonds svg .node { outline: none; transition: opacity .18s var(--ease-out); }
.bonds svg .node:focus-visible rect { stroke: var(--acc); stroke-width: 2; }
.bonds svg .ln { transition: opacity .18s var(--ease-out); }
.bonds svg.hov .node:not(.hl) { opacity: .2; }
.bonds svg.hov .ln:not(.hl) { opacity: .08; }
.bonds svg.hov .ln.hl.ln-kid, .bonds svg.hov .ln.hl.ln-cop { stroke: var(--ink); }
.bonds-legend { flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.bonds-legend span { display: inline-flex; align-items: center; gap: 8px; }
.bonds .bonds-legend svg { overflow: visible; flex: none; width: auto; min-width: 0; height: auto; display: inline-block; }
.bonds-hint { margin-top: 10px; color: var(--ink-3); font-size: 13px; }
.bonds-read { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; max-width: 72ch; }
.bonds-read li { position: relative; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.bonds-read li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; background: var(--acc); box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .25); }
@media (hover: none) { .bonds-hint { display: none; } }

/* ── HOME: LA MAPPA DAL VIVO (04/11, Mirko: "metti la mappa in home oltre che nella diretta") ── */
.now.now-live { margin-top: 0; padding: 56px 0 8px; }
.now-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.now-head a { color: var(--acc); font-weight: 600; font-size: 15px; }
.now-map { position: relative; aspect-ratio: 16 / 8; min-height: 360px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.now-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.now-map .map-shield { position: absolute; inset: 0; z-index: 2; border: 0; padding: 0; background: transparent; cursor: pointer; display: grid; place-items: end center; color: inherit; font: inherit; }
.now-map .map-shield span { margin: 0 0 18px; padding: 8px 12px; border-radius: 999px; background: color-mix(in srgb, var(--bg-2) 86%, transparent); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); backdrop-filter: blur(6px); transition: color .2s var(--ease-out), border-color .2s var(--ease-out); }
.now-map .map-shield:hover span, .now-map .map-shield:focus-visible span { color: var(--ink); border-color: var(--acc); }
.now-map .map-shield[hidden], .now-map .map-lock[hidden] { display: none; }
.now-map .map-lock { position: absolute; z-index: 3; top: 14px; right: 14px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--acc); background: var(--bg-2); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.now-map.active { border-color: var(--acc); }
.now-map .onair { z-index: 3; }
.now.now-live .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 18px; margin-top: 16px; }
@media (max-width: 760px) {
  .now-map { aspect-ratio: auto; height: 62vh; min-height: 380px; max-height: 560px; }
  .now-map .map-shield { place-items: start center; }
  .now-map .map-shield span { margin: 58px 0 0; }
  .now.now-live .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── CITTADINI: tutti in vista, carte e facce della stessa misura (04/11, Mirko) ──
   prima: carrellata orizzontale, una carta su tre più larga e la faccia al 62% della carta → facce di misure diverse */
.citizens .rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; overflow: visible; scroll-snap-type: none; padding: 8px 0 0; }
.citizens .rail .cz, .citizens .rail .cz:nth-child(3n+1) { flex: none; display: flex; flex-direction: column; }
.citizens .rail .cz .face { aspect-ratio: auto; height: 150px; place-items: center; }
.citizens .rail .cz .face img { width: 96px; height: 96px; transform: none; }
.citizens .rail .cz .meta { flex: 1; display: flex; flex-direction: column; }
.citizens .rail .cz .meta .mini { margin-top: auto; padding-top: 10px; flex-wrap: wrap; row-gap: 4px; }
@media (max-width: 560px) {
  .citizens .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .citizens .rail .cz .face { height: 112px; }
  .citizens .rail .cz .face img { width: 72px; height: 72px; }
  .citizens .rail .cz .meta { padding: 12px; }
  .citizens .rail .cz .meta h3 { font-size: 16px; flex-wrap: wrap; row-gap: 0; }
  .citizens .rail .cz .meta .tagline { font-size: 13px; }
}

/* ── DIARIO (04/11, Mirko: "rendi il diario migliore, anche 3D") ── */
.dy .lede { max-width: 62ch; }
.dt-stage { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--r); background: radial-gradient(70% 90% at 50% 0%, var(--acc-soft), transparent 70%), var(--bg-2); overflow: hidden; }
.dt3d { position: relative; aspect-ratio: 16 / 5.4; min-height: 280px; }
.dt3d canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.dt-stage.no3d .dt3d { display: none; }
.dt-labels span { position: absolute; left: 0; top: 0; font-family: var(--pixel); font-size: 9px; color: var(--ink-3); white-space: nowrap; pointer-events: none; }
.dt-tip { position: absolute; left: 0; top: 0; z-index: 2; width: max-content; max-width: 280px; padding: 10px 12px; border-radius: 6px; pointer-events: none;
  background: #100010f0; border: 2px solid #2a0a5e; box-shadow: inset 0 0 0 1px #5000ff55; color: #fff; display: grid; gap: 3px; }
.dt-tip[hidden] { display: none; }
.dt-tip time { font-family: var(--mono); font-size: 11px; color: #a7a7c7; }
.dt-tip b { font-size: 15px; line-height: 1.25; color: #fff; }
.dt-tip span { font-size: 12px; color: #b9b9d9; }
.dt-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.dt-legend a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.dt-legend a:hover { color: var(--ink); }
.dt-legend i, .dx-mat { display: inline-block; width: 14px; height: 14px; background-size: cover; image-rendering: pixelated; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); flex: none; }
.dt-legend .num { color: var(--ink-3); }
.dt-hint { margin-top: 12px; color: var(--ink-3); font-size: 14px; max-width: 80ch; }
@media (hover: none) { .dt-hint { display: none; } }

.dt-tools { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-top: 30px; }
.dt-who { display: flex; flex-wrap: wrap; gap: 8px; }
.dt-who .who { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer; transition: border-color .2s var(--ease-out), color .2s var(--ease-out), background-color .2s var(--ease-out); }
.dt-who .who img { width: 22px; height: 22px; border-radius: 4px; image-rendering: pixelated; }
.dt-who .who b { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.dt-who .who:hover { color: var(--ink); border-color: var(--line-2); }
.dt-who .who[aria-pressed="true"] { border-color: var(--acc); background: var(--acc-soft); color: var(--ink); }
.dt-all, .dt-reset { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer; }
.dt-all:hover, .dt-reset:hover { color: var(--ink); border-color: var(--acc); }
.dt-filter { margin-top: 14px; color: var(--ink-2); font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dt-filter[hidden] { display: none; }

#diary-list { margin-top: 26px; }
.dx { margin-top: 34px; padding: 0; }
.dx[hidden], .dd[hidden] { display: none; }
.dx-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.dx-head .slot { width: 52px; height: 52px; padding: 6px; }
.dx-head .slot img { width: 40px; height: 40px; }
.dx-id { font-family: var(--pixel); font-size: 9px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; letter-spacing: .02em; }
.dx-head h2 { font-size: clamp(22px, 2.4vw, 28px); margin: 4px 0 2px; }
.dx-sub { color: var(--ink-2); font-size: 14px; }
.dx-sub .num { color: var(--ink-3); }
.dx-link { color: var(--acc); font-weight: 600; font-size: 14px; white-space: nowrap; }

.dd { border-bottom: 1px solid var(--line); border-radius: 10px; transition: background-color .6s var(--ease-out); }
.dd.flash { animation: dd-flash 1.6s var(--ease-out); }
@keyframes dd-flash { 0%, 30% { background: var(--acc-soft); } 100% { background: transparent; } }
.dd summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto 20px; gap: 14px; align-items: center; padding: 14px 4px; }
.dd summary::-webkit-details-marker { display: none; }
.dd summary:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 8px; }
.dd-date { display: grid; justify-items: center; gap: 4px; padding: 7px 0 6px; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--line); }
.dd-date b { font-family: var(--pixel); font-size: 15px; color: var(--ink); line-height: 1; }
.dd-date span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); text-transform: lowercase; }
.dd-t { display: grid; gap: 3px; min-width: 0; }
.dd-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.dd-t small { font-size: 12px; color: var(--ink-3); }
.dd-faces { display: flex; align-items: center; }
.dd-faces img { width: 22px; height: 22px; border-radius: 4px; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--bg); margin-left: -4px; background: var(--bg-3); }
.dd-faces img:first-child { margin-left: 0; }
.dd-faces .more { font-size: 12px; color: var(--ink-3); margin-left: 6px; }
.dd .chev { color: var(--ink-3); transition: transform .2s var(--ease-out); }
.dd details[open] .chev { transform: rotate(180deg); }
.dd ul { margin: 0 0 18px 68px; padding: 0 0 0 18px; color: var(--ink-2); font-size: 15px; max-width: 74ch; }
.dd li + li { margin-top: 8px; }
.dd .nm { color: var(--ink); font-weight: 600; }
.dd .nm.on { color: var(--acc); }
@media (max-width: 640px) {
  .dt3d { aspect-ratio: 16 / 10; min-height: 0; }
  .dt-tools { flex-direction: column; }
  .dx-head { grid-template-columns: auto 1fr; }
  .dx-link { grid-column: 1 / -1; }
  .dd summary { grid-template-columns: 46px minmax(0, 1fr) 16px; gap: 12px; }
  .dd-faces { grid-column: 2; grid-row: 2; }
  .dd .chev { grid-column: 3; grid-row: 1; }
  .dd ul { margin-left: 4px; }
}
@media (prefers-reduced-motion: reduce) { .dd.flash { animation: none; } }

/* sul telefono il bottone "In diretta" è nascosto: la Diretta entra nel menu (04/11) */
.nav li.nav-only-m { display: none; }
@media (max-width: 900px) { .nav.open li.nav-only-m { display: list-item; } }
