:root {
  --tdm-red: #ff1b00;
  --tdm-red-dark: #c81707;
  --ink: #000;
  --muted: #000;
  --line: #e2e2e2;
  --soft: #f6f6f4;
  --white: #fff;
  --focus: #005fcc;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.page-header,
.page-main {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.page-header {
  position: relative;
  padding: 28px 0 18px;
  text-align: center;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 8px;
}

.brand-logo {
  width: min(130px, 42vw);
  height: auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--tdm-red-dark);
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.lead {
  max-width: 720px;
  margin: 14px auto 0;
  color: #000;
  font-size: 1.08rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.page-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--tdm-red);
  border-radius: 6px;
  background: var(--tdm-red);
  color: var(--white);
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.page-actions a:hover {
  background: var(--tdm-red-dark);
  border-color: var(--tdm-red-dark);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.summary-item {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.summary-value,
.summary-label {
  display: block;
}

.summary-value {
  font-size: 1.75rem;
  font-weight: 800;
}

.summary-label {
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(145px, .7fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #000;
  font-size: .86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.toolbar input,
.toolbar select,
.toolbar button {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.toolbar input,
.toolbar select {
  padding: 9px 11px;
}

.toolbar button {
  padding: 9px 14px;
  background: var(--tdm-red);
  border-color: var(--tdm-red);
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
}

.toolbar button:hover {
  background: var(--tdm-red-dark);
  border-color: var(--tdm-red-dark);
}

.toolbar input:focus,
.toolbar select:focus,
.toolbar button:focus {
  outline: none;
}

.toolbar input:focus-visible,
.toolbar select:focus-visible,
.toolbar button:focus-visible,
.brand-link:focus-visible,
.page-actions a:focus-visible,
.footer-logos a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.toolbar button:active {
  transform: translateY(1px);
}

.result-line {
  margin: 14px 2px 8px;
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.start-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
}

.start-table caption {
  padding: 14px 16px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
  text-align: left;
}

.start-table th,
.start-table td {
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.start-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1f1f1f;
  color: var(--white);
  font-size: .86rem;
  text-transform: uppercase;
}

.start-table tbody tr:nth-child(even) {
  background: #fbfbfb;
}

.start-table tbody tr:hover {
  background: #fff4f2;
}

.start-table tfoot td {
  border-top: 1px solid var(--line);
  background: var(--white);
}

.status-legend {
  color: var(--ink);
  font-size: .94rem;
  font-weight: 700;
}

.status-legend-item {
  display: inline;
}

.start-table tbody tr[hidden] {
  display: none !important;
}

.start-table tbody tr.is-invalid td {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #000;
}

.time-cell {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--tdm-red-dark);
  white-space: nowrap;
}

.bib-cell {
  font-weight: 900;
  white-space: nowrap;
}

.finish-cell {
  font-weight: 900;
  white-space: nowrap;
}

.gap-cell {
  font-weight: 900;
  white-space: nowrap;
}

.name-cell {
  font-weight: 800;
}

.family-name {
  font-weight: 900;
}

.muted-cell {
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
}

.country-chip {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  gap: 6px;
}

.country-flag {
  display: inline-block;
  width: 22px;
  height: 15px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 2px;
  object-fit: cover;
  background: #fff;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  margin-top: 54px;
  padding: 0 16px 0;
  background: var(--soft);
  color: var(--ink);
  text-align: center;
}

.footer-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 0 0 42px;
  padding-top: 30px;
}

.footer-logos a {
  display: inline-flex;
  border-radius: 8px;
}

.footer-logos img {
  display: block;
  max-width: 30vw;
  object-fit: contain;
}

.footer-copy {
  margin: 0 0 76px;
}

.registered-mark {
  position: relative;
  top: -0.45em;
  margin-left: 1px;
  font-size: 0.58em;
  line-height: 0;
}

#footer .container {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#footer .bear {
  width: 240px;
  animation: updown 2s infinite alternate;
}

#footer .bear__ears {
  display: flex;
  justify-content: space-between;
  animation: updown 2s infinite alternate;
  transform: translateY(10px);
}

#footer .bear__ears .ear {
  width: 50px;
  height: 60px;
  background: #120c0a;
}

#footer .bear__ears__left {
  border-radius: 50% 100%;
}

#footer .bear__ears__right {
  border-radius: 100% 50%;
}

#footer .bear__body {
  width: 100%;
  height: 230px;
  background: #120c0a;
  border-radius: 50% / 40% 40% 60% 60%;
}

#footer .bear__eyes {
  display: flex;
  justify-content: space-around;
  position: relative;
  transform: translateY(60px);
  transition: all .3s linear;
}

#footer .bear__eyes .eye {
  width: 20px;
  height: 15px;
  position: absolute;
  background: #fff;
  border-radius: 50% / 40% 40% 60% 60%;
  animation: blink .5s infinite alternate;
  transition: all .3s ease;
}

#footer .bear__eyes--left {
  left: 50px;
  transform: skewY(5deg);
}

#footer .bear__eyes--right {
  right: 50px;
  transform: skewY(-5deg);
}

#footer .bear__nose {
  position: relative;
  width: 80px;
  height: 100px;
  margin: auto;
  background: #fff;
  transform: translateY(80px);
  border-radius: 50% / 60% 60% 30% 30%;
  animation: moveNose 3s infinite;
  transition: .4s ease;
}

#footer .bear__nose--inner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 26px;
  background: #000;
  transform: translate(-50%, -50%);
  border-radius: 50% / 40% 40% 60% 60%;
  animation: flip .5s infinite alternate;
}

#footer .bear__nose--inner::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 20px;
  height: 20px;
  background: #000;
  border-radius: 50px;
  transform: translate(-50%);
  box-shadow: 20px 5px 0 #fff, -20px 5px 0 #fff;
}

#footer .shadow {
  display: block;
  width: 200px;
  height: 30px;
  margin: -20px auto 0;
  background: #000;
  opacity: .6;
  border-radius: 100%;
  transform: translateY(60px);
  filter: blur(17px);
  animation: shadow 2s infinite alternate;
}

@keyframes updown {
  to {
    transform: translateY(40px);
  }
}

@keyframes blink {
  from {
    height: 0;
  }

  to {
    height: 15px;
  }
}

@keyframes moveNose {
  0%,
  90%,
  100% {
    transform: translateY(80px);
  }

  20%,
  30% {
    transform: translate(20px, 60px);
  }

  60%,
  70% {
    transform: translate(-20px, 60px);
  }
}

@keyframes flip {
  to {
    transform: translate(-50%, -50%) rotateY(180deg);
  }
}

@keyframes shadow {
  from {
    width: 200px;
  }

  to {
    width: 150px;
  }
}

@media (max-width: 900px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .search-box {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .page-header,
  .page-main,
  .site-footer {
    width: min(100% - 20px, 1180px);
  }

  .site-footer {
    width: 100%;
    padding-inline: 10px;
  }

  .footer-logos {
    gap: 10px;
    margin-bottom: 34px;
  }

  .footer-logos img {
    max-width: 29vw;
    height: auto;
  }

  #footer .bear {
    width: 210px;
  }

  #footer .bear__body {
    height: 205px;
  }

  .summary-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .summary-item {
    min-height: auto;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .start-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .start-table caption {
    padding-inline: 0;
  }

  .start-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .start-table tbody tr {
    display: grid;
    gap: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
  }

  .start-table tbody tr:nth-child(even),
  .start-table tbody tr:hover {
    background: var(--white);
  }

  .start-table td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-top: 0;
  }

  .start-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .start-table tfoot td {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
  }

  .start-table tfoot td::before {
    content: none;
  }

  .status-legend-item {
    display: block;
  }

  .status-legend-item + .status-legend-item {
    margin-top: 4px;
  }

  .start-table .name-cell {
    display: block;
    padding-left: 118px;
    position: relative;
  }

  .start-table .name-cell::before {
    left: 0;
    position: absolute;
    top: 7px;
    width: 108px;
  }

  .time-cell {
    font-size: 1.45rem;
  }
}
