:root {
  --page-bg: var(--body-bg, #f7f7f7);
  --panel: var(--match-bg, var(--light-color, #ffffff));
  --line: var(--gray-2, #e5e5e5);
  --text: var(--header-color, #151515);
  --muted: #737373;
  --brand: var(--main-color, #00a878);
  --soft-panel: var(--gray-3, #f5f5f5);
  --table-cell: color-mix(in srgb, var(--panel) 96%, var(--text));
}

/* تبويبات معلومات المباراة والإحصائيات وعن المباراة */
.match-tabs{margin-top:4px}.match-tab-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:6px;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--soft-panel)}
.match-tab-button{min-height:46px;border:0;border-radius:9px;background:transparent;color:var(--muted);font:inherit;font-size:16px;font-weight:900;cursor:pointer}
.match-tab-button:hover,.match-tab-button:focus-visible{color:var(--text);outline:none}.match-tab-button.is-active{background:var(--panel);color:var(--main-color,#087c2d);box-shadow:0 3px 12px rgba(15,23,42,.1)}
.match-tab-panel{padding-top:24px}.match-tab-panel[hidden]{display:none!important}.match-main-title{margin-bottom:18px}
.match-info-card,.match-events-card,.match-stats-card{overflow:hidden;border:1px solid var(--line);border-radius:18px;background:var(--panel);box-shadow:0 10px 26px rgba(15,23,42,.06)}
.match-info-card>h2,.match-events-card>h2,.match-stats-card>h2{margin:0;padding:16px 20px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--main-color,#087c2d) 7%,var(--panel));color:var(--main-color,#087c2d);font-size:20px}
.match-info-card>h2 span{margin-inline-start:7px;font-size:17px}.match-info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.match-info-item{min-height:96px;display:grid;align-content:center;gap:8px;padding:15px 22px;border-bottom:1px solid var(--line)}.match-info-item:nth-child(odd){border-inline-end:1px solid var(--line)}
.match-info-item>span{color:var(--muted);font-size:14px}.match-info-item>strong{display:flex;align-items:center;gap:8px;font-size:17px;overflow-wrap:anywhere}.match-info-item i{font-style:normal;font-size:17px}
.match-events-card,.match-stats-card{margin-top:18px}.match-events-card>h2{padding-block:14px;text-align:center;color:var(--text);font-size:15px}.match-events-list{width:min(100%,540px);margin-inline:auto;padding:20px 14px 26px;direction:ltr}
.match-event{display:grid;grid-template-columns:minmax(0,1fr) 48px minmax(0,1fr);align-items:center;min-height:58px;direction:ltr}.match-event-minute{grid-column:2;grid-row:1;justify-self:center;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,var(--text) 20%,var(--panel));color:var(--text);direction:ltr;font-size:12px;font-weight:900}.match-event-body{min-width:0;display:flex;align-items:center;gap:8px;direction:ltr}.match-event-body.is-home{grid-column:3;grid-row:1;justify-content:flex-start}.match-event-body.is-away{grid-column:1;grid-row:1;flex-direction:row-reverse;justify-content:flex-start}.match-event-body.is-neutral{grid-column:1/4;grid-row:2;justify-content:center}.match-event-icon{flex:0 0 auto;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:17px;line-height:1}.match-event.is-sub .match-event-icon{border:1px solid var(--line);background:var(--soft-panel);font-size:14px}.match-event-copy{min-width:0;display:grid;gap:1px;direction:rtl;line-height:1.35}.match-event-body.is-home .match-event-copy{text-align:right}.match-event-body.is-away .match-event-copy{text-align:left}.match-event-body.is-away .match-event-copy>*{justify-self:end}.match-event-player{min-width:0;overflow-wrap:anywhere;font-size:14px}.match-event-player em{color:#08a860;font-style:normal}.match-event-player i{display:none}.match-event-player.is-in{color:#08a860}.match-event-player.is-out{color:#e3343b;font-size:12px;font-weight:800}.match-event-assist{color:var(--muted);font-size:11px}.match-event-milestone{min-height:54px;display:grid;grid-template-columns:minmax(20px,1fr) auto minmax(20px,1fr);align-items:center;gap:10px;color:var(--text);direction:ltr}.match-event-milestone>span{height:1px;background:var(--line)}.match-event-milestone strong{direction:ltr;font-size:13px;white-space:nowrap}.match-event-milestone strong b{display:inline-grid;width:36px;height:36px;margin-inline-end:6px;border:2px solid var(--line);border-radius:50%;place-items:center;font-size:12px}.match-event-milestone strong i{font-style:normal;font-weight:900}
.match-stats-head,.match-stat-row{display:grid;grid-template-columns:minmax(70px,.7fr) minmax(130px,1.4fr) minmax(70px,.7fr);align-items:center;gap:8px;padding:12px 18px;text-align:center}.match-stats-head{background:var(--soft-panel);color:var(--muted);font-size:13px}.match-stat-row{border-top:1px solid var(--line)}.match-stat-row b{direction:ltr}
.match-lineups-card{margin-top:18px;overflow:hidden;border:1px solid var(--line);border-radius:18px;background:var(--panel);box-shadow:0 10px 26px rgba(15,23,42,.06)}
.match-section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:17px 20px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--main-color,#087c2d) 7%,var(--panel))}.match-section-heading h2{margin:0;color:var(--main-color,#087c2d);font-size:20px}.match-section-heading p{margin-top:2px;color:var(--muted);font-size:12px;line-height:1.6}.match-lineup-status{flex:0 0 auto;padding:6px 11px;border-radius:999px;background:var(--soft-panel);color:var(--muted);font-size:12px;font-weight:900}.match-lineup-status.is-official{background:color-mix(in srgb,#15b86b 20%,var(--panel));color:#0aa45d}
.match-lineup-scorebar{min-height:58px;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:14px;padding:8px 20px;background:var(--soft-panel);border-bottom:1px solid var(--line)}.match-lineup-scorebar>strong{display:flex;align-items:center;justify-content:center;gap:9px;min-width:0;text-align:center}.match-lineup-scorebar>strong small{padding:4px 8px;border-radius:999px;background:var(--panel);color:var(--muted)}.match-lineup-scorebar>span{font-size:19px}.match-lineup-scorebar .is-home{justify-content:flex-start}.match-lineup-scorebar .is-away{justify-content:flex-end}
.match-lineup-pitch{position:relative;min-height:880px;display:grid;grid-template-rows:minmax(0,1fr) 1px minmax(0,1fr);padding:30px 24px;overflow:hidden;background:linear-gradient(color-mix(in srgb,var(--main-color,#087c2d) 8%,var(--panel)),color-mix(in srgb,var(--main-color,#087c2d) 14%,var(--panel)))}.match-lineup-pitch:before{content:"";position:absolute;inset:24px 18px;border:2px solid color-mix(in srgb,var(--text) 14%,transparent);border-radius:5px;pointer-events:none}.match-lineup-pitch:after{content:"";position:absolute;width:134px;height:134px;left:50%;top:50%;transform:translate(-50%,-50%);border:2px solid color-mix(in srgb,var(--text) 14%,transparent);border-radius:50%;pointer-events:none}.match-lineup-half{position:relative;z-index:1;display:flex;flex-direction:column;justify-content:space-around;gap:12px;padding:15px 0}.match-lineup-centre{position:relative;z-index:2;height:1px;background:color-mix(in srgb,var(--text) 14%,transparent)}.match-lineup-centre i{position:absolute;left:50%;top:50%;width:7px;height:7px;transform:translate(-50%,-50%);border-radius:50%;background:color-mix(in srgb,var(--text) 28%,var(--panel))}.match-lineup-row{position:relative;z-index:1;display:flex;align-items:flex-start;justify-content:space-around;gap:7px}
.match-lineup-player{position:relative;width:min(92px,24%);display:grid;justify-items:center;gap:4px;text-align:center}.match-lineup-avatar-wrap{position:relative}.match-lineup-avatar{width:var(--mg_theme-player-image-size,54px);height:var(--mg_theme-player-image-size,54px);display:grid;place-items:center;border:3px solid color-mix(in srgb,var(--text) 12%,var(--panel));border-radius:50%;background:var(--soft-panel);object-fit:cover;font-size:23px}.match-lineup-avatar.is-placeholder{color:var(--muted)}.match-lineup-player-name{max-width:100%;font-size:12px;line-height:1.35;overflow-wrap:anywhere;text-shadow:0 1px var(--panel)}.match-lineup-player-name span{margin-inline-end:4px;color:var(--muted);font-weight:700}.match-player-rating{position:absolute;inset-inline-start:-9px;top:-5px;min-width:29px;padding:3px 5px;border-radius:10px;background:#ff933a;color:#101419;font-size:10px;line-height:1}.match-player-rating.is-high{background:#27c675}.match-player-rating.is-low{background:#f2a23a}.match-player-captain{position:absolute;inset-inline-end:-5px;bottom:0;width:18px;height:18px;display:grid;place-items:center;border-radius:50%;background:var(--text);color:var(--panel);font-size:10px;font-style:normal;font-weight:900}.match-player-badges{position:absolute;inset-inline-end:-5px;top:calc(var(--mg_theme-player-image-size,54px) - 8px);display:flex;gap:2px}.match-player-badges i{width:17px;height:17px;display:grid;place-items:center;border-radius:50%;background:var(--panel);font-size:10px;font-style:normal}.match-player-badges .is-yellow{color:#ffbc16}.match-player-badges .is-red,.match-player-badges .is-out{color:#ef3545}.match-player-badges .is-in{color:#10b86c}
.match-lineup-coaches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-top:1px solid var(--line)}.match-lineup-coach{display:grid;justify-items:center;gap:4px;min-width:0;padding:15px 20px;text-align:center}.match-lineup-coach+.match-lineup-coach{border-inline-start:1px solid var(--line)}.match-lineup-coach>span:not(.match-lineup-coach-avatar){color:var(--muted);font-size:12px}.match-lineup-coach strong{max-width:100%;overflow-wrap:anywhere}.match-lineup-coach-avatar{display:grid;place-items:center;width:var(--mg_theme-player-image-size,54px);height:var(--mg_theme-player-image-size,54px);margin-bottom:4px;overflow:hidden;border:2px solid rgba(148,163,184,.3);border-radius:50%;background:#152437}.match-lineup-coach-avatar img{display:block;width:100%;height:100%;object-fit:cover}.match-lineup-coach-avatar i{font-style:normal;font-size:25px}.match-lineup-benches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-top:1px solid var(--line)}.match-lineup-bench{min-width:0;padding:18px 14px 24px}.match-lineup-bench+.match-lineup-bench{border-inline-start:1px solid var(--line)}.match-lineup-bench h3{margin:0 0 18px;text-align:center;font-size:15px}.match-lineup-bench>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 8px}.match-lineup-player.is-bench{width:auto}.match-lineup-player.is-bench small{color:var(--muted);font-size:10px}
.match-statistics-layout{display:grid;gap:18px}.match-stats-teams{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;padding:15px 18px;border:1px solid var(--line);border-radius:14px;background:var(--panel);text-align:center}.match-stats-teams strong:first-child{text-align:right}.match-stats-teams strong:last-child{text-align:left}.match-stats-teams span{color:var(--main-color,#087c2d);font-weight:900}.match-stat-group{padding:18px;border:1px solid var(--line);border-radius:18px;background:var(--panel);box-shadow:0 8px 22px rgba(15,23,42,.05)}.match-stat-group h2{margin:0 0 10px;text-align:center;font-size:19px}.match-stat-comparison{position:relative;display:grid;grid-template-columns:minmax(62px,.7fr) minmax(130px,1.6fr) minmax(62px,.7fr);align-items:center;gap:8px;min-height:49px;text-align:center}.match-stat-comparison>b{justify-self:center;direction:ltr}.match-stat-comparison>b.is-leading{min-width:42px;padding:5px 9px;border-radius:999px;background:color-mix(in srgb,var(--main-color,#087c2d) 25%,var(--panel));color:var(--text)}.match-stat-comparison>span{color:var(--muted)}.match-stat-comparison.is-possession{padding-bottom:22px}.match-possession-bar{position:absolute;inset:42px 4% auto;height:10px;border-radius:999px;background:#eaa01b;overflow:hidden}.match-possession-bar em{height:100%;display:block;background:color-mix(in srgb,var(--main-color,#087c2d) 70%,#61b9dc)}
@media(max-width:700px){.match-info-grid{grid-template-columns:1fr}.match-info-item:nth-child(odd){border-inline-end:0}.match-info-item{min-height:84px}.match-events-card>h2{padding-block:15px;font-size:16px}.match-events-list{width:100%;padding:20px 14px 28px}.match-event{grid-template-columns:48px minmax(0,1fr) 48px;min-height:92px}.match-event-minute{width:auto;height:auto;border-radius:0;background:transparent;font-size:17px}.match-event.is-home .match-event-minute{grid-column:3}.match-event.is-away .match-event-minute{grid-column:1}.match-event.is-neutral .match-event-minute{grid-column:3}.match-event-body.is-home{grid-column:2;flex-direction:row-reverse;justify-self:end;justify-content:flex-start}.match-event-body.is-away{grid-column:2;flex-direction:row;justify-self:start;justify-content:flex-start}.match-event-body.is-neutral{grid-column:1/4;grid-row:2}.match-event-icon{width:30px;height:30px;font-size:20px}.match-event.is-sub .match-event-icon{display:none}.match-event-copy{gap:3px}.match-event-player{font-size:17px}.match-event-player.is-out{font-size:16px}.match-event-assist{font-size:13px}.match-event-player i{display:inline-grid;width:22px;height:22px;margin-inline-end:6px;border-radius:50%;place-items:center;font-style:normal;font-size:14px}.match-event-player.is-in i{background:#08a860;color:#0b2a1b}.match-event-player.is-out i{background:#f22e3a;color:#fff}.match-event-milestone{min-height:70px;gap:8px}.match-event-milestone strong{font-size:16px}.match-event-milestone strong b{width:42px;height:42px;font-size:14px}}
@media(max-width:480px){.match-tab-button{min-width:0;font-size:14px}.match-stats-head,.match-stat-row{grid-template-columns:58px minmax(105px,1fr) 58px;padding-inline:8px;font-size:13px}}
@media(max-width:760px){.match-tab-list{grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible}.match-tab-button{padding-inline:5px;font-size:13px}.match-section-heading{align-items:flex-start}.match-section-heading p{display:none}.match-lineup-scorebar{padding-inline:10px;font-size:12px}.match-lineup-scorebar>strong{display:grid;gap:4px}.match-lineup-pitch{min-height:1040px;padding:26px 5px}.match-lineup-half{padding-block:22px}.match-lineup-avatar{width:64px;height:64px}.match-lineup-player{width:min(112px,25%)}.match-lineup-player-name{font-size:13px}.match-lineup-benches{grid-template-columns:repeat(2,minmax(0,1fr))}.match-lineup-bench{padding-inline:6px}.match-lineup-bench>div{grid-template-columns:1fr;gap:27px}.match-lineup-player.is-bench .match-lineup-avatar{width:68px;height:68px}.match-lineup-player.is-bench .match-lineup-player-name{font-size:14px}.match-statistics-layout{gap:14px}.match-stats-teams{font-size:13px}.match-stat-group{padding:16px 10px}.match-stat-group h2{font-size:18px}.match-stat-comparison{grid-template-columns:minmax(58px,.72fr) minmax(120px,1.65fr) minmax(58px,.72fr);font-size:15px}.match-stat-comparison>span{font-size:14px}}
@media(max-width:390px){.match-tab-button{font-size:12px}.match-lineup-pitch{min-height:960px}.match-lineup-avatar{width:56px;height:56px}.match-lineup-player-name{font-size:11px}.match-stat-comparison{grid-template-columns:54px minmax(105px,1fr) 54px;gap:4px}.match-stat-comparison>span{font-size:12px}}

html[data-theme="dark"],
body[data-theme="dark"] {
  --muted: #aaaaaa;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-type);
}

.match-related-block {
  margin-top: 20px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.16);
}

.match-related-head h2 {
  margin: 0 0 20px;
  font-size: 20px;
}

.match-related-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.match-related-card {
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.match-related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

.match-related-card > img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
  background: var(--soft-panel);
}

.match-related-card > div {
  min-height: 110px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-related-card > div > div:first-child {
  font-size: 15px;
  line-height: 1.7;
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.match-related-card > div > div:last-child {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
}

.match-related-more {
  margin: 22px auto 0;
  padding: 9px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: block;
  background: var(--soft-panel);
  color: var(--text);
  cursor: pointer;
}

.match-related-more:hover {
  background: var(--main-color);
  color: #fff;
}
a {
  color: inherit;
}
.wrap {
  width: min(100% - 24px, 1050px);
  margin: 14px auto 28px;
}
.brand {
  display: inline-block;
  margin: 8px 0 16px;
  font-weight: 900;
  text-decoration: none;
  color: #111827;
  letter-spacing: 0;
}
h1 {
  margin: 0;
  font-size: clamp(18px, 3.3vw, 24px);
  line-height: 1.55;
  text-align: center;
}
h2 {
  margin: 0 0 14px;
  font-size: clamp(16px, 3vw, 20px);
  line-height: 1.55;
}
p {
  line-height: 2;
  margin: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
}
.card strong {
  display: block;
  margin-bottom: 8px;
}
.meta {
  color: #64748b;
  font-size: 14px;
}
.top {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.teams img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.match-page {
  width: min(100% - 18px, 1000px);
  margin: 8px auto 30px;
}
.match-hero {
  min-height: 210px;
  border: 1px solid #cfd5df;
  border-radius: 8px;
  overflow: hidden;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.42)),
    var(--match-stadium-bg);
  background-size: cover;
  background-position: center;
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: clamp(18px, 4vw, 34px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.match-team {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
}
.match-team-name {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  font-weight: 900;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.match-logo {
  display: block;
  width: 64px;
  height: 64px;
  min-width: 0;
  max-width: 64px;
  aspect-ratio: 1 / 1;
  background: transparent;
  border: 0;
  box-shadow: none;
  object-position: center;
  transform: none !important;
  perspective: none;
}

.match-logo.is-national {
  border-radius: 50%;
  object-fit: cover;
}
.match-logo.is-club {
  border-radius: 0;
  object-fit: contain;
  padding: 0;
}
.match-team > .match-logo,
.match-team > .mg-theme-logo > .match-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.versus {
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
}
.match-info-ad {
  margin: 18px auto;
}
.match-floating-ads {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 950;
  display: grid;
  gap: 10px;
}
[dir="rtl"] .match-floating-ads {
  right: auto;
  left: 16px;
}
.match-floating-ad-card {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}
.match-floating-ad-card iframe,
.match-floating-ad-card img,
.match-floating-ad-card ins {
  max-width: 100%;
  max-height: 100%;
}
.content-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.match-heading {
  padding: 12px 16px;
  background: var(--soft-panel);
  border-bottom: 1px solid var(--line);
  font-weight: 900;
  text-align: center;
  font-size: clamp(16px, 2.6vw, 20px);
}
.match-body {
  padding: clamp(16px, 4vw, 28px);
}
.section-title {
  display: inline-block;
  margin: 18px 0 12px;
  padding: 7px 12px;
  border-radius: 6px;
  background: var(--soft-panel);
  font-size: 17px;
  font-weight: 900;
}
.match-body > .match-watch-box + .section-title {
  margin-top: 0;
}
.details-text {
  font-size: 17px;
  margin-bottom: 0;
}
.match-body > .match-table {
  margin-top: 0;
}
.match-watch-box {
  margin: 0 0 24px;
  display: flex;
  justify-content: center;
}
.match-watch-button,
.match-watch-unavailable,
.match-watch-countdown {
  width: var(--mg_theme-watch-width, 100%);
  min-height: var(--mg_theme-watch-height, 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 14px 18px;
  text-align: center;
  font-size: var(--mg_theme-watch-font-size, 24px);
  font-weight: 900;
  line-height: 1.35;
}
.match-watch-button {
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #b91c1c, #ef4444, #991b1b);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 26px rgba(185, 28, 28, 0.42);
  animation: matchgridWatchPulse 1s ease-in-out infinite;
}
.match-watch-button:hover,
.match-watch-button:focus-visible {
  color: #fff;
  transform: translateY(-1px);
  outline: 3px solid rgba(239, 68, 68, 0.28);
  outline-offset: 3px;
}
.match-watch-unavailable {
  color: var(--muted);
  background: var(--soft-panel);
  border: 1px dashed var(--line);
}
.match-watch-countdown {
  color: #fff7ad;
  background: #171717;
  border: 1px solid rgba(255, 247, 173, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 173, 0.12);
  direction: ltr;
}
@keyframes matchgridWatchPulse {
  0%,
  100% {
    background: linear-gradient(135deg, #991b1b, #dc2626, #7f1d1d);
    box-shadow:
      0 0 0 rgba(239, 68, 68, 0),
      0 12px 26px rgba(185, 28, 28, 0.34);
    filter: brightness(1);
    transform: scale(1);
  }
  50% {
    background: linear-gradient(135deg, #ef4444, #ff1f1f, #b91c1c);
    box-shadow:
      0 0 22px rgba(239, 68, 68, 0.72),
      0 16px 30px rgba(185, 28, 28, 0.48);
    filter: brightness(1.22);
    transform: scale(1.01);
  }
}
.match-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 16px;
}
.match-table th,
.match-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: middle;
}
.match-table th {
  width: 34%;
  background: var(--soft-panel);
  text-align: start;
  font-weight: 900;
}
.match-table td {
  background: var(--table-cell);
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .wrap {
    margin-top: 14px;
  }
  .top {
    padding: 16px;
  }
  .match-page {
    width: min(100% - 12px, 1000px);
  }
  .match-hero {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    min-height: 136px;
    aspect-ratio: 16 / 6.2;
    padding: 12px;
  }
  .match-team {
    gap: 7px;
  }
  .match-logo {
    width: 56px;
    height: 56px;
    max-width: 56px;
  }
  .match-team-name {
    font-size: clamp(11px, 3.3vw, 14px);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .versus {
    font-size: clamp(30px, 9vw, 46px);
  }
  .match-table {
    font-size: 15px;
  }
  .match-table th,
  .match-table td {
    padding: 9px;
  }
  .match-watch-button,
  .match-watch-unavailable,
  .match-watch-countdown {
    border-radius: 10px;
    padding: 12px 14px;
  }
  .match-floating-ads {
    right: 10px;
    bottom: 10px;
    gap: 7px;
  }
  [dir="rtl"] .match-floating-ads {
    right: auto;
    left: 10px;
  }
  .match-floating-ad-card {
    width: 52px;
    height: 52px;
    border-radius: 8px;
  }

  .match-related-block {
    padding: 14px;
  }

  .match-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

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

.match-editorial-content {
  margin-top: 20px;
}

.match-editorial-content p {
  margin: 0 0 15px;
  font-size: 17px;
  line-height: 2;
}

.match-editorial-content h2,
.match-editorial-content h3 {
  margin: 22px 0 12px;
  line-height: 1.7;
}

.match-editorial-content ul,
.match-editorial-content ol {
  margin: 12px 0;
  padding-inline-start: 24px;
  line-height: 2;
}

.match-editorial-content img {
  max-width: 100%;
  height: auto;
}

.match-internal-links {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
  font-size: 16px;
  line-height: 2;
}

.match-internal-links a {
  font-weight: 800;
  text-decoration: underline;
}

/* 1.3.7: compact responsive match facts, lineups, events and statistics. */
.match-tab-button {
  min-height: 42px;
  font-size: 15px;
}

.match-tab-panel {
  padding-top: 18px;
}

.match-info-card > h2 {
  padding: 14px 18px;
  font-size: 17px;
}

.match-info-card > h2 span {
  font-size: 15px;
}

.match-info-item {
  min-height: 78px;
  gap: 5px;
  padding: 12px 18px;
}

.match-info-item > span {
  font-size: 13px;
}

.match-info-item > strong {
  gap: 6px;
  font-size: 15px;
}

.match-info-item i {
  font-size: 14px;
}

.match-context-team-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
}

.match-events-card,
.match-stats-card,
.match-lineups-card,
.match-stat-group {
  border-radius: 14px;
}

.match-events-teams,
.match-stats-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--main-color, #087c2d) 7%, var(--panel));
  text-align: center;
}

.match-events-teams > strong,
.match-stats-teams > strong {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.match-events-teams > strong:first-child,
.match-stats-teams > strong:first-child {
  justify-content: flex-start;
  text-align: right;
}

.match-events-teams > strong:last-child,
.match-stats-teams > strong:last-child {
  flex-direction: row-reverse;
  justify-content: flex-start;
  text-align: left;
}

.match-events-teams b,
.match-stats-teams b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.match-events-teams > span,
.match-stats-teams > span {
  color: var(--main-color, #087c2d);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.match-events-list {
  width: min(100%, 680px);
  padding: 14px 16px 20px;
}

.match-event {
  min-height: 52px;
}

.match-event-minute {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.match-event-icon {
  width: 24px;
  height: 24px;
  font-size: 15px;
}

.match-event-player {
  font-size: 13px;
}

.match-event-player.is-out {
  font-size: 11px;
}

.match-event-assist {
  font-size: 10px;
}

.match-section-heading {
  padding: 14px 18px;
}

.match-section-heading h2 {
  font-size: 17px;
}

.match-lineup-scorebar {
  min-height: 52px;
  padding: 7px 16px;
  font-size: 13px;
}

.match-lineup-scorebar > strong > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.match-lineup-scorebar > strong small {
  padding: 3px 7px;
  font-size: 11px;
}

/* Desktop: both teams share one horizontal pitch. */
.match-lineup-pitch {
  min-height: 470px;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  padding: 24px 18px;
}

.match-lineup-half {
  min-width: 0;
  gap: 8px;
  padding: 12px 10px;
}

.match-lineup-centre {
  width: 1px;
  height: auto;
  align-self: stretch;
}

.match-lineup-player {
  width: min(82px, 24%);
  min-width: 0;
  gap: 3px;
}

.match-lineup-avatar {
  width: 46px;
  height: 46px;
  border-width: 2px;
  font-size: 20px;
}

.match-lineup-player-name {
  width: 100%;
  max-height: 2.8em;
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.match-player-rating {
  min-width: 25px;
  padding: 2px 4px;
  font-size: 9px;
}

.match-player-badges {
  top: 38px;
}

.match-player-badges i {
  width: 15px;
  height: 15px;
  font-size: 9px;
}

.match-lineup-coach {
  padding: 12px 16px;
  font-size: 13px;
}

.match-lineup-benches {
  font-size: 12px;
}

.match-lineup-bench {
  padding: 14px 10px 18px;
}

.match-lineup-bench h3 {
  margin-bottom: 14px;
  font-size: 14px;
}

.match-lineup-bench > div {
  gap: 18px 6px;
}

.match-lineup-player.is-bench .match-lineup-avatar {
  width: 44px;
  height: 44px;
}

.match-statistics-layout {
  gap: 14px;
}

.match-stat-group {
  padding: 14px;
}

.match-stat-group h2 {
  margin-bottom: 7px;
  font-size: 17px;
}

.match-stat-comparison {
  min-height: 44px;
  font-size: 14px;
}

.match-stat-comparison > span {
  font-size: 13px;
}

@media (max-width: 760px) {
  .match-body {
    padding: 12px 10px;
  }

  .match-tab-list {
    gap: 5px;
    padding: 5px;
  }

  .match-tab-list.has-2-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-tab-list.has-3-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .match-tab-list.has-4-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-tab-button {
    min-height: 39px;
    padding: 6px 4px;
    font-size: 12px;
  }

  .match-tab-panel {
    padding-top: 12px;
  }

  .match-info-card > h2 {
    padding: 11px 12px;
    font-size: 15px;
  }

  .match-info-card > h2 span {
    font-size: 13px;
  }

  .match-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-info-item,
  .match-info-item:nth-child(odd) {
    min-height: 66px;
    gap: 3px;
    padding: 8px 9px;
    border-inline-end: 1px solid var(--line);
  }

  .match-info-item:nth-child(even) {
    border-inline-end: 0;
  }

  .match-info-item > span {
    font-size: 10px;
  }

  .match-info-item > strong {
    gap: 4px;
    font-size: 12px;
    line-height: 1.45;
  }

  .match-info-item i {
    font-size: 12px;
  }

  .match-events-teams,
  .match-stats-teams {
    gap: 5px;
    padding: 9px 7px;
  }

  .match-events-teams > strong,
  .match-stats-teams > strong {
    gap: 4px;
    font-size: 10px;
  }

  .match-events-teams > span,
  .match-stats-teams > span {
    font-size: 12px;
  }

  .match-context-team-logo {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .match-events-list {
    padding: 9px 5px 14px;
  }

  .match-event {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    min-height: 58px;
  }

  .match-event-minute {
    font-size: 12px;
  }

  .match-event-body {
    gap: 5px;
  }

  .match-event-icon {
    width: 21px;
    height: 21px;
    font-size: 14px;
  }

  .match-event-copy {
    gap: 1px;
    line-height: 1.25;
  }

  .match-event-player {
    font-size: 12px;
  }

  .match-event-player.is-out {
    font-size: 11px;
  }

  .match-event-assist {
    font-size: 9px;
  }

  .match-event-player i {
    width: 16px;
    height: 16px;
    margin-inline-end: 3px;
    font-size: 10px;
  }

  .match-event-milestone {
    min-height: 48px;
    gap: 6px;
  }

  .match-event-milestone strong {
    font-size: 12px;
  }

  .match-event-milestone strong b {
    width: 31px;
    height: 31px;
    font-size: 10px;
  }

  .match-lineups-card {
    margin-top: 12px;
  }

  .match-section-heading {
    padding: 11px 12px;
  }

  .match-section-heading h2 {
    font-size: 15px;
  }

  .match-lineup-status {
    padding: 4px 8px;
    font-size: 10px;
  }

  .match-lineup-scorebar {
    min-height: 46px;
    gap: 5px;
    padding: 6px 7px;
    font-size: 10px;
  }

  .match-lineup-scorebar > strong {
    display: flex;
    gap: 4px;
  }

  .match-lineup-scorebar > strong small {
    padding: 2px 4px;
    font-size: 9px;
  }

  .match-lineup-scorebar > span {
    font-size: 14px;
  }

  /* Mobile keeps the requested vertical pitch, but without oversized players. */
  .match-lineup-pitch {
    min-height: 760px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 1px minmax(0, 1fr);
    padding: 18px 2px;
  }

  .match-lineup-half {
    gap: 7px;
    padding: 10px 0;
  }

  .match-lineup-centre {
    width: auto;
    height: 1px;
    align-self: auto;
  }

  .match-lineup-row {
    gap: 2px;
  }

  .match-lineup-player {
    width: min(76px, 24%);
    gap: 2px;
  }

  .match-lineup-avatar,
  .match-lineup-player.is-bench .match-lineup-avatar {
    width: 39px;
    height: 39px;
    border-width: 2px;
    font-size: 16px;
  }

  .match-lineup-player-name,
  .match-lineup-player.is-bench .match-lineup-player-name {
    max-height: 2.65em;
    font-size: 10px;
    line-height: 1.3;
  }

  .match-player-rating {
    inset-inline-start: -6px;
    top: -4px;
    min-width: 22px;
    padding: 2px 3px;
    font-size: 8px;
  }

  .match-player-captain {
    width: 14px;
    height: 14px;
    font-size: 8px;
  }

  .match-player-badges {
    top: 31px;
  }

  .match-player-badges i {
    width: 13px;
    height: 13px;
    font-size: 8px;
  }

  .match-lineup-coach {
    padding: 9px 6px;
    font-size: 11px;
  }

  .match-lineup-coach > span:not(.match-lineup-coach-avatar) {
    font-size: 9px;
  }

  .match-lineup-benches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-lineup-bench {
    padding: 11px 4px 14px;
  }

  .match-lineup-bench h3 {
    margin-bottom: 11px;
    font-size: 12px;
  }

  .match-lineup-bench > div {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .match-lineup-player.is-bench small {
    font-size: 8px;
  }

  .match-statistics-layout {
    gap: 10px;
  }

  .match-stat-group {
    padding: 11px 7px;
  }

  .match-stat-group h2 {
    margin-bottom: 5px;
    font-size: 16px;
  }

  .match-stat-comparison {
    grid-template-columns: minmax(48px, .65fr) minmax(105px, 1.7fr) minmax(48px, .65fr);
    gap: 4px;
    min-height: 41px;
    font-size: 13px;
  }

  .match-stat-comparison > span {
    font-size: 13px;
    line-height: 1.35;
  }

  .match-stat-comparison > b.is-leading {
    min-width: 35px;
    padding: 4px 6px;
  }

  .match-stat-comparison.is-possession {
    padding-bottom: 18px;
  }

  .match-possession-bar {
    inset-block-start: 37px;
    height: 8px;
  }
}

@media (max-width: 390px) {
  .match-tab-button {
    font-size: 11px;
  }

  .match-lineup-pitch {
    min-height: 710px;
  }

  .match-lineup-avatar,
  .match-lineup-player.is-bench .match-lineup-avatar {
    width: 36px;
    height: 36px;
  }

  .match-lineup-player-name,
  .match-lineup-player.is-bench .match-lineup-player-name {
    font-size: 9px;
  }

  .match-stat-comparison,
  .match-stat-comparison > span {
    font-size: 13px;
  }
}

/* 1.3.11: mobile team bands and precise player-event symbols. */
.match-lineup-mobile-team {
  display: none;
}

/* Captain mirrors the rating badge at the other top corner. */
.match-player-captain {
  inset-inline-end: -5px;
  top: -5px;
  bottom: auto;
}

/* A single football-boot silhouette is reused for assists everywhere. */
.match-player-badges .is-assist::before,
.match-assist-boot::before {
  content: "";
  display: block;
  width: 12px;
  height: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M3 1h6v7.2l4.2 3.1 6.2.9c1 .1 1.8 1 1.8 2v3.2H2.5v-4h7.2L5.6 10 3 9.4V1zm1.8 14.3h13.8v-1l-6.2-.9-3.9-2.9v1.2l3.1 2.5H4.8v1.1z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M3 1h6v7.2l4.2 3.1 6.2.9c1 .1 1.8 1 1.8 2v3.2H2.5v-4h7.2L5.6 10 3 9.4V1zm1.8 14.3h13.8v-1l-6.2-.9-3.9-2.9v1.2l3.1 2.5H4.8v1.1z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.match-player-badges .is-assist {
  background: #f2f2f2;
  color: #17202a;
}

.match-assist-boot {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #f2f2f2;
  color: #17202a;
  vertical-align: middle;
  margin-inline-end: 4px;
}

.match-event-assist {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Substitution arrows are generated inside fixed circles so RTL text cannot
   push the glyph away from the visual centre. */
.match-player-badges .is-in,
.match-event-player.is-in i {
  background: #08a860;
  color: #fff;
}

.match-player-badges .is-out,
.match-event-player.is-out i {
  background: #f22e3a;
  color: #fff;
}

.match-player-badges .is-in::before,
.match-event-player.is-in i::before {
  content: "←";
}

.match-player-badges .is-out::before,
.match-event-player.is-out i::before {
  content: "→";
}

.match-player-badges .is-in::before,
.match-player-badges .is-out::before,
.match-event-player.is-in i::before,
.match-event-player.is-out i::before {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-.25px);
}

/* Cards use the same upright proportions in the timeline and on players. */
.match-player-badges .is-yellow,
.match-player-badges .is-red,
.match-event.is-yellow .match-event-icon,
.match-event.is-red .match-event-icon {
  width: 9px;
  height: 15px;
  min-width: 9px;
  min-height: 15px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.45);
  font-size: 0;
}

.match-player-badges .is-yellow,
.match-event.is-yellow .match-event-icon { background: #ffd532; }

.match-player-badges .is-red,
.match-event.is-red .match-event-icon { background: #ef3545; }

@media (max-width: 760px) {
  /* The home team owns the upper half; the away team owns the lower half. */
  .match-lineup-scorebar {
    display: none;
  }

  .match-lineup-mobile-team {
    min-height: 52px;
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    background: var(--soft-panel);
  }

  .match-lineup-mobile-team.is-home {
    border-bottom: 1px solid var(--line);
  }

  .match-lineup-mobile-team.is-away {
    border-top: 1px solid var(--line);
  }

  .match-lineup-mobile-team strong {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
  }

  .match-lineup-mobile-team small {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
  }

  .match-lineup-mobile-team .match-context-team-logo {
    width: 30px;
    height: 30px;
  }

  .match-lineup-half.is-home { grid-row: 1; }
  .match-lineup-centre { grid-row: 2; }
  .match-lineup-half.is-away { grid-row: 3; }

  .match-event.is-yellow .match-event-icon,
  .match-event.is-red .match-event-icon {
    width: 10px;
    height: 16px;
    min-width: 10px;
    min-height: 16px;
  }
}

/* Keep provider events with an unknown/unmatched team on the same row as the
   minute. The historical neutral rule placed their copy on a second row. */
.match-event-body.is-neutral {
  grid-column: 3;
  grid-row: 1;
  justify-content: flex-start;
}

@media (max-width: 700px) {
  .match-event-body.is-neutral {
    grid-column: 2;
    grid-row: 1;
    flex-direction: row-reverse;
    justify-self: end;
    justify-content: flex-start;
  }
}

/* 1.3.10: player-event markers and a single mobile player scale. */
.match-player-badges {
  z-index: 4;
  inset-inline-end: -9px;
  top: auto;
  bottom: -7px;
  width: 42px;
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  gap: 2px;
  pointer-events: none;
}

.match-player-badges i {
  position: relative;
  width: 16px;
  height: 16px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--text) 28%, transparent);
  border-radius: 50%;
  background: #29323b;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.55);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.match-player-badges .is-goal,
.match-player-badges .is-own-goal {
  border: 0;
  background: #f5f5f5;
  color: #101419;
  font-size: 11px;
}

.match-player-badges .is-own-goal::after {
  content: "ع";
  position: absolute;
  inset-inline-end: -4px;
  bottom: -3px;
  min-width: 9px;
  height: 9px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ef3545;
  color: #fff;
  font-size: 6px;
}

.match-player-badges .is-yellow,
.match-player-badges .is-red {
  width: 10px;
  height: 15px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 3px;
}

.match-player-badges .is-yellow { background: #ffd532; }
.match-player-badges .is-red { background: #ef3545; }

.match-player-badges .is-in,
.match-player-badges .is-out {
  background: #f45b63;
  color: #fff;
  font-size: 10px;
}

.match-player-badges .is-in::after,
.match-player-badges .is-out::after {
  content: attr(data-minute);
  position: absolute;
  inset-inline-start: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(50%);
  width: max-content;
  color: var(--text);
  text-shadow: 0 1px 2px var(--panel), 0 0 2px var(--panel);
  font-size: 7px;
  font-weight: 900;
}

.match-player-badges .is-assist {
  background: #f2f2f2;
  color: #17202a;
}

.match-player-badges .is-assist::before {
  content: "";
  width: 10px;
  height: 7px;
  border-radius: 5px 2px 4px 2px;
  background: currentColor;
  clip-path: polygon(0 28%,55% 28%,72% 0,100% 18%,82% 70%,100% 100%,18% 100%);
  transform: rotate(-18deg);
}

.match-player-badges .is-miss { background: #ef3545; }
.match-player-badges .is-var { width: 22px; border-radius: 5px; font-size: 6px; }
.match-player-badges .is-offside { background: #f2f2f2; color: #17202a; }
.match-player-badges .is-injury { background: #ef3545; }

@media (max-width: 760px) {
  .match-player-badges {
    inset-inline-end: -7px;
    bottom: -6px;
  }

  .match-player-badges i {
    width: 15px;
    height: 15px;
    font-size: 8px;
  }

  .match-player-badges .is-yellow,
  .match-player-badges .is-red {
    width: 9px;
    height: 14px;
  }
}

/* 1.3.8: true horizontal desktop formation and complete pitch markings. */
@media (min-width: 761px) {
  .match-lineup-pitch {
    min-height: 500px;
    padding: 34px 32px;
  }

  .match-lineup-half {
    display: flex;
    flex-direction: row;
    direction: ltr;
    align-items: stretch;
    justify-content: space-evenly;
    gap: 3px;
    padding: 20px 13px;
  }

  .match-lineup-row {
    min-width: 0;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 5px;
  }

  .match-lineup-player {
    width: min(76px, 100%);
    direction: rtl;
  }
}

.match-pitch-markings,
.match-pitch-markings i {
  position: absolute;
  display: block;
  pointer-events: none;
}

.match-pitch-markings {
  z-index: 0;
  inset: 24px 18px;
}

.match-pitch-markings i {
  border: 2px solid color-mix(in srgb, var(--text) 14%, transparent);
}

.match-pitch-penalty {
  top: 25%;
  bottom: 25%;
  width: 14%;
}

.match-pitch-penalty.is-home {
  left: 0;
  border-left: 0;
}

.match-pitch-penalty.is-away {
  right: 0;
  border-right: 0;
}

.match-pitch-goal {
  top: 39%;
  bottom: 39%;
  width: 3.2%;
}

.match-pitch-goal.is-home {
  right: 100%;
  border-right: 0;
}

.match-pitch-goal.is-away {
  left: 100%;
  border-left: 0;
}

@media (max-width: 760px) {
  /* Four available tabs remain in one row, including narrow phones. */
  .match-tab-list.has-4-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .match-tab-button {
    min-width: 0;
    font-size: 13px;
    line-height: 1.25;
  }

  /* Raise the compact mobile typography one step without enlarging boxes. */
  .match-info-card > h2 { font-size: 16px; }
  .match-info-card > h2 span { font-size: 14px; }
  .match-info-item > span { font-size: 11px; }
  .match-info-item > strong { font-size: 13px; }
  .match-info-item i { font-size: 13px; }
  .match-events-teams > strong,
  .match-stats-teams > strong { font-size: 11px; }
  .match-events-teams > span,
  .match-stats-teams > span { font-size: 13px; }
  .match-event-minute { font-size: 13px; }
  .match-event-icon { font-size: 15px; }
  .match-event-player { font-size: 13px; }
  .match-event-player.is-out { font-size: 12px; }
  .match-event-assist { font-size: 10px; }
  .match-event-player i { font-size: 11px; }
  .match-event-milestone strong { font-size: 13px; }
  .match-event-milestone strong b { font-size: 11px; }
  .match-section-heading h2 { font-size: 16px; }
  .match-lineup-status { font-size: 11px; }
  .match-lineup-scorebar { font-size: 11px; }
  .match-lineup-scorebar > strong small { font-size: 10px; }
  .match-lineup-scorebar > span { font-size: 15px; }

  .match-lineup-pitch {
    min-height: 790px;
    padding-inline: 11px;
  }

  .match-lineup-half {
    min-width: 0;
    overflow: hidden;
    padding-inline: 9px;
  }

  .match-lineup-row {
    width: 100%;
    padding-inline: 2px;
    box-sizing: border-box;
  }

  .match-lineup-player {
    width: min(72px, 23.5%);
    max-width: 23.5%;
  }

  .match-lineup-player:first-child:nth-last-child(5),
  .match-lineup-player:first-child:nth-last-child(5) ~ .match-lineup-player {
    width: min(62px, 18.5%);
    max-width: 18.5%;
  }

  .match-lineup-player-name,
  .match-lineup-player.is-bench .match-lineup-player-name {
    width: 100%;
    max-height: 2.7em;
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .match-player-rating { font-size: 9px; }
  .match-player-captain { font-size: 9px; }
  .match-player-badges i { font-size: 9px; }
  .match-lineup-coach { font-size: 12px; }
  .match-lineup-coach > span:not(.match-lineup-coach-avatar) { font-size: 10px; }
  .match-lineup-bench h3 { font-size: 13px; }
  .match-lineup-player.is-bench small { font-size: 9px; }
  .match-stat-group h2 { font-size: 17px; }
  .match-stat-comparison,
  .match-stat-comparison > span { font-size: 14px; }

  .match-pitch-penalty {
    left: 25%;
    right: 25%;
    width: auto;
    height: 10%;
  }

  .match-pitch-penalty.is-home {
    left: 25%;
    right: 25%;
    top: 0;
    bottom: auto;
    border-top: 0;
    border-left: 2px solid color-mix(in srgb, var(--text) 14%, transparent);
  }

  .match-pitch-penalty.is-away {
    left: 25%;
    right: 25%;
    top: auto;
    bottom: 0;
    border-bottom: 0;
    border-right: 2px solid color-mix(in srgb, var(--text) 14%, transparent);
  }

  .match-pitch-goal {
    left: 39%;
    right: 39%;
    width: auto;
    height: 2.5%;
  }

  .match-pitch-goal.is-home {
    top: auto;
    bottom: 100%;
    border-bottom: 0;
    border-right: 2px solid color-mix(in srgb, var(--text) 14%, transparent);
  }

  .match-pitch-goal.is-away {
    top: 100%;
    bottom: auto;
    border-top: 0;
    border-left: 2px solid color-mix(in srgb, var(--text) 14%, transparent);
  }
}

@media (max-width: 390px) {
  .match-tab-button { font-size: 12px; }
  .match-lineup-pitch { min-height: 745px; }
  .match-lineup-player-name,
  .match-lineup-player.is-bench .match-lineup-player-name { font-size: 10px; }
  .match-stat-comparison,
  .match-stat-comparison > span { font-size: 14px; }
}

/* 1.3.9: final alignment corrections for tabs, facts, pitch and benches. */
@media (min-width: 761px) {
  /* The API rows start with the goalkeeper. On a horizontal RTL pitch the
     first row must face the outside goal, not the centre circle. */
  .match-lineup-half {
    flex-direction: row-reverse;
  }
}

/* Restore the substitutes presentation independently from pitch players. */
.match-lineup-benches {
  font-size: inherit;
}

.match-lineup-bench {
  padding: 18px 14px 24px;
}

.match-lineup-bench h3 {
  margin-bottom: 18px;
  font-size: 15px;
}

.match-lineup-bench > div {
  gap: 24px 8px;
}

.match-lineup-player.is-bench {
  width: auto;
  max-width: none;
  justify-self: center;
}

.match-lineup-player.is-bench .match-lineup-avatar {
  width: 54px;
  height: 54px;
}

.match-lineup-player.is-bench .match-lineup-player-name {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.match-lineup-player.is-bench small {
  font-size: 10px;
}

@media (max-width: 760px) {
  /* Use the complete phone width for every match-details section. */
  .match-body {
    padding-inline: 2px;
  }

  /* Four labels and each label itself stay on one physical row. */
  .match-tab-list {
    gap: 2px;
    padding: 4px;
  }

  .match-tab-button,
  .match-tab-list.has-4-tabs .match-tab-button {
    min-width: 0;
    padding-inline: 1px;
    white-space: nowrap;
    font-size: clamp(9px, 2.7vw, 12px);
    line-height: 1;
  }

  /* Labels such as البطولة والجولة are exactly two pixels larger. */
  .match-info-item > span {
    font-size: 13px;
  }

  /* Bring the visible touchline close to the lineup-card edges. */
  .match-lineup-pitch {
    padding-inline: 0;
  }

  .match-lineup-pitch::before,
  .match-pitch-markings {
    inset-inline: 4px;
  }

  .match-lineup-half {
    padding-inline: 3px;
  }

  /* Exact pre-compaction substitutes layout: centred, roomy and one-line. */
  .match-lineup-bench {
    padding: 18px 6px 24px;
  }

  .match-lineup-bench > div {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 27px;
  }

  .match-lineup-player.is-bench {
    width: 100%;
    max-width: 100%;
  }

  .match-lineup-player.is-bench .match-lineup-avatar {
    width: 68px;
    height: 68px;
  }

  .match-lineup-player.is-bench .match-lineup-player-name {
    width: calc(100% - 8px);
    font-size: 14px;
  }
}

@media (max-width: 390px) {
  .match-tab-button,
  .match-tab-list.has-4-tabs .match-tab-button {
    font-size: clamp(9px, 2.7vw, 12px);
  }

  .match-lineup-player.is-bench .match-lineup-avatar {
    width: 68px;
    height: 68px;
  }

  .match-lineup-player.is-bench .match-lineup-player-name {
    font-size: 14px;
  }
}

/* 1.3.10 final cascade: the former narrow-phone pitch image was 36px;
   43px is the requested twenty-percent increase (rounded). The same fixed
   geometry and name size are shared by starters and substitutes. */
@media (max-width: 760px) {
  .match-lineup-avatar,
  .match-lineup-player.is-bench .match-lineup-avatar {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
  }

  .match-lineup-player-name,
  .match-lineup-player.is-bench .match-lineup-player-name {
    font-size: 10px;
    line-height: 1.35;
  }
}

@media (max-width: 390px) {
  .match-lineup-avatar,
  .match-lineup-player.is-bench .match-lineup-avatar {
    width: 43px;
    height: 43px;
  }

  .match-lineup-player-name,
  .match-lineup-player.is-bench .match-lineup-player-name {
    font-size: 10px;
  }
}

/* 1.3.11 final specificity guard: these symbols intentionally override the
   historical 1.3.10 compatibility declarations above. */
.match-player-captain {
  inset-inline-end: -5px;
  top: -5px;
  bottom: auto;
}

.match-player-badges .is-in,
.match-event-player.is-in i {
  background: #08a860;
  color: #fff;
}

.match-player-badges .is-out,
.match-event-player.is-out i {
  background: #f22e3a;
  color: #fff;
}

.match-player-badges .is-in::before,
.match-event-player.is-in i::before { content: "←"; }

.match-player-badges .is-out::before,
.match-event-player.is-out i::before { content: "→"; }

.match-player-badges .is-in::before,
.match-player-badges .is-out::before,
.match-event-player.is-in i::before,
.match-event-player.is-out i::before {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-.25px);
}

.match-player-badges .is-assist::before,
.match-assist-boot::before {
  content: "";
  width: 12px;
  height: 10px;
  display: block;
  border-radius: 0;
  background: currentColor;
  clip-path: none;
  transform: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M3 1h6v7.2l4.2 3.1 6.2.9c1 .1 1.8 1 1.8 2v3.2H2.5v-4h7.2L5.6 10 3 9.4V1zm1.8 14.3h13.8v-1l-6.2-.9-3.9-2.9v1.2l3.1 2.5H4.8v1.1z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M3 1h6v7.2l4.2 3.1 6.2.9c1 .1 1.8 1 1.8 2v3.2H2.5v-4h7.2L5.6 10 3 9.4V1zm1.8 14.3h13.8v-1l-6.2-.9-3.9-2.9v1.2l3.1 2.5H4.8v1.1z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.match-player-badges .is-yellow,
.match-player-badges .is-red,
.match-event.is-yellow .match-event-icon,
.match-event.is-red .match-event-icon {
  width: 9px;
  height: 15px;
  min-width: 9px;
  min-height: 15px;
  padding: 0;
  border-radius: 2px;
  font-size: 0;
}

@media (max-width: 760px) {
  /* Highlightly already returns each formation row in pitch order from left
     to right. The page itself is RTL, so an inherited RTL flex direction was
     mirroring every row on phones. Keep only the pitch distribution LTR and
     restore RTL inside each player card for Arabic names and logical badges. */
  .match-lineup-pitch .match-lineup-row {
    direction: ltr;
  }

  .match-lineup-pitch .match-lineup-player {
    direction: rtl;
  }

  .match-event.is-yellow .match-event-icon,
  .match-event.is-red .match-event-icon {
    width: 10px;
    height: 16px;
    min-width: 10px;
    min-height: 16px;
  }
}

/* 1.0.11: the responsive Customizer value is authoritative for every
   starter, substitute and coach portrait, including transparent fallbacks. */
.match-lineup-avatar,
.match-lineup-player.is-bench .match-lineup-avatar {
  width: var(--mg_theme-player-image-size, 54px);
  height: var(--mg_theme-player-image-size, 54px);
  flex: 0 0 var(--mg_theme-player-image-size, 54px);
}

.match-player-badges {
  top: calc(var(--mg_theme-player-image-size, 54px) - 8px);
}

.match-lineup-coach-avatar {
  border: 3px solid color-mix(in srgb, var(--text) 12%, var(--panel));
  background: var(--soft-panel);
}
