/* Hoop Experts: the app's arena colours and scoreboard type, on the web. */

@font-face {
  font-family: 'Big Shoulders';
  src: url('/assets/fonts/big-shoulders-800.woff') format('woff');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/assets/fonts/barlow-400.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/assets/fonts/barlow-600.woff') format('woff');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/assets/fonts/barlow-700.woff') format('woff');
  font-weight: 700;
  font-display: swap;
}

:root {
  --navy: #0d1530; /* arena */
  --deep: #091026; /* scoreboard */
  --housing: #050a1d; /* shot clock housing */
  --card: #161f42;
  --raised: #1e2952;
  --line: #27325f; /* court lines */
  --chalk: #f4f2ec;
  --muted: #a3acd0;
  --orange: #f26b1d; /* the ball */
  --orange-deep: #c9531a;
  --led: #ffb020; /* shot clock digits */
  --red: #ff4d3d;
  --nba: #5b8def;
  --euroleague: #ffb020;
  --national: #34d399;
  --display: 'Big Shoulders', 'Arial Narrow', Impact, sans-serif;
  --text: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--navy);
  color: var(--chalk);
  font: 400 1.0625rem/1.6 var(--text);
  overflow-x: hidden;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--chalk);
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--orange);
}
:focus-visible {
  outline: 3px solid var(--led);
  outline-offset: 3px;
  border-radius: 4px;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0.005em;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(3.2rem, 9vw, 6.4rem);
}
h2 {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
}
h3 {
  font-size: 1.75rem;
  line-height: 1.05;
}
p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--led);
  color: var(--housing);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus {
  left: 8px;
}

/* --- Header ---------------------------------------------------------------- */

.top {
  border-bottom: 1px solid var(--line);
  background: var(--navy);
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand img {
  width: 130px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px 18px;
  flex-wrap: wrap;
  font-weight: 600;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
}
.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--chalk);
}
.nav .nav-cta {
  color: var(--housing);
  background: var(--orange);
  padding: 8px 16px;
  border-radius: 999px;
  border-bottom: 3px solid var(--orange-deep);
}
.nav .nav-cta:hover {
  color: var(--housing);
  background: #ff7d33;
}

/* --- Buttons --------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  color: var(--chalk);
  background: var(--card);
}
.button:hover {
  color: var(--chalk);
  border-color: var(--muted);
}
.button.primary {
  background: var(--orange);
  border: 0;
  border-bottom: 4px solid var(--orange-deep);
  color: var(--housing);
}
.button.primary:hover {
  background: #ff7d33;
  color: var(--housing);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* --- Home: hero -------------------------------------------------------------- */

.hero {
  padding: 56px 0 72px;
  background:
    radial-gradient(ellipse 60% 70% at 85% 30%, rgba(242, 107, 29, 0.14), transparent 70%),
    var(--navy);
}
.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}
.lede {
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 34em;
}
.lede strong {
  color: var(--chalk);
  font-weight: 600;
}
@media (min-width: 900px) {
  .hero {
    padding: 88px 0 104px;
  }
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

/* The scoreboard: the one moving thing on the site. The shot clock runs down once. */
@property --clock {
  syntax: '<integer>';
  initial-value: 30;
  inherits: false;
}
.board {
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  max-width: 460px;
  width: 100%;
  justify-self: center;
}
.board-score {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  color: var(--muted);
}
.board-score .pts {
  font: 800 2.6rem/1 var(--display);
  color: var(--chalk);
  margin-left: 8px;
}
.board-score .them {
  text-align: right;
}
.board-score .them .pts {
  margin: 0 8px 0 0;
}
.clock {
  justify-self: center;
  background: var(--housing);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2px 14px;
  font: 800 3.4rem/1.05 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--led);
  min-width: 2.2em;
  text-align: center;
  counter-reset: clock var(--clock);
  animation:
    clock 30s steps(30, end) 0.6s forwards,
    clock-late 0s linear 25.6s forwards;
}
.clock::after {
  content: counter(clock, decimal-leading-zero);
}
.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--card);
  margin: 18px 0 20px;
  overflow: hidden;
}
.bar::before {
  content: '';
  display: block;
  height: 100%;
  background: var(--orange);
  transform-origin: left;
  animation: drain 30s linear 0.6s forwards;
}
@keyframes clock {
  to {
    --clock: 0;
  }
}
@keyframes clock-late {
  to {
    color: var(--red);
  }
}
@keyframes drain {
  to {
    transform: scaleX(0);
  }
}
.topic {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.95rem;
}
.topic .league {
  color: var(--nba);
}
.board-q {
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 10px 0 18px;
}
.board-answer {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.board-answer summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 700;
  list-style: none;
}
.board-answer summary::-webkit-details-marker {
  display: none;
}
.board-answer summary::after {
  content: '+';
  float: right;
  color: var(--orange);
}
.board-answer[open] summary::after {
  content: '−';
}
.board-answer p {
  padding: 0 18px 16px;
  margin: 0;
  color: var(--muted);
}
.board-answer p strong {
  font: 800 2rem/1 var(--display);
  color: var(--chalk);
  display: block;
  margin-bottom: 6px;
}

/* --- Home: sections ---------------------------------------------------------- */

.section {
  padding: 80px 0;
}
.section.alt {
  background: var(--deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-head {
  max-width: 40em;
  margin-bottom: 40px;
}
.section-head p {
  color: var(--muted);
  font-size: 1.15rem;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px 24px 24px;
}
.steps li::before {
  content: counter(step);
  display: block;
  font: 800 4.5rem/0.9 var(--display);
  color: var(--orange);
  margin-bottom: 12px;
}
.steps p {
  color: var(--muted);
  margin: 0;
}
@media (min-width: 820px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.screens {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 48px;
  max-width: 900px;
}
.screens figure {
  margin: 0;
}
.screens img {
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.screens figcaption {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 12px;
}
@media (max-width: 560px) {
  .screens {
    grid-template-columns: 1fr 1fr;
  }
  .screens figure:last-child {
    display: none;
  }
}

.types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}
.types div {
  padding: 18px 18px 18px 0;
  border-bottom: 1px solid var(--line);
}
.types dt {
  font: 800 1.6rem/1.1 var(--display);
  margin-bottom: 4px;
}
.types dd {
  margin: 0;
  color: var(--muted);
}

.leagues {
  display: grid;
  gap: 18px;
}
.leagues article {
  border-radius: 20px;
  padding: 26px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 6px solid var(--c);
}
.leagues .nba {
  --c: var(--nba);
}
.leagues .euroleague {
  --c: var(--euroleague);
}
.leagues .national {
  --c: var(--national);
}
.leagues h3 {
  color: var(--c);
}
.leagues p {
  color: var(--muted);
  margin: 0;
}
@media (min-width: 820px) {
  .leagues {
    grid-template-columns: repeat(3, 1fr);
  }
}

.modes {
  display: grid;
  gap: 2px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.modes > div {
  background: var(--card);
  padding: 22px 24px;
  display: grid;
  gap: 4px 24px;
}
.modes h3 {
  margin: 0;
  font-size: 1.6rem;
}
.modes p {
  margin: 0;
  color: var(--muted);
}
@media (min-width: 720px) {
  .modes > div {
    grid-template-columns: 220px 1fr;
    align-items: baseline;
  }
}

.download {
  text-align: center;
}
.download .section-head {
  margin: 0 auto 8px;
}
.download .actions {
  justify-content: center;
}
.store {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 210px;
  line-height: 1.2;
}
.store small {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
}

/* --- FAQ (details) ------------------------------------------------------------ */

.faq {
  max-width: 760px;
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 18px 40px 18px 0;
  position: relative;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 14px;
  font: 800 1.8rem/1 var(--display);
  color: var(--orange);
}
.faq details[open] summary::after {
  content: '−';
}
.faq details > div {
  color: var(--muted);
  padding-bottom: 14px;
}

/* --- Text pages (rules, support, legal) --------------------------------------- */

.page-head {
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--deep);
}
.page-head p {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 40em;
  margin: 0;
}
.page-head .wrap,
.prose {
  max-width: calc(72ch + 40px);
}
.prose {
  padding-top: 40px;
  padding-bottom: 80px;
}
.prose h2 {
  font-size: 2.3rem;
  margin-top: 1.6em;
}
.prose h3 {
  font-size: 1.55rem;
  margin-top: 1.4em;
}
.prose li {
  margin-bottom: 0.4em;
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
}
.prose .updated {
  color: var(--muted);
  font-size: 0.95rem;
}
.prose .note {
  background: var(--card);
  border-left: 4px solid var(--orange);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
}
.prose .note p:last-child {
  margin: 0;
}
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.4em;
  border: 1px solid var(--line);
  border-radius: 14px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.98rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--card);
  font-weight: 700;
}
tr:last-child td {
  border-bottom: 0;
}
td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

/* --- 404 ---------------------------------------------------------------------- */

.missing {
  padding: 96px 0 120px;
}
.missing .clock {
  display: inline-block;
  animation: none;
  color: var(--red);
  font-size: 5rem;
  margin-bottom: 20px;
}
.missing .clock::after {
  content: '00';
}

/* --- Footer ------------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  background: var(--deep);
  padding: 48px 0 28px;
  font-size: 0.98rem;
}
.foot-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.foot-brand p {
  color: var(--muted);
  margin-top: 12px;
  max-width: 22em;
}
.foot h2 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}
.foot nav a,
.foot-grid > div > a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 3px 0;
  overflow-wrap: anywhere;
}
.foot a:hover {
  color: var(--chalk);
}
.foot-legal {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.foot-legal p {
  max-width: 60em;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .clock,
  .bar::before {
    animation: none;
  }
}
