/* ===== Match detail page (#/match/:id) ===== */

.matchPage .pageOverlay__inner { max-width: 900px; }

/* ---------- header ---------- */
.matchPage .pageOverlay__header.matchHead {
  display: block;
  padding: 8px 4px 0;
  border-bottom: 2px solid var(--color-primary);
  margin-bottom: 16px;
  position: relative;
}
.matchHead .pageOverlay__back {
  position: absolute;
  top: 8px;
  left: 0;
}
.matchHead__fav {
  position: absolute;
  top: 4px;
  right: 0;
  color: var(--color-support-2);
}
.matchHead__crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-support-2);
  padding-left: 44px;
  min-height: 32px;
}
.matchHead__crumb a { color: var(--color-support-4); }
.matchHead__crumb a:hover { color: var(--color-white); }
.matchHead__crumbMuted {
  color: var(--color-support-3);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.matchHead__grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 18px 8px 20px;
}
.matchHead__team {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.matchHead__team--home { justify-content: flex-start; }
.matchHead__team--away { justify-content: flex-end; }
.matchHead__teamName {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.matchHead__crest {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}
.matchHead__center { text-align: center; min-width: 120px; }
.matchHead__score {
  font-size: 34px;
  line-height: 1.05;
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -1px;
}
.matchHead__status {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-support-2);
  margin-top: 4px;
}
.matchHead__status--live {
  color: #ff4d84;
}
.matchHead__clock {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.matchHead__dotSep { margin: 0 5px; opacity: 0.55; }
.matchHead__status--ft { color: var(--color-support-4); }
.matchHead__venue {
  font-size: 11px;
  color: var(--color-support-3);
  margin-top: 4px;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ---------- timeline (Обзор) ---------- */
.timeline {
  background: var(--color-support-1);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  overflow: hidden;
}
.timeline__periodBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-secondary-3);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-support-2);
}
.timeline__periodScore {
  color: var(--color-white);
  font-size: 13px;
  letter-spacing: 0;
}
.tlRow {
  display: grid;
  grid-template-columns: 46px 26px 1fr;
  align-items: start;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid var(--color-divider);
  font-size: 13px;
}
.tlRow--away { grid-template-columns: 1fr 26px 46px; }
.tlRow--away .tlRow__min { order: 3; text-align: right; }
.tlRow--away .tlRow__icon { order: 2; }
.tlRow--away .tlRow__text { order: 1; text-align: right; }

.tlRow__min {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-support-2);
  padding-top: 2px;
}
.tlRow__icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 50%;
  background: var(--color-secondary-3);
}
.tlRow--goal .tlRow__icon { background: rgba(20, 220, 75, 0.16); }
.tlRow--red .tlRow__icon { background: rgba(220, 0, 0, 0.16); }
.tlRow--yellow .tlRow__icon { background: rgba(255, 205, 0, 0.16); }
.tlRow__text { min-width: 0; }
.tlRow__main {
  font-weight: 600;
  color: var(--color-white);
  overflow: hidden;
  text-overflow: ellipsis;
}
.tlRow__result {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--color-secondary-3);
  font-size: 11px;
  font-weight: 800;
  color: var(--color-white);
}
.tlRow__sub {
  font-size: 11px;
  color: var(--color-support-2);
  margin-top: 2px;
}

.matchMeta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.matchMeta__item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: var(--color-support-1);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
}
.matchMeta__item span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-support-2);
  font-weight: 700;
}
.matchMeta__item b { color: var(--color-white); font-size: 12px; }

/* ---------- statistics ---------- */
.statTeams {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-support-2);
  padding: 6px 4px 12px;
}
.statGroup {
  background: var(--color-support-1);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.statGroup__title {
  padding: 9px 14px;
  background: var(--color-secondary-3);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-support-2);
  text-align: center;
}
.statRow { padding: 9px 14px; border-top: 1px solid var(--color-divider); }
.statRow:first-of-type { border-top: 0; }
.statRow__values {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.statRow__side {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-white);
}
.statRow__side--away { text-align: right; }
.statRow__label {
  text-align: center;
  font-size: 12px;
  color: var(--color-support-4);
}
.statRow__bar {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--color-secondary-3);
}
.statRow__fill--home { background: var(--color-primary); }
.statRow__fill--away { background: #1f6feb; }

/* ---------- lineups ---------- */
.pitchWrap {
  background: var(--color-support-1);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  padding: 10px 12px 14px;
  margin-bottom: 16px;
}
.pitchTop {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 10px;
}
.pitchTop__team {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-support-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pitchTop__team--away { text-align: right; }
.pitchTop__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-support-3);
}

/* the field itself */
.pitchField {
  position: relative;
  width: 100%;
  aspect-ratio: 68 / 48;
  min-height: 320px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.022) 0 32px,
      rgba(0, 0, 0, 0) 32px 64px
    ),
    linear-gradient(180deg, #0d3520, #072416);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

/* markings */
.pitchField__markings { position: absolute; inset: 0; pointer-events: none; }
.pf-line--half {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(-0.5px);
}
.pf-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.pf-circle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -50%);
}
.pf-box {
  position: absolute;
  top: 18%;
  bottom: 18%;
  width: 13%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.pf-box--left { left: 0; border-left: 0; }
.pf-box--right { right: 0; border-right: 0; }
.pf-six {
  position: absolute;
  top: 34%;
  bottom: 34%;
  width: 5%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.pf-six--left { left: 0; border-left: 0; }
.pf-six--right { right: 0; border-right: 0; }

/* player on the pitch */
.pitchPlayer {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 72px;
  pointer-events: none;
  z-index: 2;
}
.pitchPlayer__avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #12341f;
  border: 2px solid rgba(255, 255, 255, 0.85);
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.pitchPlayer--home .pitchPlayer__avatar { border-color: #ff4d84; }
.pitchPlayer--away .pitchPlayer__avatar { border-color: #4d9bff; }
.pitchPlayer__initials {
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.8);
}
.pitchPlayer__photo {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  border-radius: 50%;
  object-fit: cover;
  background: #12341f;
}
.pitchPlayer__num {
  position: absolute;
  left: -6px;
  bottom: -4px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
}
.pitchPlayer__name {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.pitchPlayer__rating {
  position: absolute;
  top: -7px;
  right: 2px;
  padding: 0 4px;
  border-radius: 4px;
  background: #f5a623;
  color: #1a1a1a;
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
  z-index: 3;
}

.lineupCols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.lineupCol {
  background: var(--color-support-1);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  overflow: hidden;
}
.lineupCol__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--color-secondary-3);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-white);
}
.lineupCol__head img { width: 22px; height: 22px; object-fit: contain; }
.lineupCol__sub {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-support-2);
  border-top: 1px solid var(--color-divider);
}
.lineupCol__sub:first-of-type { border-top: 0; }
.lineupCol__empty { padding: 12px; color: var(--color-support-2); font-size: 12px; }

.lineupRow {
  display: grid;
  grid-template-columns: 26px 26px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-top: 1px solid rgba(15, 45, 55, 0.6);
  font-size: 12px;
}
.lineupRow:first-of-type { border-top: 0; }
.lineupRow__num {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-support-2);
  text-align: right;
}
.lineupRow__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-secondary-3);
}
.lineupRow__avatar {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-secondary-3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.lineupRow__initials {
  font-size: 9px;
  font-weight: 800;
  color: var(--color-support-2);
  letter-spacing: 0.2px;
}
.lineupRow__name {
  color: var(--color-white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lineupRow__pos {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--color-support-3);
}
.lineupRow__rating {
  min-width: 30px;
  text-align: center;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 205, 0, 0.16);
  color: var(--color-yellow);
  font-size: 10px;
  font-weight: 800;
}

/* ---------- empty state ---------- */
.matchEmpty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 48px 16px;
  text-align: center;
  background: var(--color-support-1);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
}
.matchEmpty__icon { font-size: 28px; }
.matchEmpty__title { font-size: 14px; font-weight: 700; color: var(--color-white); }
.matchEmpty__text { font-size: 12px; color: var(--color-support-2); max-width: 380px; }

/* ---------- text commentary ---------- */
.commentsBar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px 10px;
  flex-wrap: wrap;
}
.commentsChip {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-support-2);
  background: var(--color-support-1);
  border: 1px solid var(--color-divider);
  border-radius: 999px;
}
.commentsChip span { color: var(--color-support-3); font-weight: 600; margin-left: 2px; }
.commentsChip:hover { color: var(--color-white); }
.commentsChip.is-on { color: var(--color-white); background: var(--color-secondary-3); border-color: transparent; }
.commentsBar__note {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-support-3);
}
.comments {
  background: var(--color-support-1);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  overflow: hidden;
}
.cmtRow {
  display: grid;
  grid-template-columns: 46px 20px 1fr;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid var(--color-divider);
  align-items: start;
}
.cmtRow:first-child { border-top: 0; }
.cmtRow__min {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-support-3);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.cmtRow__icon { font-size: 12px; text-align: center; line-height: 1.5; color: var(--color-support-3); }
.cmtRow__text { font-size: 13px; line-height: 1.5; color: var(--color-support-2); }
.cmtRow--important .cmtRow__text { color: var(--color-white); font-weight: 600; }
.cmtRow--goal { background: rgba(0, 214, 143, 0.08); }
.cmtRow--goal .cmtRow__text { color: var(--color-white); font-weight: 700; }
.cmtRow--goal .cmtRow__min { color: var(--color-green); }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .matchHead__grid { grid-template-columns: 1fr auto 1fr; gap: 6px; padding: 12px 0 14px; }
  .matchHead__crest { width: 34px; height: 34px; }
  .matchHead__teamName { font-size: 12px; }
  .matchHead__score { font-size: 24px; }
  .matchHead__center { min-width: 76px; }
  .lineupCols { grid-template-columns: 1fr; }
  .tlRow { grid-template-columns: 40px 24px 1fr; padding: 8px 10px; }
  .tlRow--away { grid-template-columns: 1fr 24px 40px; }
  .statRow__values { grid-template-columns: 44px 1fr 44px; }

  /* compact pitch on phones */
  .pitchField { min-height: 240px; aspect-ratio: 68 / 56; }
  .pitchPlayer { width: 54px; }
  .pitchPlayer__avatar { width: 28px; height: 28px; }
  .pitchPlayer__initials { font-size: 9px; }
  .pitchPlayer__name { font-size: 8px; max-width: 54px; }
  .pitchPlayer__num { min-width: 13px; height: 13px; font-size: 8px; line-height: 13px; }
  .pitchPlayer__rating { font-size: 8px; line-height: 12px; top: -5px; }
  .pitchTop__team { font-size: 9px; }
  .pitchTop__label { display: none; }
  .pf-circle { width: 30%; }
}
