/* Self-hosted font: Plus Jakarta Sans (SIL Open Font License) */
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f2f2f7;
  --text: #111114;
  --muted: #6b6b73;
  --line: #e4e4ea;
  --accent: #ff7a00;
  --accent-press: #e66e00;
  --link: #0099ff;
  /* App icon background: orange (top-right) to red (bottom-left) */
  --hero-orange: #f46a1c;
  --brand-gradient: linear-gradient(to bottom left, #f16621, #e40219);
  --card: #ffffff;
  --radius: 20px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

a { color: var(--link); }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- header / footer ---------- */
.site-header {
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  font-family: inherit;
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pill {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: rgba(255, 122, 0, 0.12);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  margin-left: 18px;
}
.site-header nav a:hover { color: var(--text); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 14px;
}
.site-footer a { color: var(--muted); margin-right: 16px; }

/* ---------- hero / landing ---------- */
.hero {
  text-align: center;
  padding-top: 72px;
  padding-bottom: 24px;
}
.hero h1 {
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.hero p.lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 32px;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 200px;
  padding: 15px 22px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.btn-primary { background: var(--brand-gradient); color: #fff; }
.btn-primary:active { filter: brightness(0.92); }
.btn-ghost {
  background: var(--bg-soft);
  color: var(--text);
}
.btn svg { width: 20px; height: 20px; flex: none; }

/* Official store badges. The Google Play PNG has built-in clear space
   (visible badge = 168/250 of the image), so it's drawn taller to match. */
.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
}
.badges a { display: block; line-height: 0; }
.badge-apple { height: 48px; width: auto; }
.badge-google { height: 71px; width: auto; margin: 0 -12px; }

.wrap-wide { max-width: 1080px; }

/* ---------- home: court hero ---------- */
.court-hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-orange);
  color: #fff;
  text-align: center;
}
.court-hero-inner {
  position: relative;
  padding-top: 88px;
  padding-bottom: 64px;
}
.court-hero .pill {
  background: #fff;
  color: #e5560f;
  box-shadow: 0 6px 18px rgba(120, 40, 0, 0.18);
}
.court-hero h1 {
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(34px, 6.2vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 auto 18px;
  max-width: 14em;
}
.court-hero .lead {
  font-size: 19px;
  max-width: 34em;
  margin: 0 auto 30px;
  text-wrap: balance;
  color: rgba(255, 255, 255, 0.92);
}

/* ---------- home: orange fades out below the hero ---------- */
.home-body {
  background: linear-gradient(to bottom, var(--hero-orange) 0, #f99a5f 140px, #fde0cc 360px, #fff 640px);
  padding-top: 8px;
}

/* ---------- home: feature groups ---------- */
.feature-group { margin-top: 56px; }
.feature-group:first-child { margin-top: 40px; }
.group-organizers h2 { color: #fff; }
.feature-group h2 {
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(28px, 4.5vw, 36px);
  line-height: 1.1;
  margin: 0 0 20px;
}
.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}
.feature {
  --tint: #fff1e4;
  flex: 0 1 100%;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 6px 18px rgba(0, 0, 0, 0.06);
}
.group-players .feature { --tint: #eaf0ff; }
.feature-art {
  background: var(--tint);
  display: grid;
  place-items: center;
  padding: 18px;
  height: 230px;
}
.feature-art img {
  display: block;
  max-width: 100%;
  max-height: 194px;
  width: auto;
  height: auto;
}
.feature-text { padding: 18px 22px 24px; }
.feature h3 {
  font-family: inherit;
  font-weight: 700;
  font-size: 21px;
  line-height: 1.2;
  margin: 0 0 6px;
}
.feature p { margin: 0; color: var(--muted); font-size: 15.5px; }
@media (min-width: 640px) { .feature { flex-basis: calc((100% - 18px) / 2); } }
@media (min-width: 940px) { .feature { flex-basis: calc((100% - 36px) / 3); } }

/* ---------- home: closing band ---------- */
.closing-band {
  margin-top: 88px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.closing-inner { padding-top: 56px; padding-bottom: 56px; }
.closing-band h2 {
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(28px, 4.5vw, 38px);
  line-height: 1.1;
  margin: 0 0 8px;
}
.closing-band p { margin: 0 0 26px; color: var(--muted); font-size: 17px; }
.home .site-footer { margin-top: 0; }

a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.court-hero a:focus-visible { outline-color: #fff; }

/* ---------- invite page ---------- */
.invite {
  min-height: calc(100vh - 61px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.invite-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.invite-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  overflow: hidden;
  margin: 0 auto 22px;
  box-shadow: 0 10px 30px rgba(228, 2, 25, 0.25);
}
.invite-icon img { width: 100%; height: 100%; display: block; }
.invite h1 { font-size: 26px; margin: 0 0 8px; line-height: 1.25; }
.invite p { color: var(--muted); margin: 0 0 24px; }
.room-code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
  margin-bottom: 26px;
}
.invite .stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.invite .stack .btn { width: 100%; }
.hint {
  font-size: 14px;
  color: var(--muted);
  margin-top: 22px !important;
}

/* ---------- legal pages ---------- */
.legal { padding-top: 40px; }
.legal h1 { font-size: 34px; margin: 0 0 6px; letter-spacing: -0.01em; }
.legal .meta { color: var(--muted); margin: 0 0 32px; font-size: 15px; }
.legal h2 {
  font-size: 21px;
  margin: 40px 0 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.legal h3 { font-size: 17px; margin: 24px 0 6px; }
.legal p, .legal li { font-size: 16px; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.toc {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 8px;
}
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.toc li { font-size: 15px; margin: 0 0 4px; break-inside: avoid; }
.toc a { text-decoration: none; }
.callout {
  background: var(--bg-soft);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 14px 18px;
}

@media (max-width: 560px) {
  .toc ol { columns: 1; }
  .site-header nav a { margin-left: 12px; font-size: 14px; }
  .legal h1 { font-size: 28px; }
}
