@font-face { font-family: 'Chakra Petch'; src: url('fonts/chakra-petch-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #f3f4ee; --surface: #fff; --ink: #142a1d; --muted: #4a5b50; --line: #c6cfc0; --line2: #dfe4da;
  --turf: #1d5a36; --turf-ink: #f3f4ee; --accent: #c2410c; --accent-ink: #fff; --accent-soft: #fbe7dc;
  --warn: #8a5a00; --warn-bg: #fdf3d8; --bad: #b42318; --bad-bg: #fde8e6; --ok: #1d6b3c; --ok-bg: #e3f2e6;
  --head: 'Chakra Petch', 'Arial Narrow', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --r: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1712; --surface: #15211a; --ink: #e6ede4; --muted: #a9b8ac; --line: #33463a; --line2: #24342a;
    --turf: #153f27; --turf-ink: #e6ede4; --accent: #ff8a4c; --accent-ink: #1b0c03; --accent-soft: #3a2216;
    --warn: #f3c56b; --warn-bg: #33290f; --bad: #ff8f84; --bad-bg: #3a1714; --ok: #7fd59a; --ok-bg: #12301d;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--body); }
a { color: var(--accent); }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* header: a strip of turf with a chalk line */
.top { background: var(--turf); color: var(--turf-ink); border-bottom: 3px solid var(--turf-ink); box-shadow: 0 3px 0 var(--turf); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 700 20px/1 var(--head); letter-spacing: 0.01em; }
.top nav { display: flex; gap: 18px; }
.top nav a { color: inherit; font-size: 15px; text-decoration: none; padding: 12px 0; }
.top nav a:hover { text-decoration: underline; }
@media (max-width: 420px) { .top nav a:first-child { display: none; } }

.crumbs { font-size: 15px; margin: 14px 0 0; color: var(--muted); }
.crumbs a { color: var(--muted); }
.hero { padding: 22px 0 10px; max-width: 760px; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; line-height: 1.15; }
h1 { font-size: clamp(28px, 6vw, 42px); margin: 0 0 10px; letter-spacing: -0.01em; }
.lede { margin: 0; font-size: 18px; color: var(--muted); max-width: 68ch; }

/* tool */
.tool { margin: 18px 0 40px; }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--ink); overflow: hidden; }
.tabs [role=tab] { flex: 1 1 0; min-width: 0; min-height: 52px; border: 0; background: transparent; color: var(--muted); font: 700 16px/1.1 var(--head); padding: 8px 4px 6px; cursor: pointer; border-bottom: 5px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabs [role=tab] .tn { font-size: 12px; font-family: var(--body); font-weight: 600; opacity: 0.8; }
.tabs [role=tab][aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs [role=tab]:hover { color: var(--ink); }
@media (min-width: 640px) { .tabs [role=tab] { flex-direction: row; justify-content: center; gap: 8px; font-size: 18px; } .tabs [role=tab] .tn { font-size: 14px; } }
.pane { padding-top: 6px; }
.block { padding: 18px 0 22px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block h2 { font-size: 24px; margin: 0 0 12px; }
.block h3 { font-size: 19px; margin: 22px 0 8px; }
.count { font: 600 16px var(--body); color: var(--muted); }
.hint { color: var(--muted); font-size: 15px; margin: 6px 0; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 12px 0; align-items: flex-start; }
.row .grow { flex: 1 1 220px; }
.self-end { align-self: flex-end; }
label.stack { display: flex; flex-direction: column; gap: 4px; font-size: 15px; font-weight: 600; }
label.stack .hint { font-weight: 400; margin: 0; }
label.ck { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 16px; }
label.ck input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); padding: 9px 10px; min-height: 44px; max-width: 100%; }
textarea { width: 100%; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
input[aria-invalid=true] { border-color: var(--bad); background: var(--bad-bg); }
input.num { width: 5.5em; }
#paste { min-height: 110px; }
fieldset { border: 0; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 0 16px; }
legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 2px; }

.btn { font: 600 16px/1.2 var(--body); min-height: 44px; padding: 10px 16px; border-radius: var(--r); border: 1.5px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; }
.btn:hover { background: var(--line2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 15px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; min-height: 0; }
.x { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; border-radius: var(--r); }
.x:hover { background: var(--line2); color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 14px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 15px var(--body); cursor: pointer; }
.chip[aria-pressed=true] { border-color: var(--turf); background: var(--turf); color: var(--turf-ink); }
@media (prefers-color-scheme: dark) { .chip[aria-pressed=true] { border-color: #3fa66a; background: #1f5c38; } }
.chip small { font-weight: 500; opacity: 0.85; margin-left: 4px; font-variant-numeric: tabular-nums; }

.note { padding: 10px 12px; border-radius: var(--r); margin: 10px 0; font-size: 16px; border-left: 4px solid; }
.note p { margin: 0 0 6px; } .note p:last-child { margin: 0; }
.note ul { margin: 4px 0 0; padding-left: 20px; }
.note.warn { background: var(--warn-bg); border-color: var(--warn); }
.note.bad { background: var(--bad-bg); border-color: var(--bad); }
.note.ok { background: var(--ok-bg); border-color: var(--ok); }
.note.example { background: var(--accent-soft); border-color: var(--accent); }

/* players, skills, evaluators */
.plist, .clist { width: 100%; border-collapse: collapse; margin-top: 14px; }
.plist th, .clist th { text-align: left; font-size: 14px; font-weight: 600; color: var(--muted); padding: 4px 4px; border-bottom: 1.5px solid var(--line); }
.plist td, .clist td { padding: 3px 4px; border-bottom: 1px solid var(--line2); }
.plist td input:not([type=checkbox]), .clist td input { width: 100%; }
.plist input.num { width: 4.2em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.plist input.grp { width: 5.5em; }
.plist td:first-child, .plist th:first-child { width: 4.6em; }
.plist td:nth-child(3), .plist th:nth-child(3) { width: 6em; }
.plist.wide-g input.grp { width: 8.5em; }
.plist.wide-g td:nth-child(3), .plist.wide-g th:nth-child(3) { width: 9em; }
.plist td.c, .clist td.c { width: 44px; text-align: center; padding: 0; }
.plist input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
.plist tr.away input[data-f=p-name] { text-decoration: line-through; color: var(--muted); }
.clist input.wt { width: 5em; text-align: center; }
.clist td:nth-child(2), .clist th:nth-child(2) { width: 5.5em; }
.clist .share { width: 3.5em; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 15px; }
.elist { list-style: none; margin: 0; padding: 0; counter-reset: ev; }
.elist li { border-bottom: 1px solid var(--line2); padding: 6px 0; }
.erow { display: flex; gap: 6px; align-items: center; }
.erow input { flex: 1; }
.elist details summary { cursor: pointer; color: var(--muted); font-size: 15px; padding: 8px 2px; min-height: 40px; }
.elist details[open] { padding-bottom: 6px; }
.elist details label.stack input { max-width: 20em; }

details.kept { margin: 12px 0; }
details.kept summary, details.ex summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.kept-list { list-style: none; padding: 0; margin: 6px 0; }
.kept-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.kept-list small { display: block; color: var(--muted); font-size: 14px; }

/* score entry grid */
.gridwrap { margin: 12px 0; overflow-x: auto; }
.grid { border-collapse: collapse; min-width: 100%; }
.grid th, .grid td { border: 1px solid var(--line); padding: 0; }
.grid thead th { font: 600 13px/1.2 var(--body); color: var(--muted); padding: 6px 4px; vertical-align: bottom; text-align: center; max-width: 7em; overflow-wrap: anywhere; }
/* narrow screens: skill names read bottom to top, so the boxes stay wide enough for a thumb */
@media (max-width: 600px) {
  .grid thead th.cr { vertical-align: bottom; padding: 8px 2px; }
  .grid thead th.cr span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; display: inline-block; max-height: 150px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
}
.grid th.n { text-align: left; padding: 4px 8px; min-width: 64px; background: var(--surface); }
.grid tbody th.n b { font: 700 20px/1 var(--head); display: block; font-variant-numeric: tabular-nums; }
.grid .pn { display: block; font: 400 13px/1.25 var(--body); color: var(--muted); max-width: 11em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid tr.xtra th.n { color: var(--muted); }
.grid td { min-width: 48px; }
input.sc { width: 100%; min-width: 48px; height: 50px; border: 0; border-radius: 0; text-align: center; font: 700 22px/1 var(--head); font-variant-numeric: tabular-nums; background: var(--surface); padding: 0 2px; }
input.sc:focus { box-shadow: inset 0 0 0 3px var(--accent); }
input.sc.bad { background: var(--bad-bg); color: var(--bad); }
input.sc.odd { background: var(--warn-bg); }
.grid tbody tr:focus-within th.n { box-shadow: inset 4px 0 0 var(--accent); }
.grid tr.gh th { text-align: left; font: 700 16px var(--head); padding: 10px 8px 4px; border-left: 0; border-right: 0; background: var(--bg); }
.progress { margin: 8px 0; font-size: 16px; }

/* results */
.rgroup h3 small, .team h4 small { font: 500 15px var(--body); color: var(--muted); margin-left: 6px; }
.rwrap { container-type: inline-size; }
.rtable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rtable th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--ink); padding: 6px 6px; vertical-align: bottom; }
.rtable th small { display: block; font-weight: 400; }
.rtable td { padding: 7px 6px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.rtable .pl { font: 700 18px/1.2 var(--head); width: 3.4em; }
.rtable .n { width: 3em; font-weight: 700; }
.rtable .sc { font: 700 18px/1.2 var(--head); text-align: right; width: 4.6em; }
.rtable th.sc { font: 600 13px var(--body); text-align: right; }
.rtable .cv { text-align: right; width: 4.2em; font-size: 15px; }
.rtable .fl { color: var(--warn); font-size: 14px; }
.rtable .mini { display: none; font-size: 13px; color: var(--muted); }
.rtable tr.none td { color: var(--muted); }
.rtable tr.cut td { border-bottom: 3px dashed var(--accent); color: var(--accent); font-weight: 600; font-size: 15px; padding: 4px 6px; }
.muted { color: var(--muted); }
label.ck.phone-only { display: none; }
.phone-fold { display: none; }
@media (max-width: 640px) { .phone-fold { display: flex; } .plist.folded tr.more { display: none; } }
@media (max-width: 640px) { label.ck.phone-only { display: flex; } }
@container (max-width: 640px) {
  .rtable .cv { display: none; }
  .rtable.withskills .mini { display: block; }
  .rtable .fl { width: 5.5em; }
}
details.ex { margin: 14px 0; padding: 0 0 4px; border-top: 1px solid var(--line2); }
details.ex p, details.ex ul { margin: 6px 0; font-size: 16px; }

/* draft */
.rounds { padding-left: 0; list-style: none; margin: 6px 0; }
.rounds li { padding: 3px 0; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 10px; }
.team { border-top: 4px solid var(--turf); padding-top: 6px; }
@media (prefers-color-scheme: dark) { .team { border-top-color: #3fa66a; } }
.team h4 { font-size: 18px; margin: 0 0 6px; }
.team ol { margin: 0; padding-left: 0; list-style: none; font-size: 15px; }
.team li { display: flex; gap: 8px; padding: 2px 0; border-bottom: 1px solid var(--line2); }
.team li .n { font-weight: 700; width: 2.2em; font-variant-numeric: tabular-nums; }
.team li .muted { margin-left: auto; font-variant-numeric: tabular-nums; }

/* content */
.content { max-width: 720px; padding-bottom: 30px; }
.content h2 { font-size: 26px; margin: 34px 0 10px; }
.content p, .content li { max-width: 70ch; }
.steps { padding-left: 22px; }
.steps li { margin: 4px 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: 44px; }
.faq details p { margin: 0 0 14px; }
.sources, .related { font-size: 15px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r); max-width: min(92vw, 560px); font-size: 15px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 23; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.undo { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); background: var(--surface); color: var(--ink); border: 2px solid var(--ink); padding: 8px 10px 8px 14px; border-radius: var(--r); display: flex; align-items: center; gap: 12px; z-index: 21; max-width: 92vw; box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
/* touch screens: a dash button sits on top of the number keypad while a score box has focus */
.dashbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; display: flex; justify-content: flex-end; padding: 6px 12px; background: var(--surface); border-top: 1.5px solid var(--line); }
.dashbar .btn { font-size: 17px; }
@media (pointer: coarse) { input.sc { scroll-margin-bottom: 72px; } }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } html { scroll-behavior: auto; } }

footer { border-top: 3px solid var(--turf); padding: 22px 0 30px; font-size: 15px; color: var(--muted); }
.sb-footer { display: grid; gap: 8px; }
.sb-footer p { margin: 0; line-height: 1.6; }
.sb-footer a { color: var(--ink); }
.sb-more a { display: inline-block; padding: 4px 0; }

.print-root { display: none; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .block h2 { font-size: 22px; }
  .plist th:nth-child(4) { font-size: 12px; }
  .plist td, .plist th { padding-left: 2px; padding-right: 2px; }
  .plist input:not([type=checkbox]) { padding-left: 6px; padding-right: 6px; }
  .plist input.grp { width: 4.2em; }
  .plist td:nth-child(3), .plist th:nth-child(3) { width: 4.6em; }
  .plist td:first-child, .plist th:first-child { width: 3.6em; }
  .plist.wide-g input.grp { width: 6em; }
  .plist.wide-g td:nth-child(3), .plist.wide-g th:nth-child(3) { width: 6.4em; }
  .plist input.num { width: 3.4em; }
  .rtable .n { width: 2.4em; }
  .clist td, .clist th { padding-left: 2px; padding-right: 2px; }
  .clist input.wt { width: 3.2em; padding-left: 4px; padding-right: 4px; }
  .clist td:nth-child(2), .clist th:nth-child(2) { width: 3.6em; }
  .clist .share { width: 2.8em; font-size: 14px; }
  .clist td.c { width: 36px; }
  .clist .x { width: 36px; }
  .rtable td, .rtable th { padding-left: 4px; padding-right: 4px; }
}

/* ---------- paper ---------- */
@page { margin: 0.45in; }
@media print {
  body { background: #fff; color: #000; font: 10.5pt/1.3 var(--body); }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block; }
  .sheet { break-after: page; }
  .sheet.res { break-after: auto; break-inside: avoid; margin-bottom: 18pt; }
  .sheet:last-child { break-after: auto; }
  .pr table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .pr thead { display: table-header-group; }
  .pr th, .pr td { border: 0.9pt solid #000; padding: 2pt 4pt; text-align: left; vertical-align: middle; overflow-wrap: normal; word-break: normal; }
  .pr tr { break-inside: avoid; }
  .pr tr.run th { border: 0; border-bottom: 2pt solid #000; padding: 0 0 4pt; font-weight: 400; }
  .runh { display: flex; justify-content: space-between; align-items: baseline; gap: 12pt; }
  .runh .who { font: 700 17pt/1.15 var(--head); }
  .runh .ev { font-size: 10pt; text-align: right; }
  .runh .grp { font-size: 13pt; border: 1.5pt solid #000; padding: 0 5pt; margin-left: 6pt; }
  .scale { font-size: 9.5pt; margin-top: 2pt; }
  .line { display: inline-block; width: 2.4in; border-bottom: 1pt solid #000; height: 1em; vertical-align: baseline; }
  .line.short { width: 1.2in; }
  .pr tr.ch th { font: 700 9.5pt/1.15 var(--body); text-align: center; vertical-align: bottom; padding: 4pt 2pt; border-top: 0; overflow-wrap: normal; word-break: normal; hyphens: manual; }
  .pr tr.ch th small { font-weight: 400; }
  .pr th.num, .pr td.num { text-align: center; }
  .pr td.num { font: 700 14pt/1 var(--head); }
  .pr td.num.big { font-size: 16pt; }
  .pr td.nm { font-size: 10.5pt; }
  table.cardt td.nm { font-size: 9.5pt; line-height: 1.2; }
  .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 2.4em; }
  .pr th.notes { text-align: left; }
  table.cardt tbody td { height: 0.39in; }
  table.cardt tr.gh td { height: auto; border-left: 0; border-right: 0; border-bottom: 1.5pt solid #000; padding: 8pt 0 2pt; font: 700 12pt var(--head); }
  table.cardt tbody:first-of-type tr.gh td { padding-top: 4pt; }
  .sheet.card.land table.cardt tbody td { height: 0.4in; }
  table.cardt tr.ch th.cr { font-size: 8.5pt; }
  table.cardt tr.ch th.cr.tight { font-size: 7.5pt; letter-spacing: -0.01em; }
  .runh .grp { white-space: nowrap; }
  table.listt tbody td { height: 0.3in; }
  .tick { display: inline-block; width: 13pt; height: 13pt; border: 1pt solid #000; vertical-align: middle; }
  .pr .c { text-align: center; }
  .pr .r { text-align: right; }
  .pr .b { font-weight: 700; }
  .pr td.pl { font: 700 11pt var(--head); text-align: center; }
  .pr th.pl { text-align: center; }
  table.rest th.cr { font-size: 8pt; text-align: right; }
  table.rest td { font-variant-numeric: tabular-nums; }
  table.rest td.fl { font-size: 8.5pt; }
  table.rest tr.cut td { border-left: 0; border-right: 0; border-bottom: 2pt dashed #000; font-weight: 700; font-size: 9.5pt; }
  table.boardt tbody td { height: 0.5in; vertical-align: top; position: relative; }
  table.boardt .pk { font-size: 8pt; }
  table.boardt th.rd { text-align: center; font: 700 12pt var(--head); }
  table.boardt th.rd small { display: block; font: 400 9pt var(--body); }
  table.boardt tr.ch th { font-size: 10pt; }
  .small { font-size: 9pt; }
  .ph { border-bottom: 2pt solid #000; padding-bottom: 4pt; margin-bottom: 10pt; }
  .ph h1 { font: 700 17pt/1.15 var(--head); margin: 2pt 0; }
  .ph p { margin: 0; }
  .tgrid { columns: 2; column-gap: 0.3in; }
  .tm { break-inside: avoid; margin-bottom: 12pt; }
  .tm h2 { font: 700 12.5pt var(--head); margin: 0 0 3pt; border-bottom: 1pt solid #000; }
  .tm h2 small { font: 400 9pt var(--body); }
  .tm ol { list-style: none; margin: 0; padding: 0; }
  .tm li { display: flex; gap: 6pt; padding: 1.5pt 0; border-bottom: 0.5pt solid #999; }
  .tm li b { width: 2.2em; }
  .tm li span { margin-left: auto; }
}
