/* PACISE CTF archive: a results bulletin. One variable family (Archivo) used across widths:
   wide for headlines, condensed for the dense solve board. Gold only marks first blood. */
:root {
  --bg: #f7f8fa; --surface: #fff; --ink: #16181d; --muted: #5f6672; --line: #e1e4ea;
  --ok: #1e7a4f; --ok-soft: #e3f2ea; --gold: #c9971c; --gold-soft: #fbf1d6;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font); font-variation-settings: "wdth" 100; -webkit-font-smoothing: antialiased; }
body { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.masthead, main, footer { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.masthead { padding-top: 48px; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.kicker { margin: 0 0 18px; color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
.others a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; margin-left: 6px; }
h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.02; font-weight: 800; font-variation-settings: "wdth" 125; letter-spacing: -0.01em; max-width: 18ch; }
.when { margin: 16px 0 0; font-size: 17px; color: var(--muted); }
.stats { display: flex; flex-wrap: wrap; gap: 12px 44px; margin: 30px 0 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { color: var(--muted); font-size: 14px; }
.stats dd { margin: 0; font-size: 2rem; font-weight: 700; font-variation-settings: "wdth" 112; line-height: 1.1; }

main section { padding: 44px 0 8px; }
h2 { margin: 0 0 18px; font-size: 1.6rem; font-weight: 750; font-variation-settings: "wdth" 115; }
.note { margin: -8px 0 16px; color: var(--muted); font-size: 15px; max-width: 70ch; }

/* podium */
.podium { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.podium li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: baseline; }
.podium .rank { grid-row: span 3; font-size: 3rem; font-weight: 800; line-height: 1; font-variation-settings: "wdth" 70; color: var(--muted); }
.podium .place-1 { border-color: var(--gold); background: linear-gradient(var(--gold-soft), var(--surface) 70%); }
.podium .place-1 .rank { color: var(--gold); }
.podium .team { font-size: 1.25rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.podium .score { font-weight: 600; }
.podium .members { color: var(--muted); font-size: 14px; }

/* the board */
.board-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.board { border-collapse: collapse; width: 100%; font-variation-settings: "wdth" 78; font-size: 14px; }
.board th, .board td { border-bottom: 1px solid var(--line); padding: 8px 10px; white-space: nowrap; }
.board thead th { font-weight: 600; text-align: left; vertical-align: bottom; background: var(--surface); }
.board .cat { text-align: center; color: var(--muted); font-weight: 500; border-left: 1px solid var(--line); }
.board .chal { min-width: 84px; max-width: 120px; border-left: 1px solid var(--line); text-align: center; }
.board .chal a { display: block; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.board .chal a:hover { text-decoration: underline; }
.board .chal span { display: block; color: var(--muted); font-weight: 400; }
.board .pl { color: var(--muted); text-align: right; width: 1%; }
.board .tm { text-align: left; font-weight: 600; position: sticky; left: 0; background: var(--surface); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.board .sc { font-weight: 700; text-align: right; }
.board .cell { text-align: center; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.board .ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.board .fb { background: var(--gold-soft); color: #7a5a06; font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--gold); }
.board tbody tr:last-child > * { border-bottom: 0; }

/* chart */
.chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.chart svg { width: 100%; height: auto; display: block; font: 12px var(--font); fill: var(--muted); }
.chart .grid { stroke: var(--line); }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; }
.legend span { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }

/* challenges */
.category h3 { font-size: 1.15rem; margin: 30px 0 12px; font-variation-settings: "wdth" 112; }
.challenge { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; margin-bottom: 12px; scroll-margin-top: 16px; }
.challenge:target { border-color: var(--ink); }
.challenge h4 { margin: 0; font-size: 1.2rem; }
.facts { margin: 6px 0 0; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.desc { margin-top: 12px; max-width: 75ch; }
.desc p { margin: .6em 0; }
.desc pre { background: #f0f2f5; padding: 10px 12px; border-radius: 6px; overflow-x: auto; font-size: 13px; }
.desc code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; }
.offline { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.files { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.files li { border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 14px; }
.files a { font-weight: 600; }
.files span, .files em { color: var(--muted); }

footer { color: var(--muted); font-size: 14px; padding-top: 40px; padding-bottom: 48px; }

@media (max-width: 760px) {
  .podium { grid-template-columns: 1fr; }
  .masthead { padding-top: 32px; }
}
