/*
 * Live blog and livestream.
 *
 * These pages link this file directly while sitting on the public layout,
 * which never loaded vars.css — so --color-btn, --color-red, --color-2 and
 * --color-0-opacity were undefined here and those declarations were dropped.
 * It now uses the shared tokens, which also retires the third stray green
 * (#2A8055) that lived in this file.
 */

/*
 * Eigen signaalkleuren. Deze horen NIET in tokens.css: ze markeren
 * diskwalificatie en een volle pull, wat alleen deze pagina kent. Ze staan
 * hier als token zodat ze niet opnieuw als losse hexes wegdrijven.
 *
 * De --*-text varianten bestaan omdat de felle waarden als tekst zakken:
 * #C96E5F haalt 3.57:1 op wit. De vlakken houden hun kleur, de tekst niet.
 */
.live-blog-section {
  --dsq:         #C96E5F;
  --dsq-text:    #A8452F; /* 5.90:1 op wit, 5.55:1 op --dsq-vlak */
  --dsq-vlak:    #FFF6F4;
  --dsq-rand:    #F0CFC8;
  --vol:         #E8A317;
  --ster:        #FFE680;
}
.live-blog-section {
  background: linear-gradient(180deg, var(--surface-soft) 0%, var(--surface) 360px);
  min-height: 80vh;
  padding-bottom: 6rem;
  font-family: 'Outfit', sans-serif;
}

.live-blog__live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(0, 0, 0, 0.28);
  color: var(--surface);
  padding: 0.4rem 0.95rem 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.live-blog__live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--dsq);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(201, 110, 95, 0.7);
}

.live-blog__live-badge--connected .live-blog__live-dot {
  animation: live-blog-pulse 1.6s infinite;
}

@keyframes live-blog-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(201, 110, 95, 0.75);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(201, 110, 95, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(201, 110, 95, 0);
  }
}

.live-blog__feed {
  display: flex;
  flex-direction: column;
}

.live-blog__cards {
  display: flex;
  flex-direction: column;
}

.live-blog__cards > .live-blog__card {
  margin-bottom: 1rem;
}

.live-blog__cards > .live-blog__card:last-child {
  margin-bottom: 0;
}

.live-blog__empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.live-blog__card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 0.85rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(40, 90, 65, 0.04);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background-color 0.4s ease;
  position: relative;
  overflow: hidden;
}

.live-blog__card:hover {
  border-color: var(--brand-bright);
  box-shadow: 0 6px 18px rgba(40, 90, 65, 0.1);
  transform: translateY(-1px);
}

.live-blog__card--new {
  animation: live-blog-enter 0.55s cubic-bezier(0.2, 0.9, 0.25, 1) both, live-blog-highlight 1.4s ease-out 0.55s both;
}

@keyframes live-blog-enter {
  0% {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    border-bottom-width: 0;
    transform: translateY(-8px);
  }
  100% {
    opacity: 1;
    max-height: 360px;
    margin-bottom: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top-width: 1.5px;
    border-bottom-width: 1.5px;
    transform: translateY(0);
  }
}

@keyframes live-blog-highlight {
  0% {
    background: linear-gradient(180deg, var(--surface-soft) 0%, var(--surface) 100%);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(50, 153, 98, 0.22), 0 8px 22px rgba(40, 90, 65, 0.14);
  }
  100% {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(40, 90, 65, 0.04);
  }
}

.live-blog__card--leaving {
  animation: live-blog-leave 0.35s ease-in both;
  pointer-events: none;
}

@keyframes live-blog-leave {
  0% {
    opacity: 1;
    max-height: 360px;
    margin-bottom: 1rem;
  }
  100% {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    border-bottom-width: 0;
    transform: translateY(-4px);
  }
}

.live-blog__card--updated {
  animation: live-blog-flash 0.9s ease-out both;
}

@keyframes live-blog-flash {
  0%, 100% {
    background: var(--surface);
  }
  35% {
    background: var(--surface-soft);
  }
}

.live-blog__card--dsq {
  background: var(--dsq-vlak);
  border-color: var(--dsq-rand);
}

.live-blog__card--dsq:hover {
  border-color: var(--live);
}

.live-blog__card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.7rem;
}

.live-blog__time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Same look as an unselected class chip on the standings page. */
.live-blog__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  white-space: nowrap;
}

.live-blog__pill-num {
  display: inline-grid;
  place-items: center;
  min-inline-size: 1.6rem;
  block-size: 1.6rem;
  border-radius: 999px;
  background: var(--surface-soft);
  font-weight: 700;
}

.live-blog__distance-badge {
  margin-left: auto;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-bright) 100%);
  color: var(--surface);
  padding: 0.35rem 0.85rem;
  border-radius: 0.5rem;
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 6px rgba(50, 153, 98, 0.25);
}

.live-blog__distance-unit {
  font-size: 0.75em;
  opacity: 0.85;
  margin-left: 0.1rem;
}

.live-blog__distance-badge--full {
  background: linear-gradient(135deg, var(--vol) 0%, var(--dsq) 100%);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 10px rgba(232, 163, 23, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: help;
}

.live-blog__star {
  display: inline-block;
  color: var(--ster);
  font-size: 1.05em;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(255, 230, 128, 0.6));
  animation: live-blog-star-spin 2.4s ease-in-out infinite;
}

@keyframes live-blog-star-spin {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(15deg) scale(1.15);
  }
}

.live-blog__lane {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.live-blog__pull-label--full {
  color: var(--dsq-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.live-blog__card-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.live-blog__name-row {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.live-blog__name {
  font-weight: 700;
  color: var(--brand);
  font-size: 1.1rem;
}

.live-blog__start-nr {
  color: var(--text-subtle);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.live-blog__tractor {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.live-blog__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.live-blog__text strong {
  color: var(--brand);
  font-weight: 800;
}

.live-blog__text--dsq {
  color: var(--live-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .live-blog__card {
    padding: 0.9rem 1rem;
  }
  .live-blog__card-header {
    gap: 0.5rem;
  }
  .live-blog__distance-badge {
    font-size: 0.9rem;
    padding: 0.3rem 0.65rem;
  }
  .live-blog__name {
    font-size: 1rem;
  }
  .live-blog__text {
    font-size: 0.92rem;
  }
}

/* ------------------------------------------------ compact live layout */

/* A narrow bar that stays put: logo, the four live tabs and the language. */
.live-balk {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background-color: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--border);
}

.live-balk__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-block-size: 3.25rem;
}

.live-balk__merk { flex: 0 0 auto; display: flex; }
.live-balk__logo { inline-size: 2.25rem; block-size: auto; }

.live-balk .live-tabs {
  flex: 1;
  min-inline-size: 0;
}

.live-balk .taal--header { display: block; flex: 0 0 auto; }

@media (max-width: 40rem) {
  .live-balk .taal__label,
  .live-balk .taal__pijl { display: none; }
  .live-balk .taal__knop { padding: 0.35rem 0.5rem; }
}

.live-tabs {
  display: flex;
  gap: 0.1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.live-tabs::-webkit-scrollbar { display: none; }

@media (max-width: 40rem) {
  .live-tabs { mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%); }
}

.live-tabs__tab {
  flex: 0 0 auto;
  padding: 0.95rem 0.7rem 0.8rem;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.live-tabs__tab:hover { color: var(--text); }

.live-tabs__tab--actief {
  color: var(--text);
  border-bottom-color: var(--brand-bright);
}

/* The green header, now one line: status, title, edition and the edition picker. */
.live-kop {
  margin-bottom: 1.25rem;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-bright) 100%);
  color: var(--surface);
}

.live-kop__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  padding-block: 0.7rem;
}

.live-kop .live-blog__live-badge {
  padding: 0.25rem 0.7rem 0.25rem 0.55rem;
  font-size: 0.7rem;
}

.live-kop__titel {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--surface);
}

.live-kop__editie-naam {
  font-size: 0.875rem;
  opacity: 0.9;
}

.live-kop__tools { margin-inline-start: auto; }

.live-kop__tools select {
  appearance: none;
  min-inline-size: 11rem;
  padding: 0.35rem 2.2rem 0.35rem 0.8rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  border: 1px solid rgb(255 255 255 / 0.5);
  border-radius: 999px;
  background-color: rgb(0 0 0 / 0.2);
  color: var(--surface);
  font: inherit;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
}

.live-kop__tools select option { color: var(--text); }

@media (max-width: 40rem) {
  .live-kop__editie-naam { display: none; }
  .live-kop__tools { margin-inline-start: 0; inline-size: 100%; }
  .live-kop__tools select { inline-size: 100%; }
}

.live-modus .live-blog-section { padding-bottom: 2rem; }

/* One thin line instead of the full site footer. */
.live-voet {
  border-block-start: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.live-voet__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 1rem;
}

.live-voet a { color: var(--brand); font-weight: 600; }

/* --------------------------------------------------------- live standings */

.klasse-chips {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.klasse-chips::-webkit-scrollbar { display: none; }

@media (max-width: 48rem) {
  .klasse-chips { mask-image: linear-gradient(90deg, #000 calc(100% - 1.5rem), transparent 100%); }
}

@media (min-width: 48rem) {
  .klasse-chips {
    flex-wrap: wrap;
    overflow: visible;
  }
}

.klasse-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}

.klasse-chip:hover { border-color: var(--brand-bright); }

/* A chip without a class number, like "Alle", keeps the same height and even padding. */
.klasse-chip:not(:has(.klasse-chip__nr)) {
  min-block-size: 2.4rem;
  padding-inline: 1rem;
}

.klasse-chip__nr {
  display: inline-grid;
  place-items: center;
  min-inline-size: 1.6rem;
  block-size: 1.6rem;
  border-radius: 999px;
  background: var(--surface-soft);
  font-weight: 700;
}

.klasse-chip--actief {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.klasse-chip--actief .klasse-chip__nr {
  background: rgb(255 255 255 / 0.2);
}

.uitslagen {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  overflow: hidden;
}

.uitslagen th {
  padding: 0.65rem 0.75rem;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: start;
  border-bottom: 1px solid var(--border);
}

.uitslagen td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.uitslagen tbody tr:last-child td { border-bottom: 0; }
.uitslagen :is(th, td):first-child { padding-inline-start: 1rem; inline-size: 3.25rem; }
.uitslagen :is(th, td):last-child { padding-inline-end: 1rem; }

.uitslagen__getal {
  text-align: end !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.uitslagen__naam {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.uitslagen__sub {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.uitslagen__totaal {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.uitslagen__rij--dsq { opacity: 0.6; }

.uitslagen tr.row-updated td {
  background: var(--surface-soft);
  transition: background-color 0.4s;
}

.plek {
  display: inline-grid;
  place-items: center;
  min-inline-size: 2.1rem;
  block-size: 2.1rem;
  padding-inline: 0.3rem;
  border-radius: 999px;
  background: var(--surface-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plek--1 { background: #f6e3a1; color: #6b4e00; }
.plek--2 { background: #e3e6ea; color: #3f4650; }
.plek--3 { background: #f0d2b8; color: #6d3a12; }
.plek--dsq { background: #f8d7da; color: #721c24; font-size: 0.75rem; }
.plek--ns { background: var(--status-neutral-bg, #e9ecef); color: var(--status-neutral-text, #495057); font-size: 0.75rem; }

@media (max-width: 47.99rem) {
  .uitslagen__breed { display: none; }
}

/* ------------------------------------------------------- participant list */

.deelnemers-klasse { margin-bottom: 2rem; }

.deelnemers-klasse__kop {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.6rem;
}

.deelnemers-klasse__kop h2 {
  margin: 0;
  font-size: 1.25rem;
}

.deelnemers-klasse__bezetting {
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.deelnemers-klasse__bezetting--vol { color: var(--brand); }

.deelnemers {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  overflow: hidden;
}

.deelnemers__rij {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.65rem 1rem;
}

.deelnemers__rij + .deelnemers__rij { border-top: 1px solid var(--border); }

.deelnemers__nr {
  justify-self: start;
  padding: 0.2rem 0.55rem;
  border-radius: 0.4rem;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.deelnemers__naam {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.deelnemers__sub,
.deelnemers__trekker {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@media (max-width: 47.99rem) {
  .deelnemers__rij { grid-template-columns: 3.75rem minmax(0, 1fr); }
  .deelnemers__trekker { grid-column: 2; }
}

/* Tractor on the track right now */
.uitslagen__rij--baan td {
  background: var(--status-paid-bg, #e6f4ea);
}

.op-de-baan {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--status-paid-text, #1e5631);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.live-blog__card--on-track {
  border-left: 4px solid var(--status-paid-text, #1e5631);
}

.live-blog__card--announcement {
  border-left: 4px solid #f2b705;
  background: #fffbea;
}

.live-blog__text--announcement {
  font-size: 1.1rem;
  font-weight: 700;
}
