/* Puzzles to print (print.php, src/php/printsheet.php). On screen: a page with a preview of the
   sheets; when printing only the sheets themselves, two A4 pages. The sheets are always white
   paper, also in dark mode: they are a preview of what comes out of the printer. */
@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-display: swap;
    font-weight: 500 800; /* only the weights in use, normal width (README → Cache) */
    src: url("../fonts/bricolage-grotesque-2.woff2") format("woff2-variations"), url("../fonts/bricolage-grotesque-2.woff2") format("woff2");
}
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-display: swap;
    font-weight: 300 900;
    src: url("../fonts/figtree.woff2") format("woff2-variations"), url("../fonts/figtree.woff2") format("woff2");
}

:root {
    color-scheme: light dark;
    --paper: #f3f1ed;
    --card: #ffffff;
    --ink: #18171a;
    --ink-2: #5d5a55;
    --line: rgba(24, 23, 26, .12);
    --tile: #db4429;
    --head: "Bricolage Grotesque", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #141311;
        --card: #1c1c1f;
        --ink: #f3f2ef;
        --ink-2: #b4b0a8;
        --line: rgba(243, 242, 239, .14);
    }
}
.tile-spoor { --tile: #db4429; }
.tile-balans { --tile: #2a55d6; }
.tile-tuinen { --tile: #1f8a5b; }
.tile-kavels { --tile: #b5590e; } /* as in app.css: white text on it reaches 4.5:1 */
.tile-zestal { --tile: #6a46cc; }
.tile-leidingen { --tile: #c2387a; }
.tile-bruggen { --tile: #14857f; }
.tile-lampen { --tile: #9b6b0a; }

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.55 "Figtree", system-ui, sans-serif;
}
a { color: inherit; }

.pp-top { max-width: 860px; margin: 0 auto; padding: 14px 16px 0; }
.pp-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 800 19px var(--head); letter-spacing: -.02em; }
.pp-brand svg { width: 28px; height: 28px; }

.pp { max-width: 860px; margin: 0 auto; padding: 18px 16px 48px; }
.pp-eyebrow { margin: 10px 0 4px; font-size: 13px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--tile) 82%, #000); } /* small text: a shade darker than the game colour reaches 4.5:1 on paper */
.pp-eyebrow a { text-decoration: none; }
.pp-eyebrow a:hover { text-decoration: underline; }
.pp h1 { margin: 0 0 8px; font: 800 clamp(30px, 8vw, 44px)/1.05 var(--head); letter-spacing: -.03em; }
.pp-lead { margin: 0 0 18px; max-width: 60ch; font-size: 17px; color: var(--ink-2); }

.pp-levels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pp-level { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; font-size: 15px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); text-decoration: none; font-weight: 700; }
.pp-level[aria-current] { background: var(--tile); color: #fff; box-shadow: none; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .3; }
.pips i.on { opacity: 1; }

.pp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 22px; }
.pp-actions p { flex: 1 1 260px; margin: 0; font-size: 14px; color: var(--ink-2); }
.pp-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); font: 750 16px "Figtree", system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.pp-btn-primary { background: var(--tile); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16); }
.pp-btn:disabled { opacity: .5; cursor: default; }
.pp-wait { padding: 18px; border-radius: 16px; background: var(--card); }

/* The sheets on screen: white paper with a shadow. */
.pp-sheets { display: grid; gap: 18px; margin-bottom: 30px; }
.sheet { padding: 22px 22px 16px; border-radius: 6px; background: #fff; color: #18171a; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .08); }
.sheet-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 2.5px solid var(--tile); font-family: var(--head); }
.sheet-brand { font-weight: 800; letter-spacing: -.02em; }
.sheet-game { flex: 1; font-weight: 700; color: var(--tile); }
.sheet-week { font-size: 13px; color: #5d5a55; }
.sheet-rules { margin: 10px 0 14px; padding-left: 20px; font-size: 13.5px; line-height: 1.4; }
.sheet-rules li + li { margin-top: 2px; }
.sheet-title { margin: 10px 0 12px; font: 800 18px var(--head); }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
.sheet-puzzle { margin: 0; }
.sheet-puzzle figcaption { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; font-size: 13px; }
.sheet-puzzle figcaption b { font-family: var(--head); font-size: 15px; }
/* "Naam ____  Tijd ____": room to write */
.sheet-puzzle figcaption span { flex: 1; color: #5d5a55; border-bottom: 1px solid #bdb8b0; }
.sheet-puzzle figcaption span:last-child { flex: .6; }
.sheet-foot { margin-top: 14px; padding-top: 8px; border-top: 1px solid #e3dfd8; font-size: 12px; color: #5d5a55; text-align: center; }
.sheet-solutions .sheet-grid { grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; }
@media (max-width: 520px) {
    .pp-level { flex: 1 1 0; justify-content: center; padding: 8px 6px; }
    .sheet { padding: 14px 12px 10px; }
    .sheet-grid { gap: 14px 12px; }
    .sheet-week { display: none; }
    .sheet-puzzle figcaption span { display: none; }
}

/* The boards (src/php/printsheet.php): black lines, a little colour. */
.ps { display: block; width: 100%; height: auto; font-family: var(--head); }
.ps .g { stroke: #9a958d; stroke-width: 1; }
.ps .frame { fill: none; stroke: #18171a; stroke-width: 3; }
.ps .wall { stroke: #18171a; stroke-width: 3.5; stroke-linecap: square; }
.ps-spoor .wall { stroke-width: 6; stroke-linecap: round; }
.ps .num { font-size: 21px; font-weight: 700; fill: #18171a; text-anchor: middle; dominant-baseline: central; }
.ps .num.sol { font-weight: 500; fill: #8a857d; }
.ps .num.on-block { fill: #fff; }
.ps .disc { fill: #fff; stroke: #18171a; stroke-width: 2; }
.ps-leidingen .disc { stroke-width: 4; }
.ps .sol-line { fill: none; stroke: #9a958d; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.ps-spoor .sol-line { stroke: #db4429; stroke-width: 6; opacity: .75; }
.ps-leidingen .sol-line { stroke-width: 10; }
.ps .sol-wall { stroke: #6a46cc; stroke-width: 3.5; stroke-linecap: square; }
.ps .given { fill: #18171a; }
.ps .sol { fill: none; stroke: #8a857d; stroke-width: 2.5; }
.ps .edge { fill: #fff; stroke: #18171a; stroke-width: 1.5; }
.ps .edge-t { font-size: 13px; font-weight: 800; fill: #18171a; text-anchor: middle; dominant-baseline: central; }
.ps .shape { fill: #fff; stroke: #18171a; stroke-width: 2; }
.ps .shape-fill { fill: #fff; stroke: none; }
.ps .tree { fill: #1f6b45; }
.ps .dot { fill: #c4bfb6; }
.ps .island { stroke-width: 2.5; }
.ps .bridge { stroke: #14857f; stroke-width: 3; }
.ps .block { fill: #18171a; }
.ps .lamp { fill: #f3b82c; stroke: #18171a; stroke-width: 2; }

/* Below the sheets: the text. */
.pp-text { max-width: 64ch; }
.pp-text h2 { margin: 28px 0 8px; font: 800 22px/1.2 var(--head); letter-spacing: -.02em; }
.pp-text p { margin: 0 0 12px; }
.pp-rules { margin: 0; padding-left: 22px; }
.pp-rules li + li { margin-top: 6px; }
.pp-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
/* Filled tiles in the game's colour, like the practice tiles in the app (app.css .practice-tile). */
.pp-game a { display: block; height: 100%; padding: 13px 15px 14px; border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--tile) 86%, #fff), var(--tile) 62%); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -3px 0 rgba(0, 0, 0, .16), 0 1px 2px rgba(0, 0, 0, .08); text-decoration: none; transition: transform .1s; }
.pp-game a:hover { transform: translateY(-1px); }
.pp-game a:active { transform: translateY(1px); }
.pp-game b { display: block; font: 800 18px var(--head); letter-spacing: -.01em; }
.pp-game span { display: block; margin-top: 3px; font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, .88); }
@media (prefers-reduced-motion: reduce) { .pp-game a { transition: none; } .pp-game a:hover, .pp-game a:active { transform: none; } }
@media (prefers-color-scheme: dark) {
    .pp-eyebrow { color: color-mix(in srgb, var(--tile) 55%, #fff); }
}
.pp a:focus-visible, .pp-btn:focus-visible { outline: 3px solid var(--tile); outline-offset: 2px; }

/* On paper: only the sheets, one per A4. */
@page { size: A4; margin: 11mm 12mm; }
@media print {
    body { background: #fff; }
    .pp-top, .pp-eyebrow, .pp h1, .pp-lead, .pp-levels, .pp-actions, .pp-text { display: none; }
    .pp { max-width: none; padding: 0; }
    .pp-sheets { display: block; margin: 0; }
    .sheet { padding: 0; border-radius: 0; box-shadow: none; break-after: page; }
    .sheet:last-child { break-after: auto; }
    .sheet-head, .sheet-puzzle, .sheet-rules { break-inside: avoid; }
    .sheet-week { display: inline; }
    .sheet-puzzle figcaption span { display: block; }
    .sheet-grid { grid-template-columns: 1fr 1fr; gap: 7mm 10mm; }
    /* Four boards with their captions fit on one A4, also the 9×9 ones. */
    .sheet-puzzle .ps { width: 100%; max-width: 84mm; margin: 0 auto; }
    .sheet-solutions .sheet-grid { grid-template-columns: repeat(2, 64mm); }
    .sheet, .ps * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
