/* Torneos FC – impresión: planillas y carnets */
body.tfc-print { font-family: Arial, Helvetica, sans-serif; color: #111; margin: 0; padding: 16px; background: #fff; }
.tfc-print-bar { position: sticky; top: 0; background: #0f172a; padding: 8px; margin: -16px -16px 16px; text-align: right; }
.tfc-print-bar button { background: var(--tfc-primary, #0b6b3a); color: #fff; border: 0; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 700; }
.tfc-print-bar button + button { background: #475569; }

/* Planilla */
.tfc-sheet { max-width: 1000px; margin: 0 auto; font-size: 11px; }
.sh-head { display: flex; gap: 14px; align-items: center; border-bottom: 3px solid var(--tfc-primary, #0b6b3a); padding-bottom: 8px; margin-bottom: 8px; }
.sh-head img { height: 64px; width: auto; }
.sh-head h1 { margin: 0; font-size: 18px; }
.sh-head h2 { margin: 2px 0 0; font-size: 13px; letter-spacing: .12em; color: var(--tfc-primary, #0b6b3a); }
.sh-head p { margin: 2px 0; color: #444; }
.tfc-sheet table { width: 100%; border-collapse: collapse; }
.tfc-sheet th, .tfc-sheet td { border: 1px solid #333; padding: 3px 5px; text-align: left; }
.sh-info th { background: #eef2f7; width: 70px; }
.sh-score { display: grid; grid-template-columns: 1fr 50px 20px 50px 1fr; align-items: center; gap: 6px; margin: 10px 0; font-size: 15px; font-weight: 700; text-align: center; }
.sh-score > div:first-child { text-align: right; }
.sh-score > div:last-child { text-align: left; }
.sh-box { border: 2px solid #111; height: 34px; line-height: 34px; font-size: 20px; }
.sh-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sh-players thead th { background: #eef2f7; text-align: center; }
.sh-players thead tr:first-child th { background: var(--tfc-primary, #0b6b3a); color: #fff; font-size: 12px; }
.sh-players td { height: 16px; }
.sh-players td:nth-child(1), .sh-players td:nth-child(4) { width: 26px; text-align: center; }
.sh-players td:nth-child(3) { width: 80px; }
.sh-players td:nth-child(6), .sh-players td:nth-child(7) { width: 34px; text-align: center; }
.sh-blocked td { background: #fde2e2; }
.sh-events { margin-top: 10px; }
.sh-notes { border: 1px solid #333; min-height: 40px; padding: 5px; margin-top: 10px; }
.sh-signs { display: flex; gap: 20px; margin-top: 40px; }
.sh-signs div { flex: 1; text-align: center; }
.sh-signs span { display: block; border-top: 1px solid #111; margin-bottom: 4px; }

/* Carnets – tamaño CR80 (85.6 x 54 mm) */
.tfc-carnet-grid { display: flex; flex-wrap: wrap; gap: 6mm; justify-content: flex-start; }
.tfc-carnet { --c1: #0b6b3a; --c2: #fff; --c3: #fff; --c4: #f5b301; width: 85.6mm; height: 54mm; box-sizing: border-box; border-radius: 3mm; overflow: hidden; background: var(--c3); border: .3mm solid #ccc; display: flex; flex-direction: column; font-family: Arial, Helvetica, sans-serif; color: #111; page-break-inside: avoid; break-inside: avoid; position: relative; }
.tfc-carnet.o-vertical { width: 54mm; height: 85.6mm; }
.tfc-carnet .cn-head { background: var(--c1); color: var(--c2); display: flex; align-items: center; gap: 2mm; padding: 1.6mm 2.4mm; border-bottom: 1mm solid var(--c4); }
.tfc-carnet .cn-logo { height: 9mm; width: 9mm; object-fit: contain; background: #fff; border-radius: 1mm; }
.tfc-carnet .cn-titles { flex: 1; display: flex; flex-direction: column; line-height: 1.1; text-align: center; }
.tfc-carnet .cn-titles strong { font-size: 3.1mm; text-transform: uppercase; }
.tfc-carnet .cn-titles span { font-size: 2.2mm; letter-spacing: .3mm; opacity: .9; }
.tfc-carnet .cn-body { flex: 1; display: flex; gap: 2.4mm; padding: 2mm 2.4mm; min-height: 0; }
.tfc-carnet.ph-right .cn-body { flex-direction: row-reverse; }
.tfc-carnet.ph-top .cn-body, .tfc-carnet.o-vertical .cn-body { flex-direction: column; align-items: center; }
.tfc-carnet .cn-photo { width: 21mm; height: 26mm; flex: none; border: .6mm solid var(--c4); border-radius: 1.5mm; overflow: hidden; background: #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 2.4mm; color: #6b7280; }
.tfc-carnet.ph-top .cn-photo, .tfc-carnet.o-vertical .cn-photo { width: 20mm; height: 24mm; }
.tfc-carnet.o-horizontal.ph-top .cn-photo { width: 14mm; height: 16mm; }
.tfc-carnet .cn-photo img { width: 100%; height: 100%; object-fit: cover; }
.tfc-carnet .cn-data { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6mm 2mm; align-content: start; flex: 1; width: 100%; }
.tfc-carnet .cn-data div { min-width: 0; }
.tfc-carnet .cn-data div[data-k=nombre], .tfc-carnet .cn-data div[data-k=equipo] { grid-column: span 2; }
.tfc-carnet .cn-data dt { font-size: 1.8mm; text-transform: uppercase; color: #6b7280; }
.tfc-carnet .cn-data dd { margin: 0; font-size: 2.6mm; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tfc-carnet .cn-data div[data-k=nombre] dd { font-size: 3.1mm; white-space: normal; }
.tfc-carnet.o-vertical .cn-data, .tfc-carnet.ph-top .cn-data { text-align: center; }
.tfc-carnet .cn-foot { background: var(--c4); color: #111; font-size: 1.8mm; text-align: center; padding: .8mm; }

@media print {
	.tfc-print-bar { display: none; }
	body.tfc-print { padding: 0; }
	@page { size: letter; margin: 8mm; }
	.tfc-carnet { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.tfc-sheet { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- Carnets v1.2: tamaños, logos, reverso ---- */
.tfc-carnet .cn-data dd { font-size: 2.6mm; }
.tfc-carnet .cn-data .fs-sm dd { font-size: 2.1mm; }
.tfc-carnet .cn-data .fs-md dd { font-size: 2.6mm; }
.tfc-carnet .cn-data .fs-lg dd { font-size: 3.2mm; white-space: normal; }
.tfc-carnet .cn-data .fs-xl dd { font-size: 4mm; white-space: normal; line-height: 1.05; }
.tfc-carnet .cn-data div[data-k=nombre] dd { font-size: inherit; }
.tfc-carnet .cn-data div[data-k=nombre].fs-sm dd { font-size: 2.3mm; }
.tfc-carnet .cn-data div[data-k=nombre].fs-md dd { font-size: 2.8mm; }
.tfc-carnet .cn-data div[data-k=nombre].fs-lg dd { font-size: 3.4mm; }
.tfc-carnet .cn-data div[data-k=nombre].fs-xl dd { font-size: 4.2mm; }
.tfc-carnet.phs-sm .cn-photo { width: 16mm; height: 20mm; }
.tfc-carnet.phs-lg .cn-photo { width: 25mm; height: 31mm; }
.tfc-carnet.phs-xl .cn-photo { width: 28mm; height: 35mm; }
.tfc-carnet.o-vertical.phs-sm .cn-photo, .tfc-carnet.ph-top.phs-sm .cn-photo { width: 15mm; height: 18mm; }
.tfc-carnet.o-vertical.phs-lg .cn-photo { width: 24mm; height: 29mm; }
.tfc-carnet.o-vertical.phs-xl .cn-photo { width: 28mm; height: 34mm; }
.tfc-carnet.lgs-sm .cn-logo { width: 7mm; height: 7mm; }
.tfc-carnet.lgs-md .cn-logo { width: 9mm; height: 9mm; }
.tfc-carnet.lgs-lg .cn-logo { width: 11.5mm; height: 11.5mm; }
.tfc-carnet.lgs-xl .cn-logo { width: 14mm; height: 14mm; }
.tfc-carnet .cn-ph { display: flex; align-items: center; justify-content: center; font-size: 1.5mm; color: #6b7280; background: #fff; border-radius: 1mm; }

/* Reverso */
.tfc-carnet.cn-back .cn-head { justify-content: center; }
.cn-back-body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 2mm 3mm 1.5mm; min-height: 0; }
.cn-back-text p { margin: 0 0 .8mm; font-size: 2.3mm; line-height: 1.25; }
.bts-sm .cn-back-text p { font-size: 1.9mm; }
.bts-lg .cn-back-text p { font-size: 2.8mm; }
.bts-xl .cn-back-text p { font-size: 3.3mm; }
.cn-sign { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.1; }
.cn-sign-img { height: 9mm; display: flex; align-items: flex-end; justify-content: center; }
.cn-sign-img img { max-height: 9mm; max-width: 34mm; object-fit: contain; }
.cn-sign-line { display: block; width: 36mm; border-top: .25mm solid #111; margin: .5mm 0 .6mm; }
.cn-sign strong { font-size: 2.5mm; }
.cn-sign small { font-size: 2mm; color: #4b5563; }
.o-vertical .cn-sign-line { width: 30mm; }

/* Rejillas de impresión */
.cn-pair { display: inline-flex; gap: 3mm; break-inside: avoid; page-break-inside: avoid; }
.tfc-carnet-grid.pairs { display: flex; flex-wrap: wrap; gap: 6mm; }
.tfc-carnet-grid.fixed { display: grid; grid-template-columns: repeat(var(--cols, 2), max-content); gap: 6mm; justify-content: center; }
.tfc-carnet-empty { width: 85.6mm; height: 54mm; }
.tfc-carnet-empty.o-vertical { width: 54mm; height: 85.6mm; }
.tfc-print-note { font-size: 12px; color: #555; }
@media print { .tfc-print-note { display: none; } }
