/* Allow the board to use the space between the two measured navigation bands
   and the phone dock. Content can still flow at enlarged accessibility sizes. */
html[data-theme] #main #weekly-edition.matchday-rings {
  --paper: light-dark(#fff, #1b2023);
  --type: light-dark(#192224, #edf2f3);
  --caption: light-dark(#47585c, #b9c6c7);
  --rule: light-dark(#d0dada, #384146);
  --mint: light-dark(#197464, #77dac2);
  --amber: light-dark(#926119, #f1c777);
  --down: light-dark(#954833, #efa385);
  --gap: clamp(7px, 1.2dvh, 16px);
  --pad: clamp(12px, 2.2dvh, 28px);
  --site-text-width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  height: calc(100dvh - var(--pinned-masthead,56px) - var(--pinned-sections,0px) - var(--mobile-bottom-nav-size,0px));
  min-height: 0;
  padding: 0 0 var(--gap);
  max-width: none;
  color: var(--type);
  zoom: 1;

  .snapshot-heading { display: grid; grid-template: "identity supremacy close" auto / minmax(0,1fr) auto auto; align-items: center; gap: 12px; margin: 0; padding: clamp(7px,1.7dvh,22px) 0; }
  .snapshot-identity, .snapshot-supremacy { display:flex; align-items:center; position:static; min-height:0; margin:0; padding:0; border:0; border-radius:0; background:none; color:inherit; overflow:visible; }
  .snapshot-identity {gap:9px}
  .snapshot-identity h1 {margin:0; font-size:.77rem; font-weight:450; color:var(--caption)}
  .snapshot-switch {min-height:0; gap:8px; font-size:clamp(1.35rem,2.5vw,2.4rem); line-height:1.1; font-weight:550}
  .snapshot-switch span {white-space:normal; overflow-wrap:normal}
  .brief-league-rating {display:grid; grid-template-columns:auto auto; gap:0 8px; align-items:baseline; text-align:right}
  .brief-league-rating span, .brief-league-rating small {color:var(--caption);font-size:.8rem}
  .brief-league-rating b {font-weight:550;font-size:1.45rem;line-height:1}
  .brief-league-rating small {grid-column:1/-1}
  .snapshot-close {width:34px;height:34px;place-self:center end;color:var(--caption);background:none}

  .snapshot-grid {
    display:grid; gap:var(--gap); grid-template-columns:repeat(6,minmax(0,1fr));
    grid-template-areas:"season season season forecast forecast forecast" "strength strength form form points points" "outlook outlook outlook outlook outlook outlook";
    grid-template-rows:minmax(min-content,1.18fr) minmax(min-content,1fr) minmax(min-content,1fr);
    min-height:0; margin:0; padding:0; border:0; border-radius:0; background:none; overflow:visible;
  }
  .snapshot-grid > .snapshot-group,.outlook-list {
    display:grid; grid-template-columns:minmax(0,1fr); align-content:space-evenly; gap:4px; min-width:0;
    margin:0; padding:var(--pad); border:0; border-radius:10px; background:var(--paper); box-shadow:none; color:var(--type);
  }
  .snapshot-group h2,.outlook-list h3 {margin:0; font:550 clamp(1rem,1.35vw,1.4rem)/1.13 var(--font-reading); color:var(--type); text-wrap:wrap}
  .snapshot-group:hover :is(h2,h3) {text-decoration:underline;text-underline-offset:3px}
  .snapshot-group:focus-visible {outline:2px solid var(--mint);outline-offset:-2px}
  .snapshot-grid > .snapshot-season {grid-area:season; --ring-colour:var(--mint)}
  .snapshot-grid > .snapshot-forecast {grid-area:forecast; --ring-colour:var(--fixture-yellow)}
  .snapshot-grid > .snapshot-strength {grid-area:strength}
  .snapshot-grid > .snapshot-form {grid-area:form}
  .snapshot-grid > .snapshot-points {grid-area:points}
  .snapshot-grid > .snapshot-outlook {grid-area:outlook}
  .snapshot-grid > .snapshot-highlight {
    grid-template: none / auto minmax(0,1fr); align-items:center; justify-content:start; gap:clamp(12px,2vw,32px);
    background:linear-gradient(125deg,color-mix(in srgb,var(--ring-colour) 10%,var(--paper)),var(--paper) 78%);
  }
  .snapshot-forecast::after,.snapshot-highlight-number::before {content:none}
  .matchday-ring {position:relative;display:grid;place-items:center;width:clamp(64px,min(10vw,15dvh),168px);aspect-ratio:1}
  .matchday-ring::before {content:"";position:absolute;inset:0;border-radius:50%;background:conic-gradient(var(--ring-colour) var(--arc),var(--rule) 0);mask:radial-gradient(closest-side,transparent 89%,#000 90%)}
  .matchday-ring .snapshot-crest {width:55%;height:55%}
  .ring-copy {min-width:0;display:grid;align-content:center;justify-items:start;gap:clamp(2px,.5dvh,7px)}
  .ring-copy > * {grid-area:auto;align-self:auto}
  .snapshot-highlight h2 {font:550 clamp(.76rem,.95vw,1rem)/1.16 var(--font-ui); letter-spacing:.065em; text-transform:uppercase; color:var(--caption)}
  .snapshot-group .snapshot-highlight-number {display:block;position:static;width:auto;height:auto;min-height:0;aspect-ratio:auto;padding:0;border:0;border-radius:0;background:none;font:500 clamp(2.6rem,min(5vw,8dvh),5.5rem)/1 var(--font-reading);letter-spacing:-.05em;color:var(--type)}
  .snapshot-highlight-number small {font-size:.43em;font-weight:400;letter-spacing:0;color:var(--caption)}
  .snapshot-track,.snapshot-meter {display:none}
  .snapshot-context,.snapshot-context strong {color:var(--caption);font:400 clamp(.85rem,1.05vw,1.05rem)/1.16 var(--font-reading)}
  .snapshot-context :is(strong,span) {display:block}
  .snapshot-team {display:flex;align-items:center;gap:6px;min-width:0;align-self:center}
  .snapshot-team strong {color:var(--type);font:450 clamp(.95rem,1.25vw,1.35rem)/1.12 var(--font-reading);word-break:normal;overflow-wrap:normal}
  .snapshot-crest {display:inline-grid;flex:none;width:clamp(18px,1.5vw,28px);height:clamp(20px,1.7vw,30px);place-items:center}
  .snapshot-crest img {display:block;width:100%;height:100%;object-fit:contain}
  .snapshot-group .snapshot-row {display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"label value" "team value";align-items:center;gap:3px 5px;padding:clamp(4px,1.3dvh,16px) 0 0;margin:0;min-height:0;border:0;border-top:1px solid var(--rule)}
  .snapshot-label {color:var(--caption);font:400 clamp(.8rem,1vw,1rem)/1.1 var(--font-reading)}
  .snapshot-number,.outlook-chance {font:550 clamp(1rem,1.42vw,1.5rem)/1.05 var(--font-reading);color:var(--type);white-space:nowrap;min-width:0}
  .gain {color:var(--mint)} .loss {color:var(--down)}
  .snapshot-outlook:has(.outlook-list) {display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));align-content:stretch;gap:var(--gap);padding:0;background:none}
  .snapshot-outlook:has(.outlook-list)>h2 {position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
  .outlook-list {align-self:stretch;align-content:stretch;grid-template-rows:auto 1fr;--bar-colour:var(--amber)}
  .outlook-list:has(.title-odds) {--bar-colour:var(--mint)}
  .outlook-list ol {margin:0;display:grid;align-content:space-evenly;gap:2px;counter-reset:standing}
  .outlook-list li {min-width:0;display:grid;grid-template-columns:1.3em minmax(0,1fr) minmax(28px,25%) 4.1em;gap:8px;align-items:center;padding:0;border:0;counter-increment:standing}
  .outlook-list li::before {content:counter(standing);color:var(--caption);font-size:.8rem}
  .outlook-list li::after {content:"";grid-row:1;grid-column:3;height:5px;border-radius:6px;background:linear-gradient(to right,var(--bar-colour) var(--chance),var(--rule) 0)}
  .outlook-chance {grid-column:4;text-align:end;color:var(--type)}
}

@media(max-width:760px) and (orientation:portrait) {
  html[data-theme] #main #weekly-edition.matchday-rings {
    --gap:clamp(4px,.85dvh,9px);--pad:clamp(6px,1.15dvh,13px);
    .snapshot-heading {gap:6px;padding:clamp(3px,.9dvh,12px) 0}
    .snapshot-identity {gap:5px}
    .snapshot-identity h1,.brief-league-rating :is(span,small) {font-size:.72rem}
    .snapshot-switch {font-size:clamp(1.04rem,5vw,1.56rem);min-height:24px}
    .brief-league-rating {display:flex;align-items:flex-end;flex-direction:column;gap:0;line-height:1.05}
    .brief-league-rating b {font-size:1.14rem}
    .snapshot-close {width:28px;height:28px}
    .snapshot-grid {grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"season forecast" "strength strength" "form form" "points points" "outlook outlook";grid-template-rows:minmax(min-content,1.5fr) repeat(3,minmax(min-content,.8fr)) minmax(min-content,1.25fr)}
    .snapshot-group h2,.outlook-list h3 {font-size:clamp(.88rem,3.4vw,1.15rem)}
    .snapshot-grid > .snapshot-highlight {display:grid;align-content:center;align-items:center;grid-template-columns:minmax(0,1fr) auto;position:relative;gap:3px}
    .ring-copy {display:contents}
    .ring-copy h2 {grid-column:1/-1;grid-row:1;min-height:2.26em;font-size:clamp(.69rem,2.6vw,.82rem);line-height:1.13;letter-spacing:.045em}
    .snapshot-group .snapshot-highlight-number {font-size:clamp(1.8rem,7vw,3.5rem)}
    .matchday-ring {display:grid;grid-column:2;grid-row:2;width:clamp(27px,min(10vw,5.3dvh),57px)}
    .ring-copy>.snapshot-team,.ring-copy>.snapshot-context {grid-column:1/-1}
    .snapshot-context,.snapshot-context strong {font-size:clamp(.74rem,2.7vw,.9rem)}
    .snapshot-team {gap:4px}
    .snapshot-team strong {font-size:clamp(.82rem,3.1vw,1.06rem)}
    .snapshot-grid > :is(.snapshot-form,.snapshot-points,.snapshot-strength) {grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 9px;align-content:center}
    :is(.snapshot-form,.snapshot-points,.snapshot-strength) h2 {grid-column:1/-1}
    .snapshot-group .snapshot-row {grid-template-areas:"label label" "team value";padding:3px 0 0;gap:1px 3px}
    .snapshot-number,.outlook-chance {font-size:clamp(.86rem,3.35vw,1.08rem)}
    .snapshot-label {font-size:clamp(.73rem,2.8vw,.94rem)}
    .snapshot-crest,.outlook-list .snapshot-crest {width:15px;height:16px}
    .outlook-list li {grid-template-columns:minmax(0,1fr) auto;gap:2px 3px}
    .outlook-list li::before {content:none}
    .outlook-list li::after {grid-row:2;grid-column:1/-1;height:3px}
    .outlook-chance {grid-column:2}
  }
}
@media(max-height:690px) and (orientation:portrait) {
  html[data-theme] #main #weekly-edition.matchday-rings {
    --gap:3px;--pad:4px;
    .snapshot-heading {padding:2px 0}
    .snapshot-group h2,.outlook-list h3 {font-size:.83rem}
    .ring-copy h2 {font-size:.65rem}
    .snapshot-grid > .snapshot-highlight {gap:1px}
    .snapshot-group .snapshot-highlight-number{font-size:1.55rem}
    .snapshot-label,.snapshot-context,.snapshot-context strong {font-size:.72rem}
    .snapshot-team strong,.snapshot-number,.outlook-chance {font-size:.8rem}
    .snapshot-group .snapshot-row {grid-template-areas:"label value" "team team";padding-top:2px}
    .outlook-list ol {gap:2px}
  }
}
@media(max-height:530px) and (orientation:landscape) {
  html[data-theme] #main #weekly-edition.matchday-rings {
    --gap:4px;--pad:5px;
    .snapshot-heading {padding:2px 0;gap:5px}
    .snapshot-identity {gap:5px}
    .snapshot-brand {width:24px}
    .snapshot-switch {min-height:0;font-size:1.05rem}
    .brief-league-rating b {font-size:1.05rem}
    .snapshot-close {width:26px;height:26px}
    .snapshot-grid {grid-template-columns:repeat(12,minmax(0,1fr));grid-template-areas:"season season season forecast forecast forecast outlook outlook outlook outlook outlook outlook" "strength strength strength strength form form form form points points points points";grid-template-rows:minmax(min-content,1.3fr) minmax(min-content,.8fr)}
    .snapshot-grid > .snapshot-highlight {grid-template-columns:auto minmax(0,1fr);gap:4px}
    .matchday-ring {width:clamp(24px,4vw,48px)}
    .ring-copy,.snapshot-grid>.snapshot-group {row-gap:1px}
    .snapshot-group h2,.outlook-list h3 {font-size:.86rem}
    .snapshot-highlight h2 {font-size:.7rem}
    .snapshot-group .snapshot-highlight-number {font-size:1.8rem}
    .snapshot-context,.snapshot-context strong,.snapshot-label {font-size:.73rem}
    .snapshot-team strong,.snapshot-number,.outlook-chance {font-size:.83rem}
    .snapshot-group .snapshot-row {grid-template-areas:"label value" "team team";grid-template-columns:minmax(0,1fr) auto;padding:2px 0 0;gap:3px}
    .outlook-list {padding:3px;gap:2px}
    .outlook-list li {grid-template-columns:minmax(0,1fr) auto;gap:2px}
    .outlook-list li::before {content:none}
    .outlook-list li::after {grid-row:2;grid-column:1/-1;height:2px}
    .outlook-chance {grid-column:2}
    .snapshot-crest,.outlook-list .snapshot-crest {width:13px;height:14px}
    .outlook-list .snapshot-team {gap:2px}
  }
}

/* Short phones give each team the full width of its outcome row. */
@media (max-width:360px) and (max-height:600px) and (orientation:portrait) {
  html[data-theme] #main #weekly-edition.matchday-rings {
    --gap:3px;--pad:3px;
    .snapshot-identity .snapshot-brand {width:22px}
    .snapshot-brand img {max-width:22px;max-height:24px}
    .snapshot-heading {gap:4px}
    .snapshot-close {width:24px}
    .snapshot-switch {font-size:1rem;gap:3px}
    .outlook-list .snapshot-crest {display:none}
    .outlook-list li {grid-template-columns:minmax(0,1fr) auto;gap:1px 3px}
    .outlook-list li::after {height:2px}
    .snapshot-group .snapshot-row {row-gap:0}
    .matchday-ring {width:26px}
  }
}

/* Use the width of a rotated phone for three parallel reading columns. */
@media (max-width:760px) and (max-height:440px) and (orientation:landscape) {
  html[data-theme] #main #weekly-edition.matchday-rings {
    --pad:4px;--gap:3px;
    .snapshot-heading {grid-template-columns:minmax(0,1fr) auto auto;padding:2px 0;margin:0}
    .snapshot-heading > :is(.snapshot-identity,.snapshot-supremacy) {min-height:0;padding:0}
    .snapshot-identity > div,.brief-league-rating {display:flex;align-items:baseline;gap:6px}
    .snapshot-heading .snapshot-brand img {width:21px;height:22px}
    .snapshot-switch {min-height:0}
    .snapshot-grid {
      grid-template-columns:minmax(0,.98fr) minmax(0,1.30fr) minmax(0,.96fr);
      grid-template-areas:"season strength outlook" "season strength outlook" "season form outlook" "forecast form outlook" "forecast points outlook" "forecast points outlook";
      grid-template-rows:repeat(6,minmax(0,1fr));
    }
    .snapshot-grid>.snapshot-group,.outlook-list {min-height:0;align-content:center}
    .snapshot-grid>.snapshot-highlight {grid-template-columns:minmax(0,1fr) auto;gap:0 3px}
    .ring-copy {display:contents}
    .ring-copy h2,.ring-copy>.snapshot-context,.ring-copy>.snapshot-team {grid-column:1/-1}
    .ring-copy h2 {grid-row:1;font-size:.64rem;letter-spacing:.025em}
    .matchday-ring {grid-column:2;grid-row:2;width:23px}
    .snapshot-group .snapshot-highlight-number {font-size:1.43rem}
    .snapshot-grid .snapshot-group h2,.outlook-list h3 {margin:0}
    .snapshot-group .snapshot-row {grid-template-columns:minmax(0,.8fr) minmax(0,1.15fr) auto;grid-template-areas:"label team value";padding:1px 0;gap:2px}
    .snapshot-row .snapshot-crest,.outlook-list .snapshot-crest {display:none}
    .snapshot-label,.snapshot-context,.snapshot-context strong {font-size:.68rem}
    .snapshot-number,.snapshot-team strong,.outlook-chance {font-size:.78rem}
    .snapshot-outlook:has(.outlook-list) {grid-template-columns:minmax(0,1fr);grid-auto-rows:1fr;align-content:stretch}
    .outlook-list {grid-template-rows:auto minmax(0,1fr);align-content:stretch;gap:1px}
    .outlook-list ol {gap:1px}
    .outlook-list li {gap:0 4px}
  }
}

@media (max-width:640px) and (max-height:350px) and (orientation:landscape) {
  /* Retain labelled destinations while giving the snapshot its reading space. */
  html[data-theme][data-table-navigation][data-current-page=explore] body:has(#weekly-edition.matchday-rings) nav.app-bottom-nav.analysis-navigation {
    min-height:calc(32px + env(safe-area-inset-bottom,0px));height:auto;padding:0 0 env(safe-area-inset-bottom,0px);
    a {min-height:31px;padding:0;gap:0}
    a svg {display:none}
    a span {min-height:0;font-size:.7rem;line-height:1.04}
  }
  html[data-theme] #main #weekly-edition.matchday-rings {
    .snapshot-heading {grid-auto-rows:auto;grid-template-rows:auto;gap:4px;padding:1px 0}
    .snapshot-heading > :is(.snapshot-identity,.snapshot-supremacy) {height:26px;min-height:0;align-self:center}
    .snapshot-brand,.snapshot-brand :is(.league-badge,.browser-badge) {max-height:23px}
    .snapshot-identity > div {display:grid;row-gap:0}
    .snapshot-identity h1 {font-size:.59rem;line-height:1}
    .snapshot-heading .snapshot-switch {min-height:0;font-size:.92rem;line-height:1}
    .snapshot-grid {grid-template-columns:minmax(0,.95fr) minmax(0,1.38fr) minmax(0,.91fr)}
    .snapshot-grid > :is(.snapshot-form,.snapshot-strength,.snapshot-points) h2 {font-size:.78rem;line-height:1.04}
    .snapshot-row .snapshot-team strong {font-size:.75rem;line-height:1.02}
    .snapshot-row .snapshot-label {line-height:1.02}
    .snapshot-close {width:24px;height:24px;min-height:24px}
    .snapshot-grid > :is(.snapshot-form,.snapshot-points,.snapshot-strength) {grid-template-rows:auto auto auto;row-gap:0;padding:2px 4px}
    .snapshot-group .snapshot-row {grid-template-columns:minmax(0,.95fr) minmax(0,1.15fr) auto;line-height:1.05}
  }
}

@media (min-width:761px) and (max-width:1024px) and (orientation:portrait) {
  html[data-theme] #main #weekly-edition.matchday-rings {
    .snapshot-grid > .snapshot-highlight {grid-template-columns:1fr;justify-items:start;align-content:center;gap:clamp(8px,1.5dvh,18px)}
    .matchday-ring {width:clamp(74px,10dvh,125px)}
    .snapshot-group .snapshot-highlight-number {font-size:clamp(2.8rem,5.4vw,4rem)}
    .snapshot-team strong {font-size:1.03rem}
  }
}
@media (max-width:760px) and (min-height:700px) and (orientation:portrait) {
  html[data-theme] #main #weekly-edition.matchday-rings .matchday-ring {width:clamp(38px,min(14vw,7dvh),76px)}
}

/* On a short landscape screen, Back shares both title lines. */
@media (max-width:640px) and (max-height:350px) and (orientation:landscape) {
  html[data-theme] #main #weekly-edition.matchday-rings .brief-league-rating {
    display:grid;grid-template:"label rating" auto "rank rating" auto / auto auto;
    align-items:center;gap:0 5px;
    span {grid-area:label}
    b {grid-area:rating}
    small {grid-area:rank}
  }
}

/* Give edition rules and outcomes room to wrap, including at large text sizes. */
html[data-theme] #main #weekly-edition.matchday-rings:has(.league-outlook) {
  height:auto;
  min-height:calc(100dvh - var(--pinned-masthead,56px) - var(--pinned-sections,0px) - var(--mobile-bottom-nav-size,0px));
  .snapshot-grid {grid-template-rows:auto auto auto}
  .snapshot-grid > .league-outlook {
    grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);
    align-items:start; align-content:start; gap:clamp(12px,3vw,40px);
  }
  .league-outlook-guide,.league-outlook-data {display:grid;min-width:0;gap:5px;align-content:start}
  .league-outlook p {margin:0;font:400 .94rem/1.35 var(--font-reading);color:var(--caption);text-wrap:pretty}
  .league-outlook h2 {text-decoration:none}
  .league-outlook-link {width:fit-content;font-size:.9rem;text-decoration:underline;text-underline-offset:3px;color:var(--mint)}
  .league-outlook select {font:inherit;min-width:0;width:100%;max-width:100%;min-height:36px;color:var(--type);background:var(--paper);border:1px solid var(--rule);border-radius:5px;padding:4px 8px}
  .league-outcome-caption {font-size:.83rem}
  .league-outlook-data ul {display:grid;gap:4px;list-style:none;margin:6px 0 0;padding:0}
  .league-outlook-data li {display:flex;justify-content:space-between;align-items:center;gap:6px}
  .league-outlook-data li b {color:var(--type);font-variant-numeric:tabular-nums}
}
@media (max-width:760px) and (orientation:portrait) {
  html[data-theme] #main #weekly-edition.matchday-rings:has(.league-outlook) {
    .snapshot-grid {grid-template-rows:auto}
    .snapshot-grid > .league-outlook {grid-template-columns:minmax(0,1fr);gap:12px}
    .league-outlook select {min-height:44px}
  }
}
@media (max-height:530px) and (orientation:landscape) {
  html[data-theme] #main #weekly-edition.matchday-rings:has(.league-outlook) {
    .snapshot-grid {grid-template-rows:auto}
    .snapshot-grid > .league-outlook {grid-template-columns:minmax(0,1fr)}
  }
}
html[data-theme] #main #ratings table[data-final-points] {--forecast-label:"Final Points"}
html[data-theme] #main #ratings table[data-final-points] tr > :is(:nth-child(4),:nth-child(5)) {display:none!important}

#main .league-opening {grid-column:1/-1;grid-row:1/-1;align-content:start;display:grid;gap:.65rem;padding:1rem}
#main .league-opening :is(h2,h3,p) {margin:0}
#main .league-opening button {justify-self:start;min-height:40px;padding:.4rem .8rem;border:1px solid currentColor;border-radius:6px;color:inherit;background:transparent}
