html { font-synthesis: none; }
:root {
  --cream: #fff4df;
  --paper: #fffaf0;
  --ink: #06243f;
  --orange: #ff5a1f;
  --orange-text: #d23500;
  --blue: #d9f3f8;
  --line: 5px solid var(--ink);
  --shadow: 9px 9px 0 var(--ink);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--cream);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 90, 31, .14), transparent 23%),
    radial-gradient(circle at 82% 28%, rgba(99, 183, 199, .22), transparent 24%),
    repeating-linear-gradient(-35deg, rgba(255, 255, 255, .24) 0 12px, transparent 12px 24px),
    var(--cream);
}

a { color: inherit; text-decoration: none; }

.nav {
  position: sticky;
  top: 16px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  width: min(1320px, calc(100% - clamp(20px, 4vw, 64px)));
  margin: 16px auto 0;
}

.logo,
.nav-link,
.btn,
.card,
.row,
.badge {
  border: var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.logo {
  width: 170px;
  height: 78px;
  padding: 5px;
  border-radius: 20px;
  background: var(--cream);
  transform: rotate(-2deg);
}

.logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  transition: transform .14s, box-shadow .14s;
}

.language-flag {
  display: block;
  width: 25px;
  height: 17px;
  border: 1px solid rgba(6, 36, 63, .28);
  border-radius: 2px;
  object-fit: cover;
}

.nav-link.orange {
  color: var(--ink);
  background: var(--orange);
}

.nav-link:hover,
.nav-link:focus-visible,
.btn:hover,
.btn:focus-visible {
  transform: translate(5px, 5px) rotate(-1deg);
  box-shadow: 0 0 0 1px var(--ink);
}

main {
  width: min(1320px, calc(100% - clamp(20px, 4vw, 64px)));
  margin: 34px auto 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .58fr);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 34px;
}

.card {
  border-radius: 26px;
  padding: clamp(24px, 4vw, 42px);
  transform: rotate(var(--r, 0deg));
}

.hero-card { background: var(--paper); }
.side-card { background: var(--blue); }

.kicker,
.tag {
  display: inline-block;
  padding: 8px 12px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: var(--orange);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 14px 0 12px;
  line-height: .92;
  letter-spacing: -1px;
}

h1 {
  font-size: clamp(48px, 7vw, 98px);
  letter-spacing: -4px;
}

h2 {
  font-size: clamp(34px, 5vw, 62px);
}

h3 {
  font-size: clamp(25px, 3vw, 38px);
}

p {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.38;
}

.orange { color: var(--orange-text); }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 68px;
  padding: 14px 20px;
  border-radius: 22px;
  color: var(--ink);
  background: var(--orange);
  font-weight: 900;
  transition: transform .14s, box-shadow .14s;
}

.btn.secondary {
  color: var(--ink);
  background: var(--paper);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.leaderboard-filters {
  margin-bottom: 24px;
  background: var(--blue);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.filter-field {
  display: grid;
  gap: 7px;
  font-weight: 900;
}

.filter-field label,
.achievement-filter-title {
  font-size: 13px;
  text-transform: uppercase;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-height: 48px;
  border: 4px solid var(--ink);
  border-radius: 15px;
  padding: 8px 11px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-weight: 900;
}

.filter-reset {
  align-self: end;
  min-height: 48px;
  border-radius: 15px;
  cursor: pointer;
}

.achievement-filter-wrap {
  margin-top: 16px;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background: rgba(255, 250, 240, .72);
  overflow: hidden;
}

.achievement-filter-wrap summary {
  padding: 13px 15px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
}

.achievement-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 8px;
  padding: 0 15px 15px;
}

.achievement-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 9px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 900;
}

.achievement-filter input {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}

.filter-summary {
  margin-top: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.ranking {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.row {
  display: grid;
  grid-template-columns: 70px minmax(180px, 1.2fr) auto 104px minmax(190px, .9fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 20px;
  background: white;
  transform: none;
}

.row[hidden],
.no-results[hidden] {
  display: none;
}

.no-results {
  padding: 20px;
  border: var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-weight: 900;
  text-align: center;
}

.status {
  display: grid;
  place-items: center;
  width: 58px;
  min-height: 46px;
  border: 4px solid var(--ink);
  border-radius: 18px;
  color: var(--ink);
  background: var(--orange);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  line-height: .95;
}

.status.dark {
  background: var(--ink);
}

.rider strong {
  display: block;
  font-size: clamp(19px, 2.2vw, 27px);
  line-height: .95;
  font-weight: 900;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  font-weight: 900;
  font-size: 12px;
}

.pill.demo {
  color: var(--ink);
  background: var(--orange);
}

.time {
  min-width: 112px;
  padding: 11px 12px;
  border: 4px solid var(--ink);
  border-radius: 18px;
  color: white;
  background: var(--ink);
  text-align: center;
  font-size: 22px;
  font-weight: 900;
}

.course-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 10px 4px 5px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.course-pill img {
  width: 34px;
  height: 24px;
  object-fit: contain;
}

.highlight {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 5px 8px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--cream);
  box-shadow: 3px 3px 0 var(--orange);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.highlight img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(2px 3px 0 rgba(6, 36, 63, .18));
}

.highlight small {
  display: block;
  margin-bottom: 3px;
  color: var(--orange-text);
  font-size: 10px;
  text-transform: uppercase;
}

.achievement-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.achievement-dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 3px solid var(--ink);
  border-radius: 13px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: help;
}

.achievement-dot img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(2px 2px 0 rgba(6, 36, 63, .14));
}

.achievement-dot::after {
  content: attr(data-title);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 10;
  width: max-content;
  max-width: 220px;
  padding: 8px 10px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--orange);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .12s, transform .12s;
}

.achievement-dot:hover::after,
.achievement-dot:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.achievement-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(6, 36, 63, .42);
}

.achievement-modal.is-open {
  display: grid;
}

.achievement-dialog {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 22px;
  border: var(--line);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 10px 10px 0 rgba(255, 78, 24, .9);
}

.achievement-dialog header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.achievement-dialog h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
  line-height: .95;
}

.achievement-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  color: white;
  background: var(--ink);
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
}

.achievement-list {
  display: grid;
  gap: 12px;
}

.achievement-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--cream);
}

.achievement-card img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  padding: 4px;
  border-radius: 14px;
  background: transparent;
  filter: drop-shadow(2px 3px 0 rgba(6, 36, 63, .16));
}

.achievement-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1;
}

.achievement-card p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

footer {
  width: min(1320px, calc(100% - clamp(20px, 4vw, 64px)));
  margin: 0 auto 32px;
  padding: 20px;
  border: var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-weight: 900;
}

footer p {
  margin: 0;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
}

.footer-legal a {
  color: var(--ink);
  text-underline-offset: 4px;
  text-decoration-thickness: 3px;
}

.hero > *,
.card,
.row {
  min-width: 0;
  max-width: 100%;
}

h1,
h2,
h3,
.kicker,
.tag {
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .row { grid-template-columns: 1fr; }
  .time,
  .course-pill { justify-self: start; }
  .achievement-strip { justify-content: flex-start; }
}

@media (max-width: 860px) {
  .nav,
  .hero,
  .row {
    grid-template-columns: 1fr;
  }

  .nav {
    position: relative;
    top: auto;
  }

  .logo {
    width: 150px;
  }

  .time,
  .course-pill {
    width: fit-content;
  }

  .achievement-strip {
    justify-content: flex-start;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .card { transform: none; }

  h1,
  h2,
  h3,
  .kicker,
  .tag {
    overflow-wrap: anywhere;
  }

  h1 {
    font-size: clamp(40px, 10vw, 62px);
    letter-spacing: 0;
  }

  .achievement-dot::after { display: none; }
}
