/* ==========================================================================
   SportGala — base styles (tokens, reset, layout, shared components)
   ========================================================================== */

:root {
  --bg: #0b1220;
  --bg-2: #0e1628;
  --surface: #111a2e;
  --surface-2: #16213a;
  --line: #1f2a44;
  --line-2: #2a3858;
  --grass: #16a34a;
  --grass-dark: #15803d;
  --accent: #a3e635;
  --accent-ink: #1a2e05;
  --text: #e5edf7;
  --muted: #8a9bb8;
  --danger: #ef4444;
  --warning: #eab308;
  --info: #3b82f6;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Barlow Condensed", "Inter", system-ui, sans-serif;

  --gutter: 16px;
  --container: 1180px;
  --nav-h: 68px;

  color-scheme: dark;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
svg { display: block; max-width: 100%; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
}
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: 72px 0; }
@media (min-width: 768px) { .section { padding: 112px 0; } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2 {
  font-size: clamp(36px, 5vw, 56px);
  text-transform: uppercase;
  margin: 12px 0 16px;
}
.section-head p { color: var(--muted); font-size: 18px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow::after {
  content: "";
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(163, 230, 53, 0.25);
}
.btn-primary:hover { background: #bef264; box-shadow: 0 10px 30px rgba(163, 230, 53, 0.35); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-2);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: #3b4c72; }

.btn-danger { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.35; pointer-events: none; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--grass));
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand span b { color: var(--accent); font-weight: 800; }
.brand-row { display: inline-flex; align-items: center; gap: 10px; line-height: 1; }
.brand .brand-tagline {
  display: block;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
/* ---------- Site navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(11, 18, 32, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(31, 42, 68, 0.7);
}
.site-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-links { display: none; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-links a[aria-current="page"] { color: var(--text); background: rgba(163, 230, 53, 0.1); }
.nav-cta { display: none; }
.nav-toggle { display: inline-flex; }

.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  z-index: 49;
  padding: 12px var(--gutter) 20px;
  background: rgba(11, 18, 32, 0.97);
  border-bottom: 1px solid var(--line);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.mobile-menu.is-open { opacity: 1; transform: none; visibility: visible; }
.mobile-menu a {
  display: block;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 18px;
}
.mobile-menu a[aria-current="page"] { color: var(--accent); }
.mobile-menu .btn { margin-top: 16px; width: 100%; }

@media (min-width: 860px) {
  .nav-links, .nav-cta { display: inline-flex; }
  .nav-toggle, .mobile-menu { display: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 56px 0 32px;
  color: var(--muted);
  font-size: 15px;
}
.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-grid h4 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 14px;
}
.footer-grid li + li { margin-top: 8px; }
.footer-grid a, .footer-grid button.link {
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  transition: color 0.15s ease;
}
.footer-grid a:hover, .footer-grid button.link:hover { color: var(--accent); }
.footer-about p { margin-top: 14px; max-width: 360px; }
.footer-grid a.brand { color: var(--text); }
.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
}
@media (min-width: 900px) {
  .footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
}
.footer-copy { color: #b8c4d8; }
.footer-copy .footer-note { color: var(--muted); }
.footer-project {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.footer-project i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.18);
}
@media (min-width: 900px) {
  .footer-project {
    flex: none;
    padding: 6px 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
  }
}
.footer-project b { color: var(--text); font-weight: 600; }

/* ---------- Dialog / modal ---------- */
dialog.modal {
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in 0.18s ease-out; }
dialog.modal::backdrop { background: rgba(3, 7, 18, 0.72); backdrop-filter: blur(4px); }
dialog.modal.wide { width: min(960px, calc(100vw - 2 * var(--gutter))); }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.modal-head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  text-transform: uppercase;
}
.modal-head h3 svg { width: 22px; height: 22px; color: var(--accent); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1 1 auto; }
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  flex: none;
}
.modal-foot .btn { flex: 1; }
@media (min-width: 560px) { .modal-foot .btn { flex: none; } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.15);
}
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  user-select: none;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.color-input {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}

/* ---------- Legal content ---------- */
.legal-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.legal-tabs button {
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.legal-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.legal-content h4 { font-size: 20px; margin: 18px 0 6px; text-transform: uppercase; }
.legal-content p { color: var(--muted); }
.legal-content p + p { margin-top: 10px; }

.legal-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-content code, .legal-table code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg);
  font-size: 0.9em;
  color: var(--text);
}
.legal-table-wrap { margin: 12px 0; overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal-table th, .legal-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.legal-table th { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); }
.legal-table td { color: var(--muted); }
.legal-table td:first-child { white-space: nowrap; }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-updated { margin-top: 18px !important; font-size: 13px; }
.inline-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.noscript { margin: 0; padding: 12px 16px; background: var(--warning); color: #1c1917; font-weight: 600; text-align: center; }
