/* Fogli A4 (anteprima + stampa). Tutte le misure fisiche sono in mm. */
@page { size: A4 portrait; margin: 0; }

.sheets { zoom: var(--z, 1); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 8px 16px; width: max-content; min-width: 100%; box-sizing: border-box; }
.sheet {
  position: relative; box-sizing: border-box; flex: none; width: 210mm; height: 296.6mm; /* 0.4mm di scarto evita fogli bianchi in coda */
  margin-inline: auto; padding: var(--m, 0mm); background: #fff; color: #151515; overflow: hidden;
  box-shadow: 0 2px 14px rgba(0,0,0,.25);
  -webkit-print-color-adjust: exact; print-color-adjust: exact; font-family: var(--font);
}
.sheet .tb { font-size: 5pt; padding: 0 1.6mm; line-height: 1.7; }
.sheet img { -webkit-user-drag: none; }
.sheet .pix, .pix { image-rendering: pixelated; }
.sheet-tag { position: absolute; bottom: 1.5mm; right: 3mm; font-size: 6pt; color: #888; }

/* Immagine con scala/posizione (Collector e Token) */
.win { position: relative; overflow: hidden; }
.win img {
  position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; object-fit: contain;
  transform: translate(calc(-50% + var(--x, 0) * 1%), calc(-50% + var(--y, 0) * 1%)) scale(var(--s, 1));
}

/* ================= COLLECTOR: cornice + Pokémon full art su bianco ================= */
.cards { display: grid; grid-template-columns: repeat(3, 63mm); grid-template-rows: repeat(3, 88mm); gap: var(--gap, 0mm); justify-content: center; align-content: center; height: 100%; }
.tcg {
  position: relative; width: 63mm; height: 88mm; box-sizing: border-box; padding: 2.3mm; border-radius: 3.2mm; overflow: hidden; cursor: pointer;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 80%, #fff), color-mix(in srgb, var(--c) 65%, #000));
}
.tcg-in { position: relative; height: 100%; border-radius: 1.6mm; background: #fff; overflow: hidden; box-shadow: 0 0 0 .3mm rgba(0,0,0,.35); }
.tcg .win { position: absolute; inset: 0; }
.tcg-no {
  position: absolute; right: 1.6mm; bottom: 1.4mm; padding: .3mm 1.6mm; border-radius: 1mm;
  font-size: 6.5pt; font-weight: 800; letter-spacing: .03em; font-variant-numeric: tabular-nums;
  color: #fff; background: color-mix(in srgb, var(--c) 80%, #000);
}
.cut .tcg { outline: .2mm dashed #8a8a8a; }
.tcg-back { background: #1b3a8a; }
.tcg-back .tcg-in { background: linear-gradient(#222, #222) center/100% 1.4mm no-repeat, radial-gradient(circle at 50% 50%, #fff 0 6mm, #222 6mm 7.4mm, transparent 7.4mm), linear-gradient(#d8392f 50%, #f1f1f1 50%); }

/* ================= TOKEN ================= */
.tokens {
  display: grid; grid-template-columns: repeat(var(--cols), var(--sz)); grid-template-rows: repeat(var(--rows), var(--sz)); gap: var(--gap, 1mm);
  justify-content: center; align-content: center; height: 100%;
}
.tok { position: relative; width: var(--sz); height: var(--sz); box-sizing: border-box; overflow: hidden; cursor: pointer; }
.tok.circle { border-radius: 50%; } .tok.square { border-radius: 0; }
.tok.ring-type { border: calc(var(--sz) * .045) solid color-mix(in srgb, var(--c) 75%, #000); }
.tok.ring-black { border: calc(var(--sz) * .03) solid #111; }
.tok.fill-type { background: radial-gradient(circle at 50% 40%, #fff 0, color-mix(in srgb, var(--c) 45%, #fff) 100%); }
.tok.fill-white { background: #fff; }
.tok .win { position: absolute; inset: 0; }
.tok .n { position: absolute; left: 0; right: 0; bottom: 3%; text-align: center; font-size: calc(var(--sz) * .13); font-weight: 800; line-height: 1; color: #111; text-shadow: 0 0 .6mm #fff, 0 0 .6mm #fff; pointer-events: none; }
.cut .tok { outline: .15mm dashed #8a8a8a; outline-offset: .3mm; }

/* ================= CHECKLIST ================= */
.cl-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 9pt; font-weight: 700; border-bottom: .35mm solid #222; padding-bottom: 1.5mm; margin-bottom: 1.5mm; height: 8mm; box-sizing: border-box; }
.cl-head span { font-weight: 400; color: #555; font-size: 7pt; }
.cl-cols { display: grid; grid-template-columns: repeat(var(--cols), 1fr); column-gap: 6mm; }
.cl-row { display: flex; align-items: center; gap: 1.8mm; height: var(--rh); border-bottom: .1mm dotted #aaa; font-size: 7.5pt; min-width: 0; }
.cl-row .bx { flex: none; width: 3.6mm; height: 3.6mm; border: .3mm solid #222; border-radius: .6mm; }
.cl-row img { flex: none; height: calc(var(--rh) - .6mm); width: calc(var(--rh) - .6mm); }
.cl-row .no { flex: none; width: 9mm; color: #666; font-variant-numeric: tabular-nums; font-size: 6.5pt; }
.cl-row .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cl-row .dots { display: flex; gap: .6mm; }
.cl-row .dots i { width: 2.4mm; height: 2.4mm; border-radius: 50%; background: var(--c); border: .15mm solid rgba(0,0,0,.4); }

/* ================= WHO IS THAT? (SVG con viewBox in mm, vedi Modes.whois) ================= */
.sheet.wit > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Pokédex: vedi manual.css */

/* selezione carta/token (solo schermo) */
@media screen { .sel-on { box-shadow: 0 0 0 .8mm #e5483b, 0 0 0 1.6mm rgba(229,72,59,.35); z-index: 1; } }

/* ================= STAMPA ================= */
@media print {
  html, body { background: #fff !important; }
  .ui, .panel, .ptools, .banner { display: none !important; }
  .layout { display: block !important; }
  .preview { padding: 0 !important; background: none !important; }
  .scroller { overflow: visible !important; }
  .sheets { zoom: 1 !important; display: block; padding: 0; gap: 0; width: auto; min-width: 0; }
  .sheet { box-shadow: none; margin: 0; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .sel-on { box-shadow: none !important; }
}
