/* Home */
.home {
  padding-top: var(--space-4);
}
.home__grid {
  display: grid;
  gap: var(--space-4);
  grid-template-areas:
    'main'
    'first'
    'side'
    'records';
}
.home__main {
  grid-area: main;
  min-width: 0;
}
.home__first {
  grid-area: first;
  min-width: 0;
}
.home__records {
  grid-area: records;
  min-width: 0;
}
.home__side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}
.home__cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.section-title {
  font-size: var(--display-sm);
}

/* ---------- Hero (poster: title left, floodlit cup right) ---------- */
.home-hero {
  position: relative;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  overflow: hidden;
}
.home-hero > * {
  position: relative;
  min-width: 0;
}
/* Floodlight beams, as on the cover. */
.home-hero__beam {
  position: absolute;
  top: -10%;
  width: 46%;
  height: 130%;
  background: linear-gradient(180deg, rgb(234 242 255 / 0.16), transparent 75%);
  pointer-events: none;
}
.home-hero__beam--l {
  left: 26%;
  transform: skewX(24deg);
  clip-path: polygon(40% 0, 52% 0, 100% 100%, 0 100%);
}
.home-hero__beam--r {
  right: -12%;
  transform: skewX(-22deg);
  clip-path: polygon(48% 0, 60% 0, 100% 100%, 0 100%);
}
/* Phone: the question across the card on two lines ("Can you win the" / "2026 World Cup?",
   sized to the card's width), then the lead beside the pitch. */
.home-hero__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(104px, 32%, 400px);
  align-items: center;
  gap: var(--space-4);
  container-type: inline-size;
}
.home-hero__title {
  grid-column: 1 / -1;
  font-size: min(13.4cqi, 118px);
  line-height: 0.9;
  text-transform: uppercase;
}
.home-hero__title span,
.home-hero__title em {
  display: block;
  text-wrap: balance;
}
.home-hero__title em {
  font-style: normal;
  color: var(--volt-400);
  text-shadow: 0 0 36px rgb(205 245 69 / 0.35);
}
.home-hero__lead {
  max-width: 44ch;
  color: var(--text-2);
  font-size: var(--text-md, 1rem);
}
.hero-pitch {
  position: relative;
  aspect-ratio: 400 / 526;
  container-type: inline-size;
  /* Relative to its own box (cqw here would read the hero's container: huge corners on
     desktop that cut the pitch lines). */
  border-radius: 7% / 5.3%;
  transform: perspective(1400px) rotateY(-9deg) rotateX(3deg);
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgb(0 10 5 / 0.5)),
    repeating-linear-gradient(180deg, #186b3e 0 8.333%, #155f37 8.333% 16.666%);
  box-shadow:
    0 0 0 1.5px rgb(255 255 255 / 0.12),
    0 24px 48px rgb(0 0 0 / 0.5),
    0 0 80px rgb(205 245 69 / 0.12);
}
.hero-pitch__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgb(236 255 240 / 0.4);
  stroke-width: 2;
}
.hero-pitch__link {
  stroke: var(--gold-400);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgb(245 200 76 / 0.7));
}
.hero-pitch__tok {
  position: absolute;
  width: 16cqw;
  height: 16cqw;
  margin: -8cqw 0 0 -8cqw;
  padding: 0.8cqw;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff1c4, #f5c84c 45%, #a8770f 70%, #f7d774);
  box-shadow: 0 2.5cqw 4.5cqw rgb(0 0 0 / 0.45);
}
.hero-pitch__tok.is-holo {
  background: conic-gradient(from 30deg, #ff8fd0, #b494ff, #6fd6ff, #7dffc0, #ff8fd0);
}
.hero-pitch__tok > * {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  overflow: hidden;
}
@media (min-width: 960px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
    column-gap: var(--space-8);
    padding: var(--space-8);
    align-items: center;
    /* The left column centred against the pitch: the pitch spans every row, its extra height
       goes to the two flexible rows around the column. */
    grid-template-rows: 1fr repeat(6, auto) 1fr;
  }
  .home-hero__head {
    display: contents;
  }
  .home-hero__title {
    grid-column: 1;
    grid-row: 2;
    font-size: clamp(64px, 6.6vw, 100px);
  }
  .home-hero__lead {
    grid-row: 3;
  }
  .home-hero > .run-path {
    grid-row: 4;
  }
  .home-hero__cta {
    grid-row: 5;
  }
  .home-hero__budget {
    grid-row: 7;
  }
  .home-hero__art {
    grid-column: 2;
    grid-row: 1 / -1;
  }
  .home-hero__lead {
    font-size: var(--text-lg, 1.125rem);
  }
  .home-hero__cta,
  .home-hero__budget {
    max-width: 460px;
  }
}

.home-hero__budget {
  margin-top: calc(-1 * var(--space-2));
}

/* ---------- Run path strip ---------- */
.run-path {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 400px;
}
.run-path__track {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.run-path__pip {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 1 0;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-3);
  background: rgb(4 7 15 / 0.55);
  color: var(--text-2);
  font-size: 15px;
  font-weight: var(--weight-bold);
}
.run-path__pip.is-ko {
  margin-left: 12px;
}
.run-path__pip.is-ko::before {
  content: '';
  position: absolute;
  left: -13px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--line-3);
}
.run-path__pip.is-final {
  border-color: rgb(245 200 76 / 0.65);
  color: var(--gold-400);
  background: rgb(245 200 76 / 0.12);
}
.run-path__pip.is-done {
  border-color: transparent;
  background: var(--green-500);
  color: #04140a;
}
.run-path__pip.is-current {
  border-color: var(--volt-400);
  color: var(--volt-300);
  box-shadow: 0 0 0 3px rgb(205 245 69 / 0.15);
}
.run-path__legend {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  white-space: nowrap;
  color: var(--text-3);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.run-path__group {
  width: calc((100% - 7 * 6px - 12px) * 3 / 8 + 12px);
}
.run-path__perfect,
.run-path__record {
  margin-left: auto;
  letter-spacing: 0.04em;
}
.run-path__perfect b {
  color: var(--gold-400);
  font-size: 15px;
  letter-spacing: 0;
}

/* ---------- Desktop: hero banner, then a row of cards ---------- */
@media (min-width: 960px) {
  .home {
    padding-top: var(--space-6);
  }
  .home__grid {
    gap: var(--space-5);
    grid-template-areas:
      'main'
      'side'
      'records'
      'first';
  }
  .home__side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: var(--space-5);
    align-items: stretch;
  }
  .home__cards > :only-child {
    flex: 1;
  }
  /* Nothing to continue: the other modes take the whole row. */
  .home__side > .home-modes:only-child {
    grid-column: 1 / -1;
  }
}

/* ---------- Continue run ---------- */
.continue {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.continue__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.continue__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}
.continue__icon {
  background: var(--volt-400);
  color: var(--on-volt);
}
.continue__titles {
  flex: 1;
  min-width: 0;
}
.continue__title {
  font-size: var(--display-sm);
}
.continue__record {
  font-size: 30px;
  font-weight: var(--weight-heavy);
}
.continue__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.continue__meta {
  color: var(--text-3);
  font-size: var(--text-sm);
}

.continue__record small {
  color: var(--text-3);
  font-size: 0.55em;
}
.draft-resume__bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.draft-resume__bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--volt-400);
}

/* ---------- Daily (second in the hero, under Start World Cup) ---------- */
.home-daily {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgb(245 200 76 / 0.45);
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, rgb(245 200 76 / 0.14), rgb(245 200 76 / 0.04));
  color: var(--text-1);
  text-decoration: none;
  transition:
    transform var(--dur-fast, 120ms) ease,
    border-color var(--dur-fast, 120ms) ease;
}
.home-daily:hover {
  border-color: var(--gold-400);
}
.home-daily:active {
  transform: scale(0.99);
}
.home-daily__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--tier-star-frame);
  color: var(--on-gold);
}
.home-daily__text {
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: 1.3;
  text-wrap: balance;
}
.home-daily__text b {
  display: block;
  color: var(--text-1);
  font-weight: var(--weight-bold);
}
.home-daily__state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.home-daily__streak {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-2);
  font-size: var(--text-sm);
}
.home-daily__streak .icon {
  color: var(--amber-400);
}
@media (min-width: 960px) {
  .home-daily {
    grid-row: 6;
    max-width: 460px;
  }
}

/* ---------- Mode tiles ---------- */
.home-modes {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}
.home-modes .section-title {
  font-size: var(--display-xs);
  color: var(--text-2);
  letter-spacing: 0.06em;
}
.home-modes__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}
.mode-tile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 72px;
}
.mode-tile__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--surface-4), var(--surface-2));
  color: var(--volt-300);
  box-shadow: var(--shadow-inset);
}
.mode-tile__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.mode-tile__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: var(--weight-heavy);
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-transform: uppercase;
}
.mode-tile__desc {
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: 1.35;
}
.mode-tile__chevron {
  flex: none;
  color: var(--text-3);
  transition: transform var(--dur-base) var(--ease-out);
}
.mode-tile:hover .mode-tile__chevron {
  color: var(--volt-300);
  transform: translateX(3px);
}
@media (min-width: 960px) {
  .home-modes .section-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .home-modes__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
    height: 100%;
  }
  .home-modes__list > li {
    display: flex;
  }
  .mode-tile {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5);
  }
  .mode-tile__text {
    gap: 6px;
  }
  .mode-tile__title {
    font-size: 24px;
  }
  .mode-tile__chevron {
    position: absolute;
    top: var(--space-5);
    right: var(--space-5);
  }
}

/* ---------- First run: swipeable on phones, a row of four on desktop ---------- */
.home-first {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}
.home-first__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.home-first .howto--row {
  display: flex;
  gap: var(--space-3);
  margin-inline: calc(-1 * var(--space-4));
  padding: 2px var(--space-4) var(--space-1);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--space-4);
  scrollbar-width: none;
}
.home-first .howto--row::-webkit-scrollbar {
  display: none;
}
.home-first .howto__step {
  flex: 0 0 min(76%, 280px);
  grid-template-columns: 1fr;
  scroll-snap-align: start;
}
@media (min-width: 960px) {
  .home-first .howto--row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}

/* ---------- Footer ---------- */
.home__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
  color: var(--text-3);
  font-size: var(--text-xs);
  text-align: center;
}
/* The version line (screens/home/version-line.js) and the update button beside it. */
.home__version {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.home__update {
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.home__update:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.home__legal {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 var(--space-2);
  color: var(--text-2);
  font-weight: var(--weight-semibold);
}

/* The footer's "Report a bug or send feedback" (only while reports can be sent). */
.home__report {
  min-height: 1px;
  margin: 0;
}
.home__report-link {
  min-height: var(--touch);
  padding: 0 var(--space-3);
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.home__report-link:hover {
  color: var(--text-1);
}
