:root {
  --bg: #071014;
  --bg-deep: #030607;
  --surface: rgb(12 23 27 / 84%);
  --surface-strong: #101d21;
  --line: rgb(244 247 239 / 14%);
  --line-strong: rgb(142 230 0 / 36%);
  --text: #f4f7ef;
  --muted: #a7b5b4;
  --green: #8ee600;
  --green-dark: #3f8b2f;
  --gold: #f6c35b;
  --coral: #ef6a4a;
  --blue: #4da3ff;
  --shadow: 0 24px 70px rgb(0 0 0 / 40%);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 80% 0%, rgb(246 195 91 / 16%), transparent 26rem),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(110deg, transparent 0 32%, rgb(142 230 0 / 8%) 32.2% 32.5%, transparent 32.8%),
    linear-gradient(180deg, rgb(255 255 255 / 3%) 1px, transparent 1px);
  background-size: auto, 100% 96px;
  content: "";
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 72px;
  padding: 0.8rem max(1rem, env(safe-area-inset-right)) 0.8rem
    max(1rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgb(5 10 12 / 84%);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.brand img {
  width: 2.6rem;
  height: 2.6rem;
  filter: drop-shadow(0 0 14px rgb(142 230 0 / 22%));
}

.brand span span {
  color: var(--green);
}

.header-nav {
  display: none;
  align-items: center;
  gap: 0.4rem;
  justify-self: center;
}

.header-nav a,
.site-footer nav a {
  min-height: 2.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.header-nav a:hover,
.site-footer nav a:hover {
  background: rgb(244 247 239 / 8%);
  color: var(--text);
}

.header-action {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(142 230 0 / 50%);
  border-radius: var(--radius);
  padding: 0.78rem 0.95rem;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 900;
}

.hero {
  position: relative;
  min-height: 82svh;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(90deg, rgb(3 6 7 / 96%) 0%, rgb(3 6 7 / 70%) 43%, rgb(3 6 7 / 0%) 100%),
    linear-gradient(180deg, transparent 0%, rgb(7 16 20 / 18%) 64%, var(--bg) 100%),
    url("/assets/goalrace-hero-stadium.png");
  background-position: center, center, 64% center;
  background-size: cover, cover, cover;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.4rem 0 3.5rem;
}

.hero-copy {
  max-width: 38rem;
}

.hero h1 {
  margin: 0;
  font-size: 3.7rem;
  font-weight: 950;
  line-height: 0.94;
  color: var(--text);
}

.tagline {
  margin: 1.25rem 0 0;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.16;
}

.hero-text {
  max-width: 32rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.7rem;
}

.button {
  display: inline-flex;
  min-height: 3.2rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0.95rem 1.2rem;
  font-weight: 950;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--green);
  color: #071014;
  box-shadow: 0 18px 36px rgb(142 230 0 / 20%);
}

.button.secondary {
  border: 1px solid rgb(244 247 239 / 34%);
  color: var(--text);
}

.race-board {
  width: min(100%, 31rem);
  border: 1px solid rgb(142 230 0 / 40%);
  border-radius: var(--radius);
  padding: 1rem;
  background: linear-gradient(180deg, rgb(10 18 20 / 90%), rgb(6 10 12 / 88%));
  box-shadow: var(--shadow);
}

.board-header,
.fixture-preview,
.leaderboard-preview div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.board-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}

.board-header span,
.leaderboard-preview em {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 800;
}

.board-header strong {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.35rem;
}

.fixture-preview {
  padding: 1.2rem 0;
}

.fixture-team {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
}

.fixture-preview strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 2rem;
}

.team-flag {
  display: block;
  width: 4.2rem;
  height: 3rem;
  overflow: hidden;
  border: 1px solid rgb(244 247 239 / 22%);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(244 247 239 / 10%), transparent),
    rgb(255 255 255 / 4%);
  box-shadow: inset 0 -2px 0 rgb(142 230 0 / 28%);
}

.team-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fixture-meta {
  margin: -0.25rem 0 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.leaderboard-preview {
  display: grid;
  gap: 0.5rem;
}

.leaderboard-preview div {
  min-height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 0.75rem;
  background: rgb(255 255 255 / 4%);
}

.leaderboard-preview span {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 0.45rem;
  background: rgb(142 230 0 / 14%);
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}

.quick-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  transform: translateY(-1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
  box-shadow: var(--shadow);
}

.quick-strip div {
  min-width: 0;
  padding: 1.1rem;
  background: rgb(10 18 20 / 94%);
}

.quick-strip strong {
  display: block;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.65rem;
}

.quick-strip span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.section {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.5rem 0;
}

.section-heading {
  max-width: 43rem;
}

.section-label {
  margin: 0 0 0.8rem;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

.section h2,
.ready-section h2 {
  margin: 0;
  font-size: 2.15rem;
  font-weight: 950;
  line-height: 1.05;
}

.section-heading > p:last-child,
.score-card p,
.ready-section p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.rule-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.rule-grid article {
  min-height: 13rem;
  border-left: 2px solid var(--line-strong);
  padding: 1.15rem 1.1rem;
  background: linear-gradient(180deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 2%));
}

.rule-grid span {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.9rem;
  font-weight: 950;
}

.rule-grid h3,
.race-line strong {
  margin: 1rem 0 0;
  font-size: 1rem;
  text-transform: uppercase;
}

.race-line strong {
  display: block;
  margin-top: 0.2rem;
}

.rule-grid p,
.race-line p,
.faq-list p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.race-section {
  position: relative;
  overflow: visible;
}

.race-section::before {
  display: none;
}

.race-line {
  position: relative;
  display: grid;
  gap: 1rem;
  margin-top: 2.2rem;
}

.race-line::before {
  display: none;
}

.race-line div {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem;
  background: linear-gradient(180deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 2%));
}

.race-line span {
  display: block;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.score-section {
  width: 100%;
  padding: 4rem max(1rem, calc((100% - 1180px) / 2));
  background:
    linear-gradient(120deg, rgb(142 230 0 / 7%), transparent 36%),
    linear-gradient(180deg, rgb(16 29 33 / 72%), rgb(8 16 20 / 72%));
  border-block: 1px solid var(--line);
}

.score-card {
  display: grid;
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
}

.score-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}

.score-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 3.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  background: rgb(3 6 7 / 36%);
}

.score-list dt {
  color: var(--text);
  font-weight: 850;
}

.score-list dd {
  margin: 0;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 950;
}

.faq-section {
  display: grid;
  gap: 1.6rem;
}

.faq-list {
  display: grid;
  gap: 0.7rem;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

summary {
  min-height: 3.5rem;
  cursor: pointer;
  padding: 1rem;
  color: var(--text);
  font-weight: 900;
}

.faq-panel {
  overflow: hidden;
}

.faq-panel p {
  margin: 0;
  padding: 0 1rem 1rem;
}

.faq-enhanced .faq-panel {
  transition:
    height 240ms ease,
    opacity 180ms ease;
}

.ready-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding: 4rem max(1rem, calc((100% - 1180px) / 2));
}

.ready-section::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(3 6 7 / 92%), rgb(3 6 7 / 76%)),
    url("/assets/goalrace-hero-stadium.png");
  background-position: center;
  background-size: cover;
  content: "";
}

.ready-section > div {
  max-width: 40rem;
}

.ready-section .button {
  margin-top: 1.5rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem max(1rem, calc((100% - 1180px) / 2));
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

@media (min-width: 720px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-inline: max(1.5rem, calc((100% - 1180px) / 2));
  }

  .header-nav {
    display: flex;
  }

  .hero {
    min-height: 80svh;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.78fr);
    align-items: center;
    padding-top: 5.5rem;
  }

  .hero h1 {
    font-size: 5.7rem;
  }

  .tagline {
    font-size: 2.1rem;
  }

  .race-board {
    justify-self: end;
  }

  .quick-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .section h2,
  .ready-section h2 {
    font-size: 3rem;
  }

  .rule-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .race-section {
    display: grid;
    grid-template-columns: minmax(0, 0.76fr) minmax(25rem, 1fr);
    align-items: start;
    gap: clamp(2rem, 5vw, 4.75rem);
  }

  .race-section .section-heading {
    max-width: 35rem;
  }

  .race-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 1rem;
    margin-top: 0;
    padding-top: 0;
  }

  .race-line::before {
    display: none;
  }

  .race-line div {
    min-height: 10.2rem;
    padding: 1.15rem;
  }

  .race-line div::before {
    display: none;
  }

  .score-card,
  .faq-section {
    grid-template-columns: minmax(0, 0.72fr) minmax(24rem, 1fr);
    align-items: start;
  }
}

@media (min-width: 1080px) {
  .hero h1 {
    font-size: 7rem;
  }
}

@media (max-width: 480px) {
  .site-header {
    min-height: 64px;
  }

  .brand {
    font-size: 1.08rem;
  }

  .brand img {
    width: 2.25rem;
    height: 2.25rem;
  }

  .header-action {
    padding-inline: 0.8rem;
  }

  .hero-inner {
    padding-top: 3rem;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .tagline {
    font-size: 1.35rem;
  }

  .button {
    width: 100%;
  }
}

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