
:root {
  /* Ground: near-black with a navy cast, not a flat grey. */
  --bg: #05080f;
  --panel: #0b111c;
  --panel-2: #111a29;
  --line: #1b2536;
  --line-soft: #141c29;

  --text: #f2f6fb;
  --muted: #9aa8bf;
  --dim: #64728c;

  /* Cayman Autosport blue, sampled from Branding/CAS Logo Dark
     Background.png: the mark is #3b88c8 over #212d65 with #d3d3d5 type.
     The navy is the ground and the washes below; the blue is the accent.
     One accent, used sparingly.
     --accent is decoration only (5.2:1 on the ground, comfortably past the
     3:1 UI-component floor). Solid buttons use the slightly deeper
     --accent-press so white button text clears 4.5:1, and lift to --accent
     on hover. */
  --accent: #3b88c8;
  --accent-press: #2b74ad;
  --accent-soft: #6aa9df;
  --accent-line: #27366b;
  --accent-wash: #101a34;

  --gold: #d9b978;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          sans-serif;

  --shell: 1140px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-soft); outline-offset: 2px;
}

/* ----------------------------------------------------------------- shell */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(5, 8, 15, .93); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .inner {
  max-width: var(--shell); margin: 0 auto; padding: 13px 22px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
/* The official mark, at its own proportions. Height is set; width follows,
   so the artwork is never stretched. */
.logo { display: flex; align-items: center; gap: 13px; min-width: 0; }
.logo img { height: 26px; width: auto; display: block; }
.logo .rc {
  padding-left: 13px; border-left: 1px solid var(--line);
  font-size: 12px; font-weight: 700; letter-spacing: .17em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.menu { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.menu a {
  padding: 8px 14px; border-radius: 7px; font-size: 13.5px; font-weight: 600;
  letter-spacing: .02em; color: var(--muted);
}
.menu a:hover { color: var(--text); background: var(--panel-2); }
.menu a.on {
  color: var(--text); background: var(--panel-2);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.wrap { max-width: var(--shell); margin: 0 auto; padding: 30px 22px 72px; }

/* ------------------------------------------------------------------ hero */
.hero {
  border: 1px solid var(--line); border-radius: 16px;
  background:
    radial-gradient(90% 130% at 8% 0%, #16224a 0%, #0a1020 52%, #05080f 100%);
  padding: 38px 30px; margin-bottom: 28px;
}
.hero .eyebrow {
  color: var(--accent-soft); font-size: 11px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; margin-bottom: 12px;
}
.hero h1 {
  margin: 0 0 10px; font-size: 32px; line-height: 1.12; letter-spacing: -.02em;
  font-weight: 700;
}
.hero p { margin: 0; color: var(--muted); max-width: 60ch; }

/* The homepage masthead: the mark, then the product name, given room. */
.masthead {
  border: 1px solid var(--line); border-radius: 16px;
  background:
    radial-gradient(80% 140% at 6% 0%, #1a2757 0%, #0a1122 50%, #05080f 100%);
  padding: 52px 32px 46px; margin-bottom: 26px;
}
.masthead .mark {
  height: 60px; width: auto; display: block; margin-bottom: 26px;
}
.masthead h1 {
  margin: 0; font-size: 54px; line-height: .98; letter-spacing: .01em;
  text-transform: uppercase; font-weight: 800;
}
.masthead h1 .thin { display: block; font-weight: 300; color: var(--accent-soft); }
.masthead p {
  margin: 20px 0 0; color: var(--muted); max-width: 56ch; font-size: 16.5px;
}
.rule {
  height: 2px; width: 74px; background: var(--accent); border-radius: 2px;
  margin: 22px 0 0;
}

/* ----------------------------------------------------------------- cards */
h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim); margin: 0 0 14px;
}
h3 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.01em; font-weight: 700; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 13px; overflow: hidden; margin-bottom: 24px;
}
.card.feature { border-color: var(--accent-line); }
.card .head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.card .head h2 { margin: 0; }
.card .head .more {
  margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent-soft);
}
.card .head .more:hover { color: var(--text); }
.card .body { padding: 20px; }
.card .foot {
  padding: 16px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}

.grid { display: grid; gap: 18px; }
@media (min-width: 900px) { .grid.two { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- tables */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 11px 16px; font-size: 10.5px; font-weight: 700;
  color: var(--dim); letter-spacing: .13em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
tbody tr.p1 { background: var(--accent-wash); }
tbody tr.p1:hover { background: #15224a; }

.num {
  text-align: right; font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
/* The subject of the page. */
.time {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 16.5px; letter-spacing: -.01em;
  white-space: nowrap;
}
tr.p1 .time { color: #fff; }
.pos {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 15px; color: var(--dim); width: 46px;
}
tr.p1 .pos { color: var(--gold); }
.name { font-weight: 600; }
.name .car {
  display: none; font-weight: 400; font-size: 12.5px; color: var(--dim);
  margin-top: 2px;
}
.sub { color: var(--dim); font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.link { color: var(--accent-soft); font-weight: 600; }
.link:hover { color: var(--text); }
.rowlink { display: block; color: inherit; }

/* ------------------------------------------------------------------ tags */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; border: 1px solid var(--line);
  color: var(--muted); background: var(--panel-2); white-space: nowrap;
}
.tag.live { color: #7fe0ac; border-color: #1d4433; background: #0b1d16; }
.tag.done { color: var(--muted); }
.tag.cls { color: var(--accent-soft); border-color: var(--accent-line);
           background: var(--accent-wash); }

/* --------------------------------------------------------------- pickers */
.picker { display: grid; gap: 14px; }
@media (min-width: 760px) {
  /* Game, track, vehicle type, go. The track gets the most room because it
     carries the longest names. */
  .picker { align-items: end;
            grid-template-columns: minmax(150px, .8fr) minmax(190px, 1.4fr)
                                   minmax(140px, .85fr) auto; }
}
/* A game selector with a single game is shown, but is plainly not a
   decision: it says what you are looking at rather than asking. */
.field select:disabled {
  color: var(--muted); opacity: 1; -webkit-text-fill-color: var(--muted);
}
.field { display: block; }
.field .k {
  display: block; color: var(--dim); font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: 7px;
}
.field select {
  width: 100%; font: inherit; font-size: 15px; border-radius: 9px;
  padding: 12px 13px; min-height: 48px; color: var(--text);
  border: 1px solid var(--line); background: var(--bg);
}
.field select:hover { border-color: var(--accent-line); }
.btn {
  font: inherit; font-size: 15px; font-weight: 700; letter-spacing: .02em;
  border: 0; border-radius: 9px; padding: 12px 26px; min-height: 48px;
  background: var(--accent-press); color: #fff; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--accent); }
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--accent-line);
}
.btn.ghost:hover { background: var(--panel-2); border-color: var(--accent); }
a.btn { display: inline-block; text-align: center; line-height: 24px; }

/* ----------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
         margin-bottom: 26px; }
@media (min-width: 660px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px;
}
.stat .n {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 26px; font-weight: 700; letter-spacing: -.02em;
}
.stat .k {
  color: var(--dim); font-size: 10.5px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; margin-top: 4px;
}

/* ------------------------------------------------------------ definitions */
.meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 18px 24px;
}
.meta .k, .label {
  color: var(--dim); font-size: 10.5px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase;
}
.label { display: block; margin-bottom: 4px; }
.meta .v { margin-top: 4px; font-weight: 600; }

/* The podium strip on the homepage feature. */
.podium { display: grid; gap: 1px; background: var(--line-soft); }
.podium .slot {
  background: var(--panel); display: flex; align-items: center; gap: 14px;
  padding: 15px 20px;
}
.podium .slot.first { background: var(--accent-wash); }
.podium .rank {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  color: var(--dim); width: 22px; flex: none;
}
.podium .slot.first .rank { color: var(--gold); }
.podium .who { min-width: 0; flex: 1 1 auto; }
.podium .who .d { font-weight: 600; }
.podium .who .c {
  color: var(--dim); font-size: 12.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.podium .t {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 16.5px; flex: none;
}

/* ---------------------------------------------------------------- states */
.note {
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: var(--accent-wash); color: var(--muted); font-size: 13px;
}
.note strong { color: var(--text); font-weight: 600; }

/* Category chips on the circuit index: one circuit, its categories. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { display: inline-block; }
.chips a:hover .tag { color: var(--text); border-color: var(--accent); }

.empty { padding: 52px 24px; text-align: center; color: var(--dim); }
.empty strong { display: block; color: var(--muted); font-size: 16px;
                font-weight: 600; margin-bottom: 6px; }
.empty .code {
  font-family: var(--mono); font-size: 40px; color: var(--line);
  font-weight: 700; margin-bottom: 10px;
}

footer {
  border-top: 1px solid var(--line); color: var(--dim); font-size: 12.5px;
  text-align: center; padding: 30px 22px 48px;
}
footer .gen { display: block; margin-top: 6px; color: var(--line); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 720px) {
  .top .inner { padding: 11px 16px; gap: 10px; }
  /* The four sections have to fit on one line next to the wordmark. */
  .menu a { padding: 7px 9px; font-size: 12.5px; }
  .logo img { height: 21px; }
  .logo { gap: 10px; }
  .logo .rc { padding-left: 10px; font-size: 10px; letter-spacing: .13em; }
  .wrap { padding: 22px 16px 56px; }
  .masthead { padding: 38px 22px 34px; }
  .masthead h1 { font-size: 38px; }
  .masthead .mark { height: 38px; margin-bottom: 20px; }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 26px; }
  .card .head, .card .body, .card .foot { padding-left: 16px; padding-right: 16px; }
  thead th, tbody td { padding: 12px 9px; }
  .pos { width: 34px; font-size: 14px; }
  .time { font-size: 15.5px; }
  /* The car is required reading on a leaderboard, so on a narrow screen it
     moves under the driver rather than being dropped with the other
     secondary columns. */
  .name .car { display: block; }
  .hide-s { display: none; }
  .podium .slot { padding: 13px 16px; }
}
