/* Local copies of the web fonts Valet loads from Google Fonts (same family names). */
@font-face { font-family: 'DM Sans'; src: url('./fonts/DMSans-VariableFont_opsz%2Cwght.ttf') format('truetype'); font-weight: 100 1000; font-display: block; }
@font-face { font-family: 'Source Serif 4'; src: url('./fonts/SourceSerif4%5Bopsz%2Cwght%5D.ttf') format('truetype'); font-weight: 200 900; font-display: block; }
@font-face { font-family: 'IBM Plex Mono'; src: url('./fonts/IBMPlexMono-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: block; }
/* Suit symbols: Source Serif 4 has none, so browsers fall back to whatever system font they find
   (Valet's stack names Times New Roman). Pin them to Liberation Serif Bold (Times New Roman's metric
   clone) and DejaVu Serif Bold for the outline suits, so screen and PDF match on every device. */
@font-face { font-family: 'Source Serif 4'; src: url('./fonts/SuitsSolid-LiberationSerifBold.ttf') format('truetype'); font-weight: 200 900; unicode-range: U+2660, U+2663, U+2665, U+2666; font-display: block; }
@font-face { font-family: 'Source Serif 4'; src: url('./fonts/SuitsOutline-DejaVuSerifBold.ttf') format('truetype'); font-weight: 200 900; unicode-range: U+2661, U+2662, U+2664, U+2667; font-display: block; }
@font-face { font-family: 'Noto Sans TC'; src: url('./fonts/NotoSansCJKtc-Regular-seats.woff2') format('woff2'); font-weight: 400; unicode-range: U+5317, U+6771, U+5357, U+897F; font-display: block; }
@font-face { font-family: 'Noto Sans TC'; src: url('./fonts/NotoSansCJKtc-Bold-big5.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* A4 sheet: 6 Valet boards per page, each laid out at Valet's desktop width and zoomed to fit. */
:root { --ds-board-width: 560px; }
.ds-sheet { display: grid; gap: 24px; justify-content: center; }
.ds-page {
  width: 210mm; height: 297mm; padding: 8mm 8mm 7mm;
  display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 3mm;
  background: var(--page-bg); color: var(--text-primary); overflow: hidden;
  break-after: page; page-break-after: always;
}
.ds-page:last-child { break-after: auto; page-break-after: auto; }
.ds-page-head {
  display: flex; align-items: baseline; gap: 10px; min-height: 22px;
  padding-bottom: 5px; border-bottom: 1.5px solid var(--text-primary);
  font: 700 15px/1.3 'DM Sans', 'Noto Sans TC', sans-serif;
}
.ds-page-head span { font-weight: 500; color: var(--text-muted); }
.ds-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 3mm 4mm; min-height: 0; }
.ds-cell { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
/* A scaled board's layout box is taller than its cell; without containment the browser's print
   fragmentation splits it across page boundaries (the 下載 PDF writer doesn't print, but Cmd+P does). */
.ds-cell { contain: strict; }
.ds-board {
  position: absolute; left: 50%; top: 50%; width: var(--ds-board-width);
  transform: translate(-50%, -50%) scale(var(--ds-board-scale, 1));
}
.ds-board .deal-explorer { padding: 0; border: 0; background: transparent; box-shadow: none; }

/* Print omissions: interactive pieces of the live viewer that mean nothing on paper. */
.ds-board .board-average,
.ds-board .board-nav,
.ds-board .player-detail-popover,
.ds-board .play-keyboard,
.ds-board .board-export-actions,
.ds-board .analysis-status,
.ds-board .error-text { display: none !important; }
.ds-board button { cursor: default; }
.ds-board .contract-score { pointer-events: none; }

@page { size: A4; margin: 0; }
@media print {
  html, body { margin: 0 !important; padding: 0 !important; background: var(--page-bg); }
  body > :not(.ds-print-root) { display: none !important; }
  .ds-sheet { display: block; }
  .ds-sheet { transform: none !important; height: auto !important; }
  .ds-print-root { height: auto !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
