/* ===== Manchester United fan site — стили ===== */

:root {
  --red: #da291c;
  --red-dark: #a81f14;
  --yellow: #fbe122;
  --black: #0b0b0d;
  --ink: #17171b;
  --muted-ink: #5a5a66;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --border: #e3e3e8;
  --shadow: 0 6px 20px rgba(11, 11, 13, 0.08);
  --radius: 14px;
  --maxw: 1140px;
  --transition: 200ms ease;
}

html[data-theme="dark"] {
  --ink: #f2f2f5;
  --muted-ink: #a8a8b8;
  --bg: #101014;
  --bg-alt: #17171d;
  --surface: #1c1c24;
  --border: #2d2d38;
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}
.container--narrow { max-width: 720px; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--yellow);
  color: var(--black);
  padding: 10px 16px;
  z-index: 100;
  font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* ===== Шапка ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--black);
  border-bottom: 3px solid var(--red);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 66px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}
.logo__mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--red);
  color: var(--yellow);
  font-weight: 800;
  font-size: 0.95rem;
}
.logo__text strong { color: var(--red); }

.nav { margin-left: auto; }
.nav__list {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: #e8e8ee;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}
.nav__link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav__link.is-active { background: var(--red); color: #fff; }

.header__actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 38px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 2px;
  background: #fff;
  transition: transform var(--transition), opacity var(--transition);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Кнопки ===== */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), color var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--accent { background: var(--yellow); color: var(--black); }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn--small { padding: 8px 16px; font-size: 0.85rem; background: var(--yellow); color: var(--black); }

/* ===== Hero ===== */
.hero {
  position: relative;
  color: #fff;
  text-align: center;
  padding: 96px 0 80px;
  background:
    radial-gradient(circle at 20% 20%, rgba(251, 225, 34, 0.18), transparent 45%),
    linear-gradient(140deg, var(--red) 0%, var(--red-dark) 55%, var(--black) 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg, rgba(255, 255, 255, 0.05) 0 40px, transparent 40px 80px
  );
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.8rem;
  color: var(--yellow);
}
.hero__title {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -1px;
}
.hero__title span { color: var(--yellow); }
.hero__slogan {
  max-width: 560px;
  margin: 16px auto 28px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.92);
}
.hero__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hero__fact {
  max-width: 620px;
  margin: 40px auto 0;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
}
.hero__fact p { margin: 0 0 12px; min-height: 3em; }

/* ===== Секции ===== */
.section { padding: 72px 0; }
.section--muted { background: var(--bg-alt); }
.section--dark { background: var(--black); color: #f2f2f5; }
.section--dark .section__lead { color: rgba(255, 255, 255, 0.75); }

.section__title {
  position: relative;
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.section__title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 10px;
  background: var(--red);
  border-radius: 2px;
}
.section__lead {
  max-width: 720px;
  margin: 0 0 32px;
  color: var(--muted-ink);
}

/* ===== Карточки ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.card {
  padding: 22px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.card:hover { transform: translateY(-4px); }
.card__title { margin: 0 0 8px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted-ink); font-size: 0.95rem; }

/* ===== Счётчики ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.stat {
  padding: 24px 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}
.stat__num {
  display: block;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--yellow);
}
.stat__label {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.72);
}

/* ===== Фильтры ===== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.is-active { background: var(--red); border-color: var(--red); color: #fff; }

/* ===== Игроки ===== */
.players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.player {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: fade-in 320ms ease both;
}
.player__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px;
  background: linear-gradient(120deg, var(--red), var(--red-dark));
  color: #fff;
}
.player__number { font-size: 2rem; font-weight: 800; color: var(--yellow); line-height: 1; }
.player__pos {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
}
.player__body { padding: 16px 18px 20px; }
.player__name { margin: 0 0 4px; font-size: 1.05rem; }
.player__years { margin: 0 0 10px; font-size: 0.85rem; color: var(--muted-ink); }
.player__note { margin: 0; font-size: 0.9rem; color: var(--muted-ink); }

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

.empty { color: var(--muted-ink); font-style: italic; }

/* ===== Обратный отсчёт ===== */
.countdown {
  padding: 24px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.countdown__label { margin: 0 0 16px; color: var(--muted-ink); }
.countdown__label strong { color: var(--red); }
.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 460px;
  margin-inline: auto;
}
.countdown__cell {
  padding: 12px 4px;
  border-radius: 10px;
  background: var(--black);
  color: #fff;
}
.countdown__cell span {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}
.countdown__cell small { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; }

/* ===== Матчи ===== */
.matches__subtitle {
  margin: 26px 0 14px;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted-ink);
}
.matches__status { margin-bottom: 4px; }
.matches__note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.92rem;
}
.matches__note--error { border-left-color: var(--red); }
.matches__note p { margin: 0; }
.matches__note strong { display: block; margin-bottom: 2px; }
.matches__footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 24px 0 0;
  font-size: 0.85rem;
  color: var(--muted-ink);
}
.matches__footnote a { color: var(--red); }

.match-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.match {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.match--result { border-top: 4px solid var(--red); }
.match--upcoming { border-top: 4px solid var(--yellow); }

.match__top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted-ink);
}
.match__comp { font-weight: 700; color: var(--ink); }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge--home { background: var(--red); color: #fff; }
.badge--away { background: var(--border); color: var(--ink); }
.badge--neutral { background: var(--yellow); color: var(--black); }

.match__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}
.match__team { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.match__crest {
  width: 42px; height: 42px;
  object-fit: contain;
  background: transparent;
}
.match__crest--fallback {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-alt);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted-ink);
}
.match__team-name { font-size: 0.88rem; font-weight: 600; line-height: 1.25; }
.match__team--mu .match__team-name { color: var(--red); }

.match__score {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--black);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.match__score--pending { font-size: 1rem; letter-spacing: 1px; }
.match__score b { color: var(--yellow); }

.match__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted-ink);
}
.match__outcome { font-weight: 700; }
.match__outcome--win { color: #1f9d55; }
.match__outcome--draw { color: var(--muted-ink); }
.match__outcome--loss { color: var(--red); }

/* Скелетон загрузки */
.match--skeleton { min-height: 168px; }
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.2s infinite linear;
}
.skeleton-line--title { width: 45%; }
.skeleton-line--wide { width: 100%; height: 44px; }
.skeleton-line--short { width: 65%; }

@keyframes skeleton {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

[hidden] { display: none !important; }

/* ===== Квиз ===== */
.quiz__item {
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.quiz__question { margin: 0 0 12px; font-weight: 700; }
.quiz__options { display: grid; gap: 8px; }
.quiz__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.quiz__option:hover { border-color: var(--red); }
.quiz__option input { accent-color: var(--red); width: 18px; height: 18px; }
.quiz__item.is-correct { border-color: #1f9d55; }
.quiz__item.is-wrong { border-color: var(--red); }
.quiz__hint { margin: 10px 0 0; font-size: 0.85rem; color: var(--muted-ink); }
.quiz__footer { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.quiz__result { margin: 16px 0 0; font-weight: 700; min-height: 1.6em; }

/* ===== Подписка ===== */
.subscribe { display: flex; flex-wrap: wrap; gap: 10px; }
.input {
  flex: 1 1 240px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
}
.input[aria-invalid="true"] { border-color: var(--yellow); }
.form__msg { flex-basis: 100%; margin: 4px 0 0; font-size: 0.9rem; min-height: 1.4em; }
.form__msg.is-error { color: var(--yellow); }
.form__msg.is-ok { color: #7ee2a8; }

/* ===== Футер ===== */
.site-footer {
  padding: 32px 0;
  background: var(--black);
  color: rgba(255, 255, 255, 0.8);
  border-top: 3px solid var(--red);
  font-size: 0.9rem;
}
.footer__inner { display: grid; gap: 6px; }
.footer__note { margin: 0; color: rgba(255, 255, 255, 0.5); font-size: 0.82rem; }
.footer__inner p { margin: 0; }
.footer__top { color: var(--yellow); text-decoration: none; font-weight: 700; justify-self: start; }
.footer__top:hover { text-decoration: underline; }

/* ===== Адаптив ===== */
@media (max-width: 820px) {
  .burger { display: flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--black);
    border-bottom: 3px solid var(--red);
    display: none;
  }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; gap: 0; padding: 8px 20px 16px; }
  .nav__link { padding: 12px 8px; border-radius: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }

  .hero { padding: 72px 0 60px; }
  .section { padding: 56px 0; }
  .countdown__grid { grid-template-columns: repeat(2, 1fr); }
}

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