/* SK Javornik Timing — spectator site.
   All tokens and components live in tokens.css, the shared design system for every timing app
   (source of truth: core/docs/ui/tokens.css, spec: core/docs/ui-design-guidelines.md). This file holds
   the public site's own layer on top: page layouts, the marketing pages, and the spectator-only
   refinements (podium marks, the fresh-result flash, quiet finished rows). Use var(--…), no hex. */

/* ---------- 1. Base refinements ---------- */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { letter-spacing: -.01em; }
::selection { background: var(--accent-fill); color: var(--blue-dark); }
.small { font-size: .85rem; font-weight: 400; }
.nowrap { white-space: nowrap; }

/* Line icons (js/icons.js) and status icons (ui.js stateIcon). */
.icon { display: inline-flex; width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -.2em; }
.icon svg { width: 100%; height: 100%; }
.state-icon { display: inline-flex; margin-right: 4px; vertical-align: -2px; }
.state-icon svg { width: 1.05em; height: 1.05em; }

/* Keyboard users skip the menu; focus on the blue panels is white, not blue-on-blue. */
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--surface); color: var(--primary); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow-modal); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
:is(#topbar, #footer, .hero, .live-header, .cta) :focus-visible { outline-color: var(--on-blue); }
#main:focus { outline: none; }

/* A new page fades in (app.js). Reveal-on-scroll and count-up only on the marketing pages; all of it
   is switched off by prefers-reduced-motion in tokens.css. */
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
#content.page-enter { animation: page-in 240ms var(--ease) both; }
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 520ms var(--ease), transform 520ms var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } }

/* ---------- 2. Top bar ---------- */
.topbar-inner { flex-wrap: nowrap; }
.brand { letter-spacing: 0; }
.nav { align-items: center; }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 4px; line-height: 1.2; white-space: nowrap; border-bottom: 0; border-radius: 6px; transition: background var(--dur) var(--ease); }
.nav a[hidden] { display: none; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 220ms var(--ease); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav a.active { border-radius: 6px; font-weight: 700; }
.nav a.nav-org { font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); margin-left: 6px; }
.nav a.nav-org::after { display: none; }
.nav a.nav-org:hover, .nav a.nav-org.active { background: var(--on-blue); color: var(--blue-dark); }
.live-nav-dot { vertical-align: baseline; margin-left: 0; line-height: 1; }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 8px; }
.nav-toggle .icon { width: 26px; height: 26px; }
.nav-toggle:hover { background: rgba(255,255,255,.1); }
/* The bar stays on screen on desktop; long standings keep their header row just under it. */
@media (min-width: 1001px) {
  #topbar { position: sticky; top: 0; }
  thead th { top: 64px; }
}
/* Seven menu items don't fit next to the wordmark below ~1060 px: fold them behind the toggle there
   (tokens.css only folds at 640, which made tablets scroll sideways). */
@media (max-width: 1060px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .nav { display: none; flex-direction: column; align-items: stretch; width: 100%; padding-bottom: 10px; }
  .nav.open { display: flex; }
  .nav a { display: flex; min-height: 44px; padding: 10px 12px; }
  .nav a::after { display: none; }
  .nav a.active { background: rgba(255,255,255,.12); }
  .nav a.nav-org { margin: 6px 0 0; }
}
/* Wide boards (laps, several runs, combined) scroll sideways instead of being clipped. */
@media (max-width: 1000px) { .table-wrap { overflow-x: auto; } }

/* ---------- 3. Footer ---------- */
#footer { padding: 44px 0 24px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: 32px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--on-blue); font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.footer-brand img { height: 40px; width: auto; }
.footer-claim { margin: 12px 0 0; max-width: 36ch; color: var(--on-blue-soft); line-height: 1.6; }
.footer-col h2 { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-blue-soft); font-weight: 700; margin-bottom: 10px; }
.footer-col a { display: block; color: var(--on-blue); text-decoration: none; padding: 5px 0; opacity: .85; transition: opacity var(--dur); }
.footer-col a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--on-blue-line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--on-blue-soft); font-size: .82rem; }
.footer-bottom a { color: var(--on-blue-soft); }

/* ---------- 4. Buttons ---------- */
.btn { transition: background var(--dur) var(--ease), border-color var(--dur), color var(--dur), box-shadow var(--dur); }
.btn-hero { display: inline-flex; align-items: center; gap: 10px; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur); }
.btn-hero:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.22); filter: none; }
.btn-hero:active { transform: none; }
.btn-hero-ghost { background: transparent; color: var(--on-blue); box-shadow: none; border: 2px solid rgba(255,255,255,.7); padding: 10px 22px; }
.btn-hero-ghost:hover { background: rgba(255,255,255,.12); box-shadow: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0 12px; }
.hero-actions.center { justify-content: center; }
.btn .icon-after, .btn-hero .icon-after { transition: transform var(--dur) var(--ease); }
.btn:hover .icon-after, .btn-hero:hover .icon-after { transform: translateX(3px); }

/* ---------- 5. Brand panels: hero, live header, CTA ---------- */
/* A finish line, drawn very faintly across the right side of every blue panel, and a soft light. */
.hero, .live-header, .cta { position: relative; overflow: hidden; isolation: isolate; }
.hero::before, .live-header::before, .cta::before {
  content: ''; position: absolute; inset: -40% -5% -40% 52%; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.07) 0 2px, transparent 2px 24px);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 45%); mask-image: linear-gradient(90deg, transparent, black 45%);
}
.hero::after, .cta::after { content: ''; position: absolute; width: 560px; height: 560px; right: -180px; top: -260px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(255,255,255,.16), transparent); }
.live-header::before { opacity: .7; }
.cta::before { inset: -40% -5% -40% 0; -webkit-mask-image: linear-gradient(90deg, transparent, black 30%, black 70%, transparent); mask-image: linear-gradient(90deg, transparent, black 30%, black 70%, transparent); }

.hero { padding: 44px 40px; }
.hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -.025em; line-height: 1.08; }
.hero-sub { font-size: 1.08rem; line-height: 1.55; max-width: 52ch; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--on-blue-soft); margin-bottom: 14px; }

/* Front page hero: the promise and a search on the left, the race of the moment on the right. */
.hero-home { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero-search { margin-top: 26px; display: flex; align-items: center; gap: 6px; background: var(--surface); border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 520px; }
.hero-search .icon { color: var(--muted); margin-left: 10px; width: 20px; height: 20px; }
.hero-search input { flex: 1; min-width: 0; border: 0; min-height: 44px; padding: 0 6px; background: transparent; font-size: 1rem; }
.hero-search input:focus { outline: none; }
.hero-search:focus-within { box-shadow: 0 10px 30px rgba(0,0,0,.2), 0 0 0 3px rgba(255,255,255,.55); }
.hero-search .btn { min-height: 44px; }
.hero-panel { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 22px 24px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hero-panel-label { display: flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--on-blue-soft); }
.hero-panel-name { font-size: 1.45rem; font-weight: 700; line-height: 1.2; margin-top: 12px; letter-spacing: -.01em; }
.hero-panel-meta { color: var(--on-blue-soft); margin-top: 4px; font-size: .92rem; }
.hero-panel-sessions { list-style: none; margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--on-blue-line); display: grid; gap: 6px; font-size: .92rem; }
.hero-panel-sessions li { display: flex; align-items: center; gap: 8px; }
.hero-panel .btn-hero { margin-top: 18px; }

/* Brand mark in the about hero. */
.hero-logo-img { height: 140px; opacity: .95; }

/* CTA panel */
.cta { padding: 44px 32px; }
.cta h2 { font-size: 1.6rem; letter-spacing: -.015em; }

/* ---------- 6. Stats ---------- */
.stat-card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.stat-value { letter-spacing: -.02em; }
/* Orange is for "live" only: the tile keeps its orange top line, the number stays brand blue. */
.stat-orange .stat-value { color: var(--primary); }
.stat-link { text-decoration: none; display: block; }
.stat-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat-link .stat-label { color: var(--primary); font-weight: 500; }

/* ---------- 7. Section headings ---------- */
.section-title { letter-spacing: -.01em; }
section + .section-title, .card + .section-title, .stats-row + .section-title, .boards + .section-title { margin-top: 40px; }
.section-lead { margin: -8px 0 20px; max-width: 70ch; color: var(--muted); line-height: 1.6; }

/* ---------- 8. Front page: seasons and event cards ---------- */
.season { margin-top: 32px; }
.season-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font-size: 1.3rem; font-weight: 700; color: var(--primary); }
details.season > summary { cursor: pointer; list-style: none; border-radius: 8px; }
details.season > summary::-webkit-details-marker { display: none; }
details.season > summary::before { content: '\25B8'; color: var(--muted); font-size: 1rem; transition: transform var(--dur) var(--ease); }
details.season[open] > summary::before { transform: rotate(90deg); }
.season-title .count { color: var(--muted); font-weight: 400; font-size: .9rem; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.event-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-card); color: var(--text); text-decoration: none; border: 1px solid transparent; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur); }
.event-card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: var(--shadow-hover); }
/* Live = orange (it used to be red, which the system keeps for faults). */
.event-card.active { border-color: color-mix(in srgb, var(--orange) 40%, transparent); box-shadow: var(--shadow-card), inset 4px 0 0 var(--orange); }
.event-card-body { flex: 1; min-width: 0; }
.event-card .event-name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.event-card.active .event-name { color: var(--primary); }
.event-card .icon.chev { color: var(--faint); transition: transform var(--dur) var(--ease), color var(--dur); }
.event-card:hover .icon.chev { transform: translateX(3px); color: var(--primary); }
.event-meta { display: flex; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin-top: 3px; }
.event-meta .dot-sep::before { content: '\00B7'; margin: 0 6px; }
/* Sport tiles: one calm brand tint for every sport (the emoji carries the sport). */
.sport-icon { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.6rem; background: color-mix(in srgb, var(--blue) 9%, var(--surface)); }
.event-card .event-logo.small { height: 32px; max-width: 64px; object-fit: contain; }
@media (max-width: 640px) { .event-grid { grid-template-columns: 1fr; gap: 10px; } .event-card { padding: 12px; } }

/* ---------- 9. Live page header ---------- */
.live-header { border-radius: 12px; padding: 20px 24px; }
.live-header-top { align-items: flex-start; }
.live-event-name { letter-spacing: -.01em; }
.live-status { flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; color: var(--on-blue-soft); }
.live-status .viewers { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--on-blue-soft); }
.conn { display: inline-flex; align-items: center; font-size: .8rem; font-weight: 600; color: var(--on-blue-soft); }
.conn .dot { width: 8px; height: 8px; }
.live-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--on-blue-line); }
.live-controls .pills { margin: 0; padding: 0; border: 0; }
.pill { min-height: 36px; transition: background var(--dur) var(--ease), color var(--dur); }
.pill:hover:not(.selected) { background: rgba(255,255,255,.2); }
.pill .icon { width: 1em; height: 1em; }
.view-toggle { margin: 0; gap: 2px; padding: 3px; background: rgba(255,255,255,.1); border-radius: 10px; }
.view-btn { border: 0; border-radius: 8px; min-height: 32px; transition: background var(--dur) var(--ease), color var(--dur); }
.view-btn:hover:not(.selected) { background: rgba(255,255,255,.12); }
.view-btn.selected { background: var(--on-blue); color: var(--blue-dark); }
.board-host { min-height: 200px; }

/* ---------- 10. Standings: the spectator layer ---------- */
.category-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.category-count { font-size: .85rem; font-weight: 500; color: var(--muted); }
tbody tr { transition: background var(--dur); }
/* When everyone has finished, a green board says nothing: finished rows stay white, the time carries
   the state (and the "V cilju" chip the word). Operator apps keep the green wash. */
tr.row-finished td { background: transparent; font-weight: inherit; }
tr.row-finished td.pos, tr.row-finished td.bib { font-weight: 700; }
tr.row-finished td.time { color: var(--green-deep); font-weight: 700; }
/* Podium places: a medal tint behind the place number. */
.rank-badge { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 999px; font-weight: 700; font-size: 1rem; line-height: 1; color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.rank-badge.r1 { background: var(--medal-1); }
.rank-badge.r2 { background: var(--medal-2); }
.rank-badge.r3 { background: var(--medal-3); }
/* A result that just came in flashes and fades back over four seconds. A redraw mid-fade continues
   the same animation (negative delay from live.js), so live pushes don't restart it. */
@keyframes fresh-row { from { background-color: var(--fresh); } to { background-color: transparent; } }
@keyframes fresh-edge { from { box-shadow: inset 4px 0 0 var(--green); } to { box-shadow: inset 4px 0 0 transparent; } }
tr.row-fresh > td { animation: fresh-row 4s var(--ease) both; animation-delay: var(--fresh-delay, 0ms); }
tr.row-fresh > td:first-child { animation: fresh-row 4s var(--ease) both, fresh-edge 4s var(--ease) both; animation-delay: var(--fresh-delay, 0ms); }
/* On phones the status column goes; a state that matters (on course, DNF…) sits under the name. */
.status-inline { display: none; }

/* Competitor names link to their profile (ui.js athleteLink): look like text until hovered. */
a.athlete-link { color: inherit; text-decoration: none; }
a.athlete-link:hover, a.athlete-link:focus-visible { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 11. Cup standings (pages/cup.js) ---------- */
.cup-wrap { overflow-x: auto; }
.cup-note { margin: 0 0 8px; }
.cup-table th.cup-race, .cup-table td.cup-race { text-align: center; min-width: 54px; padding-left: 6px; padding-right: 6px; }
.cup-race-no { display: block; font-weight: 700; }
.cup-race-date, .cup-place { display: block; font-size: .72rem; font-weight: 400; color: var(--faint); }
.cup-pts { display: block; font-weight: 500; }
td.cup-race.dropped .cup-pts { text-decoration: line-through; color: var(--faint); font-weight: 400; }
td.cup-race.out .cup-pts { color: var(--faint); font-size: .8rem; }
td.cup-race.na { background: var(--surface-2); }
td.cup-total { font-size: 1.2rem; font-weight: 700; color: var(--blue-dark); }
.cup-races.pad { margin: 0; padding: 16px 24px 16px 46px; line-height: 1.9; }
.cup-legend { margin-top: 16px; }
.cup-race-name { font-weight: 500; }
@media (max-width: 640px) {
  .cup-table th.cup-race, .cup-table td.cup-race { min-width: 44px; }
  td.cup-total { font-size: 1.05rem; }
}

/* Race clock of a criterium-style laps race ("4 min + 1 krog"), above the standings */
.race-clock { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 20px; padding: 16px 24px; margin-bottom: 24px; }
.race-clock-time { font-size: 2.75rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.race-clock-label { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.race-clock[data-phase="overtime"] .race-clock-label, .race-clock[data-phase="final"] .race-clock-label { color: var(--red); }
.race-clock[data-phase="final"] { box-shadow: var(--shadow-card), inset 5px 0 0 var(--red); }
.race-clock[data-phase="finished"] .race-clock-label { color: var(--ok); }

/* ---------- 12. Organizer invitation (ui.js organizerCta) ---------- */
.org-cta { display: flex; align-items: center; gap: 14px 20px; flex-wrap: wrap; margin-top: 40px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text-2); }
.org-cta-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-fill); color: var(--primary); }
.org-cta-icon .icon { width: 22px; height: 22px; }
.org-cta-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.org-cta-text strong { color: var(--primary); }
.org-cta .btn { flex: 0 0 auto; text-decoration: none; }

/* ---------- 13. Marketing pages: Za organizatorje, O nas, Kontakt ---------- */
/* Icon tiles replace the emoji: same size and tint everywhere. */
.feature-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-fill); color: var(--primary); font-size: 1rem; }
.feature-icon .icon { width: 24px; height: 24px; }
.feature, .org-step { border-top: 0; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.feature:hover, .org-step:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.feature h3, .org-step h3, .org-process-step h3 { font-size: 1.05rem; font-weight: 700; margin-top: 14px; }
.org-lead { margin: -8px 0 20px; max-width: 70ch; line-height: 1.6; }
.org-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 8px; }
.org-step p { color: var(--muted); font-size: .9rem; margin: 8px 0 0; line-height: 1.55; }
.org-sports { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 36px; }
.org-sport { display: flex; gap: 14px; align-items: flex-start; }
.org-sport-name { font-weight: 700; margin-bottom: 2px; }
.org-sport .muted { font-size: .9rem; line-height: 1.5; }
.org-formats { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.org-format-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.org-more { margin: 16px 0 0; }
/* How we work: four numbered steps joined by a line. */
.org-process { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.org-process::before { content: ''; position: absolute; left: 12%; right: 12%; top: 42px; height: 2px; background: linear-gradient(90deg, var(--accent-fill), var(--primary), var(--accent-fill)); z-index: 0; }
.org-process-step { position: relative; z-index: 1; }
.org-process-no { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-blue); font-weight: 700; box-shadow: 0 0 0 6px var(--surface); }
.org-process-step p { font-size: .9rem; margin: 8px 0 0; line-height: 1.55; }
.why-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.why-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); line-height: 1.5; }
.why-list .icon { color: var(--primary); width: 22px; height: 22px; margin-top: 1px; }
/* Team avatars: brand tint instead of orange/green circles (those colours mean live/done). */
.av-orange, .av-green, .av-blue { background: var(--accent-fill); color: var(--primary); }
.contact-head .avatar { background: rgba(255,255,255,.14); color: var(--on-blue); box-shadow: 0 0 0 2px rgba(255,255,255,.45); }
.contact { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.contact:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.phone { display: inline-flex; align-items: center; gap: 8px; }
.phone .icon, .email-icon .icon { color: var(--primary); }
.email-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-fill); }
.email-icon .icon { width: 22px; height: 22px; }
.page-title.with-lead { margin-bottom: 6px; }

/* ---------- 14. Tekmovalci (pages/athlete.js) ---------- */
.athlete-search { padding-bottom: 16px; }
.search-field { position: relative; }
.search-field .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; pointer-events: none; }
.search-field input { padding-left: 44px; font-size: 1.05rem; min-height: 48px; }
.athlete-row { padding: 10px 24px; transition: background var(--dur); }
.athlete-row .icon.chev { color: var(--faint); transition: transform var(--dur) var(--ease), color var(--dur); }
.athlete-row:hover .icon.chev { transform: translateX(3px); color: var(--primary); }
.athlete-row-side { display: flex; align-items: center; gap: 12px; }
.athlete-row-facts { font-size: .85rem; text-align: right; }
.athlete-initials, .athlete-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-fill); color: var(--primary); font-weight: 700; font-size: .9rem; }
.athlete-avatar { width: 60px; height: 60px; font-size: 1.35rem; background: rgba(255,255,255,.14); color: var(--on-blue); box-shadow: 0 0 0 2px rgba(255,255,255,.4); }
.athlete-header .live-event-name { font-size: 1.7rem; }
.on-blue-btn { background: rgba(255,255,255,.14); color: var(--on-blue); border-color: rgba(255,255,255,.4); }
.on-blue-btn:hover { background: rgba(255,255,255,.24); }
.athlete-stats { margin-bottom: 8px; }
.athlete-cups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.athlete-cups .card + .card { margin-top: 0; }
.athlete-cup-title { text-decoration: none; justify-content: space-between; }
.athlete-cup-title:hover .muted { color: var(--primary); }
.athlete-cup-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.athlete-cup-body { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 8px 32px; align-items: start; }
.athlete-cup-rank, .athlete-cup-total { display: flex; flex-direction: column; }
.athlete-cup-rank .big, .athlete-cup-total .big { font-size: 2.3rem; font-weight: 700; line-height: 1.1; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
/* A podium cup place is underlined with its medal tint, like a highlighter. */
.athlete-cup-rank.p1 .big { box-shadow: inset 0 -.32em 0 var(--medal-1); }
.athlete-cup-rank.p2 .big { box-shadow: inset 0 -.32em 0 var(--medal-2); }
.athlete-cup-rank.p3 .big { box-shadow: inset 0 -.32em 0 var(--medal-3); }
.athlete-cup-races { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.athlete-cup-races li { display: grid; grid-template-columns: minmax(0, 1fr) auto 34px 46px; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line-table); }
.athlete-cup-races li:last-child { border-bottom: 0; }
.athlete-cup-races .race-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.athlete-cup-races a.race-label { color: inherit; text-decoration: none; }
.athlete-cup-races a.race-label:hover { color: var(--primary); text-decoration: underline; }
.athlete-cup-races .race-date { white-space: nowrap; }
.athlete-cup-races .race-place, .athlete-cup-races .race-pts { text-align: right; font-variant-numeric: tabular-nums; }
.athlete-cup-races .race-pts { font-weight: 600; }
.athlete-cup-races li.dropped .race-pts { text-decoration: line-through; color: var(--faint); font-weight: 400; }
.athlete-cup-races li.out { color: var(--faint); }
table.athlete-results td.pos { width: 84px; }
table.athlete-results td.pos .of { display: block; font-size: .72rem; font-weight: 400; color: var(--faint); margin-top: 2px; }
table.athlete-results td.name, table.athlete-results td.name .club { white-space: normal; }
table.athlete-results td.name a.competitor { color: var(--text); text-decoration: none; }
table.athlete-results td.name a.competitor:hover { color: var(--primary); text-decoration: underline; }
table.athlete-results td.status { width: 1%; white-space: nowrap; }
.athlete-note { margin: 24px 0 0; font-size: .85rem; }

/* ---------- 15. Responsive ---------- */
@media (max-width: 900px) {
  .hero-home { grid-template-columns: 1fr; gap: 28px; }
  .org-steps, .org-process { grid-template-columns: repeat(2, 1fr); }
  .org-process::before { display: none; }
  .org-sports { grid-template-columns: 1fr; }
  .why-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .stats-row:not(:has(.stat-wide)) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .stats-row:not(:has(.stat-wide)) .stat-card { padding: 16px 8px; }
  .stats-row:not(:has(.stat-wide)) .stat-value { font-size: 1.7rem; }
  .stats-row:not(:has(.stat-wide)) .stat-label { font-size: .8rem; }
  .hero { padding: 30px 20px; }
  .hero-search { flex-wrap: wrap; }
  .hero-search .btn { flex: 1 1 100%; }
  .hero-panel { padding: 18px; }
  .cta { padding: 32px 20px; }
  .live-header { padding: 16px; }
  .live-header-top { flex-direction: column; gap: 10px; }
  .live-status { justify-content: flex-start; }
  .live-controls { flex-direction: column; align-items: stretch; }
  .live-controls .pills { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .live-controls .pills::-webkit-scrollbar { display: none; }
  .pill { flex: 0 0 auto; min-height: 40px; }
  .view-toggle { align-self: flex-start; }
  .view-btn { min-height: 38px; }
  .board-host th.status, .board-host td.status { display: none; }
  .status-inline { display: block; margin-top: 4px; }
  .rank-badge { min-width: 26px; height: 26px; font-size: .9rem; padding: 0 5px; }
  .org-steps, .org-process { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-col a { padding: 9px 0; }
  .athlete-cups { grid-template-columns: 1fr; }
  .athlete-row { padding: 10px 16px; }
  .athlete-row-facts { display: none; }
  .athlete-header .live-event-name { font-size: 1.3rem; }
  table.athlete-results td.pos { width: 56px; }
  table.athlete-results td.time { font-size: 1rem; }
  table.athlete-results th:last-child, table.athlete-results td.status:empty { padding: 0; }
}

/* ---------- 16. Utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.footer-col a[hidden] { display: none; }
.lap-toggle { background: none; border: 0; padding: 0 6px 0 0; font: inherit; color: var(--muted); cursor: pointer; min-width: 20px; }
.lap-toggle:hover { color: var(--primary); }
.viewers[hidden] { display: none; }
h3.category-title { font-size: 1.15rem; }
.card-title .icon, .live-event-name .icon { color: inherit; }
/* Standings cards clip instead of hiding overflow: `overflow: hidden` made each card its own scroll
   container, so the sticky header row stuck to the card (and with the top bar offset, slid over the
   first row) instead of to the page. `clip` keeps the rounded corners without that side effect. */
.card.table-wrap { overflow: clip; }
@media (max-width: 1000px) { .card.table-wrap { overflow-x: auto; overflow-y: hidden; } }
thead th { background: var(--bg); }
thead th.current { background: var(--current); }
.athlete-cup-rank .big, .athlete-cup-total .big { align-self: flex-start; padding: 0 2px; }
.athlete-cups + .section-title, .stats-row + .section-title { margin-top: 40px; }

/* ---------- 17. Front page: live first (pages/home.js) ---------- */
/* Every running race at the very top, with a button straight into its running session. */
.live-now { display: block; padding: 28px 32px 32px; }
.live-now-head { display: flex; align-items: center; gap: 12px; }
.live-now-head .chip.live { font-size: .85rem; padding: 4px 14px; letter-spacing: .02em; }
.live-now-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 18px; }
.live-now-item { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 22px 24px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.live-now-grid.single .live-now-item { background: transparent; border: 0; padding: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.live-now-top { display: flex; align-items: center; gap: 16px; }
.live-now-top .event-logo { height: 52px; max-width: 120px; background: var(--surface); border-radius: 8px; padding: 4px; }
.live-now-title { min-width: 0; }
.live-now-name { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.live-now-grid.single .live-now-name { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.live-now-name a { color: inherit; text-decoration: none; }
.live-now-name a:hover { text-decoration: underline; text-underline-offset: 4px; }
.live-now-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 6px; color: var(--on-blue-soft); font-size: .95rem; }
.live-now-viewers { display: inline-flex; align-items: center; gap: 6px; }
.live-now-viewers[hidden] { display: none; }
.live-now-sessions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.live-now-sessions .btn-hero { font-size: 1.05rem; padding: 14px 26px; }
.live-now-sessions .btn-hero-ghost { padding: 12px 24px; }
.live-now-others { margin-top: 16px; color: var(--on-blue-soft); font-size: .9rem; }
.live-now-others a { color: var(--on-blue); }

/* Find your own results: second on the page, one slim card. */
.quick-search { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 24px; }
.quick-search-label { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; }
.quick-search-label strong { color: var(--primary); }
.quick-search-label .muted { font-size: .88rem; }
.quick-search .search-field { flex: 1 1 280px; }
.quick-search .search-field input { min-height: 44px; font-size: 1rem; }
.quick-search .btn { min-height: 44px; }
@media (max-width: 640px) {
  .live-now { padding: 20px 18px 22px; }
  .live-now-item { padding: 18px; }
  .live-now-top .event-logo { height: 40px; }
  .live-now-sessions .btn-hero { flex: 1 1 100%; justify-content: center; margin-top: 16px; }
  .quick-search .btn { flex: 1 1 100%; }
}

/* ---------- 18. Zdaj na progi (boards/on-course.js) ---------- */
/* The competitors on course right now, above the standings: bib, who, what they race against, and a
   running clock. Orange marks it as live; the clock itself stays in text colour for contrast. */
.onc { margin-bottom: 24px; box-shadow: var(--shadow-card), inset 4px 0 0 var(--orange); }
.onc-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px 10px 24px; }
.onc-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--warn-text); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.onc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: pulse-live 1.4s ease-in-out infinite; }
.onc-head .count { color: var(--muted); font-size: .85rem; }
.onc-list { list-style: none; margin: 0; padding: 0 0 6px; }
.onc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 10px 20px 10px 24px; border-top: 1px solid var(--line-table); }
.onc-row:first-child { border-top: 0; }
.onc-bib { min-width: 52px; height: 44px; padding: 0 10px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-dark); color: var(--on-blue); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.onc-who { display: flex; flex-direction: column; min-width: 0; }
.onc-who .competitor { font-size: 1.1rem; font-weight: 600; }
.onc-sub { color: var(--faint); font-size: .8rem; }
.onc-context { color: var(--text-2); font-size: .85rem; margin-top: 2px; }
.onc-time { display: flex; flex-direction: column; align-items: flex-end; }
.onc-clock { font-size: 1.9rem; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.01em; min-width: 4.5ch; text-align: right; }
.onc-label { color: var(--warn-text); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.onc-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }
.onc-start-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); margin-right: 4px; }
.onc-start-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--accent-fill); color: var(--primary); font-size: .85rem; }
.onc > .onc-start:first-child { border-top: 0; }
@media (max-width: 640px) {
  .onc-row { gap: 10px; padding: 10px 14px 10px 18px; }
  .onc-bib { min-width: 42px; height: 38px; font-size: 1.1rem; }
  .onc-clock { font-size: 1.5rem; }
  .onc-head, .onc-start { padding-left: 18px; padding-right: 14px; }
}
