:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --line: #e2e2e2;
  --accent: #1f5fbf;
  --accent-hover: #174a99;
  --result-bg: #f7f7f7;
  --max-width: 720px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.generator {
  padding: 1rem 0 1.5rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0.5rem 0 1rem;
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.controls label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted);
}

.controls label span {
  margin-bottom: 0.25rem;
}

select,
input[type="text"] {
  width: 100%;
  font-size: 1rem;
  padding: 0.6rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
}

#generate {
  grid-column: 1 / -1;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  margin-top: 0.25rem;
}

#generate:hover {
  background: var(--accent-hover);
}

#generate:active {
  transform: translateY(1px);
}

.results {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  /* Reserve space for the default 10 results so the pre-render
     doesn't shift the content below it (CLS). */
  min-height: 252px;
}

.results li {
  background: var(--result-bg);
  padding: 0.65rem 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  user-select: all;
  transition: background 0.15s;
}

.results li:hover {
  background: #ececec;
}

.results li.copied {
  background: #d4edda;
}

.more-options {
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.more-options summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  padding-top: 0.75rem;
}

.options-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted);
}

.options-grid label span {
  margin-bottom: 0.25rem;
}

.content {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.content--full {
  border-top: 0;
  padding-top: 1rem;
}

.content h1 {
  font-size: 1.5rem;
  margin: 0.5rem 0 1rem;
  font-weight: 700;
}

.content h2 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
}

.content h2:first-of-type {
  margin-top: 0.5rem;
}

.content p {
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.content p.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.content a {
  color: var(--accent);
}

.gear {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.75rem 0.9rem;
  margin: 1.25rem 0 0.5rem;
  background: var(--result-bg);
}

.gear h2 {
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
  font-weight: 600;
}

.gear ul {
  list-style: none;
  margin: 0 0 0.4rem;
  padding: 0;
}

.gear li {
  margin: 0.2rem 0;
  font-size: 0.95rem;
}

.gear a {
  color: var(--accent);
}

.gear .disclosure {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.race-index {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.75rem;
}

@media (min-width: 600px) {
  .race-index {
    grid-template-columns: repeat(3, 1fr);
  }
}

.contact-email {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 0;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (min-width: 600px) {
  .controls {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }

  #generate {
    grid-column: auto;
    margin-top: 0;
    padding: 0.6rem 1.25rem;
    height: fit-content;
  }

  .results {
    grid-template-columns: repeat(3, 1fr);
    min-height: 190px;
  }

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