/* ============================================================
   GOLDENBOOTRACE.COM — STYLES v2
   Light-first with a dark override, both sharing the identity:
   pitch green + chalk lines + trophy gold.
   Layout: colorful "pitch band" summary up top (the FIFA-style
   pop of color), then one clean labeled leaderboard where the
   leader sits INLINE with the pack — just outlined in gold.
   ============================================================ */

/* ------------------------- THEMES ------------------------- */
:root {
  /* light (default) */
  --bg:         #ffffff;
  --surface:    #f6f5ef;
  --surface-2:  #eeece3;
  --ink:        #14180f;
  --muted:      #63705f;
  --line:       #e3e1d5;

  --band:       #0d4f30;   /* the pitch band */
  --band-2:     #0a3d25;
  --band-ink:   #f3efe4;
  --band-muted: #b9cdba;
  --band-line:  rgba(243, 239, 228, 0.22);

  --gold:       #c9930f;   /* readable gold on white */
  --gold-bright:#e9b94f;
  --gold-hi:    #f7dc92;
  --gold-deep:  #94660f;
  --gold-wash:  #fdf6e3;

  --silver:     #7d8894;
  --bronze:     #a4703f;
  --live:       #d92d2d;

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-data:    "Chakra Petch", "Courier New", monospace;
  --font-body:    "Barlow", "Helvetica Neue", Arial, sans-serif;

  --maxw: 1080px;
  --pad: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg:         #0a130f;
  --surface:    #101d15;
  --surface-2:  #16271c;
  --ink:        #f1ede2;
  --muted:      #94a29a;
  --line:       rgba(241, 237, 226, 0.13);

  --band:       #0e2418;
  --band-2:     #0a1a11;
  --band-ink:   #f1ede2;
  --band-muted: #8fa596;
  --band-line:  rgba(241, 237, 226, 0.16);

  --gold:       #e9b94f;
  --gold-bright:#e9b94f;
  --gold-hi:    #f7dc92;
  --gold-deep:  #94660f;
  --gold-wash:  rgba(233, 185, 79, 0.09);

  --silver:     #c9cfd6;
  --bronze:     #c98f5f;
  --live:       #ff5c5c;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }
a { color: var(--gold); }
code {
  font-family: var(--font-data);
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--gold); color: #fff;
  font-family: var(--font-display); text-transform: uppercase;
  padding: 8px 16px; border-radius: 6px; z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================ NAV ============================ */
.nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px var(--pad) 14px;
}

.nav__brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav__brand img { height: 28px; width: auto; }
.nav__word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}
.nav__word b { color: var(--gold); font-weight: 800; }

.nav__chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  padding: 2px;
}
.nav__chips::-webkit-scrollbar { display: none; }

.chip {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip--on {
  color: #fff;
  background: var(--band);
  border-color: var(--band);
  font-weight: 700;
}
[data-theme="dark"] .chip--on { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.chip__live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(217, 45, 45, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(217, 45, 45, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 45, 45, 0); }
}

.nav__side { flex-shrink: 0; display: flex; align-items: center; gap: 14px; }
.nav__link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.nav__link:hover { color: var(--ink); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); transform: rotate(15deg); }
.theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: block; }

/* ==================== BANNERS ==================== */
.demo-banner, .error-panel {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 9px var(--pad);
  font-size: 13.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.error-panel { color: var(--ink); background: var(--surface); }

/* ================ PITCH BAND (race at a glance) ================ */
.racehead {
  position: relative;
  background: linear-gradient(115deg, var(--band) 0%, var(--band-2) 100%);
  color: var(--band-ink);
  overflow: hidden;
}
.racehead__pitch {
  position: absolute;
  top: 0; right: 0;
  height: 100%;
  width: auto;
  color: var(--band-line);
  pointer-events: none;
}
.racehead__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(24px, 4.5vw, 44px) var(--pad) clamp(22px, 4vw, 38px);
}
.racehead__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  font-family: var(--font-data);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--band-muted);
}
.eyebrow__comp { color: var(--gold-bright); font-weight: 700; }
.eyebrow__sep { width: 24px; height: 1px; background: var(--band-line); }

.racehead__title {
  margin: 0 0 clamp(16px, 3vw, 24px);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 7vw, 68px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.racehead__title .accent { color: var(--gold-bright); }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: #ffb3b3;
  border: 1px solid rgba(255, 120, 120, 0.5);
  border-radius: 4px;
  padding: 3px 9px;
}
[data-theme="light"] .other .live-badge, .board .live-badge { color: var(--live); border-color: rgba(217,45,45,.4); }
.live-badge__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live);
  animation: pulse 1.6s infinite;
}
.live-badge--sm { font-size: 10px; padding: 1px 6px; }

/* pulse cards */
.pulse {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  max-width: 760px;
}
.pulse__card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--band-line);
  border-radius: 12px;
  padding: 12px 14px 11px;
  backdrop-filter: blur(2px);
}
.pulse__label {
  display: block;
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--band-muted);
  margin-bottom: 4px;
}
.pulse__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pulse__value .num { font-family: var(--font-data); color: var(--gold-bright); }

/* ============================ BOARD ============================ */
.board {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 3.5vw, 32px) var(--pad) clamp(28px, 4.5vw, 48px);
}

.board__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.board__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.board__status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.board__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }

/* shared column grid for header + rows */
.board__head, .row {
  display: grid;
  grid-template-columns: 44px minmax(210px, 30%) 1fr 76px 76px;
  align-items: center;
  gap: 10px;
}

.board__head {
  padding: 0 14px 8px;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.board__head .col-goals { color: var(--gold); }
.board__head .col-goals, .board__head .col-assists { text-align: right; }
.board__head .col-race em { font-style: normal; letter-spacing: 0.04em; opacity: 0.7; text-transform: none; }

.board__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  transition: background 0.15s ease;
}
.row:hover { background: var(--surface); }

.row__rank {
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 17px;
  color: var(--muted);
  text-align: center;
}
.row__rank--silver { color: var(--silver); }
.row__rank--bronze { color: var(--bronze); }

.row__player { display: flex; align-items: center; gap: 13px; min-width: 0; }
.row__id { min-width: 0; }
.row__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__meta {
  display: block;
  margin-top: 2px;
  font-family: var(--font-data);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__goals, .row__assists { font-family: var(--font-data); text-align: right; }
.row__goals { font-weight: 700; font-size: 22px; color: var(--gold); }
.row__assists { font-weight: 500; font-size: 16px; color: var(--muted); }

/* ---------- the leader: inline with the pack, outlined in gold ---------- */
.row--leader {
  position: relative;
  background: var(--gold-wash);
  border: 2px solid var(--gold-bright);
  border-radius: 14px;
  padding-top: 16px;
  padding-bottom: 16px;
  margin-bottom: 6px;
  box-shadow: 0 2px 14px rgba(201, 147, 15, 0.13);
}
.row--leader:hover { background: var(--gold-wash); }
.row--leader .row__rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  background: linear-gradient(160deg, var(--gold-hi) 5%, var(--gold-bright) 45%, var(--gold-deep) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.row--leader .row__name { font-size: 26px; font-weight: 700; }
.row--leader .row__goals { font-size: 28px; }
.leader-pill {
  display: inline-block;
  vertical-align: 3px;
  margin-left: 10px;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(120deg, var(--gold-bright), var(--gold-deep));
  border-radius: 4px;
  padding: 2.5px 8px;
}

/* ------------------- avatars ------------------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}
.row--leader .avatar { box-shadow: 0 0 0 2px var(--gold-bright), 0 0 0 6px var(--gold-wash); }
.avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line);
  letter-spacing: 0.03em;
}

/* =================== TICK STRIP (signature) =================== */
.ticks {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}
.tick {
  width: 8px;
  height: 20px;
  border-radius: 2px;
  transform-origin: bottom;
}
.tick--goal {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-bright) 55%, var(--gold-deep));
}
.tick--assist {
  background: transparent;
  border: 1.5px solid var(--muted);
  height: 14px;
}
.row--leader .tick { width: 10px; height: 26px; }
.row--leader .tick--assist { height: 18px; }

.anim-ticks .tick { animation: tick-in 0.4s both; animation-delay: calc(var(--i) * 40ms); }
@keyframes tick-in {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

.ticks__bar {
  width: 100%;
  max-width: 320px;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.ticks__bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright), var(--gold-hi));
}

/* live goal flash */
.just-scored { animation: scored 1.4s ease-out; }
@keyframes scored {
  0%   { background: rgba(233, 185, 79, 0.35); }
  100% { background: transparent; }
}

.board__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.show-more {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--muted);
  border-radius: 999px;
  padding: 8px 20px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.show-more:hover { background: var(--ink); color: var(--bg); }

.board__legend {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.legend__tick { width: 7px; height: 15px; border-radius: 2px; display: inline-block; }
.legend__tick--goal { background: var(--gold-bright); }
.legend__tick--assist { border: 1.5px solid var(--muted); height: 11px; margin-left: 14px; }

/* ========================= AD SLOTS ========================= */
/* Rendered only when ads are enabled in config — otherwise the
   containers stay hidden and empty. */
.ad-slot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px var(--pad) 24px;
}
.ad-slot__label {
  display: block;
  text-align: center;
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.ad-slot__box { display: flex; justify-content: center; }
.ad-slot__placeholder {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ========================= OTHER RACES ========================= */
.other {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(36px, 5.5vw, 64px);
}
.other__title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}
.other__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.race-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.race-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.race-card__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.race-card__meta {
  font-family: var(--font-data);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}
.race-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.race-card__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.race-card__row:last-child { border-bottom: 0; }
.race-card__rank {
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--muted);
  width: 16px;
}
.race-card__row:first-child .race-card__rank { color: var(--gold); font-weight: 700; }
.race-card__player {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  min-width: 0;
}
.race-card__player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-card__goals {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 17px;
  color: var(--gold);
}
.race-card__cta {
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold-bright);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.race-card__cta:hover { background: var(--gold-bright); color: #fff; }
[data-theme="dark"] .race-card__cta:hover { color: var(--bg); }

/* ============================ FOOTER ============================ */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
[data-theme="dark"] .footer { background: transparent; }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px var(--pad) 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer__blurb {
  margin: 0;
  max-width: 480px;
  color: var(--muted);
  font-size: 14px;
}
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a {
  color: var(--ink);
  font-size: 13.5px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.footer__links a:hover { border-color: var(--gold); color: var(--gold); }
.footer__legal { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ========================= ABOUT PAGE ========================= */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) var(--pad) clamp(48px, 7vw, 80px);
}
.page h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 7vw, 56px);
  line-height: 0.95;
  text-transform: uppercase;
  margin: 0 0 24px;
}
.page h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 40px 0 12px;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}
.page p { color: var(--ink); opacity: 0.85; }
.page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.page th {
  text-align: left;
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--muted);
}
.page td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--line);
}
.page td.w {
  font-family: var(--font-data);
  font-weight: 700;
  color: var(--gold);
}

/* ========================= RESPONSIVE ========================= */
@media (max-width: 820px) {
  .board__head, .row { grid-template-columns: 40px minmax(0, 1fr) 76px 66px; }
  .col-race, .row__ticks { display: none; }
}

@media (max-width: 760px) {
  .nav { flex-wrap: wrap; }
  .nav__chips { order: 3; flex-basis: 100%; }
  .racehead__pitch { opacity: 0.6; }
  .pulse { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 460px) {
  .row__name { font-size: 17px; }
  .row--leader .row__name { font-size: 21px; }
  .row__avatar-img, .row .avatar { width: 38px !important; height: 38px !important; }
  .row--leader .avatar { width: 46px !important; height: 46px !important; }
  .board__bar { flex-direction: column; gap: 6px; align-items: flex-start; }
  .board__head, .row { padding-left: 8px; padding-right: 8px; gap: 8px; }
}
