/* Cluefox League Intelligence: the club's pages.
   Brand colours from cluefox-site (site/src/styles/global.css:1-13); system fonts only, nothing from another host. */
:root {
  color-scheme: light;
  --ink: #172b32;
  --ink-deep: #071318;
  --orange: #d66a3c;
  --orange-light: #f0a179;
  --paper: #f8f6f0;
  --paper-muted: #d7d6ce;
  /* Derived for text and controls: each passes 4.5:1 (text) or 3:1 (edges) on paper and white. */
  --ink-soft: #4f5f64;
  --edge: #7d8a8e;
  --surface: #ffffff;
  --warn-bg: #fbe3d6;
  --warn-fg: #6b2a0e;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  font-synthesis: none;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem); font-weight: 800; margin: 0.2em 0 0.4em; }
h2 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem); font-weight: 750; margin: 1.8em 0 0.5em; }
h3 { font-size: 1.125rem; font-weight: 700; margin: 0 0 0.3em; }
p, li { max-width: 68ch; }
a { color: var(--ink); text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 2px; }
.small { color: var(--ink-soft); font-size: 0.9375rem; }

/* ---- header, the same on every page ---------------------------------------------------------------- */
.site-header { background: var(--ink-deep); color: var(--paper); }
.site-header .bar { max-width: var(--page); margin: 0 auto; padding: 14px var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--paper); text-decoration: none; font-weight: 700; font-size: 1.0625rem; letter-spacing: 0.005em; }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand:hover { text-decoration: underline; text-decoration-color: var(--orange); }

/* ---- the club's pages: one column of reading width, inside the page width ----------------------------- */
main.page { max-width: var(--page); margin: 0 auto; padding: 24px var(--gutter) 64px; }
main.page > h1 { margin-top: 0.3em; }

.problem { background: var(--warn-bg); color: var(--warn-fg); padding: 12px 16px; border-radius: 8px; border-left: 4px solid var(--orange); font-weight: 600; }

/* The upload page's three sections are panels. On a desktop the form comes first, with where the video goes beside it.
   The sections are picked out by position, so their markup stays on the lines the pilot pack cites. */
.club-grid { display: grid; column-gap: 24px; align-content: start; }
.club-grid > * { min-width: 0; }
.club-grid > section { background: var(--surface); border: 1px solid var(--paper-muted); border-radius: var(--radius); padding: 4px 20px 20px; margin-bottom: 24px; }
.club-grid > section > h2:first-child { margin-top: 0.9em; }
@media (min-width: 900px) {
  .club-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
  .club-grid > h1, .club-grid > #link-problem { grid-column: 1 / -1; }
  .club-grid > section:nth-of-type(1) { grid-column: 2; grid-row: 3; }
  .club-grid > section:nth-of-type(2) { grid-column: 1; grid-row: 3; }
  .club-grid > section:nth-of-type(3) { grid-column: 1 / -1; grid-row: 4; }
}
.club-grid > section.where { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.where a { color: var(--orange-light); text-decoration-color: var(--orange-light); }
.where p { max-width: none; }

form { display: grid; gap: 18px; }
label { display: grid; gap: 6px; font-weight: 600; }
input, button { font: inherit; }
input:not([type="checkbox"]):not([type="file"]) {
  min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--edge); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 400; width: 100%;
}
input[type="date"] { max-width: 16rem; }
fieldset { border: 1px solid var(--paper-muted); border-radius: var(--radius); margin: 0; padding: 8px 14px 14px; display: grid; gap: 8px; background: var(--paper); }
legend { font-weight: 700; padding: 0 6px; }
label.tick { display: flex; gap: 12px; align-items: flex-start; padding: 12px; min-height: 48px; background: var(--surface); border: 1px solid var(--paper-muted); border-radius: 8px; font-weight: 400; cursor: pointer; }
label.tick input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--orange); cursor: pointer; }
input[type="file"] { width: 100%; min-height: 52px; padding: 7px; border: 1.5px dashed var(--edge); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 400; }
input[type="file"]::file-selector-button {
  min-height: 36px; margin-right: 12px; padding: 0 16px; border: 0; border-radius: 6px; background: var(--ink); color: var(--paper); font: inherit; font-weight: 600; cursor: pointer;
}

button {
  min-height: 48px; padding: 10px 24px; border-radius: 8px; border: 2px solid var(--orange); background: var(--orange); color: var(--ink-deep);
  font-weight: 700; cursor: pointer;
}
button:hover { background: var(--orange-light); border-color: var(--orange-light); }
button:disabled { background: var(--paper-muted); border-color: var(--paper-muted); color: var(--ink); cursor: default; }
button.secondary { min-height: 44px; padding: 8px 16px; background: transparent; border-color: var(--ink); color: var(--ink); font-weight: 600; }
button.secondary:hover { background: var(--paper-muted); }
#start { justify-self: start; min-width: 12rem; }

#progress { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
progress { flex: 1; width: min(560px, 100%); height: 12px; accent-color: var(--orange); }
#percent { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.5ch; }
#status:empty { margin: 0; }
.done { font-weight: 600; background: var(--paper); border-left: 4px solid var(--orange); padding: 12px 16px; border-radius: 8px; }

.games { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.games li { max-width: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--paper-muted); border-radius: 8px; }
.games li .state { font-weight: 700; }
.games li button { margin-left: auto; }
.games:empty { display: none; }

/* ---- tables: the record and the example ---------------------------------------------------------- */
table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; background: var(--surface); font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--paper-muted); padding: 10px 12px; text-align: left; vertical-align: top; }
thead th { background: var(--ink); color: var(--paper); font-weight: 600; border-bottom: 0; }
tbody th { font-weight: 600; }
caption { text-align: left; font-weight: 700; padding: 0 0 8px; caption-side: top; }
.table-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--paper-muted); border-radius: var(--radius); background: var(--surface); margin: 8px 0 16px; }
.table-scroll table { margin: 0; }
.table-scroll caption { position: sticky; left: 0; padding: 12px 12px 8px; }
#totals { max-width: 640px; border: 1px solid var(--paper-muted); }
#sets { min-width: 840px; }
#checked, #where { max-width: none; }
.scroll-hint { display: none; }
@media (max-width: 900px) { .scroll-hint { display: block; } }
td.clip video { display: block; max-width: 320px; width: 100%; height: auto; background: var(--ink-deep); border-radius: 6px; }
.fixed { font-weight: 600; background: var(--surface); border-left: 4px solid var(--orange); padding: 12px 16px; border-radius: 8px; }
table.flag caption { padding-top: 4px; }

/* ---- the player notice --------------------------------------------------------------------------- */
.notice { background: var(--surface); border: 1px solid var(--paper-muted); border-top: 4px solid var(--orange); border-radius: var(--radius); padding: 8px clamp(16px, 4vw, 40px) 24px; max-width: 760px; }
.notice h2 { margin-top: 0.9em; }
.notice li { margin: 8px 0; }
/* The notice's tick box, drawn: some computers have no font with the character, which then shows as a gap. */
.tickbox { display: inline-block; width: 0.95em; height: 0.95em; margin: 0 0.15em; vertical-align: -0.12em; border: 1.5px solid currentColor; border-radius: 2px; overflow: hidden; white-space: nowrap; text-indent: 200%; }

@media (max-width: 640px) {
  td.clip video { max-width: 200px; }
  .club-grid > section { padding: 4px 14px 16px; }
  #start { justify-self: stretch; }
}

/* ---- the front page ------------------------------------------------------------------------------ */
.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.hero { background: var(--ink-deep); color: var(--paper); padding: clamp(32px, 6vw, 72px) 0 clamp(40px, 7vw, 88px); }
.hero h1 { font-size: clamp(2.1rem, 1.3rem + 4vw, 3.75rem); line-height: 1.04; letter-spacing: -0.025em; max-width: 17ch; margin: 0 0 0.45em; }
.hero .lead { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3rem); color: var(--paper-muted); max-width: 46ch; margin: 0; }
.hero-mark { display: none; }
@media (min-width: 900px) {
  .hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 48px; }
  .hero-mark { display: block; width: clamp(180px, 20vw, 280px); height: auto; margin-right: 4%; }
}
.part { padding: clamp(36px, 6vw, 72px) 0 0; }
.part h2 { margin-top: 0; }
.gets .wrap { display: grid; gap: 20px; }
.gets .wrap > * { min-width: 0; }
@media (min-width: 900px) {
  .gets .copy { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 48px; align-items: start; }
  .gets .copy h2 { grid-column: 1 / -1; }
  .gets .flags-note { margin-top: 6px; }
}
.gets ul { padding-left: 1.2em; margin: 0 0 16px; }
.gets li { margin: 6px 0; }
.gets li::marker { color: var(--orange); }
.flags-note { border-left: 4px solid var(--paper-muted); padding-left: 14px; }
.sheet { margin: 0; background: var(--surface); border: 1px solid var(--paper-muted); border-top: 5px solid var(--orange); border-radius: var(--radius); padding: 0 0 4px; }
.sheet .table-scroll { border: 0; border-radius: 0; margin: 0; }
.sheet table { font-size: 0.9375rem; min-width: 640px; }
.sheet caption { font-size: 1rem; }
.sheet td { white-space: nowrap; }
.sheet .clip-cell { color: var(--ink-soft); }
.sheet .after { margin: 8px 16px 12px; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
.steps li { counter-increment: step; position: relative; max-width: none; background: var(--surface); border: 1px solid var(--paper-muted); border-radius: var(--radius); padding: 18px 18px 14px 70px; min-height: 88px; }
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 16px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--orange); color: var(--ink-deep); font-weight: 800; display: grid; place-items: center;
}
.steps p { margin: 0; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps li { padding: 66px 18px 18px; }
  .steps li::before { top: 18px; }
  .steps li:not(:last-child)::after { content: ""; position: absolute; top: 35px; left: 62px; right: -17px; height: 2px; background: var(--orange); }
}
.pair { display: grid; gap: 0 48px; }
@media (min-width: 900px) { .pair { grid-template-columns: 1fr 1fr; } }
.pair ul { padding-left: 1.2em; }
.pair li::marker { color: var(--orange); }
.pilot { background: var(--ink); color: var(--paper); margin-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(36px, 6vw, 64px); }
.pilot a { color: var(--orange-light); text-decoration-color: var(--orange-light); }
.pilot ul { padding-left: 1.2em; }
.pilot li::marker { color: var(--orange-light); }
.site-footer { background: var(--ink-deep); color: var(--paper-muted); padding: 20px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--orange-light); text-decoration-color: var(--orange-light); }

@media print {
  .site-header, .site-footer { background: none; color: var(--ink); }
  .brand { color: var(--ink); }
}
