/* Game Open Playbook — shared design system */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;0,700;0,800;1,700;1,800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0a0d12;
  --surface: #121722;
  --surface-2: #1a2130;
  --text: #e9edf5;
  --muted: #9aa4b8;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #f5b73d;
  --accent-ink: #0a0d12;
  --radius: 16px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}

body.sport-football  { --accent: #4ade80; }
body.sport-cricket   { --accent: #38bdf8; }
body.sport-basketball{ --accent: #fb923c; }
body.sport-tennis    { --accent: #d4e94e; }
body.sport-badminton { --accent: #f472b6; }
body.sport-running   { --accent: #fbbf24; }
body.sport-padel     { --accent: #2dd4bf; }
body.sport-pickleball  { --accent: #c084fc; }
body.sport-tabletennis { --accent: #f87171; }
body.sport-esports     { --accent: #e879f9; }
body.page-events       { --accent: #f5b73d; }
body.page-host         { --accent: #e879f9; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 120px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Top navigation ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 28px;
  background: rgba(10, 13, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  font-size: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand em {
  font-style: italic;
  color: var(--accent);
}
.topnav nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav nav::-webkit-scrollbar { display: none; }
.topnav nav a {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 15px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.topnav nav a:hover { color: var(--text); background: var(--surface-2); }
.topnav nav a.active { color: var(--accent); }
.topnav nav a.btn-cta {
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 700;
  padding: 8px 18px;
}
.topnav nav a.btn-cta:hover { color: var(--accent-ink); background: var(--accent); filter: brightness(1.12); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  overflow: hidden;
}
.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10,13,18,0.55) 0%, rgba(10,13,18,0.15) 40%, rgba(10,13,18,0.92) 88%, var(--bg) 100%),
    linear-gradient(100deg, rgba(10,13,18,0.6) 0%, transparent 55%);
}
.hero-inner {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 90px 28px 54px;
}
.kicker {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 10px;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(52px, 9vw, 108px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.hero .lede {
  max-width: 620px;
  margin-top: 18px;
  font-size: 18px;
  color: var(--text);
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

/* Quick facts chips */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.fact {
  background: rgba(18, 23, 34, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
}
.fact b {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
}
.fact span {
  font-size: 12.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Hero "Find Open Games" CTA — right side of the hero image */
.hero-find {
  position: absolute;
  right: 28px;
  bottom: 54px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 18px;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 15px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.hero-find:hover { transform: translateY(-2px); filter: brightness(1.1); }
.hero-find svg { width: 20px; height: 20px; }
@media (max-width: 720px) {
  .hero-find {
    position: static;
    display: flex;
    justify-content: center;
    margin: 18px 18px 0;
    right: auto;
    bottom: auto;
  }
}

/* Official rulebook / resource link block */
.resource-link {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-top: 4px;
  transition: border-color 0.15s;
}
.resource-link:hover { border-color: var(--accent); }
.resource-link .rl-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-radius: 10px;
}
.resource-link .rl-icon svg { width: 22px; height: 22px; color: var(--accent); }
.resource-link .rl-body { flex: 1; }
.resource-link .rl-body b { display: block; font-size: 16px; }
.resource-link .rl-body span { font-size: 13.5px; color: var(--muted); }
.resource-link .rl-go {
  flex-shrink: 0;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 14px;
  color: var(--accent);
  white-space: nowrap;
}

/* "What's new" regulation badge on cards */
.card .whatsnew {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: 999px;
  padding: 2px 9px;
  margin-bottom: 10px;
}

/* ---------- Section chrome ---------- */
main { width: min(1160px, 100%); margin: 0 auto; padding: 0 28px 40px; }

.section { padding-top: 72px; }
.section > h2 {
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(32px, 4.5vw, 46px);
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
}
.section > h2 .num {
  font-size: 0.55em;
  color: var(--accent);
  letter-spacing: 0.1em;
}
/* Collapsible sections (activated by playbook.js, which wraps content in
   .section-body > .section-inner for smooth height animation) */
.section.collapsible > h2 {
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  border-radius: 8px;
  transition: color 0.15s;
}
.section.collapsible > h2:hover { color: var(--accent); }
.section.collapsible > h2:hover .num { color: var(--text); }
.section.collapsible > h2::after {
  content: '';
  width: 13px;
  height: 13px;
  border-right: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: rotate(45deg) translateY(-4px);
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.section.collapsible.closed > h2::after { transform: rotate(-45deg) translateY(2px); }
.section-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.35s ease, opacity 0.3s ease;
  opacity: 1;
}
.section.closed .section-body { grid-template-rows: 0fr; opacity: 0; }
.section-inner { overflow: hidden; min-height: 0; }
@media (prefers-reduced-motion: reduce) {
  .section-body { transition: none; }
}
.section > .section-intro {
  color: var(--muted);
  max-width: 720px;
  margin-bottom: 28px;
}

/* Sub-nav for sport pages */
.subnav {
  position: sticky;
  top: 57px;
  z-index: 40;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(10, 13, 18, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 8px 28px;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 8px 15px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.subnav a svg { width: 15px; height: 15px; flex-shrink: 0; }
.subnav a:hover { color: var(--accent-ink); background: var(--accent); }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 21px;
  margin-bottom: 8px;
}
.card p { color: var(--muted); font-size: 15.5px; }
.card .tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 12px;
}
.card.outline .tag {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* Numbered rule list */
.rules-list { list-style: none; display: grid; gap: 14px; counter-reset: rule; }
.rules-list li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  align-items: start;
}
.rules-list li::before {
  content: counter(rule, decimal-leading-zero);
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  font-size: 34px;
  line-height: 1;
  color: var(--accent);
  padding-top: 2px;
  grid-row: 1 / span 2;
}
.rules-list b { display: block; font-size: 16.5px; margin-bottom: 3px; grid-column: 2; }
.rules-list span { color: var(--muted); font-size: 15.5px; grid-column: 2; }

/* Diagram wrapper */
.diagram {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  overflow-x: auto;
}
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

/* Two-column: prose + media */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.split .photo {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.split .photo img { width: 100%; height: 100%; object-fit: cover; }

/* FAQ */
details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 12px;
}
details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: '+';
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}
details[open] summary::after { content: '–'; }
details p { margin-top: 12px; color: var(--muted); font-size: 15.5px; }

/* ---------- Homepage sport cards ---------- */
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}
.sport-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 11;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.sport-card img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.sport-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10,13,18,0.05) 30%, rgba(10,13,18,0.88) 92%);
}
.sport-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.25); }
.sport-card:hover img { transform: scale(1.045); }
.sport-card .sc-body { padding: 20px 22px; width: 100%; }
.sport-card .sc-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sc-accent, var(--accent));
  color: #0a0d12;
  margin-bottom: 10px;
}
.sport-card h3 {
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.sport-card p { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- Footer ---------- */
footer {
  margin-top: 90px;
  border-top: 1px solid var(--line);
  padding: 42px 28px 60px;
}
.footer-inner {
  width: min(1160px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}
footer .brand { font-size: 21px; }
footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
footer nav a {
  font-size: 13.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
footer nav a:hover { color: var(--accent); }
footer .credit { width: 100%; font-size: 12.5px; color: var(--muted); }

/* Next sport CTA */
.next-sport {
  margin-top: 80px;
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 190px;
  display: flex;
  align-items: center;
  isolation: isolate;
}
.next-sport img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
.next-sport::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(10,13,18,0.92) 20%, rgba(10,13,18,0.35) 100%);
}
.next-sport .ns-body { padding: 30px 34px; }
.next-sport .ns-body .kicker { margin-bottom: 4px; }
.next-sport h3 {
  font-family: var(--display);
  font-weight: 800; font-style: italic; text-transform: uppercase;
  font-size: 42px; line-height: 1;
}
.next-sport:hover h3 { color: var(--accent); }

/* SVG shared classes (used inside inline diagrams) */
.svg-line   { stroke: rgba(233,237,245,0.65); stroke-width: 2; fill: none; }
.svg-faint  { stroke: rgba(233,237,245,0.22); stroke-width: 1.5; fill: none; }
.svg-accent { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.svg-fill-accent { fill: var(--accent); }
.svg-fill-soft { fill: rgba(233,237,245,0.07); }
.svg-fill-accent-soft { fill: color-mix(in srgb, var(--accent) 18%, transparent); }
.svg-label  { font-family: 'Inter', sans-serif; font-size: 12.5px; fill: #9aa4b8; }
.svg-label-strong { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600; fill: #e9edf5; }
.svg-label-accent { font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 0.06em; fill: var(--accent); text-transform: uppercase; }

/* ---------- Events layer ---------- */
.nav-hot { color: #f5b73d !important; }
.nav-hot::before { content: '● '; font-size: 8px; vertical-align: 2px; }

.freshness {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(18, 23, 34, 0.7);
  border-radius: 999px;
  padding: 6px 14px;
}
.freshness b { color: var(--accent); }

.chipbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 26px; }
.chip {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.chip:hover { color: var(--text); }
.chip.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

.event-list { display: grid; gap: 14px; }
.event-card {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 20px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.15s;
}
.event-card:hover { border-color: rgba(255,255,255,0.22); }
.event-card.hidden { display: none; }
.event-date {
  text-align: center;
  border-right: 1px solid var(--line);
  padding-right: 20px;
}
.event-date b {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
}
.event-date span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.event-body h3 { font-size: 17.5px; margin-bottom: 4px; }
.event-body .meta { font-size: 14px; color: var(--muted); }
.event-body .meta b { color: var(--text); font-weight: 600; }
.event-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.event-tags span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  padding: 2px 9px;
}
.event-cta {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 15px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 10px;
  padding: 10px 18px;
  white-space: nowrap;
}
.event-cta:hover { filter: brightness(1.1); }

/* Host form */
.host-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.host-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.host-form input, .host-form select, .host-form textarea {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--body);
  font-size: 15.5px;
  padding: 12px 14px;
}
.host-form input:focus, .host-form select:focus, .host-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.host-form .full { grid-column: 1 / -1; }
.host-form button {
  grid-column: 1 / -1;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 18px;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
}
.host-form button:hover { filter: brightness(1.1); }

@media (max-width: 640px) {
  .event-card { grid-template-columns: 64px 1fr; }
  .event-date { padding-right: 14px; }
  .event-cta { grid-column: 1 / -1; text-align: center; }
  .host-form { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .topnav { padding: 12px 18px; gap: 16px; }
  .hero { min-height: 62vh; }
  .hero-inner { padding: 70px 18px 40px; }
  main { padding: 0 18px 30px; }
  .subnav { padding: 8px 18px; top: 53px; }
  .home-grid { grid-template-columns: 1fr; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .rules-list li { grid-template-columns: 40px 1fr; padding: 16px 18px; gap: 12px; }
  .rules-list li::before { font-size: 26px; }
  .facts { gap: 8px; }
  .fact { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sport-card, .sport-card img { transition: none; }
}
