/* Print edition: one full comic page per A4 sheet.
   Loaded last with media="print", so it wins over the screen layout and older print rules.
   Panels stack as rows that share the page height; the art sits in a square beside the
   lettering, alternating sides like a comic strip. Single-panel pages get a full-width image. */

@page{size:A4 portrait;margin:0}
*{-webkit-print-color-adjust:exact;print-color-adjust:exact}
*,*::before,*::after{animation:none!important;transition:none!important}
html,body{margin:0!important;padding:0!important;background:#fff!important}
#app{max-width:none!important;margin:0!important}
#app>*:not(#printBook),.toast,.masthead,#shareDlg,#printDlg{display:none!important}
#printBook{display:block!important}

.psheet{width:210mm;height:297mm;box-sizing:border-box;padding:10mm 10mm 9mm;display:flex!important;flex-direction:column;overflow:hidden;
  break-after:page;page-break-after:always;background:#fff}
.psheet:last-child{break-after:auto;page-break-after:auto}

/* the comic page */
.psheet .page{flex:1;min-height:0;display:flex;flex-direction:column;box-sizing:border-box;margin:0!important;
  padding:5mm!important;border:.5mm solid var(--ink)!important;box-shadow:none!important;background:var(--paper)!important;transform:none!important;animation:none!important}
.psheet .banner{flex:none;margin:0 0 4mm!important;gap:4mm}
.psheet .roundel{width:15mm;height:15mm;box-shadow:.6mm .6mm 0 var(--ink)}
.psheet .roundel small{font-size:7pt}.psheet .roundel b{font-size:16pt}.psheet .roundel.long b{font-size:8pt}
.psheet .stitle h2{font-size:26pt!important;line-height:1.1}
.psheet .stitle p{font-size:9.5pt!important;margin-top:1mm}
.psheet .folio{flex:none;margin-top:3mm;font-size:8.5pt;color:#6A5A44}

.psheet .grid{flex:1;min-height:0;display:grid!important;grid-template-columns:1fr!important;grid-auto-rows:minmax(0,1fr);gap:4mm!important;align-items:stretch}
.psheet .grid>.panel{grid-column:1/-1!important}

/* a panel = art square + lettering column */
.psheet .panel{display:flex!important;flex-direction:row;align-items:stretch;min-height:0;margin:0;overflow:hidden;
  border:.5mm solid var(--ink)!important;background:var(--white)!important}
.psheet .grid>.panel:nth-child(even){flex-direction:row-reverse}
.psheet .frame{flex:none;position:relative;height:100%;width:auto;aspect-ratio:1/1!important;max-width:58%;min-height:0;
  border:0!important;border-inline-end:.5mm solid var(--ink)!important;overflow:hidden}
.psheet .grid>.panel:nth-child(even) .frame{border-inline-end:0!important;border-inline-start:.5mm solid var(--ink)!important}
.psheet .frame svg.art{position:absolute;inset:0;width:100%;height:100%;transform:none!important}
.psheet .frame::after{display:none}

/* lettering */
.psheet .panel-copy{flex:1;min-width:0;display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;justify-content:center;align-items:stretch!important;
  gap:4mm!important;padding:5mm 6mm!important;direction:inherit!important;container-type:normal}
.psheet .panel-copy:empty{display:none!important}
.psheet .panel-copy .cap,.psheet .panel-copy .bub{position:relative!important;inset:auto!important;flex:none!important;max-width:100%!important;width:auto;margin:0!important;order:0!important;box-sizing:border-box}
.psheet .panel-copy .cap{font-size:12.5pt!important;line-height:1.35!important;padding:2mm 3mm!important;border-inline-start:1.2mm solid var(--ink)!important;background:var(--yellow)!important}
.psheet .panel-copy .bub{font-size:13pt!important;line-height:1.35!important;padding:3mm 4.5mm!important;border:.5mm solid var(--ink)!important;border-radius:5mm!important;background:#fffdf5!important;text-align:center}
.psheet .panel-copy .after{display:block!important;opacity:1!important;visibility:visible!important}
#app[lang=en] .psheet .panel-copy .cap,#app[lang=en] .psheet .panel-copy .bub{font-size:11.5pt!important}

/* a panel with no lettering (sound effect only): the art takes the whole row */
.psheet .panel:has(> .panel-copy:empty) .frame{flex:1;width:100%;max-width:none;aspect-ratio:auto!important;border-inline:0!important}

/* one-panel pages (splash, the playground search): full-width art, lettering underneath */
.psheet .grid.n1>.panel{flex-direction:column!important}
.psheet .grid.n1 .frame{flex:1;height:auto;width:100%;max-width:none;aspect-ratio:auto!important;border-inline-end:0!important;border-bottom:.5mm solid var(--ink)!important}
.psheet .grid.n1 .panel-copy{flex:none;flex-direction:row!important;flex-wrap:wrap!important;padding:4mm 6mm!important}
.psheet .grid.n1 .panel-copy .bub,.psheet .grid.n1 .panel-copy .cap{flex:1 1 40%!important}

/* sound effects and the splash title keep their comic look, sized for paper */
.psheet .sfx{font-size:26pt!important}
.psheet .ttl b{font-size:40pt!important}.psheet .ttl small{font-size:12pt!important}

/* live-game markers make no sense on paper */
.psheet #swimmer,.psheet #trail,.psheet #diver,.psheet #target,.psheet #carry,.psheet #beam,.psheet .art-hit,.psheet .hud{display:none!important}

/* cover sheet */
.psheet.pcover .book{flex:1;height:auto!important;width:100%!important;max-height:none!important;margin:0!important;display:flex!important;flex-direction:column;box-shadow:none!important;transform:none!important}
.psheet.pcover .cover-art{flex:1;min-height:0;aspect-ratio:auto!important}
.psheet.pcover .cover-image{width:100%;height:100%;object-fit:cover}
.psheet.pcover .logo{font-size:64pt!important}
.psheet.pcover .logo-wrap .pre{font-size:12pt!important}
.psheet.pcover .cornerbox{width:16mm}.psheet.pcover .cornerbox b{font-size:24pt}.psheet.pcover .cornerbox .pr{font-size:6.5pt;max-width:15mm}
.psheet.pcover .blurb{font-size:14pt!important;max-width:55%}
.psheet.pcover .seal{font-size:7pt}.psheet.pcover .seal b{font-size:10pt}
.psheet.pcover .book-footer{font-size:10pt}

/* last sheet */
.psheet .endcard{flex:1;align-content:center;gap:6mm}
.psheet .endcard svg{width:70mm}
.psheet .endcard .big{font-size:60pt!important}
.psheet .endcard p{font-size:13pt;max-width:130mm}
.psheet .endcard .row{display:none!important}

/* ---------- 22 × 22 cm children's book (print-shop format) ----------
   The page-size rule itself is injected at print time (@page{size:220mm 220mm}).
   At most two panels a page (see printPlan), 10 mm white margin all round, so nothing
   has to print to the trimmed edge. */
.fmt-sq .psheet{width:220mm;height:220mm;padding:10mm}
.fmt-sq .psheet .page{padding:4mm!important}
.fmt-sq .psheet .banner{margin-bottom:3mm!important;gap:3mm}
.fmt-sq .psheet .roundel{width:12mm;height:12mm}
.fmt-sq .psheet .roundel b{font-size:13pt}.fmt-sq .psheet .roundel.long b{font-size:7pt}
.fmt-sq .psheet .stitle h2{font-size:20pt!important}
.fmt-sq .psheet .stitle p{font-size:8.5pt!important}
.fmt-sq .psheet .grid{gap:4mm!important}
.fmt-sq .psheet .frame{max-width:52%}
.fmt-sq .psheet .panel-copy{padding:4mm 5mm!important;gap:3mm!important}
.fmt-sq .psheet .panel-copy .cap{font-size:12.5pt!important}
.fmt-sq .psheet .panel-copy .bub{font-size:13.5pt!important}
#app[lang=en] .fmt-sq .psheet .panel-copy .cap,#app[lang=en] .fmt-sq .psheet .panel-copy .bub{font-size:12pt!important}
.fmt-sq .psheet .folio{margin-top:2.5mm;font-size:8pt}
.fmt-sq .psheet .ttl b{font-size:34pt!important}
.fmt-sq .psheet.pcover .cover-image{object-position:center 30%}
.fmt-sq .psheet.pcover .logo{font-size:52pt!important}
.fmt-sq .psheet.pcover .blurb{font-size:12pt!important}
.fmt-sq .psheet .endcard .big{font-size:48pt!important}
.fmt-sq .psheet .endcard svg{width:48mm}
.fmt-sq .psheet .endcard p{font-size:12pt}

/* on paper the "order printing" call to action has nothing to click */
.psheet .pro-cta{display:none!important}

/* ---------- print-clean text: one layer per heading ----------
   Stacked text-shadows print as duplicated, offset copies of the text (the "overlapped heading"
   a preflight flags). On paper every heading is a single layer. */
.psheet *{text-shadow:none!important}
.psheet .stitle h2{color:var(--red)!important;-webkit-text-stroke:0!important}
.psheet .endcard .big{color:var(--red)!important;-webkit-text-stroke:0!important}
.book-footer .stars svg{display:inline-block;vertical-align:-1px}

/* ---------- publisher interior: 28 single pages, 226.4 mm = 220 mm trim + 3.2 mm bleed ----------
   15.2 mm padding = 3.2 mm bleed + 12 mm provisional safe margin on every side, so text and art
   stay well inside the trim and clear of the glue side, whichever side that turns out to be. */
.prod-interior .psheet{width:226.4mm;height:226.4mm;padding:15.2mm}
.prod-interior .psheet.blank{background:#fff}
.prod-interior .psheet .page{padding:4mm!important}
.title-page,.belongs-page{display:grid!important;place-items:center;text-align:center}
.title-page .tp{display:flex;flex-direction:column;align-items:center;gap:4mm;max-width:150mm}
.title-page svg,.belongs-page svg{width:26mm;height:auto}
.tp-pre{margin:0;font-family:var(--f-let);font-weight:700;font-size:13pt}
.tp-logo{margin:0;font-family:var(--f-logo);font-weight:400;font-size:46pt;line-height:1.05;color:var(--red)}
.tp-sub{margin:0;font-family:var(--f-logo);font-size:15pt;line-height:1.3}
.tp-star{margin:4mm 0 0;font-family:var(--f-let);font-weight:700;font-size:12pt;color:#4b3f30}
.belongs-page .bp{display:flex;flex-direction:column;align-items:center;gap:10mm;width:130mm}
.belongs-page p{margin:0;font-family:var(--f-logo);font-size:22pt}
.bp-line{width:100%;border-bottom:.6mm solid var(--ink);height:14mm}

/* ---------- publisher cover: ONE landscape spread = back + spine + front (or front + spine + back) ----------
   Each half is 223.2 mm (220 mm + 3.2 mm outer bleed) wide; the spine width is a parameter. */
.prod-cover .psheet.cover-spread{width:var(--cw);height:226.4mm;padding:0;display:grid!important;grid-template-columns:223.2mm var(--spine) 223.2mm;direction:ltr;overflow:hidden;background:#fff}
.cv-front,.cv-back{position:relative;overflow:hidden}
.cv-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 32%}
.cv-safe{position:absolute;inset:15.2mm;display:flex;flex-direction:column;justify-content:space-between}
.cv-top{display:flex;flex-direction:column;align-items:center;gap:2mm;text-align:center}
.cv-pre{font-family:var(--f-let);font-weight:700;font-size:12pt;color:#fff;background:var(--ink);padding:1.2mm 3mm}
.cv-logo{font-family:var(--f-logo);font-size:52pt;line-height:1.05;color:var(--yellow);-webkit-text-stroke:.8mm var(--ink);paint-order:stroke fill}
.cv-blurb{align-self:flex-start;max-width:62%;background:var(--yellow);border:.6mm solid var(--ink);padding:3mm 4mm;font-family:var(--f-let);font-weight:700;font-size:13pt;line-height:1.3}
.cv-back{background:var(--desk);color:var(--white)}
.cv-back .cv-safe{justify-content:center;align-items:center;gap:6mm;text-align:center}
.cv-heart svg{width:24mm;height:auto}
.cv-back-title{margin:0;font-family:var(--f-logo);font-size:30pt;color:var(--yellow)}
.cv-back-text{margin:0;max-width:150mm;font-family:var(--f-let);font-weight:700;font-size:13pt;line-height:1.55}
.cv-url{margin:4mm 0 0;font-family:var(--f-ui);font-weight:700;font-size:11pt;color:var(--yellow);direction:ltr}
.cv-made{margin:0;font-family:var(--f-ui);font-size:10pt;color:var(--mist)}
.cv-spine{background:var(--red)}
