:root {
  --eng-red: #ce1126;
  --eng-red-dark: #a50d1e;
  --eng-blue: #012169;
  --eng-blue-light: #1a3a8f;
  --eng-white: #f8f9fc;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f0f2f8;
  --text-muted: rgba(240, 242, 248, 0.65);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: linear-gradient(145deg, var(--eng-blue) 0%, #020818 55%, #0a1628 100%);
}

.bg-pattern {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(206, 17, 38, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(206, 17, 38, 0.08) 0%, transparent 40%),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(255, 255, 255, 0.015) 40px,
      rgba(255, 255, 255, 0.015) 41px
    );
  pointer-events: none;
  z-index: 0;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(1, 33, 105, 0.85);
  border-bottom: 1px solid var(--border);
}

.skip-link {
  position: absolute;
  left: -999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 20;
}

.skip-link:focus,
.skip-link:focus-visible {
  left: 1.25rem;
  top: 0.5rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: var(--text);
  color: var(--eng-blue);
  border-radius: 6px;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

:focus-visible {
  outline: 3px solid #9bb1ff;
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .match-status.live {
    animation: none;
  }

  .refresh-btn.spinning svg {
    animation: none;
  }
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.625rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
}

.site-logo {
  display: inline-flex;
  flex-shrink: 0;
  text-decoration: none;
  justify-self: start;
}

.site-logo img {
  display: block;
  height: 22px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.site-logo:hover img {
  opacity: 1;
}

.site-logo:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
  border-radius: 4px;
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 0;
  justify-self: center;
}

.header-brand .brand-flag {
  width: 28px;
  height: 21px;
  flex-shrink: 0;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  object-fit: cover;
}

.header-brand h1 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(0.9375rem, 2.4vw, 1.125rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  justify-self: end;
}

.last-updated {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3125rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.refresh-btn:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.refresh-btn:active {
  transform: scale(0.97);
}

.refresh-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.brand-flag {
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.brand-kicker {
  margin: 0 0 0.125rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--eng-red);
}

h1 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
}

@media (max-width: 520px) {
  .last-updated {
    display: none;
  }

  .refresh-btn-label {
    display: none;
  }

  .refresh-btn {
    padding: 0.375rem;
  }

  .header-brand h1 {
    font-size: 0.875rem;
  }
}

h2 {
  margin: 0 0 1rem;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.main {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.seo-intro {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.seo-summary {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.seo-summary p {
  margin: 0 0 0.75rem;
}

.seo-summary ul,
.seo-summary ol {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

.seo-summary li {
  margin-bottom: 0.25rem;
}

.seo-faq .faq-list {
  margin: 0;
}

.seo-faq dt {
  font-weight: 600;
  margin-top: 1rem;
}

.seo-faq dt:first-child {
  margin-top: 0;
}

.seo-faq dd {
  margin: 0.375rem 0 0;
  color: var(--text-muted);
}

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

.noscript-seo {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  color: var(--text);
}

.noscript-seo h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  margin: 0 0 0.75rem;
}

.noscript-seo p,
.noscript-seo ul {
  color: var(--text-muted);
  line-height: 1.6;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.hero {
  padding: 1.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(206, 17, 38, 0.2) 0%, rgba(1, 33, 105, 0.4) 100%);
  border-color: rgba(206, 17, 38, 0.35);
}

.hero-loading {
  color: var(--text-muted);
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-position {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.position-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.position-value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.position-rank {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(3rem, 12vw, 4.5rem);
  line-height: 1;
  color: var(--eng-white);
  text-shadow: 0 4px 20px rgba(206, 17, 38, 0.4);
}

.position-suffix {
  font-size: 1.125rem;
  color: var(--text-muted);
}

.qualification-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.qualification-badge.qualified {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.qualification-badge.contending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.qualification-badge.eliminated {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.hero-stat {
  text-align: center;
  padding: 0.875rem 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.hero-stat-value {
  display: block;
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--eng-white);
}

.hero-stat-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hero-stat.highlight .hero-stat-value {
  color: var(--eng-red);
}

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

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.next-match {
  min-height: 120px;
}

.match-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.match-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: fit-content;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.match-status.live {
  background: var(--eng-red);
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

.match-status.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}

.match-status.upcoming {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.match-status.finished {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.match-team img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.match-team-flag {
  display: block;
  width: 56px;
  height: 42px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.match-round {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.match-team-name {
  font-weight: 600;
  font-size: 0.9375rem;
  text-align: center;
}

.match-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 80px;
}

.match-score {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: 0.05em;
}

.match-vs {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.match-meta {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.record-stat {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  text-align: center;
}

.record-stat-value {
  display: block;
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.25rem;
  line-height: 1;
}

.record-stat-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.record-stat.wins .record-stat-value { color: var(--success); }
.record-stat.draws .record-stat-value { color: var(--warning); }
.record-stat.losses .record-stat-value { color: var(--danger); }
.record-stat.points .record-stat-value { color: var(--eng-red); }

.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.result-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
}

.result-badge {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.result-badge.win {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.result-badge.draw {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.result-badge.loss {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.result-opponent {
  font-weight: 500;
}

.result-stage {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.result-score {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

.result-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.standings-table th,
.standings-table td {
  padding: 0.625rem 0.5rem;
  text-align: center;
}

.standings-table th:first-child,
.standings-table td:first-child {
  text-align: left;
  padding-left: 0;
}

.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
  text-align: left;
}

.standings-table thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.standings-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.standings-table tbody tr.england-row {
  background: rgba(206, 17, 38, 0.12);
}

.standings-table tbody tr.england-row td {
  font-weight: 600;
}

.standings-note {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.highlights-lead {
  margin: 0 0 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.highlights-cta {
  --iplayer-pink: #f5498e;

  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid rgba(245, 73, 142, 0.28);
  border-radius: calc(var(--radius) - 4px);
  background: #0a0a0c;
  color: var(--iplayer-pink);
  text-decoration: none;
  box-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.highlights-cta:hover {
  background: #121216;
  border-color: rgba(245, 73, 142, 0.45);
}

.highlights-cta:active {
  background: #08080a;
}

.highlights-cta:focus-visible {
  outline: 2px solid var(--iplayer-pink);
  outline-offset: 3px;
}

.highlights-cta__mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(245, 73, 142, 0.1);
  border: 1px solid rgba(245, 73, 142, 0.25);
}

.highlights-cta__play {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--iplayer-pink);
}

.highlights-cta__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  text-align: left;
}

.highlights-cta__brand {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--iplayer-pink);
}

.highlights-cta__label {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(245, 73, 142, 0.78);
}

.highlights-cta__action {
  flex-shrink: 0;
  padding: 0.3125rem 0.625rem;
  border: 1px solid rgba(245, 73, 142, 0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--iplayer-pink);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.highlights-note {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (max-width: 420px) {
  .highlights-cta {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .highlights-cta__action {
    width: 100%;
    padding: 0.4375rem 0.75rem;
    text-align: center;
  }
}

.sf-symbol--play-fill {
  -webkit-mask-image: url(/assets/sf-symbols/play.fill.svg);
  mask-image: url(/assets/sf-symbols/play.fill.svg);
}

.sf-symbol {
  display: block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.sf-symbol--heart-fill {
  -webkit-mask-image: url(/assets/sf-symbols/heart-fill.svg);
  mask-image: url(/assets/sf-symbols/heart-fill.svg);
}

.sf-symbol--hammer-fill {
  -webkit-mask-image: url(/assets/sf-symbols/hammer.fill.svg);
  mask-image: url(/assets/sf-symbols/hammer.fill.svg);
}

.site-credit {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
  text-align: center;
}

.site-credit-line {
  margin: 0;
  font-size: 0.8125rem;
}

.site-credit-line a {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  color: var(--text-muted);
  text-decoration: none;
}

.site-credit-line a:hover {
  color: var(--text);
}

.site-credit-line a:hover .site-credit-text {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-credit-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.site-credit-heart-word {
  display: inline-block;
  vertical-align: -0.08em;
}

.site-credit-heart {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin: 0 0.12em;
  color: #026e6a;
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem 1.25rem 2rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--eng-red);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.mode-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100% - 2rem);
  padding: 0.625rem 1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mode-banner.local {
  background: rgba(245, 158, 11, 0.95);
  color: #1a1200;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.mode-banner.live {
  background: rgba(34, 197, 94, 0.95);
  color: #052e14;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-lg { height: 140px; }
.skeleton-stat { height: 80px; }
.skeleton-row { height: 52px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.error-banner {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.875rem;
}

.empty-state {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 1.5rem;
}
