@font-face {
  font-family: 'Pacifico';
  src: url('../../../fonts/Pacifico-Regular.ttf') format('truetype');
  font-display: swap;
}

@page { size: A4 portrait; margin: 0; }
@page certificate { size: A4 landscape; margin: 0; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  color: #274b8f;
  background: #dce8ef;
  font-family: Arial, Helvetica, sans-serif;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.print-page {
  position: relative;
  width: 210mm;
  height: 297mm;
  margin: 8mm auto;
  overflow: hidden;
  page-break-after: always;
  break-after: page;
  background: #fff;
}
.print-page:last-child { page-break-after: auto; break-after: auto; }
.print-footer {
  position: absolute;
  right: 12mm;
  bottom: 7mm;
  left: 12mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #5f6c76;
  font-size: 8.5pt;
}
.signature { color: #c1440e; font-family: 'Pacifico', cursive; font-size: 11pt; }

.book-cover {
  display: grid;
  place-items: center;
  padding: 22mm 16mm;
  text-align: center;
  background:
    radial-gradient(circle at 12% 15%, rgba(255,213,74,.58), transparent 45mm),
    radial-gradient(circle at 88% 70%, rgba(78,198,255,.4), transparent 55mm),
    linear-gradient(160deg, #fff9e8, #eefaff 60%, #efffea);
}
.book-cover__badge {
  display: inline-block;
  padding: 3mm 6mm;
  border-radius: 999px;
  background: #ffd54a;
  font-size: 11pt;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.book-cover h1 { margin: 8mm 0 3mm; font-size: 34pt; line-height: 1.02; }
.book-cover h2 { margin: 0; color: #c1440e; font-family: 'Pacifico', cursive; font-size: 25pt; font-weight: 400; }
.book-cover p { max-width: 145mm; margin: 7mm auto; color: #4c5660; font-size: 14pt; line-height: 1.5; }
.book-cover__figures { display: flex; align-items: end; justify-content: center; gap: 5mm; margin: 7mm 0; }
.book-cover__figures img { width: 43mm; height: 63mm; object-fit: contain; }
.name-field { width: 145mm; margin-top: 8mm; padding: 4mm; border: 2px dashed #4ec6ff; border-radius: 4mm; background: rgba(255,255,255,.8); font-size: 13pt; }

.coloring-page { padding: 11mm 12mm 15mm; }
.coloring-page__header { display: flex; align-items: center; justify-content: space-between; min-height: 16mm; }
.coloring-page h1 { margin: 0; font-size: 20pt; }
.coloring-page__name { color: #55636e; font-size: 10pt; }
.coloring-page__art {
  display: grid;
  height: 250mm;
  place-items: center;
  margin-top: 4mm;
  border: 1.5px solid #d9e4ea;
  border-radius: 5mm;
}
.coloring-page__art img { display: block; width: 100%; height: 100%; object-fit: contain; }

.sheet-title { margin: 0; color: #274b8f; font-size: 25pt; text-align: center; }
.sheet-subtitle { margin: 2mm 0 7mm; color: #58636b; font-size: 11pt; text-align: center; }

.memory-page { padding: 10mm 12mm 12mm; }
.memory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; }
.memory-print-card {
  display: grid;
  height: 56mm;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  border: 1.2px dashed #52606a;
  border-radius: 3mm;
  background: #fffaf0;
}
.memory-print-card img { width: 100%; height: 44mm; object-fit: cover; object-position: top; }
.memory-print-card strong { padding: 2mm; color: #274b8f; background: #fff; font-size: 11pt; text-align: center; }
.cut-note { margin: 3mm 0 0; color: #5f6c76; font-size: 8.5pt; text-align: center; }

.puzzle-page { padding: 10mm 14mm 12mm; }
.puzzle-print-board {
  display: grid;
  width: 156mm;
  height: 234mm;
  margin: 0 auto;
  grid-template-columns: repeat(var(--cols), 1fr);
  border: 1.5px solid #263238;
}
.puzzle-print-piece {
  border: 1px dashed rgba(0,0,0,.85);
  background-image: var(--image);
  background-repeat: no-repeat;
  background-size: calc(var(--cols) * 100%) calc(var(--rows) * 100%);
  background-position: var(--x) var(--y);
}
.puzzle-label {
  position: absolute;
  right: 15mm;
  bottom: 4mm;
  left: 15mm;
  display: flex;
  justify-content: space-between;
  color: #5f6c76;
  font-size: 8.5pt;
}

.certificate-page {
  page: certificate;
  width: 297mm;
  height: 210mm;
  padding: 12mm;
  background: #fff;
}
.certificate {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  border: 4mm solid #ffd54a;
  border-radius: 8mm;
  background:
    radial-gradient(circle at 8% 15%, rgba(78,198,255,.28), transparent 40mm),
    radial-gradient(circle at 92% 85%, rgba(123,203,91,.25), transparent 48mm),
    #fffdf7;
  text-align: center;
}
.certificate::before { content: ''; position: absolute; inset: 5mm; border: 1.5px solid #274b8f; border-radius: 5mm; }
.certificate__content { position: relative; z-index: 1; width: 215mm; }
.certificate__eyebrow { font-size: 12pt; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.certificate h1 { margin: 5mm 0 2mm; font-size: 32pt; line-height: 1.08; }
.certificate p { margin: 3mm 0; color: #4d5962; font-size: 15pt; }
.certificate__name { display: block; width: 155mm; height: 16mm; margin: 8mm auto 4mm; border-bottom: 2px solid #274b8f; }
.certificate__reason { color: #c1440e; font-family: 'Pacifico', cursive; font-size: 24pt; }
.certificate__bottom { display: flex; align-items: end; justify-content: space-between; width: 215mm; margin: 12mm auto 0; }
.certificate__date { width: 55mm; padding-top: 2mm; border-top: 1px solid #274b8f; color: #5f6c76; font-size: 9pt; }
.certificate__brand { font-family: 'Pacifico', cursive; font-size: 17pt; }
.certificate__character { position: absolute; right: 13mm; bottom: 8mm; width: 43mm; height: 60mm; object-fit: contain; opacity: .92; }

@media print {
  body { background: #fff; }
  .print-page { margin: 0; box-shadow: none; }
}

@media screen {
  .print-page { box-shadow: 0 8px 30px rgba(0,0,0,.18); }
}
