/*
 * Cup pages: rules for pages with <body class="p-cup">. Shared rules are in sfp.css.
 */

/* ------------------------------------------------------------------
   SHELL
------------------------------------------------------------------- */
.p-cup .section > .sub { margin: -6px 4px 0; font-size: 13px; color: var(--ink-faint); line-height: 1.35; }
.p-cup .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------
   SITE HEADER
------------------------------------------------------------------- */
.p-cup a:focus-visible, .p-cup button:focus-visible, .p-cup summary:focus-visible, .p-cup .scroll:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ------------------------------------------------------------------
   THE CARD
------------------------------------------------------------------- */
.p-cup .scroll { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.p-cup .scroll::-webkit-scrollbar { display: none; }

/* ------------------------------------------------------------------
   CUP SWITCH + HERO
------------------------------------------------------------------- */
.p-cup .switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: rgba(0,0,40,.25);
}
.p-cup .switch a {
  text-align: center;
  padding: 8px 4px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}
.p-cup .switch a[aria-current="page"] { background: var(--royal); color: #fff; box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 600; }
.p-cup .hero .label { margin: 0 0 4px; font-size: 14px; font-weight: 500; color: var(--gold); }
.p-cup .hero h1 { margin: 0; font-size: 40px; font-weight: 700; line-height: .98; }
.p-cup .hero .tag { margin: 6px 0 0; font-size: 15px; color: var(--ink-soft); line-height: 1.3; }
.p-cup .winner {
  margin: 16px 0 0;
  padding: 14px 14px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,213,74,.2), rgba(255,213,74,.05));
  border: 1px solid rgba(255,213,74,.5);
}
.p-cup .winner .wrow { display: flex; align-items: center; gap: 12px; }
.p-cup .winner .k { margin: 0; font-size: 13px; color: var(--gold); font-weight: 500; }
.p-cup .winner .n { margin: 2px 0 0; font-size: 30px; font-weight: 700; line-height: 1.05; }
.p-cup .winner .d { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.p-cup .stat-bars { margin: 14px 0 0; display: grid; gap: 8px; }
.p-cup .mine { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--hair); font-size: 14px; color: var(--ink-soft); line-height: 1.4; }
.p-cup .mine b { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------
   DRAW VIDEO
------------------------------------------------------------------- */
.p-cup .video { display: block; position: relative; padding: 0; overflow: hidden; color: inherit; text-decoration: none; }
.p-cup .poster {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  padding-bottom: 36px;
  text-align: center;
  background: radial-gradient(90% 120% at 30% 20%, rgba(255,255,255,.22), transparent 60%), linear-gradient(135deg, #3a2a7a, #1b1b9a 55%, #7a2a9a);
}
.p-cup .poster .big {
  font-size: 42px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: .01em;
  line-height: .95;
  text-shadow: 0 3px 16px rgba(0,0,60,.5);
}
.p-cup .poster .yr { display: block; font-size: 26px; font-weight: 600; opacity: .9; }
.p-cup .play {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 58px;
  height: 40px;
  margin: 0 0 0 -29px;
  border-radius: 12px;
  background: #e0222a;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
}
.p-cup .play::after {
  content: "";
  border-left: 15px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 4px;
}
.p-cup .video-cap { padding: 12px 16px 14px; }
.p-cup .video-cap b { display: block; font-size: 16px; font-weight: 600; }
.p-cup .video-cap span { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-soft); }
.p-cup .video-cap em { display: block; margin-top: 6px; font-size: 12px; font-style: normal; color: var(--ink-faint); }

/* ------------------------------------------------------------------
   TABLES
------------------------------------------------------------------- */
.p-cup .tbl-card { padding: 12px 0 10px; }
.p-cup .tbl-card .gh { display: flex; align-items: center; gap: 8px; padding: 0 16px 8px; font-size: 16px; font-weight: 600; }
.p-cup .tbl-card .gh i { width: 10px; height: 10px; border-radius: 3px; background: var(--accent-2); }
.p-cup .tbl-card .gh.a i { background: var(--grp-a); }
.p-cup .tbl-card .gh.b i { background: var(--grp-b); }
.p-cup .scroll.tbl {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
}
.p-cup table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.p-cup table.t th { font-size: 11.5px; font-weight: 500; color: var(--ink-faint); text-align: right; padding: 4px 7px 6px; white-space: nowrap; }
.p-cup table.t td { padding: 8px 7px; text-align: right; border-top: 1px solid rgba(255,255,255,.08); white-space: nowrap; }
.p-cup table.t .pos {
  text-align: left;
  width: 34px;
  min-width: 34px;
  padding-left: 16px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--stick-bg);
  font-weight: 600;
  color: var(--ink-soft);
}
.p-cup .tc { display: inline-flex; align-items: center; gap: 8px; }
.p-cup table.t .team {
  text-align: left;
  min-width: 186px;
  position: sticky;
  left: 34px;
  z-index: 1;
  background: var(--stick-bg);
  font-weight: 500;
  padding-right: 12px;
}
.p-cup table.t thead .pos, .p-cup table.t thead .team { background: var(--stick-bg); }
.p-cup table.t .pts { font-weight: 700; font-size: 15px; color: var(--accent); }
.p-cup table.t tr.q .pos { box-shadow: inset 4px 0 0 var(--accent-2); }
.p-cup table.t.a tr.q .pos { box-shadow: inset 4px 0 0 var(--grp-a); }
.p-cup table.t.b tr.q .pos { box-shadow: inset 4px 0 0 var(--grp-b); }
.p-cup table.t tr.x td { color: var(--ink-faint); }
.p-cup table.t tr.x .pts { color: var(--ink-faint); }
.p-cup table.t tr.me td { font-weight: 700; }
.p-cup table.t tr.me td.pos, .p-cup table.t tr.me td.team { background: #3a1a9e; }
.p-cup table.t tr.me td:not(.pos):not(.team) { background: rgba(242,44,247,.16); }
.p-cup .key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 16px 0; font-size: 12px; color: var(--ink-soft); }
.p-cup .key b {
  display: inline-block;
  min-width: 18px;
  padding: 0 4px;
  margin-right: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,.14);
  text-align: center;
  font-weight: 600;
}

/* ------------------------------------------------------------------
   MATCHES
------------------------------------------------------------------- */
.p-cup .match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,.09);
}
.p-cup .match:first-child { border-top: 0; }
.p-cup .side { min-width: 0; }
.p-cup .side.h { text-align: right; }
.p-cup .side .tl { display: flex; align-items: center; gap: 7px; min-height: 34px; }
.p-cup .side.h .tl { justify-content: flex-end; }
.p-cup .side .tm { display: block; min-width: 0; font-size: 14px; line-height: 1.2; color: var(--ink-soft); }
.p-cup .side .tm.w { font-weight: 700; color: var(--ink); }
.p-cup .side .sc { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.25; color: var(--ink-faint); font-style: italic; }
.p-cup .score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 66px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  overflow: hidden;
  background: var(--royal);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  line-height: 1;
}
.p-cup .score b { padding: 7px 0 6px; }
.p-cup .score b + b { border-left: 1px solid rgba(255,255,255,.3); }
.p-cup .match.me { margin: 0 -8px; padding-left: 8px; padding-right: 8px; background: rgba(242,44,247,.14); border-radius: 8px; }
.p-cup .match.me + .match { border-top-color: transparent; }
.p-cup .bye {
  margin: 2px 0 0;
  padding: 8px 0 2px;
  border-top: 1px solid rgba(255,255,255,.09);
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: center;
}
.p-cup .bye.me { color: var(--ink); }
.p-cup .grp-label { margin: 14px 0 4px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.p-cup .grp-label:first-child { margin-top: 2px; }
.p-cup .grp-label i { width: 9px; height: 9px; border-radius: 2px; }
.p-cup .grp-label.a i { background: var(--grp-a); }
.p-cup .grp-label.b i { background: var(--grp-b); }
.p-cup details.round { margin: 0; border-top: 1px solid var(--hair); }
.p-cup details.round:first-of-type { border-top: 0; }
.p-cup details.round > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 13px 0;
  font-size: 16px;
  font-weight: 600;
}
.p-cup details.round > summary::-webkit-details-marker { display: none; }
.p-cup details.round > summary span { font-size: 13px; font-weight: 400; color: var(--ink-faint); }
.p-cup details.round > summary svg { margin-left: auto; width: 12px; height: 12px; align-self: center; transition: transform .2s; }
.p-cup details.round[open] > summary svg { transform: rotate(90deg); }
.p-cup details.round .body { padding-bottom: 8px; }
.p-cup .rounds-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.p-cup .toggle {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 99px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--hair);
  cursor: pointer;
}
.p-cup .toggle[aria-pressed="true"] { background: var(--royal); border-color: var(--accent); color: #fff; }
.p-cup .empty { margin: 0; padding: 10px 0; font-size: 13px; color: var(--ink-faint); }

/* ------------------------------------------------------------------
   BRACKET + TIES
------------------------------------------------------------------- */
.p-cup .bracket-card { padding: 14px 12px; }
.p-cup .bracket { --bg: 22px; --pg: 10px; display: flex; gap: var(--bg); min-width: 470px; align-items: stretch; }
.p-cup .bracket .col { display: flex; flex-direction: column; flex: 0 0 132px; }
.p-cup .bracket .col h3 { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--ink-faint); text-align: center; }
.p-cup .bracket .col .stack { flex: 1; display: flex; flex-direction: column; gap: var(--pg); }
.p-cup .pair { position: relative; flex: 1 1 0; display: grid; grid-template-rows: 1fr 1fr; gap: var(--pg); align-items: center; }
.p-cup .pair::after {
  content: "";
  position: absolute;
  right: calc(var(--bg) / -2);
  top: calc((100% - var(--pg)) / 4);
  bottom: calc((100% - var(--pg)) / 4);
  width: calc(var(--bg) / 2);
  border: 2px solid var(--hair);
  border-left: 0;
}
.p-cup .pair::before {
  content: "";
  position: absolute;
  right: calc(var(--bg) * -1);
  top: 50%;
  width: calc(var(--bg) / 2);
  border-top: 2px solid var(--hair);
}
.p-cup .tb {
  width: 132px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  overflow: hidden;
  font-size: 11.5px;
}
.p-cup .tb .r {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  min-height: 30px;
  line-height: 1.15;
  color: var(--ink-faint);
}
.p-cup .tb .r + .r { border-top: 1px solid var(--hair); }
.p-cup .tb .r.w { color: var(--ink); font-weight: 700; }
.p-cup .tb .r.w .g { color: var(--accent); }
.p-cup .tb .r.me { background: rgba(242,44,247,.16); }
.p-cup .tb .r .g { font-size: 13px; font-weight: 600; }
.p-cup .final-col .stack { justify-content: center; }
.p-cup .final-col .tb { border-color: rgba(255,213,74,.6); }
.p-cup .stage { margin: 4px 4px 0; font-size: 17px; font-weight: 600; }
.p-cup .tie { padding: 14px 16px 6px; }
.p-cup .tie h4 {
  margin: 0 0 4px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}
.p-cup .tt { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; font-size: 15px; font-weight: 600; color: var(--ink); }
.p-cup .tt i { font-style: normal; font-weight: 400; color: var(--ink-faint); }
.p-cup .tie h4 > span:not(.tt) { flex: none; font-size: 12.5px; font-weight: 500; color: var(--ink-faint); }
.p-cup .tie h4 > span b { color: var(--accent); font-size: 15px; }
.p-cup .leg { margin: 6px 0 0; font-size: 12px; color: var(--ink-faint); }

/* ------------------------------------------------------------------
   RULES, WINNERS, FOOTER
------------------------------------------------------------------- */
.p-cup details.fold { padding: 0; }
.p-cup details.fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
}
.p-cup details.fold > summary::-webkit-details-marker { display: none; }
.p-cup details.fold > summary svg { width: 14px; height: 14px; transition: transform .2s; }
.p-cup details.fold[open] > summary svg { transform: rotate(45deg); }
.p-cup details.fold .in { padding: 0 16px 16px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.p-cup details.fold ul { margin: 0; padding-left: 18px; display: grid; gap: 9px; }
.p-cup details.fold ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.p-cup details.fold ol li { display: grid; grid-template-columns: 46px 1fr; }
.p-cup details.fold ol li b { font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------------------
   YOUR TEAM PICKER + DATA PANEL
------------------------------------------------------------------- */
.p-cup .picker { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.p-cup .picker label { font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.p-cup .picker select {
  flex: 1;
  max-width: 240px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,40,.4);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 7px 10px;
}
.p-cup .picker select option { color: #000; }
.p-cup .picker select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.p-cup label.btn:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
.p-cup .status { margin-top: 12px; font-size: 13px; min-height: 18px; color: var(--ink-soft); line-height: 1.4; }

/* ------------------------------------------------------------------
   LAYOUT HELPERS (the same markup serves phone, tablet and desktop)
------------------------------------------------------------------- */
.p-cup .bar { display: flex; flex-direction: column; gap: var(--gap); }
.p-cup .ties, .p-cup .tables-grid { display: contents; }
.p-cup .rsec { display: block; }
.p-cup .rounds-card { padding-top: 4px; padding-bottom: 4px; }

/* ------------------------------------------------------------------
   TABLET
------------------------------------------------------------------- */
@media (min-width: 640px) {
  .p-cup .poster { aspect-ratio: 21 / 8; }
}

/* ------------------------------------------------------------------
   DESKTOP
------------------------------------------------------------------- */
@media (min-width: 1000px) {
  .p-cup .page {
    max-width: 1180px;
    padding: 28px var(--page-pad) 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    column-gap: 24px;
    row-gap: 28px;
    align-items: start;
    grid-template-areas: "bar bar" "hero side" "ko ko" "tables tables" "rounds rounds" "info info" "data data" "foot foot";
  }
  .p-cup .bar { grid-area: bar; flex-direction: row; align-items: center; justify-content: space-between; }
  .p-cup .bar .switch { width: 330px; }
  .p-cup .bar .picker { width: 400px; }
  .p-cup .picker select { max-width: none; }
  .p-cup #hero { grid-area: hero; }
  .p-cup #video { grid-area: side; }
  .p-cup .page:not(.has-video) #hero { grid-column: 1 / -1; }
  .p-cup #knockout { grid-area: ko; }
  .p-cup #group-stage { grid-area: tables; }
  .p-cup #rounds-sec { grid-area: rounds; }
  .p-cup #info-sec { grid-area: info; }
  .p-cup #data-sec { grid-area: data; max-width: 680px; }
  .p-cup .site-foot { grid-area: foot; margin-top: 8px; }
  .p-cup .hero { padding: 32px 34px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
  .p-cup .hero h1 { font-size: 62px; }
  .p-cup .hero .tag { font-size: 17px; }
  .p-cup .winner .n { font-size: 38px; }
  .p-cup .stat-bars dd { font-size: 24px; }
  .p-cup .bracket-card { padding: 26px 30px; }
  .p-cup .bracket { --bg: 56px; --pg: 18px; min-width: 0; }
  .p-cup .bracket .col { flex: 1 1 0; }
  .p-cup .bracket .col h3 { font-size: 13px; margin-bottom: 12px; }
  .p-cup .tb { width: 100%; font-size: 14px; }
  .p-cup .tb .r { min-height: 40px; padding: 6px 12px; gap: 8px; }
  .p-cup .tb .r .g { font-size: 16px; }
  .p-cup .stage { margin: 8px 4px 0; font-size: 20px; }
  .p-cup .ties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .p-cup .tables-grid { display: grid; gap: 24px; align-items: start; }
  .p-cup .tables-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-cup .tables-grid.one { grid-template-columns: minmax(0, 820px); }
  .p-cup .scroll.tbl { -webkit-mask-image: none; mask-image: none; }
  .p-cup table.t { font-size: 15px; }
  .p-cup table.t td { padding: 10px 5px; }
  .p-cup table.t th { padding: 6px 5px 8px; font-size: 12px; }
  .p-cup table.t .pos, .p-cup table.t thead .pos, .p-cup table.t .team, .p-cup table.t thead .team { position: static; background: none; min-width: 0; }
  .p-cup table.t .pos { padding-left: 18px; width: 56px; }
  .p-cup table.t .team { padding-right: 8px; }
  .p-cup table.t th:last-child, .p-cup table.t td:last-child { padding-right: 18px; }
  .p-cup table.t tr.me td, .p-cup table.t tr.me td.pos, .p-cup table.t tr.me td.team { background: rgba(242,44,247,.16); }
  .p-cup .rounds-card { display: grid; gap: 14px; background: none; border: 0; padding: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .p-cup .rounds-card.one { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .p-cup details.round {
    background: var(--card-fill);
    border: 1px solid var(--card-border) !important;
    border-radius: var(--card-radius);
    padding: 2px 22px 10px;
    -webkit-backdrop-filter: blur(var(--card-blur));
    backdrop-filter: blur(var(--card-blur));
  }
  .p-cup details.round > summary { font-size: 19px; padding: 16px 0 10px; }
  .p-cup details.round > summary svg { display: none; }
  .p-cup details.round .body.multi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; align-items: start; }
  .p-cup .side .tm { font-size: 15px; }
  .p-cup .side .sc { font-size: 12px; }
  .p-cup .score { min-width: 74px; font-size: 21px; }
  @media (hover: hover) {
    .p-cup .match:hover { background: rgba(255,255,255,.05); }
  }
  .p-cup details.fold > summary { font-size: 17px; }
  .p-cup details.fold > summary svg { display: none; }
  .p-cup #info-sec { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; align-items: start; }
  .p-cup #info-sec > h2 { grid-column: 1 / -1; }
}
@media (min-width: 1500px) {
  .p-cup .page { max-width: 1320px; grid-template-columns: minmax(0, 1fr) 360px; }
  .p-cup .hero h1 { font-size: 70px; }
}

/* ------------------------------------------------------------------
   PHP VERSION
------------------------------------------------------------------- */
a.toggle { display: inline-block; text-decoration: none; }
@media (min-width: 1000px) {
  .p-cup .updated { grid-area: data; }
  .p-cup .poster { aspect-ratio: 16 / 9; }
}
