/* ===== печать: бумажный бланк, страница на игрока =====
   На экране печатный корень не существует визуально; всё оживает
   только в @media print, поэтому обычные экраны его не задевают. */

#print-root{display:none}

@media print{
  @page{size:A4 portrait;margin:12mm}

  html,body{background:#fff!important;color:#000!important;height:100%}
  body{font-size:12pt}
  #screen-setup,#screen-game,#screen-result{display:none!important}
  #print-root{display:block}

  /* Лист ровно в высоту печатной области (100% = страница за вычетом полей).
     На разрывы страниц не полагаемся: Chrome при печати их пропускает и шапка
     следующего игрока залезает вниз предыдущей страницы. Раз лист занимает
     страницу целиком, влезать некуда — и это не зависит от формата бумаги. */
  .sheet{
    display:flex;flex-direction:column;
    height:100%;overflow:hidden;
    break-inside:avoid;page-break-inside:avoid;
  }
  .sheet + .sheet{break-before:page;page-break-before:always}

  /* ---------- шапка ---------- */
  .p-head{
    display:flex;align-items:center;gap:10px;
    border-bottom:1.5pt solid #000;padding-bottom:6pt;margin-bottom:10pt;
  }
  .p-av{font-size:22pt;line-height:1}
  .p-nm{font-size:19pt;font-weight:700;letter-spacing:-.01em}
  .p-pool{margin-left:auto;font-size:11pt;color:#444}

  /* ---------- сетка 3×3 ---------- */
  .p-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:4mm;margin-bottom:8pt}
  .p-cell{
    position:relative;border:1pt solid #222;border-radius:3mm;
    min-height:40mm;padding:6mm 3mm 3mm;
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    gap:2mm;text-align:center;
  }
  .p-box{
    position:absolute;top:2.5mm;right:2.5mm;
    width:6mm;height:6mm;border:1pt solid #222;border-radius:1.5mm;
  }
  .p-em{font-size:20pt;line-height:1}
  .p-lb{font-size:10.5pt;line-height:1.2}
  .p-pr{font-size:9.5pt;font-weight:700;color:#2C7A7B}
  .p-cell.free{
    background:repeating-linear-gradient(45deg,#fff,#fff 2mm,#EDF3F2 2mm,#EDF3F2 4mm);
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
  }
  .p-cell.free .p-box{display:none}

  /* ---------- блоки: редкости и счётчик ---------- */
  .p-block{margin-bottom:7pt}
  .p-block h3{
    font-size:10pt;text-transform:uppercase;letter-spacing:.08em;
    margin:0 0 4pt;padding-top:5pt;border-top:.75pt solid #999;font-weight:700;
  }
  .p-rares{display:grid;grid-template-columns:1fr 1fr;gap:2mm 6mm}
  .p-rare{
    display:flex;align-items:center;gap:2.5mm;
    border:.75pt solid #999;border-radius:2mm;padding:2mm 2.5mm;
  }
  .p-rare .p-box{position:static;width:5mm;height:5mm;flex:0 0 auto}
  .p-rare .p-em{font-size:13pt}
  .p-rare .p-lb{flex:1;text-align:left;font-size:10pt}
  .p-rare .p-pr{font-size:9.5pt;white-space:nowrap}

  .p-arches{display:flex;flex-wrap:wrap;gap:2mm}
  .p-arches i{
    display:block;width:9mm;height:7mm;
    border:.75pt solid #999;border-bottom:none;border-radius:4.5mm 4.5mm 0 0;
  }

  /* ---------- подвал ---------- */
  .p-foot{
    margin-top:auto;display:flex;align-items:baseline;justify-content:space-between;
    gap:6mm;border-top:1.5pt solid #000;padding-top:6pt;
  }
  .p-till{font-size:13pt;font-weight:700}
  .p-till u{display:inline-block;min-width:34mm;text-decoration:none;border-bottom:1pt solid #222}
  .p-goal{font-size:11pt;color:#444}
  .p-rules{margin:5pt 0 0;font-size:9.5pt;line-height:1.45;color:#444}
}
