/* 🖨️ Lotería для печати — панель генератора и листы (src/web/loteria-print.js).
   Листы рисуются в миллиметрах: на экране — уменьшенный предпросмотр (zoom),
   при печати — натуральная величина, всё кроме листов скрыто. */

/* ── панель ── */
.lp-tool { margin: 18px 0 8px; padding: 16px; background: #13111f; border: 1px solid #2a2540; border-radius: 18px; }
.lp-tool h2 { font-size: 1.15rem; color: #fff; margin-bottom: 12px; }
.lp-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.lp-group { display: flex; align-items: center; gap: 6px; color: #cfccdd; font-size: .92rem; flex-wrap: wrap; }
.lp-group[hidden] { display: none; }
.lp-group > span { color: #b8b4c8; }
.lp-count { width: 72px; padding: 8px 10px; border-radius: 10px; border: 1px solid #2a2540; background: #0a0912; color: #fff; font: inherit; }
.lp-sel { padding: 8px 10px; border-radius: 10px; border: 1px solid #2a2540; background: #0a0912; color: #fff; font: inherit; max-width: 100%; }
.lp-btn {
  padding: 8px 12px; border-radius: 10px; border: 1px solid #2a2540; background: #1a1730; color: #e8e6f0;
  font: inherit; font-size: .9rem; cursor: pointer; min-height: 40px;
}
.lp-btn.is-on { background: #6d28d9; border-color: #6d28d9; color: #fff; }
.lp-check-l { display: flex; align-items: center; gap: 6px; color: #cfccdd; font-size: .92rem; cursor: pointer; min-height: 40px; }
.lp-check-l input { width: 18px; height: 18px; accent-color: #7c3aed; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.lp-actions .ld-cta { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.lp-actions .ld-cta:disabled { opacity: .5; cursor: default; }
.lp-play { color: #a78bfa; font-weight: 600; }
.lp-note { margin-top: 10px; color: #b8f5c9; font-size: .9rem; min-height: 1.3em; }
.lp-note.is-err { color: #ff8ba0; }
.lp-hint { color: #8a86a0; font-size: .82rem; margin-top: 4px; }

/* ── предпросмотр ── */
.lp-preview { margin: 6px 0 10px; overflow: hidden; }
.lp-preview > h2 { font-size: 1rem; color: #b8b4c8; margin: 8px 0; }
.lp-sheets { display: flex; flex-direction: column; gap: 6mm; align-items: flex-start; }

/* ── лист: размеры области печати (бумага минус поля 8 мм, с запасом) ── */
.lp-sheet {
  --pw: 194mm; --ph: 279mm;
  width: var(--pw); height: var(--ph); background: #fff; color: #111; overflow: hidden;
  font-family: 'Manrope', 'Manrope Fallback', -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.2; box-shadow: 0 0 0 8mm #fff, 0 4px 24px 8mm rgba(0, 0, 0, .35);
  margin: 8mm; display: grid; gap: 6mm;
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
[data-lp-paper="letter"] .lp-sheet { --pw: 199mm; --ph: 261mm; }
.lp-per1 { grid-template: 1fr / 1fr; }
.lp-per2 { grid-template: 1fr 1fr / 1fr; }
.lp-per4 { grid-template: 1fr 1fr / 1fr 1fr; }

/* ── табла ── */
.lp-board {
  container-type: size; min-width: 0; min-height: 0;
  border: .7mm solid #7c2d12; border-radius: 3mm; padding: 2.5mm;
  display: flex; flex-direction: column; gap: 1.6mm; background: #fffaf0;
}
.lp-bhead, .lp-bfoot { display: flex; justify-content: space-between; align-items: baseline; gap: 2mm; }
.lp-logo { font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 800; color: #b91c1c; letter-spacing: .04em; font-size: clamp(9pt, 5.2cqw, 26pt); }
.lp-bno { font-size: clamp(7pt, 2.6cqw, 12pt); color: #555; font-weight: 700; }
.lp-bfoot { font-size: clamp(6.5pt, 2.2cqw, 10pt); color: #555; }
.lp-nameline { flex: 1; border-bottom: .3mm solid #999; padding-bottom: .5mm; }
.lp-meta { white-space: nowrap; }
.lp-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 1.4mm; }
.lp-card, .lp-cut {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: .4mm solid #444; border-radius: 1.6mm; background: #fff; text-align: center; padding: 1mm;
}
.lp-no { position: absolute; top: .6mm; left: 1mm; font-style: normal; font-weight: 700; color: #777; font-size: clamp(5.5pt, 1.7cqw, 9pt); }
.lp-emo { font-size: min(11cqw, 9cqh); line-height: 1.1; }
.lp-nm { font-weight: 700; font-size: clamp(5.5pt, min(2.3cqw, 2.3cqh), 12pt); line-height: 1.1; overflow-wrap: anywhere; }
.lp-nm small { display: block; font-weight: 500; color: #666; font-size: .82em; }

/* ── лист ведущего: список ── */
.lp-callsheet { display: block; padding: 2mm; }
.lp-ch { font-size: 15pt; margin: 0 0 2mm; color: #b91c1c; }
.lp-chint { font-size: 9.5pt; color: #333; margin: 0 0 3mm; }
.lp-ch3 { font-size: 11pt; margin: 0 0 2mm; }
.lp-check { list-style: none; padding: 0; margin: 0; columns: 3; column-gap: 5mm; font-size: 9pt; }
.lp-check li { display: flex; align-items: center; gap: 1.5mm; break-inside: avoid; padding: .75mm 0; border-bottom: .2mm solid #e3e3e3; }
.lp-check small { color: #777; }
.lp-box { width: 3.2mm; height: 3.2mm; border: .3mm solid #333; border-radius: .6mm; flex: none; }

/* ── карты ведущего на вырезку: 4×4 ── */
.lp-cutsheet { grid-template: 1fr auto / 1fr; gap: 2mm; }
.lp-cuts { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); container-type: size; min-height: 0; }
.lp-cut { border: .3mm dashed #888; border-radius: 0; }
.lp-cut .lp-emo { font-size: min(9cqw, 9cqh); }
.lp-cut .lp-nm { font-size: clamp(7pt, 2.2cqw, 12pt); }
.lp-cut .lp-no { font-size: 8pt; }
.lp-cutcap { font-size: 8.5pt; color: #666; text-align: center; margin: 0; }

/* RTL-страница: сами листы — слева направо (номера карт, латиница) */
[dir="rtl"] .lp-sheets { direction: ltr; }

@media (max-width: 560px) {
  .lp-tool { padding: 12px; }
  .lp-actions .ld-cta { width: 100%; text-align: center; }
}

/* ── печать: только листы ── */
@media print {
  html, body { background: #fff !important; }
  .ld-head, .ld-foot, .ld-main > :not(.lp-preview), .lp-preview > h2 { display: none !important; }
  .ld-main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .lp-preview { margin: 0; overflow: visible; }
  .lp-sheets { zoom: 1 !important; display: block; }
  .lp-sheet { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .lp-sheet:last-child { break-after: auto; page-break-after: auto; }
}
/* свой рисунок карты (c.art) — размером с эмодзи; в списке ведущего — по строке */
.lp-art { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; object-fit: contain; }
