/* Shared print language. Font outlines carry the handmade character;
   a static alpha mask supplies ink coverage, not a second text rendering. */
@font-face {
  font-family: "Nachtzine Print";
  src: url("assets/nachtzine/fonts/LondrinaSolid-Black.ttf") format("truetype");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Nachtzine Print";
  src: url("assets/nachtzine/fonts/LondrinaSolid-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
:root {
  --print-face: "Nachtzine Print", "Nachtzine Word", sans-serif;
  /* Exact source bytes from assets/nachtzine/ink-grain.svg and
     case-closed/stamp-wear.svg. Keep these tiny masks in the stylesheet:
     a failed decorative image request must never erase native game text.
     The print tests compare the decoded copies with their source assets. */
  --ink-grain-mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOTIiIGhlaWdodD0iMTYwIiB2aWV3Qm94PSIwIDAgMTkyIDE2MCI+CiAgPCEtLSBBIHNpbmdsZSBzdGF0aWMsIHJlcGVhdGFibGUgaW5rLWNvdmVyYWdlIG1hc2suIEl0IHJlbW92ZXMgdGlueSBmbGVja3MKICAgICAgIGZyb20gbmF0aXZlIHRleHQsIGV4cG9zaW5nIHRoZSBhY3R1YWwgcGFwZXIgYmVsb3csIG5vdCBwYWludGVkIGJlaWdlLiAtLT4KICA8ZmlsdGVyIGlkPSJpbmsiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CiAgICA8ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iLjMxIC4zOCIgbnVtT2N0YXZlcz0iMyIgc2VlZD0iMTgiIHN0aXRjaFRpbGVzPSJzdGl0Y2giLz4KICAgIDxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVz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IiByPSIzIi8+PGNpcmNsZSBjeD0iNTQwIiBjeT0iNiIgcj0iMiIvPjxjaXJjbGUgY3g9IjUiIGN5PSI3OCIgcj0iMiIvPjxjaXJjbGUgY3g9IjY5NiIgY3k9Ijg0IiByPSIzIi8+PGNpcmNsZSBjeD0iMzQwIiBjeT0iMTc2IiByPSIyIi8+PGNpcmNsZSBjeD0iNjM5IiBjeT0iMTc1IiByPSIzIi8+CiAgICA8L2c+CiAgPC9tYXNrPgogIDxwYXRoIGZpbGw9IndoaXRlIiBtYXNrPSJ1cmwoI3dlYXIpIiBkPSJNMCAwaDcwMHYxODBIMHoiLz4KPC9zdmc+Cg==");
}
.zine-stage :is(.ink-label, .word-text, .zine-button, .settings-group legend,
  .settings-choices button, .scene-title, .scene-content, .royale-word-text,
  .royale-score-name, .royale-result-label, #royaleResultName, .royale-player,
  .royale-setup h2, .royale-player-field input, .royale-add),
.game-menu button { font-family: var(--print-face); font-synthesis: none; }
.zine-stage :is(.mode-hint, .scene-hint, .scene-best, .scene-missed,
  .royale-player-field label, .royale-setup-hint, .royale-error, .rewind-status) {
  font-family: var(--print-face); font-weight: 400; font-synthesis: none;
}
.zine-stage :is(.word-text, .royale-word-text) {
  font-weight: 900; letter-spacing: .005em; line-height: .94;
  padding-block: .14em; margin-block: -.14em;
  color: var(--ink); background: none; text-shadow: none;
  /* The alpha gaps let the real paper or countdown colour show through. */
  mask-image: var(--ink-grain-mask, none); mask-size: 192px 160px;
  mask-repeat: repeat;
}
.zine-stage .royale-score-name,
.bomtafel .royale-score[data-active="true"] .royale-score-name {
  font-weight: 900; letter-spacing: .015em; color: var(--ink);
  /* Fixed name tracks reserve layout; content-box padding only extends the
     ink mask for accents. Equal negative margins preserve the outer track. */
  background: none; text-shadow: none; box-sizing: content-box;
  padding-block: .14em; margin-block: -.14em;
  mask-image: var(--ink-grain-mask, none); mask-size: 192px 160px;
}
.bomtafel .game-toggle { background: none; color: var(--ink); letter-spacing: .005em; }
.zine-stage :is(.zine-button, .settings-choices button) { letter-spacing: .015em; }
.zine-stage :is(.royale-result-label, .royale-player-field label) { letter-spacing: .035em; }
.zine-stage .royale-player-field input { letter-spacing: .015em; }
.bomtafel #royaleResultName {
  padding-block: .13em; margin-block: -.13em; line-height: 1;
  mask-image: var(--ink-grain-mask, none); mask-size: 192px 160px;
}
/* Review tools are deliberately outside the normal play surface. Opt in with
   ?review=1; the colour/view query options continue to work without the deck. */
html:not([data-print-review="true"]) .review-deck { display: none; }
html:not([data-print-review="true"]) { background: #221f25; }
@media (min-width: 901px) and (min-height: 561px) {
  html:not([data-print-review="true"]) .zine-page { min-height: 100svh; display: grid; align-content: center; }
  html:not([data-print-review="true"]) .zine-stage { height: 100svh; max-height: 1040px; }
  .bomtafel .royale-heading .ink-label { transform: rotate(-1deg); }
  .bomtafel .royale-heading .ink-label::before { transform: none; }
  .bomtafel .royale-score { gap: 14px; }
  .bomtafel :is(.royale-word-text, #royaleResultName) { font-synthesis: none; }
  .bomtafel:is([data-player-count="5"], [data-player-count="6"], [data-player-count="7"], [data-player-count="8"]) .royale-score {
    height: 15%; top: 75%; padding-block: 6px; gap: 4px;
  }
  .bomtafel:is([data-player-count="5"], [data-player-count="6"], [data-player-count="7"], [data-player-count="8"]) .royale-score:nth-child(n+5) { top: 6%; }
  .bomtafel:is([data-player-count="5"], [data-player-count="6"], [data-player-count="7"], [data-player-count="8"]) .royale-score:nth-child(-n+4) { top: 75%; }
  .bomtafel:is([data-player-count="5"], [data-player-count="6"], [data-player-count="7"], [data-player-count="8"]) .royale-score-name {
    --score-name-ceiling: 28; --score-name-floor: 22; --score-name-lines: 2;
    height: 64px; flex: 0 0 64px; line-height: 1.05;
    white-space: normal; overflow-wrap: anywhere; text-wrap: balance;
    display: grid; align-content: center;
  }
  #zineApp .zine-words { --word-fit-ratio: 1.08; }
}
@media (max-height: 560px) and (orientation: landscape) {
  html:not([data-print-review="true"]) .zine-stage { height: 100svh; }
}
@media (max-width: 900px), (max-height: 560px) {
  /* Compact layouts keep the dark title/active-name slips. Their ink must
     stay light; the desktop table's cream paper is not used here. */
  .bomtafel .game-toggle,
  .bomtafel .royale-score-name,
  .bomtafel .royale-score[data-active="true"] .royale-score-name {
    color: var(--paper); mask-image: none;
  }
}
@media (forced-colors: active) {
  .zine-stage :is(.word-text, .royale-word-text, .royale-score-name),
  .bomtafel .royale-score[data-active="true"] .royale-score-name,
  .bomtafel .game-toggle, .bomtafel #royaleResultName { mask-image: none; background: none; color: CanvasText; }
}
