/* Match page (match_page.py), in Pacy's night style. Loaded after seo.css
   and scoped to .mp, because competition pages reuse the .mp-block pieces.
   One bold thing: a full-width scoreboard with a living backdrop and the
   win-probability bar. Under it, two columns so the page reads in one
   screen or two instead of five: the match on the left, context in a rail. */

.mp {
  --mp-ink: #EFF5FF;
  --mp-soft: #93A9C6;
  --mp-line: rgba(160, 210, 255, .14);
  --mp-home: #2563EB;
  --mp-away: #7FC4FF;
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding-block: 0 var(--s-9, 64px);
  color: var(--mp-ink);
  color-scheme: dark;
  background:
    radial-gradient(50% 40% at 90% 30%, rgba(37, 99, 235, .16), transparent 70%),
    radial-gradient(40% 40% at 0% 70%, rgba(23, 74, 126, .3), transparent 70%),
    linear-gradient(180deg, #071B33, #06162A 60%, #050F1F);
}
/* A faint pitch grid behind everything. */
.mp::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(247, 250, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 250, 255, .025) 1px, transparent 1px);
  background-size: 64px 64px;
}
.mp .page { max-width: 1280px; }
.mp .seo-crumbs { padding-top: var(--s-4, 16px); color: var(--mp-soft); }
.mp .seo-crumbs a { color: #9FC0FF; }
/* Back, then the breadcrumb, on one row. */
.mp-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding-top: var(--s-4, 16px);
  margin-bottom: var(--s-5, 24px);
}
.mp-topbar .seo-crumbs { padding-top: 0; margin-bottom: 0; }
.mp-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  border: 1px solid rgba(160, 210, 255, .22);
  border-radius: 999px;
  background: rgba(247, 250, 255, .06);
  color: #EFF5FF;
  font-size: var(--t-meta, .85rem);
  font-weight: 700;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.mp-back span { font-size: 1.05em; line-height: 1; transition: transform .18s ease; }
.mp-back:hover { background: rgba(247, 250, 255, .12); border-color: rgba(160, 210, 255, .4); }
.mp-back:hover span { transform: translateX(-3px); }
.mp-back:focus-visible { outline: 2px solid #7FC4FF; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .mp-back, .mp-back span { transition: none; } }

/* ---- scoreboard --------------------------------------------------- */
.mp .mp-head {
  width: 100vw;
  margin: var(--s-3, 12px) 0 0 calc(50% - 50vw);
  padding: clamp(24px, 4vw, 56px) max(16px, calc(50vw - 600px)) clamp(20px, 3vw, 36px);
  border-radius: 0;
  background:
    radial-gradient(55% 90% at 85% 0%, rgba(37, 99, 235, .45), transparent 60%),
    radial-gradient(45% 80% at 10% 100%, rgba(23, 74, 126, .55), transparent 70%),
    linear-gradient(160deg, #0A2A52 0%, #071B33 55%, #050F1F 100%);
  box-shadow: inset 0 -1px 0 var(--mp-line);
}
.mp .mp-head::after { opacity: .5; }
.mp .mp-head h1 { font-size: .95rem; color: rgba(247, 250, 255, .75); }
.mp .mp-board { gap: clamp(8px, 3vw, 48px); }
.mp .mp-crest {
  width: clamp(64px, 9vw, 124px);
  height: clamp(64px, 9vw, 124px);
  filter: drop-shadow(0 18px 40px rgba(37, 99, 235, .5));
  animation: mp-rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
.mp .mp-side--away .mp-crest { animation-delay: .08s; }
.mp .mp-team { font-size: clamp(1.05rem, .8rem + 1.2vw, 1.9rem); letter-spacing: -.02em; }
.mp .mp-score {
  font-size: clamp(3.4rem, 2rem + 6vw, 7.5rem);
  letter-spacing: -.04em;
  text-shadow: 0 0 40px rgba(79, 134, 255, .55);
  animation: mp-pop .8s .15s cubic-bezier(.2, 1.4, .3, 1) both;
}
.mp .mp-kickoff time { text-shadow: 0 0 36px rgba(79, 134, 255, .5); }

/* The backdrop: drifting light, streaks of lightning now and then. */
.mp-fx { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.mp-fx::before, .mp-fx::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.mp-fx::before {
  width: 60vw; height: 60vw; max-width: 780px; max-height: 780px;
  left: -12%; top: -70%;
  background: radial-gradient(circle, rgba(37, 99, 235, .5), transparent 65%);
  animation: mp-drift-a 18s ease-in-out infinite alternate;
}
.mp-fx::after {
  width: 45vw; height: 45vw; max-width: 620px; max-height: 620px;
  right: -8%; bottom: -80%;
  background: radial-gradient(circle, rgba(56, 189, 248, .32), transparent 68%);
  animation: mp-drift-b 23s ease-in-out infinite alternate;
}
.mp-fx span {
  position: absolute;
  left: 0;
  height: 2px;
  width: 26%;
  background: linear-gradient(90deg, transparent, rgba(127, 196, 255, .75) 60%, #fff 78%, transparent);
  opacity: 0;
  transform: translateX(-120%) rotate(-10deg);
  animation: mp-streak 9s cubic-bezier(.6, 0, .3, 1) infinite;
}
.mp-fx span:nth-child(1) { top: 22%; animation-delay: 1.2s; }
.mp-fx span:nth-child(2) { top: 58%; width: 18%; animation-delay: 4.6s; animation-duration: 11s; }
.mp-fx span:nth-child(3) { top: 86%; width: 32%; animation-delay: 7.5s; animation-duration: 13s; }

/* Win probability across the foot of the board. */
.mp-odds { max-width: 720px; margin: clamp(18px, 2.5vw, 28px) auto 0; }
.mp-odds-title { margin: 0 0 8px; text-align: center; font-size: .8rem; font-weight: 600; color: rgba(247, 250, 255, .65); }
.mp-odds-bar { display: flex; gap: 3px; height: 10px; border-radius: 99px; overflow: hidden; }
.mp-odds-bar i { flex-basis: 0; transform-origin: left; animation: mp-fill 1s .3s cubic-bezier(.2, .8, .2, 1) both; }
.mp-odds-home { background: var(--mp-home); box-shadow: 0 0 16px rgba(37, 99, 235, .8); }
.mp-odds-draw { background: rgba(247, 250, 255, .28); }
.mp-odds-away { background: var(--mp-away); }
.mp-odds-keys { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 8px 0 0; font-size: .85rem; color: rgba(247, 250, 255, .75); }
.mp-odds-key b { font-family: var(--font-display); color: #fff; font-variant-numeric: tabular-nums; }
.mp-odds-key::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; border-radius: 50%; vertical-align: 1px; }
.mp-odds-key--home::before { background: var(--mp-home); }
.mp-odds-key--draw::before { background: rgba(247, 250, 255, .4); }
.mp-odds-key--away::before { background: var(--mp-away); }

/* ---- under the board --------------------------------------------- */
.mp .mp-updated { margin: var(--s-3, 12px) 0 0; color: var(--mp-soft); }
.mp .mp-jump {
  position: sticky;
  top: calc(var(--header-h, 64px) + 8px);
  z-index: 5;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: var(--s-3, 12px) 0 var(--s-5, 20px);
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--mp-line);
  border-radius: 99px;
  background: rgba(7, 27, 51, .86);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(3, 16, 32, .4);
}
.mp .mp-jump::-webkit-scrollbar { display: none; }
.mp .mp-jump a {
  flex: none;
  padding: 7px 14px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: #B4C9E4;
  font-weight: 600;
  font-size: .85rem;
  white-space: nowrap;
}
.mp .mp-jump a:hover { background: rgba(37, 99, 235, .25); color: #fff; }
.mp :is(section[id]) { scroll-margin-top: calc(var(--header-h, 64px) + 72px); }

.mp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--s-5, 20px);
  align-items: start;
}
.mp-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5, 20px); min-width: 0; }
@media (max-width: 960px) { .mp-grid { grid-template-columns: minmax(0, 1fr); } }

.mp .mp-block {
  margin: 0;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--mp-line);
  border-radius: 20px;
  background: linear-gradient(170deg, rgba(17, 43, 77, .92), rgba(10, 30, 56, .92));
  box-shadow: 0 18px 40px rgba(3, 16, 32, .3);
  color: var(--mp-ink);
  animation: mp-rise .6s cubic-bezier(.2, .8, .2, 1) both;
}
.mp .mp-col > :nth-child(2) { animation-delay: .06s; }
.mp .mp-col > :nth-child(3) { animation-delay: .12s; }
.mp .mp-col > :nth-child(n+4) { animation-delay: .18s; }
.mp .mp-block h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--s-4, 16px);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1rem + .4vw, 1.35rem);
  letter-spacing: -.02em;
  color: #fff;
}
.mp .mp-block h2::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 4px;
  background: linear-gradient(180deg, #7FC4FF, #2563EB);
  box-shadow: 0 0 10px rgba(79, 134, 255, .8);
}
.mp .mp-block h3 { color: #fff; }
.mp .mp-block p, .mp .mp-block ul, .mp .mp-block dd { color: #C9D8EC; }
.mp .mp-block dt { color: var(--mp-soft); }

/* Timeline: a centre line, each side's events on its own side. */
.mp .mp-timeline { position: relative; gap: 6px; }
.mp .mp-timeline::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(180deg, transparent, rgba(127, 196, 255, .35) 8%, rgba(127, 196, 255, .35) 92%, transparent);
}
.mp .mp-timeline li.mp-ev {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(50% - 22px);
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(247, 250, 255, .04);
  font-size: .88rem;
  animation: mp-rise .5s cubic-bezier(.2, .8, .2, 1) both;
}
.mp .mp-ev--home { margin-inline-end: auto; flex-direction: row-reverse; text-align: end; }
.mp .mp-ev--away { margin-inline-start: auto; }
.mp .mp-ev::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #33517A;
  box-shadow: 0 0 0 3px #0C2140;
  transform: translateY(-50%);
}
.mp .mp-ev--home::after { right: -27px; }
.mp .mp-ev--away::after { left: -27px; }
.mp .mp-ev .mp-ev-min { flex: none; color: #7FC4FF; }
.mp .mp-ev--goal { background: linear-gradient(90deg, rgba(37, 99, 235, .3), rgba(37, 99, 235, .1)); font-weight: 700; color: #fff; }
.mp .mp-ev--goal::after { background: #fff; box-shadow: 0 0 0 3px #0C2140, 0 0 14px rgba(127, 196, 255, .9); }
.mp .mp-ev--yellow::after { border-radius: 2px; width: 8px; height: 11px; background: #FFC53D; }
.mp .mp-ev--red::after { border-radius: 2px; width: 8px; height: 11px; background: #FF4D4D; }
.mp .mp-ev--sub { color: var(--mp-soft); }
.mp .mp-ev--sub::after { background: #3FB37F; }
.mp .mp-timeline li:nth-child(n+2) { animation-delay: .04s; }
.mp .mp-timeline li:nth-child(n+4) { animation-delay: .1s; }
.mp .mp-timeline li:nth-child(n+7) { animation-delay: .16s; }
@media (max-width: 640px) {
  .mp .mp-timeline::before { left: 7px; }
  .mp .mp-timeline li.mp-ev { width: auto; margin-inline: 22px 0; flex-direction: row; text-align: start; }
  .mp .mp-ev--home::after, .mp .mp-ev--away::after { left: -20px; right: auto; }
  .mp .mp-ev--home { box-shadow: inset 3px 0 0 var(--mp-home); }
  .mp .mp-ev--away { box-shadow: inset 3px 0 0 var(--mp-away); }
}

/* Statistics: two bars meeting in the middle; the leader lit. */
.mp-bars-head { display: flex; justify-content: space-between; margin: 0 0 10px !important; font-size: .82rem; font-weight: 700; }
.mp-bars-head span:first-child { color: #7FA8FF !important; }
.mp-bars-head span:last-child { color: var(--mp-away); }
.mp-bars { display: grid; gap: 12px; }
.mp-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; }
.mp-bar-v { font-family: var(--font-display); font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; color: #C9D8EC; min-width: 2.5ch; }
.mp-bar-v:last-of-type { text-align: end; }
.mp-bar[data-lead="home"] .mp-bar-v:first-child, .mp-bar[data-lead="away"] .mp-bar-v:nth-child(3) { color: #fff; }
.mp-bar-name { text-align: center; font-size: .84rem; color: var(--mp-soft); }
.mp-bar-track { grid-column: 1 / -1; display: flex; gap: 4px; height: 6px; }
.mp-bar-track i { border-radius: 99px; background: rgba(247, 250, 255, .12); animation: mp-fill .9s .2s cubic-bezier(.2, .8, .2, 1) both; }
.mp-bar-track i:first-child { flex: 0 0 calc(var(--share) - 2px); transform-origin: right; }
.mp-bar-track i:last-child { flex: 1; transform-origin: left; }
.mp-bar[data-lead="home"] .mp-bar-track i:first-child { background: var(--mp-home); box-shadow: 0 0 12px rgba(37, 99, 235, .7); }
.mp-bar[data-lead="away"] .mp-bar-track i:last-child { background: var(--mp-away); box-shadow: 0 0 12px rgba(127, 196, 255, .5); }
.mp-bar[data-lead=""] .mp-bar-track i { background: rgba(247, 250, 255, .28); }

.mp-more { margin-top: 14px; }
.mp-more summary {
  display: inline-flex;
  padding: 7px 14px;
  border: 1px solid var(--mp-line);
  border-radius: 99px;
  cursor: pointer;
  list-style: none;
  font-size: .84rem;
  font-weight: 600;
  color: #9FC0FF;
}
.mp-more summary::-webkit-details-marker { display: none; }
.mp-more summary:hover { background: rgba(37, 99, 235, .2); }
.mp-more[open] summary { margin-bottom: 12px; }

/* Lineups: players as chips, position first. */
.mp .mp-lineups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.mp .mp-lineups h3 { margin: 0 0 10px; font-size: .95rem; }
.mp .mp-xi { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; font-size: .86rem; }
.mp .mp-xi li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(247, 250, 255, .05); color: #E3ECF8; }
.mp .mp-pos { flex: none; min-width: 2.6em; padding: 1px 6px; border-radius: 6px; background: rgba(37, 99, 235, .3); color: #BFD4FF; font-size: .7rem; font-weight: 700; text-align: center; }
.mp .mp-pos:empty { display: none; }
.mp .mp-xi--bench li { background: none; color: var(--mp-soft); }
@media (max-width: 520px) {
  .mp .mp-lineups { gap: 10px; }
  .mp .mp-xi li { padding: 5px 7px; font-size: .8rem; gap: 6px; }
  .mp .mp-pos { min-width: 0; }
}
.mp .mp-xi li { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp :is(.mp-standings, .mp-h2h) { display: block; overflow-x: auto; }

/* Rail pieces. */
.mp .mp-standings { color: #E3ECF8; }
.mp .mp-standings caption { color: var(--mp-soft); padding-bottom: 8px; font-size: .8rem; }
.mp .mp-standings :is(td, th) { border-bottom-color: var(--mp-line); color: inherit; }
.mp .mp-standings thead th { color: var(--mp-soft); }
.mp .mp-standings .is-here { background: rgba(37, 99, 235, .28); }
.mp .mp-standings .is-here th { color: #fff; }
.mp .mp-h2h { width: 100%; border-collapse: collapse; font-size: .84rem; color: #E3ECF8; }
.mp .mp-h2h :is(td, th) { padding: 6px 4px; border-bottom: 1px solid var(--mp-line); text-align: start; }
.mp .mp-h2h thead th { color: var(--mp-soft); }
.mp .mp-h2h-tally { font-weight: 700; color: #fff !important; }
.mp .mp-form { display: grid; gap: 12px; }
.mp .mp-form h3 { margin: 0 0 6px; font-size: .9rem; }
.mp .mp-venue { display: grid; gap: 10px; margin: 0; }
.mp .mp-venue div { display: grid; gap: 2px; }
.mp .mp-venue dd { margin: 0; }
.mp #where-to-watch ul { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.mp #where-to-watch li { padding: 6px 14px; border: 1px solid rgba(160, 210, 255, .25); border-radius: 99px; color: #fff; font-weight: 600; }
.mp .mp-prob li { color: #E3ECF8; }

.mp .mp-related { margin-top: var(--s-6, 28px); }
.mp .mp-related h2 { color: #fff; }
.mp .mp-related ul { display: flex; flex-wrap: wrap; gap: 8px; }
.mp .mp-related a {
  display: inline-flex;
  padding: 9px 16px;
  border: 1px solid rgba(160, 210, 255, .25);
  border-radius: 99px;
  background: rgba(247, 250, 255, .04);
  color: #CFE0FF;
}
.mp .mp-related a:hover { background: rgba(37, 99, 235, .3); color: #fff; }

/* ---- motion ------------------------------------------------------- */
@keyframes mp-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes mp-pop { from { opacity: 0; transform: scale(.85); } }
@keyframes mp-fill { from { transform: scaleX(0); } }
@keyframes mp-drift-a { to { transform: translate3d(36vw, 20%, 0); } }
@keyframes mp-drift-b { to { transform: translate3d(-40vw, -26%, 0); } }
@keyframes mp-streak {
  0% { opacity: 0; transform: translateX(-120%) rotate(-10deg); }
  8% { opacity: 1; }
  22%, 100% { opacity: 0; transform: translateX(480%) rotate(-10deg); }
}
@media (prefers-reduced-motion: reduce) {
  .mp *, .mp *::before, .mp *::after { animation: none !important; }
}
[data-motion="off"] .mp *, [data-motion="off"] .mp *::before, [data-motion="off"] .mp *::after { animation: none !important; }
