/* Football Lookalike — "floodlit matchday" theme */

@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --pitch-950: #04201a;
  --pitch-900: #072c22;
  --pitch-800: #0b3b2c;
  --pitch-700: #11513c;
  --lime: #d6ff4a;
  --lime-dark: #b8e620;
  --chalk: #f4f2ea;
  --card: #ffffff;
  --ink: #0f1f19;
  --muted: #56655e;
  --line: #e2dfd3;
  --on-dark: #eef5f1;
  --on-dark-muted: #a9c2b7;
  --radius: 20px;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--pitch-700); }
h1, h2, h3, h4 { margin: 0; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.display {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: .92;
}
.eyebrow {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 15px;
  color: var(--pitch-700);
  margin: 0 0 10px;
}

/* ---------------- Top bar ---------------- */
.topbar {
  background: var(--pitch-900);
  color: var(--on-dark);
}
.topbar .wrap { display: flex; align-items: center; height: 60px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-dark);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.brand img { width: 30px; height: 30px; display: block; }
.brand span { color: var(--lime); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-lime { background: var(--lime); color: var(--pitch-950); box-shadow: 0 6px 24px rgba(214, 255, 74, .25); }
.btn-lime:hover { background: #e2ff75; color: var(--pitch-950); }
.btn-dark { background: var(--pitch-800); color: var(--on-dark); }
.btn-dark:hover { background: var(--pitch-700); color: #fff; }
.btn-outline { background: transparent; color: var(--pitch-800); border-color: var(--pitch-800); }
.btn-outline:hover { background: rgba(11, 59, 44, .06); }
.btn-ghost { background: transparent; color: var(--on-dark); border-color: rgba(238, 245, 241, .35); }
.btn-ghost:hover { border-color: var(--on-dark); color: #fff; }
.link-btn {
  background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--on-dark-muted); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--on-dark); }

/* ---------------- Hero (pitch) ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--on-dark);
  text-align: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% -10%, rgba(214, 255, 74, .16), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(255, 255, 255, .025) 72px 144px),
    linear-gradient(180deg, var(--pitch-900), var(--pitch-800));
  background-position: center;
  padding: 44px 0 56px;
}
.hero::before { /* centre circle */
  content: "";
  position: absolute;
  left: 50%; bottom: -260px;
  width: 520px; height: 520px;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after { /* halfway line */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, .07);
}
.hero .wrap { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--lime); }
.hero h1 { font-size: clamp(54px, 13vw, 116px); }
.hero h1 .hl { color: var(--lime); display: block; }
.hero-sub {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--on-dark-muted);
  max-width: 30em;
  margin: 18px auto 28px;
  text-wrap: balance;
}

.upload { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.upload input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.preview {
  display: none;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 12px 18px 12px 12px;
  text-align: left;
}
.preview img { width: 76px; height: 76px; object-fit: cover; border-radius: 14px; display: block; }
.preview strong { display: block; font-size: 16px; color: var(--on-dark); }
.upload.has-file .preview { display: flex; }
.upload.has-file .pick { display: none; }
.upload .go { display: none; }
.upload.has-file .go { display: inline-flex; }

.trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  padding: 0;
  margin: 26px 0 0;
  font-size: 14px;
  color: var(--on-dark-muted);
}
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust svg { width: 16px; height: 16px; color: var(--lime); }

/* ---------------- Sections ---------------- */
.section { padding: 64px 0; }
.section-head { text-align: center; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(40px, 6vw, 60px); }
.section-head p { color: var(--muted); margin: 10px auto 0; max-width: 34em; }

/* Face wall */
.face-stream {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
}
.face-stream img.face-tile {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: top;
  border-radius: 18px;
  background: linear-gradient(160deg, #e6efe9, #dde7f0);
  display: block;
  transition: opacity .35s ease;
  opacity: 1;
}
.fade-out { opacity: 0 !important; }
@media (max-width: 760px) {
  .face-stream { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .face-stream img.face-tile { border-radius: 14px; }
  .face-stream img.face-tile:nth-child(n+13) { display: none; }
}

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
}
.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--pitch-800);
  color: var(--lime);
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  margin-bottom: 14px;
}
.steps h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 26px; line-height: 1; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 10px; }
  .steps li { display: grid; grid-template-columns: 40px 1fr; column-gap: 16px; padding: 18px; }
  .steps li::before { grid-row: span 2; margin: 0; }
}

/* FAQ */
.faq { max-width: 720px; margin: 0 auto; display: grid; gap: 10px; }
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-weight: 650;
  font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--chalk) no-repeat center / 14px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='%230b3b2c' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline: 3px solid var(--pitch-700); outline-offset: -3px; border-radius: 16px; }
.faq .answer { padding: 0 20px 20px; color: var(--muted); }

/* CTA band */
.cta-band { text-align: center; padding: 8px 0 72px; }

/* ---------------- Footer ---------------- */
.footer {
  background: var(--pitch-950);
  color: var(--on-dark-muted);
  font-size: 14px;
  padding: 34px 0;
}
.footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer .brand { font-size: 18px; }
.footer .brand img { width: 24px; height: 24px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer a { color: var(--on-dark); text-decoration: none; }
.footer a:hover { color: var(--lime); }
@media (max-width: 600px) {
  .footer .wrap { flex-direction: column; text-align: center; }
  .footer nav { justify-content: center; }
}

/* ---------------- Flash messages ---------------- */
.flash {
  max-width: 720px;
  margin: 16px auto 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: #fff4e5;
  border: 1px solid #f3d3a4;
  color: #6b3d00;
}
.flash-danger { background: #fdecec; border-color: #f2c0c0; color: #7a1a1a; }

/* ---------------- Loading overlay ---------------- */
.loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: rgba(4, 32, 26, .86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--on-dark);
  text-align: center;
  padding: 24px;
}
.loading.show { display: grid; }
.loading img { width: 72px; height: 72px; animation: roll 1.1s linear infinite; }
.loading p { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 30px; letter-spacing: .03em; margin: 18px 0 4px; }
.loading small { color: var(--on-dark-muted); font-size: 15px; }
@keyframes roll { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .loading img { animation-duration: 3s; }
  .face-stream img.face-tile { transition: none; }
}

/* ---------------- Legal pages ---------------- */
.legal { max-width: 760px; margin: 0 auto; padding: 48px 20px 72px; }
.legal h1 { font-size: clamp(44px, 7vw, 64px); margin-bottom: 8px; }
.legal .updated { color: #dfeee6; margin-bottom: 28px; }
.legal .sheet { color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px clamp(20px, 4vw, 40px); }
.legal h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 24px; margin: 26px 0 8px; }
.legal h3:first-child { margin-top: 0; }
.legal p { margin: 0 0 12px; }
.legal .back { margin-top: 28px; text-align: center; }

/* =====================================================================
   Immersive stadium: the 3D scene (stadium.js) fills the screen behind
   the page. Without WebGL the dark gradient below stays and chips show
   as a flat grid.
   ===================================================================== */
body {
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, rgba(60, 207, 78, .18), transparent 70%),
    linear-gradient(180deg, var(--pitch-900), var(--pitch-950));
  background-attachment: fixed;
  color: var(--on-dark);
}
#stadium {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  display: block;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}
#stadium.ready { opacity: 1; }
.topbar, main, .footer { position: relative; z-index: 2; }

.topbar { background: rgba(4, 22, 18, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* Each section is one camera shot */
.shot { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 72px 0; }
.shot-top { justify-content: flex-start; }
.shot-end { justify-content: flex-end; }

.is-3d .hero { background: none; }
.is-3d .hero::before, .is-3d .hero::after { display: none; }
.hero { min-height: calc(100svh - 60px); display: flex; align-items: center; }
.hero .wrap { padding-bottom: 6vh; }
.hero h1, .hero .hero-sub, .section-head h2, .rp-title, .legal h1 {
  text-shadow: 0 2px 24px rgba(0, 0, 0, .55), 0 1px 2px rgba(0, 0, 0, .5);
}
.hero-sub { color: #dfeee6; }
.trust { color: #dfeee6; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }

.eyebrow { color: var(--lime); }
.section-head h2 { color: #fff; }
.section-head p { color: #dfeee6; }

/* Frosted panels floating over the pitch */
.glass, .steps li, .faq details {
  background: rgba(5, 24, 20, .72);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--on-dark);
}
.steps p, .faq .answer { color: var(--on-dark-muted); }
.steps li::before { background: var(--lime); color: var(--pitch-950); }
.faq summary::after { background-color: rgba(255, 255, 255, .12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='%23d6ff4a' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.faq summary:focus-visible { outline-color: var(--lime); }
.cta-band { padding: 0; }
.cta-band h2 { font-size: clamp(48px, 9vw, 96px); margin-bottom: 22px; text-shadow: 0 2px 24px rgba(0, 0, 0, .55); }

.footer { background: rgba(2, 14, 11, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.flash { position: relative; z-index: 3; }

/* ---------------- Player chips ---------------- */
/* Flat fallback: a simple grid inside the section */
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 14px;
  max-width: 640px;
  margin: 28px auto 0;
  list-style: none;
  padding: 0;
}
.chip { display: flex; flex-direction: column; align-items: center; }
.chip-face {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: #e9f3ee;
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
  display: block;
  transition: opacity .35s ease;
}
.chip-tag {
  margin-top: 6px;
  white-space: nowrap;
  background: var(--pitch-950);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: 15px;
  line-height: 1;
  padding: 5px 10px 4px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}
.chip-tag b { color: var(--lime); }
.chip-base { width: 46px; height: 12px; margin-top: 4px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.45), transparent); }
.chip.star .chip-face { width: 96px; height: 96px; border-color: var(--lime); box-shadow: 0 0 0 6px rgba(214, 255, 74, .3), 0 10px 26px rgba(0, 0, 0, .5); }
.chip.star .chip-tag { background: var(--lime); color: var(--pitch-950); font-size: 19px; }
.chip.star .chip-tag b { color: var(--pitch-700); }

/* 3D: chips leave the page flow and stand on their spots on the pitch */
.is-3d .chips {
  position: fixed;
  inset: 0;
  z-index: 1;
  margin: 0;
  max-width: none;
  display: block;
  pointer-events: none;
  visibility: hidden;
}
.is-3d .chip {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 50% 100%;
  will-change: transform;
}
.is-3d .chip-base { display: none; }

/* keep headings and panels above the faces standing on the pitch */
.section-head, .rp-header > p, .rp-header > h1, .hero .wrap, .steps, .faq { position: relative; z-index: 2; }

/* ---------------- Scroll cue ---------------- */
.hero, .rp-first { position: relative; }
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: 0;
  padding: 8px 14px;
  cursor: pointer;
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .7);
  white-space: nowrap;
  transition: opacity .4s ease;
  -webkit-tap-highlight-color: transparent;
}
.scroll-cue svg {
  width: 30px; height: 30px;
  color: var(--lime);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6));
  animation: cue-bounce 1.6s ease-in-out infinite;
}
.scroll-cue:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; border-radius: 12px; }
.scroll-cue.gone { opacity: 0; pointer-events: none; }
@keyframes cue-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue svg { animation: none; } }
/* results: first screen fills the viewport so the cue sits at its bottom */
.rp-first { min-height: calc(100svh - 100px); padding-bottom: 90px; }

/* ---------------- The open spot in the lineup ---------------- */
.chip-you {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.is-3d .chip-you { pointer-events: auto; }            /* the rest of the face layer ignores taps */
.chip-q {
  display: grid;
  place-items: center;
  background: var(--pitch-950);
  border-color: var(--lime);
  color: var(--lime);
  font-family: var(--display);
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
  animation: you-pulse 2.2s ease-in-out infinite;
}
.chip-you .chip-tag { background: var(--lime); color: var(--pitch-950); }
.chip-you:hover .chip-q, .chip-you:focus-visible .chip-q { background: var(--lime); color: var(--pitch-950); }
.chip-you:focus-visible { outline: none; }
.chip-you:focus-visible .chip-tag { box-shadow: 0 0 0 3px #fff; }
@keyframes you-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 255, 74, .55), 0 6px 16px rgba(0, 0, 0, .45); }
  50%      { box-shadow: 0 0 0 12px rgba(214, 255, 74, 0), 0 6px 16px rgba(0, 0, 0, .45); }
}
@media (prefers-reduced-motion: reduce) { .chip-q { animation: none; box-shadow: 0 0 0 5px rgba(214, 255, 74, .35); } }
