/* ===========================================================================
   SpoilSports — shared design system
   Loaded by index.html, how-it-works.html and watch.html so every page shares
   the same tokens, nav, footer, buttons, badges and match-card styling.
   Page-specific styling stays inline in each page.
   =========================================================================== */

:root {
  --bg: #06070b;
  --bg-2: #0a0c12;
  --panel: #0f1218;
  --panel-2: #0c0e14;
  --panel-3: #141925;
  --border: #1d222e;
  --border-2: #283041;
  --text: #eef1f4;
  --muted: #8b919d;
  --muted-2: #686e7c;
  --brand: #b4ee2f;
  --brand-2: #c8f95f;
  --brand-ink: #0a1400;
  --brand-dim: rgba(180, 238, 47, .12);
  --brand-border: rgba(180, 238, 47, .35);
  --warn: #e0a83b;
  --nav-h: 72px;
  --radius: 14px;
  --maxw: 1240px;
  --card-h: 190px;
  /* shared match-card height so featured + competition tiles line up */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* visible focus for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 8px;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 11px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter .12s ease, background .12s ease, border-color .12s ease;
  white-space: nowrap;
}

.btn-brand { background: var(--brand); color: var(--brand-ink); }
.btn-brand:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--panel-3); }
.btn.lg { padding: 13px 22px; font-size: 15px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
}
.icon-btn:hover { background: #1a2030; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: rgba(8, 9, 14, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav .brand { display: flex; align-items: center; }
.nav .brand img { height: 38px; width: auto; display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 14px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 9px;
  font-weight: 600;
  color: var(--muted);
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }

/* ---------- generic section header ---------- */
.section { padding: 26px 0; scroll-margin-top: calc(var(--nav-h) + 12px); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.3px;
  margin: 0;
}
.section-head h2 i { color: var(--brand); font-size: 20px; }
.view-all { color: var(--brand); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.view-all:hover { filter: brightness(1.1); }

/* ---------- match card (featured + results) ---------- */
.mcard {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-height: var(--card-h);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.mcard:hover {
  transform: translateY(-3px);
  border-color: var(--brand-border);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45), 0 0 0 1px rgba(180, 238, 47, .12);
}
.mcard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mcard-comp {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.mcard-badges { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 6px 0 2px; }
.vs { color: var(--muted-2); font-size: 12px; font-weight: 700; }

.badge {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.badge img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 3px; }
/* fallback chip (only shown if the badge image fails to load) — keep it legible, no circle */
.badge.badge--fb {
  font-size: 12px; font-weight: 800; color: var(--text); letter-spacing: .3px;
  background: var(--panel-3); border: 1px solid var(--border); border-radius: 6px;
}
.badge.sm { width: 26px; height: 26px; }
.badge.sm.badge--fb { font-size: 9px; }

.mcard-teams { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.mcard-teams span { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mcard-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 11px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.mcard-foot i:first-child { color: var(--brand); font-size: 15px; }
.mcard-foot .go { margin-left: auto; transition: transform .14s ease; }
.mcard:hover .mcard-foot .go { transform: translateX(3px); color: var(--brand); }

/* ---------- how-it-works steps (shared: footer pages reuse) ---------- */
.step-ic {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-dim);
  border: 1px solid var(--brand-border);
  color: var(--brand);
  font-size: 26px;
}
.step-n { font-size: 12px; font-weight: 800; color: var(--brand); margin-bottom: 3px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); margin-top: 16px; }
.foot-main { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 26px 0 18px; }
.foot-main .brand { display: flex; align-items: center; }
.foot-main .brand img { height: 34px; display: block; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); font-weight: 600; }
.foot-links a:hover { color: var(--text); }
.foot-social { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.foot-social a { color: var(--muted); font-size: 19px; display: flex; }
.foot-social a:hover { color: var(--brand); }
.foot-copy { border-top: 1px solid var(--border); padding: 14px 0; color: var(--muted-2); font-size: 12.5px; }

[hidden] { display: none !important; }

/* ---------- shared responsive nav ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    margin: 0;
    padding: 10px 14px 14px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open a.active::after { display: none; }
  .menu-btn { display: inline-flex; }
  /* keep the mobile header compact: logo + hamburger only */
  .nav-right .btn-brand,
  .nav-right .btn-ghost,
  .nav-right > .icon-btn:not(.menu-btn) { display: none; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .nav { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mcard, .mcard-foot .go { transition: none; }
}

/* ---------- modal (shared: report a problem + request a match) ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 3, 6, .72); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; width: min(460px, 100%); background: var(--panel); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: grid; place-items: center;
  background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 8px; font-size: 18px;
}
.modal-x:hover { background: var(--panel-3); color: var(--text); }
.modal-title { margin: 0 0 4px; font-size: 19px; }
.modal-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-status { margin: 12px 0 0; font-size: 14px; color: var(--brand-2); text-align: center; }

/* request-a-match form fields */
.req-form { display: grid; gap: 12px; }
.req-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.req-field { display: grid; gap: 6px; }
.req-field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.req-field .req-req { color: var(--brand); }
.req-input {
  width: 100%; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font: inherit; font-size: 14px; box-sizing: border-box;
}
.req-input:focus { outline: none; border-color: var(--brand-border); }
.req-input::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }
@media (max-width: 460px) { .req-row { grid-template-columns: 1fr; } }
