/* Shared styles for the printable sheets. The class vocabulary of css/article.css is reused as is. */
.print-controls { display: grid; gap: 14px; margin: 1em 0; }
.print-controls label { display: grid; gap: 6px; font-weight: 700; }
.print-controls select, .print-controls textarea { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--text-primary); font: inherit; }
.print-controls textarea { resize: vertical; min-height: 140px; }
.print-controls fieldset { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 10px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.print-controls fieldset label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.print-controls .btn { justify-self: start; min-height: 44px; }
.print-status { color: var(--text-secondary); font-size: .9rem; }

/* The sheet always previews as black on white, like the paper output. */
section.print-sheet { padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; color: #111; overflow-x: auto; }
section.print-sheet * { color: #111; }
.sheet-page { margin-bottom: 28px; }
.sheet-page:last-child { margin-bottom: 0; }
.sheet-title { margin: 0 0 6px; font-size: 1.2rem; }
.sheet-line { margin: 4px 0 10px; font-size: .9rem; }

.sheet-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.sheet-table caption { margin-bottom: 6px; text-align: left; font-weight: 700; }
.sheet-table th, .sheet-table td { padding: 4px 6px; border: 1px solid #111; text-align: center; height: 1.9em; }
.sheet-table tbody th { width: 3.2em; font-weight: 700; }
.baseball-table td:nth-child(2) { width: 22%; }
.baseball-table td:last-child { width: 32%; }
.digit-table { margin-top: 14px; }
.digit-table td { height: 2.2em; }
.record-table th, .record-table td { height: 1.7em; }
.order-table td:nth-child(2) { width: 22%; }
.order-table td:nth-child(3) { width: 34%; }
.role-table th[scope="row"] { width: 7em; }
.throw-table td:nth-child(2) { width: 12%; }

.secret-box { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 6px 0 12px; }
.secret-label { font-weight: 700; font-size: .9rem; }
.secret-cells { display: inline-flex; gap: 6px; }
.secret-cell { display: inline-block; width: 2.4em; height: 2.4em; border: 2px solid #111; }

.gomoku-svg, .yut-svg { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; }
.pieces-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.pieces-label { font-weight: 700; font-size: .9rem; margin-right: 4px; }
.piece-svg { width: 48px; height: 48px; }

.redraw-box { margin-top: 18px; }
.write-line { height: 2em; margin: 0; border-bottom: 1px solid #111; }

.bingo-page { margin-bottom: 20px; }
.bingo-card { margin: 0 auto 22px; max-width: 420px; }
.bingo-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.bingo-table caption { margin-bottom: 6px; text-align: left; font-weight: 700; }
.bingo-table td { height: 4.2em; padding: 4px; border: 2px solid #111; text-align: center; vertical-align: middle; font-weight: 700; font-size: 1.3rem; overflow-wrap: anywhere; word-break: keep-all; line-height: 1.25; }
.bingo-table.size-3 td { height: 5.4em; font-size: 1.5rem; }
.bingo-table.size-4 td { height: 4.8em; }
.bingo-table.size-5 td { font-size: 1.3rem; }
.bingo-table.words td { font-size: .95rem; }

@media (max-width: 640px) {
    .sheet-table { font-size: .75rem; }
    .bingo-table td { font-size: 1.05rem; }
    .bingo-table.words td { font-size: .8rem; }
}

@media print {
    section.print-sheet { padding: 0; border: 0; background: #fff; overflow: visible; }
    .sheet-page { break-after: page; margin: 0; }
    .sheet-page:last-child { break-after: auto; }
    .sheet-table th, .sheet-table td { border-color: #000; }
    .bingo-page { break-after: page; margin: 0; }
    .bingo-page:last-child { break-after: auto; }
    .bingo-card { margin-bottom: 14mm; break-inside: avoid; }
    .bingo-table td { border-color: #000; }
    .gomoku-svg { max-width: 175mm; }
    .yut-svg { max-width: 165mm; }
    .sheet-table, .secret-box, .pieces-row { break-inside: avoid; }
    .sheet-table tr { break-inside: avoid; }
    .piece-svg { width: 16mm; height: 16mm; }
}
