/* Pocket Bestiary — © 2026 Noemi Marcolini. Tutti i diritti riservati. Vedi LICENSE. */
/* ============================================================
   SCHEDE.CSS — Le vesti della scheda. Manuale e Carta hanno
   colori propri (carta, inchiostro, rosso) perché imitano un
   oggetto stampato: restano uguali di notte e di giorno. Pocket
   segue la tavolozza dell'app. Inchiostro è bianco e nero.
   ============================================================ */

/* ── Comune ── */
.scheda { width: 100%; max-width: 440px; font-size: 1rem; line-height: 1.45; overflow-wrap: break-word; }
.scheda p { margin: 0; }
.scheda .sv { margin: 0 0 .5em; }
.scheda .sv-n { font-weight: 700; font-style: italic; }
.scheda .sv.intro { font-style: normal; }
.scheda .dado { white-space: nowrap; font: inherit; color: inherit; background: none; border: 0; padding: 0 1px; border-bottom: 1px dotted currentColor; cursor: pointer; border-radius: 2px; }
.scheda .dado:hover { background: color-mix(in oklch, currentColor 12%, transparent); }
.scheda .sf { margin-top: 10px; font-size: .74rem; opacity: .7; }
.due-col { max-width: 860px; }
@media (min-width: 1200px) { .due-col .sx { columns: 2; column-gap: 28px; } .due-col .ss { break-inside: auto; } .due-col .sv { break-inside: avoid; } }

/* ── Manuale ── */
.s-manuale {
  --carta: #f4ead2; --carta-2: #efe2c3; --inchiostro: #241b12; --rosso: #7a2016; --rosso-chiaro: #9c3a24; --filetto: #8a2a1a;
  --verde-24: #e3dcc4; --fis: #ece0c0; --men: #e6dcc8;
  background: var(--carta);
  background-image: radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,.35), transparent 60%), radial-gradient(90% 60% at 100% 100%, rgba(140,100,40,.12), transparent 70%);
  color: var(--inchiostro); font-family: 'Alegreya Sans', 'Figtree', sans-serif; font-size: 1.02rem;
  padding: 22px 24px 18px; border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 18px 40px -22px rgba(0,0,0,.55);
  position: relative;
}
.s-manuale::before, .s-manuale::after { content: ''; position: absolute; left: -3px; right: -3px; height: 5px; background: linear-gradient(#b9893b, #8f6524); border-radius: 2px; }
.s-manuale::before { top: -2px; }
.s-manuale::after { bottom: -2px; }
.s-manuale .sn { font-family: 'Alegreya', Georgia, serif; font-weight: 700; font-variant: small-caps; font-size: 1.85rem; line-height: 1.05; color: var(--rosso); letter-spacing: .01em; }
.s-manuale .st { font-style: italic; margin-top: 2px; }
.s-manuale .filetto { height: 5px; margin: 8px 0; background: var(--filetto); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.s-manuale .pr { color: var(--rosso); margin: 1px 0; }
.s-manuale .pr b { font-weight: 700; }
.s-manuale .pr { color: var(--inchiostro); }
.s-manuale .pr b { color: var(--rosso); }
.s-manuale .sep { display: inline-block; width: 1.4em; }
.s-manuale .car14 { display: grid; grid-template-columns: repeat(6, 1fr); text-align: center; color: var(--rosso); gap: 2px; }
.s-manuale .car14 b { display: block; font-weight: 700; }
.s-manuale .car14 span { color: var(--inchiostro); font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-manuale .ss-t { font-family: 'Alegreya', Georgia, serif; font-variant: small-caps; font-weight: 500; font-size: 1.4rem; color: var(--rosso); border-bottom: 1px solid var(--rosso); margin: 14px 0 6px; line-height: 1.2; letter-spacing: .01em; }
.s-manuale .sx > .ss:first-child .ss-t { margin-top: 4px; }
.s-manuale .sv-n { color: var(--inchiostro); }

/* Manuale 2024: tabella delle caratteristiche, titoli di sezione pieni */
.s-manuale.f-2024 { --rosso: #6b2a1d; --filetto: #6b2a1d; }
.s-manuale.f-2024 .sn { font-variant: normal; font-family: 'Alegreya', Georgia, serif; }
.s-manuale.f-2024 .filetto { height: 2px; clip-path: none; opacity: .75; }
.s-manuale .car24 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-variant-numeric: tabular-nums; }
.s-manuale .col24 { display: grid; gap: 2px; }
.s-manuale .c24 { display: grid; grid-template-columns: 2.3em 1.8em 1fr 1fr; align-items: center; text-align: center; padding: 2px 4px; border-radius: 3px; font-size: .95rem; }
.s-manuale .c24 b { text-align: left; font-weight: 700; color: var(--rosso); }
.s-manuale .c24.fis { background: var(--fis); }
.s-manuale .c24.men { background: var(--men); }
.s-manuale .c24.testa { font-size: .68rem; font-weight: 700; color: var(--rosso); padding-block: 0; }
.s-manuale .c24 .p { font-weight: 700; }
.s-manuale.f-2024 .ss-t { font-variant: normal; font-family: 'Alegreya', Georgia, serif; font-weight: 700; font-size: 1.15rem; border-bottom: 2px solid var(--rosso); }

/* ── Inchiostro: bianco e nero, compatta ── */
.s-inchiostro { background: #fff; color: #111; font-family: 'Alegreya Sans', 'Figtree', sans-serif; padding: 20px 22px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.s-inchiostro .sn { font-family: 'Gloock', Georgia, serif; font-size: 1.7rem; line-height: 1.05; }
.s-inchiostro .st { font-style: italic; }
.s-inchiostro .filetto { height: 1px; background: #111; margin: 8px 0; }
.s-inchiostro .pr b, .s-inchiostro .car14 b, .s-inchiostro .c24 b { font-weight: 700; }
.s-inchiostro .car14 { display: grid; grid-template-columns: repeat(6, 1fr); text-align: center; font-variant-numeric: tabular-nums; }
.s-inchiostro .car14 b { display: block; }
.s-inchiostro .car24 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-variant-numeric: tabular-nums; }
.s-inchiostro .col24 { display: grid; gap: 1px; }
.s-inchiostro .c24 { display: grid; grid-template-columns: 2.3em 1.8em 1fr 1fr; text-align: center; font-size: .94rem; border-bottom: 1px solid #ddd; }
.s-inchiostro .c24 b { text-align: left; }
.s-inchiostro .c24.testa { font-size: .66rem; font-weight: 700; border: 0; }
.s-inchiostro .sep { display: inline-block; width: 1.4em; }
.s-inchiostro .ss-t { font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: 1.2rem; border-bottom: 1px solid #111; margin: 12px 0 5px; }

/* ── Pocket: tessere dell'app ── */
.s-pocket { max-width: 640px; background: var(--tessera); color: var(--testo); border-radius: 24px; padding: 22px; display: grid; gap: 16px; }
.pk-testa { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pk-tipo { font-size: .82rem; font-weight: 700; color: var(--ac-testo); }
.s-pocket .sn { font-family: var(--font-titoli); font-size: 2.1rem; line-height: 1.02; margin-top: 2px; }
.pk-gs { display: grid; justify-items: center; background: var(--ac); color: var(--sul-ac); border-radius: 18px; padding: 8px 14px; min-width: 76px; }
.pk-gs span { font-size: .75rem; font-weight: 700; }
.pk-gs b { font-family: var(--font-titoli); font-weight: 400; font-size: 1.9rem; line-height: 1; }
.pk-gs small { font-size: .74rem; font-variant-numeric: tabular-nums; }
.pk-numeri { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.pk-n { background: var(--fondo-alto); border-radius: 16px; padding: 10px 12px; display: grid; }
.pk-e { font-size: .78rem; font-weight: 700; color: var(--testo-quieto); }
.pk-v { font-family: var(--font-titoli); font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pk-s { font-size: .82rem; color: var(--testo-medio); }
.pk-car { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.pk-car > div { background: var(--fondo-alto); border-radius: 14px; padding: 8px 4px; display: grid; justify-items: center; text-align: center; }
.pk-car > div.ts { box-shadow: inset 0 0 0 2px color-mix(in oklch, var(--ac) 55%, transparent); }
.pk-car span { font-size: .74rem; font-weight: 700; color: var(--testo-quieto); }
.pk-car b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.pk-car small { font-size: .72rem; color: var(--testo-medio); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .pk-car { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pk-props { margin: 0; display: grid; gap: 6px; }
.pk-props div { display: grid; grid-template-columns: 9em 1fr; gap: 10px; }
.pk-props dt { font-size: .85rem; font-weight: 700; color: var(--testo-quieto); }
.pk-props dd { margin: 0; min-width: 0; }
@media (max-width: 520px) { .pk-props div { grid-template-columns: 1fr; gap: 0; } }
.s-pocket .ss-t { font-family: var(--font-titoli); font-size: 1.35rem; margin: 6px 0 8px; }
.s-pocket .sv-n { font-style: normal; }
.s-pocket .sx { font-size: 1rem; line-height: 1.55; }
.s-pocket .sf { margin-top: 0; color: var(--testo-quieto); opacity: 1; }

/* ── Carta da gioco (schermo e stampa) ── */
.mazzetto { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; zoom: 1.45; }
@media (max-width: 560px) { .mazzetto { zoom: 1.2; } }
.carta {
  --cornice: oklch(42% .11 var(--tinta)); --cornice-chiara: oklch(93% .03 var(--tinta)); --inchiostro: #1d1712; --fondo-carta: #faf5ea;
  width: var(--w); height: var(--h); flex: none; position: relative; overflow: hidden;
  --bordo: 1.6mm; --pad-y: 2.6mm; --pad-x: 2.8mm; --raggio-c: 3mm;
  background: var(--fondo-carta); color: var(--inchiostro); border-radius: var(--raggio-c);
  box-shadow: inset 0 0 0 var(--bordo) var(--cornice), 0 10px 24px -14px rgba(0,0,0,.6);
  padding: var(--pad-y) var(--pad-x) 2.2mm; display: flex; flex-direction: column;
  font-family: 'Alegreya Sans', 'Figtree', sans-serif; font-size: calc(var(--fs, 6.9pt) * var(--sc, 1)); line-height: 1.22;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.carta.neutra { --cornice: #3a322a; --cornice-chiara: #efe8da; }
.carta.f-grande, .carta.f-tarocchi { --pad-y: 3.2mm; --pad-x: 3.4mm; padding-bottom: 2.6mm; }
.carta.f-a5 { --bordo: 2.4mm; --pad-y: 5mm; --pad-x: 5.5mm; --raggio-c: 4mm; padding-bottom: 4mm; }
.carta.f-mini { --bordo: 1.2mm; --pad-y: 2mm; --pad-x: 2.1mm; --raggio-c: 2.4mm; padding-bottom: 1.7mm; }
.carta p { margin: 0; }
/* La testata arriva fino al bordo della carta e si fonde con la cornice: nessun angolino di carta */
.ct { display: flex; align-items: stretch; gap: 1.5mm; background: var(--cornice); color: #fff; margin: calc(-1 * var(--pad-y)) calc(-1 * var(--pad-x)) 1.4mm; padding: calc(var(--bordo) + 1.2mm) calc(var(--bordo) + 1.6mm) 1.5mm; border-radius: var(--raggio-c) var(--raggio-c) 0 0; }
.ct-n { flex: 1; min-width: 0; }
.ct h2 { font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: calc(var(--w) * .062); line-height: 1.02; letter-spacing: -.01em; overflow-wrap: anywhere; }

.ct p { font-size: calc(var(--w) * .034); font-style: italic; opacity: .92; margin-top: .4mm; line-height: 1.15; }

.ct-gs { display: grid; place-items: center; align-content: center; min-width: 9mm; background: #fff; color: var(--cornice); border-radius: 1.6mm; padding: .6mm 1mm; text-align: center; line-height: 1; }
.ct-gs small { font-size: calc(var(--w) * .028); font-weight: 700; }
.ct-gs b { font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: calc(var(--w) * .062); }
.cb { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1.1mm; }
.cs { display: flex; gap: .8mm; }
.cs > div { background: var(--cornice-chiara); border-radius: 1.2mm; padding: .5mm 1mm; display: grid; text-align: center; min-width: 7mm; }
.cs .cs-v { flex: 1; text-align: left; }
.cs small { font-size: .74em; font-weight: 700; color: var(--cornice); line-height: 1.1; }
.cs b { font-size: 1.12em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cs .cs-v b { font-size: .95em; font-weight: 400; }
.cs i { font-size: .78em; font-style: normal; opacity: .8; }
.cc { display: grid; grid-template-columns: repeat(6, 1fr); gap: .6mm; text-align: center; }
.cc > div { border-radius: 1mm; padding: .3mm 0; display: grid; background: color-mix(in srgb, var(--cornice-chiara) 55%, transparent); }
.cc > div.ts { box-shadow: inset 0 0 0 .25mm var(--cornice); }
.cc small { font-size: .7em; font-weight: 700; color: var(--cornice); line-height: 1.1; }
.cc b { font-size: 1.05em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cc i { font-size: .72em; font-style: normal; opacity: .8; font-variant-numeric: tabular-nums; }
.cp p { line-height: 1.18; }
.cp b { color: var(--cornice); }
.cx { min-height: 0; }
.cx h3 { font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: 1.32em; color: var(--cornice); border-bottom: .25mm solid var(--cornice); margin: .8mm 0 .6mm; line-height: 1.15; }
.cx .sv { margin: 0 0 .7mm; }
.cx .sv-n { font-weight: 700; font-style: italic; }
.cf { display: flex; justify-content: space-between; gap: 2mm; font-size: calc(var(--w) * .028); opacity: .7; padding-top: .6mm; border-top: .2mm solid color-mix(in srgb, var(--inchiostro) 25%, transparent); margin-top: .6mm; font-variant-numeric: tabular-nums; }
.carta.retro { padding: 0; background: var(--cornice); display: grid; place-items: center; box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); }
.carta.retro::before { content: ''; position: absolute; inset: 3mm; border: .4mm dashed rgba(255,255,255,.55); border-radius: 2mm; }
.rt { display: grid; justify-items: center; gap: 1.5mm; color: #fff; text-align: center; }
.rt svg { width: calc(var(--w) * .35); height: calc(var(--w) * .35); fill: #fff; }
.rt b { font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: calc(var(--w) * .07); }
.rt small { font-size: calc(var(--w) * .034); opacity: .8; }

/* Misuratore fuori schermo: stessa larghezza in mm delle carte vere */
.misuratore { position: absolute; left: -9999px; top: 0; visibility: hidden; pointer-events: none; }

/* ── Stampa: la scheda singola esce senza ombre ── */
@media print {
  .scheda { box-shadow: none !important; max-width: none; }
  .s-pocket { background: #fff; color: #111; }
  .mazzetto { zoom: 1; }
}

/* ── Illustrazioni ── */
/* Le illustrazioni sono incisioni in bianco e nero su carta chiara: con "multiply" la carta sparisce
   e resta il tratto, sulla pergamena come sulla tessera. */
.sm-fig { margin: -6px 0 6px; display: flex; justify-content: center; }
.sm-fig img { display: block; width: 100%; max-height: 240px; object-fit: contain; mix-blend-mode: multiply; filter: grayscale(1) brightness(1.14) contrast(1.25) sepia(.3); }
.s-inchiostro .sm-fig img { filter: grayscale(1) brightness(1.14) contrast(1.3); }
.sm-fig.generica img { max-height: 170px; opacity: .8; }
.sm-fig.propria img { mix-blend-mode: normal; filter: none; border-radius: 4px; max-height: 280px; }
.due-col .sm-fig img { max-height: 280px; }

.pk-testa { align-items: center; }
.pk-nome { flex: 1; min-width: 0; }
.pk-fig { flex: none; width: 112px; height: 112px; margin: 0; border-radius: 18px; overflow: hidden; background: oklch(93% calc(var(--ca) * .25) var(--ha)); }
.pk-fig img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; filter: grayscale(1) brightness(1.14) contrast(1.25); }
.pk-fig.propria img { mix-blend-mode: normal; filter: none; }
@media (max-width: 520px) { .pk-fig { width: 76px; height: 76px; border-radius: 14px; } .s-pocket .sn { font-size: 1.7rem; } }

.c-fig { margin: -.4mm -1.2mm 1mm; overflow: hidden; border-radius: 1mm; background: transparent; flex: none; }
.c-fig img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 50%; mix-blend-mode: multiply; filter: grayscale(1) brightness(1.14) contrast(1.25); }
.c-fig.generica img { opacity: .6; }
.c-fig.propria img { object-fit: cover; mix-blend-mode: normal; filter: none; }

/* Miniatura nell'elenco */
.mini-fig { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex: none; background: oklch(93% calc(var(--ca) * .25) var(--ha)); grid-row: span 2; align-self: center; }
.mini-fig img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; filter: grayscale(1) brightness(1.14) contrast(1.25); }
.mini-fig.generica img { opacity: .55; }
.mini-fig.propria img { mix-blend-mode: normal; filter: none; }

/* Retro con l'illustrazione del mostro */
.carta.retro.con-fig { background: var(--fondo-carta); box-shadow: inset 0 0 0 1.6mm var(--cornice), 0 10px 24px -14px rgba(0,0,0,.6); display: flex; flex-direction: column; padding: 2.6mm; place-items: stretch; }
.carta.retro.con-fig::before { inset: 2.6mm; border-color: color-mix(in srgb, var(--cornice) 45%, transparent); }
.rt-fig { flex: 1; min-height: 0; margin: 1.5mm 1.5mm 0; overflow: hidden; }
.rt-fig img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; filter: grayscale(1) brightness(1.14) contrast(1.25); }
.carta.retro.propria .rt-fig img { object-fit: cover; mix-blend-mode: normal; filter: none; }
.rt-nome { text-align: center; padding: 1mm 1mm 2mm; color: var(--cornice); display: grid; }
.rt-nome b { font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: calc(var(--w) * .075); line-height: 1.05; }
.rt-nome small { font-size: calc(var(--w) * .036); color: var(--inchiostro); opacity: .75; }

/* Illustrazione della scheda: si ingrandisce al passaggio e si apre con un clic */
[data-ingrandisci] { cursor: zoom-in; }
.pk-fig[data-ingrandisci] { position: relative; transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s; }
/* Nella scheda niente transform sulla figura: creerebbe un livello a sé e la carta dell'incisione tornerebbe bianca */
.sm-fig img { transition: max-height .4s cubic-bezier(.16, 1, .3, 1); }
.sm-fig[data-ingrandisci]:hover img, .sm-fig[data-ingrandisci]:focus-visible img { max-height: 300px; }
.sm-fig[data-ingrandisci]:focus-visible { outline: 2px solid var(--rosso, #7a2016); outline-offset: 4px; border-radius: 4px; }
.pk-fig[data-ingrandisci]:hover, .pk-fig[data-ingrandisci]:focus-visible { transform: scale(1.9); transform-origin: 0 0; z-index: 5; box-shadow: 0 24px 50px -18px rgba(0,0,0,.6); }
@media (prefers-reduced-motion: reduce) { [data-ingrandisci] { transition: none; } }
@media print { .carta .ct { border-radius: 0; } }
