/* Raspored: uvod s brojkama, pa skupine disciplina kao kartice. U svakoj kartici gore je
   zadnji upisani rekord, a ispod vremenska crta prethodnih. Na kraju napomene i tablica izvora.
   Boje i slova prate stranicu prvaka u ciklokrosu. */
:root {
  --bg: #eef1f2;
  --surface: #ffffff;
  --ink: #1f1b17;
  --muted: #6b655d;
  --line: #d6d9d8;
  --accent: #c8102e;
  --accent-soft: #f6dde1;
  --gold: #b8860b;
  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141615; --surface: #1d201f; --ink: #ece8e1; --muted: #a29b91; --line: #2f3432;
    --accent: #ef4b5f; --accent-soft: #3a1d22; --gold: #e0b44a; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.okvir { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.sahovnica { height: 14px; background-color: var(--surface);
  background-image: conic-gradient(var(--accent) 25%, transparent 0 50%, var(--accent) 0 75%, transparent 0);
  background-size: 14px 14px; }

/* Uvod */
.uvod { padding-block: 3.5rem 2.5rem; display: grid; gap: 2rem; }
.nadnaslov { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-size: .95rem; }
.uvod h1 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: clamp(2.3rem, 7vw, 4.6rem); line-height: .94; margin: .3rem 0 0; text-wrap: balance; letter-spacing: -.01em; max-width: 18ch; }
.sazetak { max-width: 66ch; color: var(--muted); margin: 0; font-size: 1.05rem; }
.brojke { display: flex; flex-wrap: wrap; gap: 2.5rem; }
.brojka b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.brojka span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.upozorenje { margin: 0; padding: .8rem 1rem; border-left: 4px solid var(--gold); background: var(--surface); border-radius: 0 6px 6px 0; max-width: 80ch; font-size: .95rem; }
.upozorenje:empty { display: none; }

/* Odjeljci */
.odjeljak { padding-block: 2.5rem; border-top: 2px solid var(--ink); display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.odjeljak h2 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; font-size: 1.9rem; line-height: 1; margin: 0; }
.pojasnjenje { color: var(--muted); max-width: 75ch; margin: 0; font-size: .92rem; }

/* Kartice disciplina */
.kartice { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr)); gap: 1rem; align-items: start; }
.kartica { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.15rem 1.25rem 1.25rem; display: grid; gap: .9rem; min-width: 0; }
.kartica header { display: grid; gap: .4rem; justify-items: start; }
.kartica h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .04em; }
.oznaka { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: .15rem .55rem; white-space: nowrap; }

/* Zadnji upisani rekord */
.vazeci { display: grid; gap: .15rem; padding-top: .85rem; border-top: 3px solid var(--accent); }
.vrijeme { font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 9vw, 3.9rem); line-height: .95; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.uz-vrijeme { font-size: .82rem; color: var(--muted); }
.nositelj { font-weight: 600; font-size: 1.1rem; margin-top: .35rem; }
.kada { color: var(--muted); font-size: .92rem; }
.pomak { justify-self: start; margin-top: .45rem; font-size: .78rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: .15rem .5rem; }
.biljeska { margin: .5rem 0 0; font-size: .84rem; color: var(--muted); line-height: 1.4; }
.izvor, .p-izvor { font-size: .78rem; color: var(--muted); }
.izvor { margin-top: .5rem; }
.izvor a, .p-izvor a { white-space: nowrap; }
.opis { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.4; }

/* Prethodni rekordi */
.povijest { border-top: 1px solid var(--line); padding-top: .8rem; display: grid; gap: .6rem; }
.povijest h4 { margin: 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.povijest ol { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); display: grid; gap: .85rem; }
.povijest li { position: relative; display: grid; gap: .1rem; }
.povijest li::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .5rem; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.p-vrijeme { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--muted); }
.p-tko { font-size: .9rem; }
.p-biljeska { font-size: .8rem; color: var(--muted); line-height: 1.35; }
.bez-povijesti { margin: 0; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }

/* Pregled najboljih vremena */
.odjeljak.prvi { margin-top: 0; }
.pregled { border-collapse: collapse; width: 100%; font-size: .92rem; }
.pregled th, .pregled td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pregled thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.pregled tbody tr:last-child th, .pregled tbody tr:last-child td { border-bottom: 0; }
.pregled tbody th a { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink); text-decoration: none; }
.pregled tbody th a:hover { color: var(--accent); }
.pregled small { display: block; font-size: .76rem; color: var(--muted); font-weight: 400; }
.pr-vrijeme { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Oznaka porijekla vremena */
.porijeklo { display: inline-block; font-family: var(--font-body); font-size: .64rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; border-radius: 4px; padding: .12rem .45rem; vertical-align: middle; white-space: nowrap; line-height: 1.4; }
.porijeklo.hbs { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.porijeklo.vani { background: var(--accent-soft); color: var(--accent); border: 1px solid transparent; }
.nad-vrijeme { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: .3rem; }
.p-vrijeme .porijeklo { margin-left: .35rem; }

/* Najbliža vremena nakon 2013. */
.ostalo { border-top: 1px solid var(--line); padding-top: .7rem; }
.ostalo summary { cursor: pointer; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; width: fit-content; }
.ostalo summary:hover { color: var(--accent); }
.ostalo[open] summary { margin-bottom: .6rem; }
.ostalo ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.ostalo li { display: grid; gap: .1rem; }
.o-vrijeme { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--muted); }
.podnaslov { margin: .5rem 0 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }

@media (max-width: 560px) {
  .pregled thead { display: none; }
  .pregled tr { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
  .pregled tbody tr:last-child { border-bottom: 0; }
  .pregled th, .pregled td { padding: 0; border: 0; }
  .pregled .pr-vrijeme { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

/* Napomene i izvori */
.napomene { margin: 0; padding-left: 1.1rem; color: var(--muted); max-width: 80ch; display: grid; gap: .4rem; font-size: .92rem; }
.tablica-okvir { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.izvori { border-collapse: collapse; width: 100%; font-size: .86rem; min-width: 560px; }
.izvori th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
.izvori td { padding: .45rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.izvori tr:last-child td { border-bottom: 0; }
.izvori td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.izvori code { font-size: .8rem; }
.izvori tr.promjena td { color: var(--ink); }
.izvori tr.promjena td:last-child { font-weight: 600; }

footer { padding-block: 1.5rem 3rem; font-size: .8rem; color: var(--muted); max-width: 80ch; }

@media (max-width: 520px) {
  .brojke { gap: 1.5rem; }
  .uvod { padding-block: 2.5rem 2rem; }
}
