/* ===== CAPTAIN RESOURCES + LEAGUE HISTORY ===== */
.cheat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.cheat-card{background:var(--paper);border:1px solid var(--line);border-radius:11px;overflow:hidden;box-shadow:0 4px 16px #0000000b}
.cheat-card summary{list-style:none;cursor:pointer;min-height:58px;padding:15px 50px 15px 18px;display:flex;flex-direction:column;justify-content:center;position:relative;font-weight:800;color:var(--green)}
.cheat-card summary::-webkit-details-marker{display:none}
.cheat-card summary::after{content:'+';position:absolute;right:18px;top:50%;transform:translateY(-50%);font-size:1.45rem;font-weight:500;color:var(--red)}
.cheat-card[open] summary{border-bottom:1px solid var(--line);background:#fffaf2}
.cheat-card[open] summary::after{content:'–'}
.cheat-card summary span{font-size:1.14rem}
.cheat-card summary small{font-size:.72rem;color:var(--muted);font-weight:600;margin-top:2px}
.cheat-body{padding:17px 18px 19px}
.cheat-line{display:flex;justify-content:space-between;gap:18px;align-items:baseline;padding:8px 0;border-bottom:1px solid #ece8df}
.cheat-line strong,.cheat-block>strong{color:var(--green);font-size:.78rem;text-transform:uppercase;letter-spacing:.05em}
.cheat-line span{font-weight:800;letter-spacing:.035em}
.cheat-block{padding:10px 0;border-bottom:1px solid #ece8df}
.cheat-block ol{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 24px;margin:7px 0 0;padding-left:1.55rem}
.cheat-block li{font-weight:750;padding:2px 0}
.cheat-note{margin:13px 0 0;color:#4c504b;font-size:.9rem}
.download-card{display:flex;flex-direction:column}
.download-card p:last-child{margin-top:auto;padding-top:8px}
.paired-tool-list{gap:13px}.paired-tool{align-items:flex-start}.paired-tool-buttons{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.paired-tool-buttons .btn{margin:0}.mini-btn{padding:9px 12px;font-size:.72rem}
.history-table-wrap{max-width:720px}
.history-standings{min-width:0}
.history-standings th:nth-child(1),.history-standings td:nth-child(1){width:80px;text-align:center}
.history-standings th:nth-child(2),.history-standings td:nth-child(2){width:auto}
.history-standings th:nth-child(3),.history-standings td:nth-child(3){width:110px;text-align:right}
.cheat-sheet-section{padding-top:24px}.cheat-controls{max-width:7.5in;margin:0 auto 18px}.cheat-paper{background:#fff;color:#111;border:1px solid #bbb;box-shadow:0 6px 24px #00000018;max-width:7.5in;margin:0 auto;padding:14px;font-family:Arial,Helvetica,sans-serif}.cheat-paper-title{text-align:center;border-bottom:2px solid #111;padding-bottom:5px;margin-bottom:8px}.cheat-paper-title h2{font-size:1.15rem;margin:1px 0;color:#111}.cheat-paper-title .eyebrow{color:#111;font-size:.62rem}.cheat-sheets-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.cheat-sheet-card{border:1.5px solid #111;padding:6px;break-inside:avoid}.cheat-sheet-card h3{font-size:.82rem;margin:0 0 4px;text-align:center;color:#111}.cheat-sheet-card h4{font-size:.63rem;margin:3px 0 2px;color:#111;text-transform:uppercase;letter-spacing:.04em}.cheat-sheet-card table{width:100%;min-width:0!important;table-layout:fixed;border-collapse:collapse;margin:0}.cheat-sheet-card th,.cheat-sheet-card td{border:1px solid #555;padding:1px 3px;text-align:left;font-size:.58rem;line-height:1.12;height:14px}.cheat-sheet-card th{background:#f1f1f1}.cheat-roster-table th:last-child,.cheat-roster-table td:last-child{width:38px;text-align:center}.cheat-paper-block{margin:3px 0}.cheat-team-row{border:1px solid #555;display:grid;grid-template-columns:repeat(4,1fr);height:24px;overflow:hidden}.cheat-team-row span{display:flex;align-items:center;justify-content:center;border-right:1px solid #555;font-size:.53rem;font-weight:700;transform:rotate(-12deg);white-space:nowrap}.cheat-team-row span:last-child{border-right:0}.cheat-games td:first-child{width:27px;text-align:center;font-weight:700}.no-print{display:block}
@media(max-width:700px){.cheat-sheet-card table{display:table!important}.cheat-sheet-card thead{display:table-header-group!important}.cheat-sheet-card tbody{display:table-row-group!important}.cheat-sheet-card tr{display:table-row!important}.cheat-sheet-card th,.cheat-sheet-card td{display:table-cell!important;min-height:0;width:auto;padding:1px 3px}.cheat-sheet-card td::before{display:none!important}.cheat-grid{grid-template-columns:1fr}.cheat-card summary{min-height:62px;padding:16px 48px 16px 17px}.cheat-block ol{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 20px}.cheat-paper{padding:8px;margin-left:-8px;margin-right:-8px}.cheat-sheets-grid{grid-template-columns:1fr}.cheat-sheet-card th,.cheat-sheet-card td{font-size:.72rem;height:17px}.cheat-sheet-card h3{font-size:.95rem}.cheat-sheet-card h4{font-size:.72rem}.cheat-team-row span{font-size:.66rem}}
@media(max-width:520px){.cheat-body{padding:14px 16px 17px}.cheat-line{gap:12px}.cheat-block ol{gap:4px 16px}.history-standings th,.history-standings td{padding:10px 7px}.history-standings th:nth-child(1),.history-standings td:nth-child(1){width:48px}.history-standings th:nth-child(2),.history-standings td:nth-child(2){width:auto}.history-standings th:nth-child(3),.history-standings td:nth-child(3){width:72px}}
@media print{@page{size:letter portrait;margin:8mm 8mm 8mm 16mm}.no-print,.site-header,.page-hero,.footer{display:none!important}body{background:#fff!important}.cheat-sheet-section,.cheat-sheet-section .wrap{padding:0!important;margin:0!important;max-width:none!important}.cheat-paper{box-shadow:none;border:0;max-width:7.5in;width:7.5in;padding:0;margin:0 auto}.cheat-paper-title{margin-top:0}.cheat-sheets-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.cheat-sheet-card{padding:5px}.cheat-sheet-card th,.cheat-sheet-card td{font-size:6.7pt;height:12px;padding:1px 2px}.cheat-sheet-card h3{font-size:9pt}.cheat-sheet-card h4{font-size:7pt}.cheat-team-row{height:21px}.cheat-team-row span{font-size:6.3pt}}

/* Original supplied order-of-play sheet presentation — readable screen and print */
.cheat-paper{box-sizing:border-box;max-width:7.5in;padding:26px 26px 30px}
.cheat-paper-title{border-bottom:0;padding-bottom:0;margin-bottom:20px;text-align:center}
.cheat-paper-title h1{font-size:23px;line-height:1.15;margin:0 0 4px;color:#111}
.cheat-paper-title h2{font-size:17px;line-height:1.2;margin:0 0 9px;color:#111}
.cheat-paper-title p{font-size:13px;line-height:1.4;margin:0;color:#111}
.cheat-sheets-grid{gap:18px}
.cheat-sheet-card{box-sizing:border-box;min-width:0;border:1.5px solid #2d654d;border-radius:10px;padding:15px 15px 17px;min-height:365px;display:flex;flex-direction:column}
.cheat-sheet-card h3{font-size:21px;line-height:1.15;margin:0 0 17px;text-align:left;color:#285d45}
.cheat-order-line{display:grid;grid-template-columns:86px minmax(0,1fr);align-items:baseline;gap:6px;margin:0 0 14px}
.cheat-order-line strong,.cheat-doubles>strong{font-size:15px;line-height:1.3;color:#111}
.cheat-order-line span{font-size:18px;font-weight:700;line-height:1.25;letter-spacing:0;overflow-wrap:anywhere}
.cheat-doubles{display:grid;grid-template-columns:86px minmax(0,1fr);align-items:start;gap:6px}
.cheat-doubles-list{margin:0 0 13px;padding:0;list-style:none;counter-reset:doubles-game}
.cheat-doubles-list li{display:flex;align-items:baseline;gap:8px;padding:0 0 6px;font-size:18px;font-weight:700;line-height:1.2;counter-increment:doubles-game}
.cheat-doubles-list li::before{content:counter(doubles-game) '.';flex:0 0 17px;text-align:right;font-size:13px;font-weight:500;color:#555}
.cheat-set-count{border-top:1px solid #bbb;margin-top:auto;padding-top:11px;font-size:16px;line-height:1.4;display:flex;flex-direction:column;gap:2px}
.cheat-set-count strong{font-size:15px;line-height:1.3;color:#111;margin-bottom:3px}
@media(max-width:700px){
  .cheat-paper{padding:22px 16px;margin-left:0;margin-right:0}
  .cheat-sheets-grid{grid-template-columns:1fr;gap:15px}
  .cheat-sheet-card{min-height:0;padding:18px}
  .cheat-paper-title h1{font-size:22px}
  .cheat-paper-title h2{font-size:16px}
  .cheat-paper-title p{font-size:13px}
}
@media print{
  .cheat-paper{box-sizing:border-box;min-height:0;height:10.25in;display:flex;flex-direction:column;max-width:none;width:7.5in;padding:6px 8px 8px;margin:0 auto;box-shadow:none;border:0}
  .cheat-paper-title{margin-bottom:11px}
  .cheat-paper-title h1{font-size:17pt;line-height:1.1;margin-bottom:2px}
  .cheat-paper-title h2{font-size:12pt;line-height:1.15;margin-bottom:4px}
  .cheat-paper-title p{font-size:9pt;line-height:1.2}
  .cheat-sheets-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr));gap:10px 12px;width:100%!important;flex:1;min-height:0;counter-reset:cheat-sheet;break-inside:avoid-page;page-break-inside:avoid}
  .cheat-sheet-card{min-width:0!important;min-height:0!important;height:auto;padding:11px 12px;break-inside:avoid-page;page-break-inside:avoid;counter-increment:cheat-sheet}
  .cheat-sheet-card h3{font-size:16pt;margin-bottom:15px}
  .cheat-sheet-card h3::after{content:'Sheet ' counter(cheat-sheet);float:right;font-size:9pt;color:#555;font-weight:700;letter-spacing:.04em}
  .cheat-order-line{grid-template-columns:71px minmax(0,1fr);gap:5px;margin-bottom:11px}
  .cheat-order-line strong,.cheat-doubles>strong{font-size:11pt;line-height:1.2}
  .cheat-order-line span{font-size:14pt;line-height:1.2}
  .cheat-doubles{grid-template-columns:71px minmax(0,1fr);gap:5px}
  .cheat-doubles-list{margin-bottom:9px;padding-left:0}
  .cheat-doubles-list li{font-size:14pt;line-height:1.15;padding-bottom:5px;gap:6px}
  .cheat-doubles-list li::before{flex-basis:14px;font-size:10pt;color:#555}
  .cheat-set-count{font-size:11.5pt;line-height:1.3;padding-top:9px;gap:3px}
  .cheat-set-count strong{font-size:11pt;line-height:1.2;margin-bottom:2px}
}

/* Actions belong immediately beside their generated cheat sheets. */
.cheat-result-actions{max-width:7.5in;margin:12px auto 0;display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.cheat-result-actions .btn{margin:0}
html[data-theme="dart-night"] .cheat-note{color:var(--muted)}
html[data-theme="dart-night"] .cheat-paper{color:#111}
html[data-theme="dart-night"] .cheat-paper th{background:#f1f1f1;color:#111}
