/* DataCycling — minimal, readable, mobile-first */

:root {
  --bg: #0f0f0f;
  --fg: #e8e8e8;
  --accent: #e8c547;
  --muted: #888;
  --max-width: 720px;
  --font: system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --fg: #111;
    --accent: #c8a000;
    --muted: #555;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  line-height: 1.6;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */

header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #222;
}

.site-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg);
}

/* Main */

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
  width: 100%;
}

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent);
}

.tagline {
  font-size: 1.2rem;
  color: var(--muted);
}

.coming-soon {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.description {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
  max-width: 540px;
}

/* Footer */

footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid #222;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Responsive */

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  main {
    padding: 2.5rem 1.25rem;
  }
}

/* -------------------------
   Race page
   ------------------------- */

.race-page main,
main {
  max-width: 900px;
}

.race-header {
  margin-bottom: 2rem;
}

.race-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.race-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.race-date,
.race-category {
  font-weight: 600;
}

.race-profile {
  text-transform: capitalize;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  font-size: 0.8rem;
}

.profile-cobbled  { background: #3a2e1a; color: #d4a017; }
.profile-sprinter { background: #1a2e3a; color: #17a0d4; }
.profile-punchy   { background: #1a3a2a; color: #17d476; }
.profile-hilly    { background: #2a1a3a; color: #a017d4; }

/* Predictions section */

.predictions h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* Table scroll wrapper */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pred-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.pred-table thead th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #333;
  white-space: nowrap;
}

.pred-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.pred-table td {
  padding: 0.35rem 0.6rem;
  vertical-align: middle;
  border-bottom: 1px solid #1e1e1e;
}

/* Column widths */
.col-rank  { width: 2.5rem; color: var(--muted); font-size: 0.8rem; text-align: right; }
.col-flag  { width: 1.8rem; text-align: center; }
.col-rider { font-weight: 600; white-space: nowrap; }
.col-team  { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.col-prob  { width: 110px; }

/* Probability bars */
.prob-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.prob-bar {
  display: inline-block;
  height: 6px;
  border-radius: 3px;
  min-width: 1px;
  max-width: 60px;
  flex-shrink: 0;
}

.prob-win    { background: var(--accent); }
.prob-podium { background: #5cb85c; }
.prob-top10  { background: #5bc0de; }

.prob-label {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

/* Flag emoji fallback - country code spans */
.flag {
  display: inline-block;
  width: 1.2em;
  font-size: 0.85rem;
  text-align: center;
}

/* Model info footer */
.model-info {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #222;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Upcoming races section */
.upcoming-races {
  margin-top: 2.5rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* Race list on homepage */
.race-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.race-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid #222;
  border-radius: 6px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s;
}

.race-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.race-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}

.race-card-date {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Responsive: hide team column on small screens */
@media (max-width: 600px) {
  .col-team { display: none; }
  .col-prob { width: 80px; }
  .prob-bar { max-width: 35px; }
}

@media (prefers-color-scheme: light) {
  .pred-table tbody tr:hover {
    background: rgba(0,0,0,0.03);
  }
  .pred-table td {
    border-bottom: 1px solid #e8e8e8;
  }
  .pred-table thead th {
    border-bottom: 1px solid #ccc;
  }
  .race-card {
    border-color: #ddd;
  }
  .race-card:hover {
    border-color: var(--accent);
  }
  .profile-cobbled  { background: #f5e6c0; color: #8a6010; }
  .profile-sprinter { background: #c0dff5; color: #105080; }
  .profile-punchy   { background: #c0f5d5; color: #105030; }
  .profile-hilly    { background: #e0c0f5; color: #500880; }
}
