/* nhl-v3 — one hand-written stylesheet. Tokens first, then type, layout, tables, forms. */

:root {
  --paper: #faf9f6;
  --ink: #1c1b19;
  --ink-2: #5f5c55;
  --rule: #dedbd2;
  --accent: #a3281c;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: 16px;
  --section: 48px;
  --measure: 42rem;
}
@media (min-width: 1000px) { :root { --measure: 76rem; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #151514; --ink: #ece9e2; --ink-2: #96928a; --rule: #2f2e2b; --accent: #e9705f; }
}
:root[data-theme="dark"] { --paper: #151514; --ink: #ece9e2; --ink-2: #96928a; --rule: #2f2e2b; --accent: #e9705f; }
@media (min-width: 720px) { :root { --gutter: 32px; --section: 64px; } }

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) var(--section); }
.nowrap { white-space: nowrap; }

.num, td.num, th.num, .score, .sc, .pts, .rank, .nr, .gn, input, select, .form { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; }
.skip:focus { left: 8px; z-index: 2; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--paper); }

/* type */
h1, h2, h3, .display { font-family: var(--serif); font-weight: 400; margin: 0; color: var(--ink); }
h1 { font-size: 2rem; line-height: 1.12; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 12px; }
h3 { font-size: 1.125rem; line-height: 1.3; font-style: italic; margin: 32px 0 8px; }
.display { font-size: 2rem; line-height: 1.12; }
@media (min-width: 720px) { h1, .display { font-size: 2.5rem; } }
p { margin: 0 0 12px; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
p a, dd a, .meta a, .eyebrow a { color: var(--accent); }
li a { color: var(--ink); }
li a:hover, li a:focus-visible { text-decoration-thickness: 2px; }
a:hover { text-decoration-thickness: 2px; }
b, strong { font-weight: 600; }
small { font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
i { font-style: italic; color: var(--ink-2); }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.meta, .sub { color: var(--ink-2); font-size: 0.9375rem; }
.sub { display: block; font-size: 0.875rem; line-height: 1.4; }
.lede { font-size: 1.125rem; max-width: 36rem; }
.more { margin-top: 12px; font-size: 0.9375rem; }
.note { color: var(--ink-2); }
.error { color: var(--accent); }
.error:focus { outline: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
ul.plain li:last-child { border-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--section) 0; }

/* header, footer */
.top { display: flex; align-items: baseline; gap: 16px; max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 20px var(--gutter) 0; width: 100%; }
.brand, .back { font-family: var(--serif); font-size: 1.25rem; text-decoration: none; letter-spacing: 0.02em; }
.top nav { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.875rem; }
@media (min-width: 720px) { .top { gap: 24px; } .top nav { gap: 20px; font-size: 0.9375rem; } }
.top nav a { text-decoration: none; color: var(--ink-2); padding: 12px 0; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }
.top nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
main > header.hero { margin: 40px 0 var(--section); }
main > header.hero h1 a { text-decoration: none; }
.hero .meta { margin-top: 8px; }
.foot { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) 40px; width: 100%; font-size: 0.875rem; color: var(--ink-2); }
.foot::before { content: ""; display: block; border-top: 1px solid var(--rule); margin-bottom: 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 12px; }
.foot a, .foot .linklike { color: var(--ink-2); }
.foot .theme { display: flex; gap: 8px; align-items: baseline; margin-bottom: 12px; }
.foot .theme button { background: none; border: 0; padding: 12px 6px; font: inherit; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.foot .theme button[aria-pressed="true"] { color: var(--ink); text-decoration: none; }
.colophon { font-family: var(--serif); font-style: italic; }
.flash { margin: 24px 0 0; padding: 12px 0; border-bottom: 1px solid var(--ink); }
.inline { display: inline; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.linklike.small { font-size: 0.8125rem; }

.xwide { display: none; }
/* sections and the wide grid */
main > section, main > .grid2, main > .grid3 { margin-top: var(--section); }
main > section + section, main > * + .grid2, main > * + .grid3, main > .grid2 + section, main > .grid3 + section { padding-top: var(--section); border-top: 1px solid var(--rule); }
main > header.hero + .grid2, main > header.hero + .grid3 { padding-top: 0; border-top: 0; }
.grid2 > section + section, .grid3 > section + section { margin-top: var(--section); }
@media (min-width: 1000px) {
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 64px; align-items: start; }
  .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 48px; align-items: start; }
  .grid2 > section + section, .grid3 > section + section { margin-top: 0; }
  .grid2 > section:nth-child(n+3) { margin-top: var(--section); }
  .grid2 > *, .grid3 > * { min-width: 0; }
  .grid2 > .span2 { grid-column: 1 / -1; }
  .grid2 > .span2:not(:first-child), .grid2 > .span2 + section, .grid2 > .span2 + section + section { margin-top: var(--section); }
  .grid2 > .o1 { order: 1; } .grid2 > .o2 { order: 2; } .grid2 > .o3 { order: 3; } .grid2 > .o4 { order: 4; } .grid2 > .o5 { order: 5; }
  .grid2 > .o3, .grid2 > .o4, .grid2 > .o5 { margin-top: var(--section); }
  .grid3 > section:nth-child(n+4) { margin-top: var(--section); }
  .xwide { display: table-cell; }
}
/* icons: monochrome line icons, one sprite */
.ico { width: 1em; height: 1em; vertical-align: -0.15em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1 .ico { width: 0.8em; height: 0.8em; vertical-align: -0.05em; margin-right: 12px; color: var(--ink-2); stroke-width: 1.5; }
h2 .ico { width: 0.85em; height: 0.85em; vertical-align: -0.06em; margin-right: 10px; color: var(--ink-2); stroke-width: 1.75; }
h3 .ico { width: 0.9em; height: 0.9em; margin-right: 6px; color: var(--ink-2); }
.top nav .ico, .foot nav .ico, .foot .theme .ico, .eyebrow .ico, .linklike .ico, .cancel .ico { margin-right: 5px; }
@media (max-width: 599px) { .top nav .ico { display: none; } }
.btn .ico { margin-right: 8px; }
.filters .ico, .more .ico { margin-right: 4px; }
.t .form { letter-spacing: 0.12em; color: var(--ink-2); }
main > section.nextup, main > .saved + header.hero { margin-top: 32px; }
main > section.nextup + section { border-top: 0; padding-top: 0; margin-top: var(--section); }
.longview { margin-top: calc(var(--section) * 2) !important; padding-top: 0; border-top: 0 !important; }
.longview .display { margin-bottom: 8px; }
.longview h3 { margin-top: 40px; }

/* tables: a well-set sports page */
table.t { border-collapse: collapse; width: 100%; font-size: 0.9375rem; line-height: 1.4; }
.t th, .t td { padding: 8px 12px; text-align: left; vertical-align: baseline; }
.t th:first-child, .t td:first-child { padding-left: 0; }
.t th:last-child, .t td:last-child { padding-right: 0; }
.t thead th { font-family: var(--sans); font-weight: 400; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--ink); padding-top: 0; }
.t tbody th { font-weight: 400; }
.t tbody tr { border-bottom: 1px solid var(--rule); }
.t tbody tr:last-child { border-bottom: 1px solid var(--ink); }
.t .num { text-align: right; white-space: nowrap; }
.t tbody th a { text-decoration: none; }
.t tbody th a:hover, .t tbody th a:focus-visible { text-decoration: underline; }
.t tr.lead th, .t tr.lead .pts { font-weight: 600; }
.t tr.lead .rank { color: var(--accent); }
.t .rank { width: 1.5em; color: var(--ink-2); }
.t .sub { margin-top: 2px; }
.t.games .nr { width: 2em; color: var(--ink-2); }
.t.games .match i { margin: 0 2px; }
.t.games .score { white-space: nowrap; }
.t.games tr.unplayed td, .t.games tr.unplayed .sub { color: var(--ink-2); }
.t.games tr.unplayed .rowlink { color: var(--ink); }
.t.games .dash { color: var(--ink-2); }
@media (max-width: 599px) { .wide { display: none; } .wide-inline { display: none; } table.t { font-size: 0.875rem; } .t th, .t td { padding: 8px 8px; } .t.standings, .t.alltime { font-size: 1rem; } }
@media (min-width: 600px) { .nowide { display: none; } }
.t.roll .champ { white-space: nowrap; }
.t.roll .sub { display: inline; }
.t.roll .runner { display: block; }
@media (min-width: 600px) { .t.roll .nowide { display: none; } }
.t .score, .t .rec, .t .date, .gamelog .score { white-space: nowrap; }
.t.pairs th[scope="row"], .t.standings th[scope="row"], .t.alltime th[scope="row"] { white-space: nowrap; }
.t .rowlink { text-decoration: none; display: block; padding: 6px 0; margin: -6px 0; }
.t .rowlink:hover, .t .rowlink:focus-visible { text-decoration: underline; }
.t caption { text-align: left; font-family: var(--serif); font-size: 1.125rem; padding: 0 0 8px; }
.t caption.vh { padding: 0; }

/* results list */
.results { list-style: none; padding: 0; margin: 0; }
.results li { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.results li:last-child { border-bottom: 1px solid var(--ink); }
.results .sc { text-align: right; }
.results .sub { grid-column: 1 / -1; }

/* next up and entry */
.nextup .matchup { font-size: 1.25rem; line-height: 1.3; margin: 0 0 16px; }
.nextup .gn { display: block; font-size: 0.9375rem; color: var(--ink-2); }
.matchup i { margin: 0 4px; }
.actions { margin: 16px 0 0; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.btn { display: inline-block; font: inherit; font-size: 1.0625rem; padding: 14px 24px; min-height: 48px; border: 1px solid var(--ink); background: none; color: var(--ink); text-decoration: none; cursor: pointer; border-radius: 0; line-height: 1.2; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { text-decoration: underline; }
.upnext { list-style: none; padding: 0; margin: 20px 0 0; }
.upnext li { border-top: 1px solid var(--rule); }
.upnext li:last-child { border-bottom: 1px solid var(--rule); }
.upnext a { display: flex; gap: 12px; align-items: baseline; min-height: 48px; padding: 12px 0; text-decoration: none; }
.upnext a:hover, .upnext a:focus-visible { text-decoration: underline; }
.upnext .gn { color: var(--ink-2); width: 5.5em; flex: none; white-space: nowrap; }
details.missing { margin-top: 12px; font-size: 0.9375rem; }
details.missing summary { cursor: pointer; color: var(--ink-2); padding: 12px 0; }
details.missing summary:hover { color: var(--ink); }
.choices { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 4px 0 0; }
.choices a { color: var(--ink-2); text-decoration: none; padding: 12px 0; min-height: 44px; display: inline-flex; align-items: center; }
.choices a:hover { color: var(--ink); text-decoration: underline; }
.choices a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.3em; }
.saved { margin-top: 24px; padding-bottom: 8px; }
.saved .line { font-size: 1.125rem; margin: 0 0 4px; }
.saved .ops { display: flex; gap: 20px; align-items: center; margin: 4px 0 0; }
.saved .ops .linklike, .saved .ops a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); }
.saved .note { font-family: var(--serif); font-style: italic; margin: 4px 0 0; color: var(--ink); }
.meetup .when { font-weight: 600; }

/* entry form */
.bare main { max-width: 32rem; }
.bare .top { max-width: 32rem; }
.bare-top { padding-bottom: 8px; }
.bare-top .back { display: inline-block; padding: 8px 0; }
.entry { margin-top: 24px; }
.entry .eyebrow { margin-bottom: 20px; }
.entry.narrow h1 { margin-bottom: 24px; }
.entry .stack + .sub { margin-top: 24px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.side { min-width: 0; }
.pairname { display: block; font-family: var(--serif); font-size: 1.25rem; line-height: 1.2; margin-bottom: 8px; }
.side:last-child .pairname { text-align: right; }
select, input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], textarea { font: inherit; color: var(--ink); background: var(--paper); border: 0; border-bottom: 1px solid var(--ink-2); border-radius: 0; padding: 10px 0; width: 100%; min-height: 44px; }
select { -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 8px) 50%, calc(100% - 3px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 20px; text-overflow: ellipsis; }
.side:last-child select { text-align: right; padding-right: 20px; }
.scores { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 24px 0 4px; }
.scores input { font-size: 2.5rem; line-height: 1; text-align: center; height: 60px; border: 0; border-bottom: 1px solid var(--ink); padding: 4px; }
.scores input::placeholder { color: var(--rule); }
.scores input:focus-visible { border-bottom-width: 3px; }
.scores .dash { font-size: 2rem; color: var(--ink-2); }
.ot { margin: 8px 0 0; }
.ot label { display: inline-flex; gap: 12px; align-items: center; min-height: 44px; cursor: pointer; }
.ot input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.scoreform .actions { margin-top: 16px; }
.scoreform .btn.primary { flex: 1; text-align: center; }
.cancel { color: var(--ink-2); padding: 12px 0; }
.danger { display: block; margin-top: 24px; }
.danger .linklike { color: var(--ink-2); }
.result { font-size: 1.25rem; margin: 8px 0 4px; }
.before { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule); }
.before h2 { font-size: 1.125rem; font-style: italic; }
.facts dt { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin-top: 16px; }
.facts dd { margin: 4px 0 0; }
.form { letter-spacing: 0.15em; }
.stack label { display: block; margin: 16px 0 6px; }
.narrow { max-width: 28rem; }
.narrow > header.hero, article > header.hero { margin: 40px 0 32px; }
.contents { display: flex; gap: 20px; flex-wrap: wrap; margin: 12px 0 0; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; font-size: 0.9375rem; align-items: baseline; }
.filters a { color: var(--ink-2); text-decoration: none; padding: 10px 0; display: inline-block; }
.filters a:hover { color: var(--ink); text-decoration: underline; }
.filters a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.3em; }
.filters .sub { display: inline; }

/* chart */
.chartwrap { max-width: 40rem; }
.chart { width: 100%; height: auto; display: block; font-family: var(--sans); }
.chart-l { display: none; }
@media (min-width: 600px) { .chart-s { display: none; } .chart-l { display: block; } }
.chartout { min-height: 1.4em; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { stroke: var(--ink); stroke-width: 1; }
.chart .tick { fill: var(--ink-2); font-size: 10px; }
.chart .label { fill: var(--ink); font-size: 11px; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.chart .line.dim { stroke: var(--rule); }
.chart .line.hot { stroke-width: 2.5; }
.chart .pt { fill: transparent; }
.chart .pt:focus { outline: 0; fill: var(--accent); }
.chart:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; }
.chart .pt.hot { fill: var(--ink); }

/* photos */
.photogroups > section + section { border-top: 0; padding-top: 0; margin-top: 32px; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.grid li { position: relative; }
.grid .inline { display: block; text-align: right; }
.grid .linklike.small { color: var(--ink-2); padding: 8px 0; display: inline-block; }
.grid img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--rule); }
.upload { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 0.875rem; color: var(--ink-2); }
.upload .btn { font-size: 0.9375rem; padding: 10px 16px; min-height: 44px; }
.upload input[type="file"] { max-width: 100%; }

/* sheet (print) */
.bare.sheetpage main { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.sheet h1 { margin-top: 24px; }
.sheet h1 .sub { display: inline; font-family: var(--sans); font-size: 1rem; }
.sheet .noprint { margin: 12px 0 24px; }
.sheetgames tbody tr { border-bottom: 0; }
.sheetgames td { padding: 12px 8px; }
.sheetgames .box span { display: block; border-bottom: 1px solid var(--ink); min-width: 4em; height: 1.4em; }
.sheetgames .ot span { min-width: 2em; }
.sheetgames .dash { color: var(--ink-2); padding: 8px 0; }
@media (max-width: 599px) { .sheetgames { font-size: 0.8125rem; } .sheetgames th, .sheetgames td, .sheetgames td.box { padding: 8px 3px; } .sheetgames .box span { min-width: 2.2em; } }
@media (max-width: 599px) { .sheetgames { font-size: 0.8125rem; } .sheetgames th, .sheetgames td { padding: 8px 4px; } .sheetgames .box { min-width: 2em; } }
@media print {
  .top, .foot, .noprint { display: none !important; }
  html { font-size: 12px; }
  .bare main, .bare.sheetpage main { max-width: none; padding: 0; }
  .wide { display: table-cell !important; }
  .sheetgames td { padding: 10px 8px; }
  .sheetgames .box { min-width: 6em; }
}

/* profiles and records */
.overview { display: flex; flex-wrap: wrap; gap: 16px 32px; margin: 0 0 16px; }
.hero .overview { margin-top: 16px; }
.overview dd { white-space: nowrap; }
.overview div { margin: 0; }
.overview dt { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.overview dd { margin: 2px 0 0; font-size: 1.25rem; }
.facts.cols { display: grid; grid-template-columns: 1fr; gap: 0 32px; margin: 0; }
@media (min-width: 600px) { .facts.cols { grid-template-columns: 1fr 1fr; } }
.facts.cols div { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.facts.cols dt { margin-top: 0; }
h1 .in { font-style: italic; color: var(--ink-2); }
.cols2 { display: grid; grid-template-columns: 1fr; gap: 0 40px; }
@media (min-width: 720px) { .cols2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cols2.grid3x { grid-template-columns: repeat(3, 1fr); } }
ol.rec { list-style: none; padding: 0; margin: 0 0 8px; counter-reset: rec; }
ol.rec li { padding: 6px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 3.5em 1fr; gap: 0 8px; }
ol.rec li > .num:first-child { text-align: right; }
ol.rec li .sub { grid-column: 2; }
ol.rec li .what { min-width: 0; }
ol.rec li:last-child { border-bottom: 1px solid var(--ink); }
.t.h2h .self { color: var(--ink-2); }
@media (max-width: 599px) { .t.h2h th, .t.h2h td { padding: 8px 4px; } .t.h2h thead th { letter-spacing: 0; } }
[aria-sort] a { color: var(--ink); text-decoration-thickness: 2px; }
.t.teamsidx thead a { color: var(--ink-2); }
.t.teamsidx [aria-sort] a { color: var(--ink); }
.t.h2h .rate { display: none; }
@media (max-width: 599px) { .t.h2h .rec { display: none; } .t.h2h .rate { display: inline; } }
.userrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 16px 0 4px; border-top: 1px solid var(--rule); align-items: end; margin-top: 8px; }
.userops label { display: inline-flex; gap: 8px; align-items: center; }
.userrow label { font-size: 0.9375rem; color: var(--ink-2); }
.userrow input, .userrow select { font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.userrow .actions { grid-column: 1 / -1; margin: 4px 0 0; }
.userops { font-size: 0.875rem; color: var(--ink-2); margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.userops .linklike { padding: 12px 4px; }
.userops input { width: auto; display: inline-block; min-height: 36px; font-size: 0.9375rem; }
textarea { min-height: 5em; }
.winner { font-size: 1.125rem; margin-top: 8px; }
