/* ==========================================================================
   OriginalXG — Global Stylesheet
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
  --teal: #0d6e6e;
  --teal-light: #0f8a8a;
  --teal-dark: #095555;
  --amber: #e8913a;
  --amber-light: #f0a050;
  --bg: #fafafa;
  --bg-alt: #f0f0f0;
  --text: #1a1a2e;
  --text-secondary: #6c757d;
  --border: #e0e0e0;
  --white: #ffffff;
  --navy: #1a1a2e;
  --green: #28a745;
  --red: #dc3545;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.1);
  --transition: 0.2s ease;

  --container: 1200px;
  --header-height: 64px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--teal-light);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.375rem; }
}

p + p {
  margin-top: 1em;
}

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

@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}

.section {
  padding: 3rem 0;
}

.section--alt {
  background-color: var(--bg-alt);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--2 {
  grid-template-columns: 1fr;
}

.grid--3 {
  grid-template-columns: 1fr;
}

.grid--4 {
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.flex {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition), transform var(--transition);
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background-color: var(--teal);
  color: var(--white);
}

.btn--primary:hover {
  background-color: var(--teal-light);
  color: var(--white);
}

.btn--accent {
  background-color: var(--amber);
  color: var(--white);
}

.btn--accent:hover {
  background-color: var(--amber-light);
  color: var(--white);
}

.btn--outline {
  background-color: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}

.btn--outline:hover {
  background-color: var(--teal);
  color: var(--white);
}

.btn--sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card__body {
  padding: 1.25rem;
}

.card__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card__footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background-color: var(--bg);
}

/* ---------- Probability Bar ---------- */
.prob-bar {
  display: flex;
  width: 100%;
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 32px;
}

.prob-bar__segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  min-width: 2.5rem;
  transition: flex-basis var(--transition);
}

.prob-bar__home {
  background-color: var(--teal);
}

.prob-bar__draw {
  background-color: var(--text-secondary);
}

.prob-bar__away {
  background-color: var(--amber);
}

.prob-bar__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  padding: 0 0.25rem;
}

/* ---------- Match Card ---------- */
.match-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}

.match-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.match-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.25rem;
}

.match-card__league {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.match-card__teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.match-card__team {
  flex: 1;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--navy);
}

.match-card__team--away {
  text-align: right;
}

.match-card__score {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal);
  flex-shrink: 0;
}

.match-card__score span {
  width: 1.75rem;
  text-align: center;
}

.match-card__score .score-sep {
  width: auto;
  color: var(--text-secondary);
  font-weight: 400;
}

.match-card__kickoff {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  text-align: center;
}

.match-card__value-bet {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background-color: var(--amber);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Accuracy / Stat Cards ---------- */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
}

.stat-card__value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
}

.stat-card__label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.stat-card--highlight {
  border: 2px solid var(--teal);
}

/* ---------- Tables ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.875rem;
}

.data-table th {
  background-color: var(--navy);
  color: var(--white);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background-color: var(--bg);
}

.data-table--striped tbody tr:nth-child(even) {
  background-color: var(--bg);
}

/* Responsive table wrapper */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

/* ---------- Score Probability Matrix / Heatmap ---------- */
.score-matrix {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.score-matrix table {
  border-collapse: collapse;
  min-width: 400px;
}

.score-matrix th,
.score-matrix td {
  width: 3rem;
  height: 2.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--white);
}

.score-matrix th {
  background-color: var(--navy);
  color: var(--white);
  font-weight: 600;
}

.score-matrix td {
  color: var(--white);
  font-weight: 600;
}

/* Heatmap intensity classes — applied via JS or template */
.heat-0 { background-color: #e8eef2; color: var(--text-secondary); }
.heat-1 { background-color: #b4d5d5; color: var(--navy); }
.heat-2 { background-color: #7abcbc; color: var(--white); }
.heat-3 { background-color: #3f9e9e; color: var(--white); }
.heat-4 { background-color: #0d6e6e; color: var(--white); }
.heat-5 { background-color: #095555; color: var(--white); }

.score-matrix__predicted {
  outline: 3px solid var(--amber);
  outline-offset: -1px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  transition: box-shadow var(--transition);
}

.site-header--scrolled {
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.site-logo {
  font-size: 1.375rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.logo-original {
  color: var(--navy);
}

.logo-xg {
  color: var(--teal);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  z-index: 1001;
}

.menu-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--navy);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.primary-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--white);
  padding: 1.5rem 1rem;
  overflow-y: auto;
  z-index: 999;
}

.primary-nav.is-open {
  display: block;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-link {
  display: block;
  padding: 0.75rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--teal);
}

.nav-link--accent {
  color: var(--amber);
}

.nav-link--accent:hover {
  color: var(--amber-light);
}

@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }

  .primary-nav {
    display: block;
    position: static;
    padding: 0;
    overflow: visible;
  }

  .nav-list {
    flex-direction: row;
    gap: 0.25rem;
  }

  .nav-link {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    border-bottom: none;
    border-radius: var(--radius-sm);
  }

  .nav-link:hover {
    background-color: var(--bg-alt);
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background-color: var(--navy);
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 2rem;
  }
}

.footer-logo .logo-original {
  color: var(--white);
}

.footer-logo .logo-xg {
  color: var(--teal-light);
}

.footer-tagline {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  opacity: 0.8;
}

.footer-heading {
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--white);
}

.footer-responsible p {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.footer-responsible a {
  color: var(--amber-light);
}

.footer-responsible a:hover {
  color: var(--amber);
}

.footer-disclaimer {
  margin-top: 0.75rem;
  font-style: italic;
  opacity: 0.7;
  font-size: 0.75rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.8125rem;
  opacity: 0.6;
}

/* ---------- Responsible Gambling Disclaimer Bar ---------- */
.gambling-disclaimer-bar {
  background-color: var(--navy);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.625rem 0;
  line-height: 1.4;
}

.gambling-disclaimer-bar a {
  color: var(--amber-light);
  text-decoration: underline;
}

/* ---------- AdSense Slot ---------- */
.ad-slot {
  background-color: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot::after {
  content: "Advertisement";
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Hero Section ---------- */
.hero {
  padding: 3rem 0;
  text-align: center;
}

.hero__title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

@media (min-width: 768px) {
  .hero {
    padding: 4rem 0;
  }
  .hero__title {
    font-size: 2.75rem;
  }
}

/* ---------- League Hub ---------- */
.league-header {
  padding: 2.5rem 0 1.5rem;
}

.league-header__title {
  font-size: 1.75rem;
}

.league-header__meta {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

.league-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .league-layout {
    grid-template-columns: 1fr 320px;
  }
}

.league-sidebar .stat-card + .stat-card {
  margin-top: 1rem;
}

/* ---------- Blog Listing ---------- */
.blog-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.blog-card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.blog-card__body {
  padding: 1.25rem;
}

.blog-card__date {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.blog-card__title {
  font-size: 1.125rem;
  margin-top: 0.5rem;
}

.blog-card__excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ---------- Prediction Page ---------- */
.prediction-header {
  text-align: center;
  padding: 2rem 0 1rem;
}

.prediction-header__meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.prediction-header__teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.prediction-header__team-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  min-width: 120px;
}

.prediction-header__team-name--home {
  text-align: right;
}

.prediction-header__team-name--away {
  text-align: left;
}

@media (min-width: 768px) {
  .prediction-header__team-name {
    font-size: 1.75rem;
    min-width: 200px;
  }
}

.prediction-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--teal);
  color: var(--white);
  font-size: 2rem;
  font-weight: 700;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius);
}

.prediction-badge__sep {
  opacity: 0.5;
  font-weight: 400;
}

.prediction-section {
  padding: 2rem 0;
}

.prediction-section__title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.prediction-version {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.prediction-version__item {
  flex-shrink: 0;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-width: 160px;
  text-align: center;
}

.prediction-version__item--active {
  border-color: var(--teal);
}

.prediction-version__label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.prediction-version__score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal);
}

/* ---------- Results / Accuracy Page ---------- */
.results-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .results-overview {
    grid-template-columns: repeat(4, 1fr);
  }
}

.chart-placeholder {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ---------- Animations ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Visually Hidden (SR only) ---------- */
.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;
}

/* ---------- Misc ---------- */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge--teal {
  background-color: var(--teal);
  color: var(--white);
}

.badge--amber {
  background-color: var(--amber);
  color: var(--white);
}

.badge--green {
  background-color: var(--green);
  color: var(--white);
}

.badge--red {
  background-color: var(--red);
  color: var(--white);
}

.divider {
  height: 1px;
  background-color: var(--border);
  margin: 2rem 0;
}

/* Odds table value highlight */
.value-highlight {
  background-color: rgba(232, 145, 58, 0.12);
  font-weight: 600;
}