/*
 * greenlive - shared styles
 *
 * A sports broadcast terminal: near-black ground, hairline panels, one
 * jade accent, tabular numbers everywhere a number can change.
 *
 * The layout is mobile first.  The base rules describe the phone; the
 * media queries further down widen it for tablets and desktops.  Two ideas
 * keep the three sizes consistent:
 *
 *   1. The video is sized with aspect-ratio, never with a fixed height, so
 *      it keeps its shape on every screen without a media query.
 *   2. The match list is a grid with auto-fill, so it becomes two or three
 *      columns as soon as there is room - the container does the work.
 *
 * The design tokens live in :root.  Every colour in this file comes from
 * there; nothing is hard-coded in a component rule.  That is what lets the
 * whole site change its skin from one place.
 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  /* ---- ground and surfaces -------------------------------------------- */
  --bg: #0a0c0b;
  --surface: #111413;
  --surface-2: #171b19;
  --surface-3: #1e2320;
  --card: #141817;

  /* a hairline, not a border - the panels are separated by light, not by
     a drawn line.  It is the cheapest way to make a dark interface read
     as ordered rather than as a wall of grey. */
  --hairline: rgba(255, 255, 255, .07);
  --hairline-2: rgba(255, 255, 255, .12);

  /* ---- ink -------------------------------------------------------------- */
  --ink: #eef2ef;
  --ink-2: #98a29d;
  --ink-3: #626c67;

  /* ---- the accent ------------------------------------------------------- */
  /* One accent, used sparingly.  Jade rather than the old emerald: it is
     cooler and less "app store", and it sits well on a near-black ground. */
  --accent: #34d399;
  --accent-2: #10b981;
  --accent-dim: rgba(52, 211, 153, .12);
  --accent-ink: #052e21;

  /* live is the only warm red on the page */
  --live: #f0524d;

  /* the key games of the day - amber, not orange.  Amber reads as "important"
     without shouting; orange reads as "error". */
  --hot: #f0a83a;
  --hot-dim: rgba(240, 168, 58, .12);
  --hot-ink: #2b1a04;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* the one easing curve used everywhere */
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Numbers that change must not move the layout.  Every score, minute and
   count on the site uses this. */
.m-row .score, .p-mid .sc, .ps-val, .plt-tbl td.v, .m-time,
.sec .n, .m-ch span, .v-ts, .vb-live, .ev-min {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/*
 * The shell.
 *
 * On a phone the page fills the width.  On a tablet it stops at 760px so
 * the line length stays readable.  On a desktop it becomes a two column
 * grid: the content and a 300px rail on the right that carries the
 * advertising.  The rail is hidden until there is room for it.
 */
.wrap {
  max-width: 100%; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column;
  width: 100%;
}

@media (min-width: 600px) {
  .wrap { max-width: 760px; }
}

@media (min-width: 1024px) {
  .wrap { max-width: 1240px; }
  /* the content and the rail share the row */
  .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      "hd hd"
      "adtop rail"
      "main rail"
      "adbottom rail"
      "note rail";
    column-gap: 20px;
    align-content: start;
  }
  .wrap > .hd { grid-area: hd; }
  .wrap > #main { grid-area: main; }
  .wrap > .rail { grid-area: rail; display: block; }
  .wrap > .p-note { grid-area: note; }
  .wrap > .p-hd { grid-area: hd; }
  .wrap > .p-video, .wrap > .p-score, .wrap > .p-live,
  .wrap > .lines, .wrap > .p-actions { grid-column: 1; }
  /* the top and the bottom banner belong to the content column */
  .wrap > .ad-slot[data-slot="list.top"] { grid-area: adtop; }
  .wrap > .ad-slot[data-slot="list.bottom"] { grid-area: adbottom; }

  /* an empty rail costs nothing - the games take the whole width */
  .wrap:not(:has(.rail .ad-slot:not(.empty))) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "hd"
      "adtop"
      "main"
      "adbottom"
      "note";
  }
  .wrap:not(:has(.rail .ad-slot:not(.empty))) > .rail { display: none; }
}

/*
 * The player page.
 *
 * On a phone and a tablet it stays a single column.  From 1180px it turns
 * into the reading column plus a 300px rail, so the space to the right of
 * the video carries the advertising instead of being empty.
 *
 * The rail only appears when there is something in it.  While the slots
 * are empty the video takes the whole width - a reserved column of
 * nothing would just make the picture smaller.
 */
.p-main { display: flex; flex-direction: column; min-width: 0; }

@media (min-width: 1024px) {
  .wrap.player-wrap { max-width: 1080px; }
  .p-main > .p-video { margin: 12px 0 8px; }
  .p-main > .p-video video,
  .p-main > .p-video iframe { max-height: 620px; }
  .p-main > .ad-slot { margin-left: 0; margin-right: 0; }
}

@media (min-width: 1180px) {
  .wrap.player-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 20px;
    align-content: start;
    max-width: 1440px;
  }
  .wrap.player-wrap > .p-hd { grid-column: 1 / -1; }
  .wrap.player-wrap > .p-main { grid-column: 1; }
  .wrap.player-wrap > .p-rail { grid-column: 2; }
  .p-main > .p-video video,
  .p-main > .p-video iframe { max-height: 660px; }

  /* an empty rail costs nothing - the video takes the whole width */
  .wrap.player-wrap:not(:has(.p-rail .ad-slot:not(.empty))) {
    grid-template-columns: minmax(0, 1fr);
    max-width: 1180px;
  }
  .wrap.player-wrap:not(:has(.p-rail .ad-slot:not(.empty))) > .p-rail { display: none; }
}

/* the rail of the player page - it only exists on a wide screen */
.p-rail { display: none; }
@media (min-width: 1180px) {
  .p-rail {
    display: block; padding: 12px 0 40px; position: sticky; top: 76px;
    align-self: start; max-height: calc(100vh - 92px); overflow-y: auto;
  }
  .p-rail .ad-slot { margin: 0 0 14px; width: 100%; align-self: center; }
}

/* the right hand rail - only on a wide screen */
.rail { display: none; }
@media (min-width: 1024px) {
  .rail {
    display: block; padding: 12px 0 40px; position: sticky; top: 76px;
    align-self: start; max-height: calc(100vh - 92px); overflow-y: auto;
  }
}

/* --------------------------------------------------------------- header --- */

/*
 * The header is a thin bar, not a colour block.
 *
 * A gradient banner is the loudest thing on the page and the least useful.
 * The bar only has to say where you are and let the games be the loud part.
 */
.hd {
  background: rgba(10, 12, 11, .88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--ink); padding: 12px 16px 0;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--hairline);
}
.hd .brand { display: flex; align-items: baseline; gap: 9px; }
.hd .brand b {
  font-size: 17px; font-weight: 650; letter-spacing: -.01em;
  display: inline-flex; align-items: center; gap: 7px;
}
/* the mark: a small jade dot, not a picture */
.hd .brand b::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px;
  background: var(--accent); display: inline-block;
}
.hd .brand span {
  font-size: 11px; color: var(--ink-3); letter-spacing: .06em;
}
.hd .sub { display: none; }

/* header row with the manual refresh button */
.hd-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 10px; padding-bottom: 2px;
}
.hd-note { font-size: 12px; color: var(--ink-3); }
.hd-note b { color: var(--live); font-weight: 600; }
.refresh-btn {
  border: 1px solid var(--hairline-2); background: var(--surface-2);
  color: var(--ink-2); border-radius: var(--radius-sm); padding: 6px 14px;
  font-size: 12px; cursor: pointer; flex: none;
  transition: background .15s var(--ease), color .15s var(--ease),
    border-color .15s var(--ease);
}
.refresh-btn:hover { background: var(--surface-3); color: var(--ink); }
.refresh-btn:active { background: var(--surface-2); }
.refresh-btn:disabled { opacity: .5; cursor: default; }

/* header 右侧的一组按钮 */
.hd-acts { display: flex; gap: 8px; align-items: center; flex: none; }

/* type tabs - a segmented control, hairline separated */
.tabs {
  display: flex; gap: 2px; margin-top: 10px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto; border: none; background: none; padding: 9px 14px 11px;
  font-size: 13px; color: var(--ink-3); cursor: pointer;
  position: relative; white-space: nowrap;
  transition: color .15s var(--ease);
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.on { color: var(--ink); font-weight: 550; }
/* the active tab is marked by an underline, not by a filled pill */
.tabs button.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}

/* section title */
.sec {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 16px 8px; color: var(--ink-2);
}
.sec h3 {
  font-size: 12px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink);
}
/*
 * A hairline that runs from the title to the edge of the page.
 *
 * It ties the heading to the block of cards below it and gives the eye a
 * place to rest, without drawing a line that would compete with the cards.
 */
.sec::after {
  content: ""; flex: 1 1 auto; height: 1px; margin-left: 2px;
  background: linear-gradient(90deg, var(--hairline), transparent);
}
.sec .n { font-size: 11px; color: var(--ink-3); }
.sec .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.sec.live .dot { background: var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/*
 * The heading of the key games.
 *
 * The flame is the mark the upstream site uses for "this is the game of
 * the day".  It is the only amber on the page, so the eye finds it without
 * reading a word.
 */
.sec.key { color: var(--hot); }
.sec.key h3 { color: var(--hot); }
.sec.key .flame { display: inline-flex; }
.sec.key .flame svg { width: 13px; height: 13px; display: block; }
.sec.key .n { color: var(--hot); opacity: .7; }

/*
 * The match list.
 *
 * auto-fill with a 300px minimum means the list is one column on a phone
 * and grows to two or three on a wide screen - no media query needed, the
 * container decides.
 */
.list {
  padding: 0 12px 24px; display: grid; gap: 8px;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) {
  .list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .sec { padding-left: 16px; padding-right: 16px; }
}

/*
 * A match card.
 *
 * A dark panel with a hairline edge.  No shadow, no gradient - the
 * separation comes from the surface, and the hover state lifts it one
 * step, which is enough to say "this one is clickable".
 */
.match {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .028), transparent 46%),
    var(--card);
  border-radius: var(--radius);
  padding: 13px 15px; display: flex; flex-direction: column; gap: 9px;
  cursor: pointer; border: 1px solid var(--hairline);
  position: relative;
  transition:
    background .18s var(--ease), border-color .18s var(--ease),
    transform .18s var(--ease), box-shadow .18s var(--ease);
}
.match:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 50%),
    var(--surface-2);
  border-color: var(--hairline-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .85);
}
.match:active { background: var(--surface-3); transform: translateY(0); }
.match.done { opacity: .55; }

/*
 * The key games of the day.
 *
 * An amber edge and an amber headline - the card is different at a glance,
 * without a single extra word on it.
 */
.match.key {
  background:
    linear-gradient(180deg, rgba(240, 168, 58, .16), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 46%),
    var(--card);
  border-color: rgba(240, 168, 58, .28);
}
.match.key:hover { border-color: rgba(240, 168, 58, .5); }
/* a slim amber bar on the edge: the card is marked before it is read */
.match.key::before {
  content: ""; position: absolute; left: 0; top: 13px; bottom: 13px;
  width: 2px; border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--hot), rgba(240, 168, 58, .1));
}
.match.key .m-row .name { font-weight: 600; color: #fff; }
.match.key .m-row .score { color: var(--hot); }
.match.key .m-row .score.live { color: var(--hot); background: rgba(240, 168, 58, .14); }

/* the flame mark of a key game */
.m-flame { margin-left: 5px; display: inline-flex; vertical-align: -1px; }
.m-flame svg { width: 11px; height: 11px; display: block; }

/* a game that nobody is waiting for - it stays readable, but it recedes */
.match.minor { opacity: .72; }
.match.minor:hover { opacity: 1; }
.match.minor .m-row .name { font-weight: 400; color: var(--ink-2); }
.match.minor .m-league { color: var(--ink-3); }

.m-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.m-league {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-3); letter-spacing: .02em;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-league i { width: 2px; height: 11px; border-radius: 1px; display: inline-block; flex: none; }
.m-time { font-size: 11px; color: var(--ink-3); flex: none; }
.m-time .st-live { color: var(--live); font-weight: 600; }
.m-time .st-live::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--live); margin-right: 5px;
  animation: pulse 1.4s infinite; vertical-align: 1px;
}
.m-time .st-fin { color: var(--ink-3); }

.m-row { display: flex; align-items: center; gap: 9px; }
.m-row .logo {
  width: 22px; height: 22px; border-radius: 5px; object-fit: contain;
  background: var(--surface-3); flex: none;
}
.m-row .name {
  flex: 1; font-size: 14px; font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-row .score {
  font-size: 15px; font-weight: 650; color: var(--ink);
  min-width: 20px; text-align: center;
}
.m-row .score.live {
  color: var(--accent); font-weight: 700;
  background: var(--accent-dim); border-radius: 6px;
  padding: 1px 7px; margin-right: -3px;
}
.m-row .score.dash { color: var(--ink-3); font-weight: 400; }

/*
 * The half time and the corners, in the middle of the card.
 *
 * The two numbers sit on one quiet line with a dot between them, so the row
 * reads as a single fact about the game instead of two loose labels.
 */
.m-mid {
  display: flex; justify-content: center; align-items: center; gap: 9px;
  font-size: 11px; color: var(--ink-3);
}
.m-mid span + span::before {
  content: "·"; margin-right: 9px; color: var(--ink-3); opacity: .45;
}
.m-mid b { color: var(--ink-2); font-weight: 600; }

/* the little chips under a card: how many lines, how many are live */
.m-ch { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.m-ch span {
  font-size: 10px; color: var(--ink-3); background: var(--surface-2);
  border: 1px solid var(--hairline); border-radius: 5px; padding: 2px 7px;
}
.m-ch span:first-child { color: var(--ink-2); }

/*
 * The entrances of a match - at the bottom right of the card.
 *
 * A small segmented control with the three mirrors on one track.  It sits
 * outside the player on purpose: a mirror is chosen before the video starts,
 * so the wait that switching used to cost does not happen at all.
 *
 * The rule is deliberately stricter than the chip rule above - this is a
 * control, not a label.
 */
.m-ch .m-entries {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 3px 2px 6px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 7px;
}
.m-entries i {
  font-style: normal; font-size: 9.5px; color: var(--ink-3);
  letter-spacing: .03em; margin-right: 1px; user-select: none;
  white-space: nowrap;
}
.m-entries button {
  width: 21px; height: 19px; padding: 0; border: 0; border-radius: 5px;
  background: transparent; color: var(--ink-2);
  font-size: 11px; line-height: 19px; text-align: center;
  cursor: pointer; font-family: inherit;
  transition: background .14s var(--ease), color .14s var(--ease), transform .1s var(--ease);
}
.m-entries button:hover { background: var(--surface-3); color: var(--accent); }
.m-entries button:active { transform: scale(.88); }
.m-entries button:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }

.empty { text-align: center; color: var(--ink-3); padding: 64px 20px; font-size: 13px; }
.empty .big { margin-bottom: 12px; display: flex; justify-content: center; }
.empty .big svg { width: 30px; height: 30px; opacity: .35; }
.refresh-tip { text-align: center; font-size: 10px; color: var(--ink-3); padding: 8px 0 16px; }

/* ---------- player page ---------- */
.p-hd {
  background: rgba(10, 12, 11, .88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--ink); padding: 11px 14px; position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--hairline);
}
.p-hd .row1 { display: flex; align-items: center; gap: 10px; }
.p-hd .back {
  font-size: 19px; color: var(--ink-2); text-decoration: none;
  padding: 0 6px 0 0; transition: color .15s var(--ease);
}
.p-hd .back:hover { color: var(--ink); }
.p-hd .lg { font-size: 12px; color: var(--ink-2); }
.p-hd .tm { font-size: 11px; color: var(--ink-3); margin-left: auto; text-align: right; }

/*
 * The score board.
 *
 * The score is the biggest thing on the page - that is what a visitor who
 * opened a live match came for.  It is set in tabular numerals so it does
 * not shift when it changes.
 */
.p-score {
  background: var(--card); margin: 12px; border-radius: var(--radius);
  padding: 18px 18px; border: 1px solid var(--hairline);
}
.p-teams { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.p-team {
  flex: 1; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 8px; min-width: 0;
}
.p-team img {
  width: 42px; height: 42px; object-fit: contain;
  border-radius: 10px; background: var(--surface-2);
}
.p-team .nm {
  font-size: 13px; font-weight: 550; color: var(--ink);
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-mid { text-align: center; min-width: 96px; }
.p-mid .sc {
  font-size: 30px; font-weight: 700; letter-spacing: -.02em;
  color: var(--ink); line-height: 1;
}
.p-mid .st { font-size: 11px; color: var(--live); font-weight: 600; margin-top: 5px; }
.p-mid .st.fin { color: var(--ink-3); }
.p-mid .st.pre { color: var(--ink-3); font-weight: 400; }
.p-mid .sub { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/*
 * The line switcher.
 *
 * A segmented control.  The active line is filled with the accent; the
 * lines whose address is ready carry a small jade dot, so the user can
 * see at a glance which switch will be instant.
 */
.lines { display: flex; gap: 6px; margin: 0 12px; flex-wrap: wrap; align-items: center; }
/*
 * The mirrors sit on their own track, above the real signal lines.
 *
 * They are the control that is picked before the video starts, so they get
 * a bar of their own - the eye finds the row, and the two groups cannot be
 * mistaken for one another.
 */
.lines.entries {
  margin-bottom: 6px;
  padding: 7px 9px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}
.lines.entries .lines-label { color: var(--accent); }
.lines-label {
  flex: 0 0 auto; font-size: 10px; color: var(--ink-3);
  letter-spacing: .08em; text-transform: uppercase;
}
.lines button {
  border: 1px solid var(--hairline); background: var(--surface);
  color: var(--ink-2); border-radius: var(--radius-sm);
  padding: 6px 13px; font-size: 12px; cursor: pointer;
  position: relative; transition: all .15s var(--ease);
}
.lines button:hover { background: var(--surface-2); color: var(--ink); border-color: var(--hairline-2); }
.lines button:disabled { cursor: wait; opacity: .6; }
.lines button.on {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent); font-weight: 600;
}
.lines.entries button.on { background: var(--accent); color: var(--accent-ink); }
/*
 * The chosen entrance is still being resolved upstream.
 *
 * The picture keeps playing the signal that is already on screen, so this
 * state only has to say "the mirror is on its way" - a slow pulse in the
 * accent colour is enough.
 */
.lines.entries button.pending {
  background: var(--accent-dim); color: var(--accent);
  border-color: rgba(52, 211, 153, .45);
  animation: pulse 1.3s infinite;
}

/* health marker: a small dot on the edge of the button */
.lines button.ok::after {
  content: ""; position: absolute; top: 4px; right: 6px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--live);
}
.lines button.bad { opacity: .45; color: var(--ink-3); }
.lines button.bad::after {
  content: ""; position: absolute; top: 4px; right: 6px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--live);
}
/* the address of this line is known and good - it starts without a wait */
.lines button.ready:not(.on) { border-color: rgba(52, 211, 153, .3); color: var(--ink); }
.lines button.ready:not(.on)::before {
  content: ""; position: absolute; top: 4px; right: 6px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
  opacity: .6;
}

/* live data panel under the video */
.p-live {
  margin: 8px 12px 0; background: var(--card); border-radius: var(--radius);
  padding: 14px 15px; border: 1px solid var(--hairline);
}
.pl-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.pl-t {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-2);
}
.pl-src { font-size: 10px; color: var(--ink-3); margin-left: auto; }
.pl-up { font-size: 10px; color: var(--ink-3); }

/* the score card */
.pl-score {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 10px;
}
.ps-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ps-side:last-child { align-items: flex-end; }
.ps-name {
  font-size: 11px; color: var(--ink-2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.ps-val {
  font-size: 25px; font-weight: 700; color: var(--ink); line-height: 1.1;
}
.ps-mid { flex: 0 0 auto; text-align: center; min-width: 80px; }
.ps-state {
  display: inline-block; font-size: 10px; font-weight: 650; color: #fff;
  background: var(--surface-3); border-radius: 5px; padding: 3px 9px;
  letter-spacing: .04em;
}
.ps-state.pre { background: var(--surface-3); color: var(--ink-2); }
.ps-state.live { background: var(--live); }
.ps-state.fin { background: var(--surface-3); color: var(--ink-3); }
.ps-extra { display: block; font-size: 10px; color: var(--ink-3); margin-top: 6px; }

/* the little statistics cells */
.pl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; }
.pl-cell {
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 9px 6px; text-align: center;
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.pl-cell .k { font-size: 10px; color: var(--ink-3); }
.pl-cell .v {
  font-size: 14px; font-weight: 650; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-extra { margin-top: 10px; font-size: 11px; color: var(--ink-2); line-height: 1.6; }

/* the tab strip */
.pl-tabs {
  display: flex; gap: 2px; margin-top: 14px;
  border-bottom: 1px solid var(--hairline);
}
.plt {
  border: none; background: none; cursor: pointer;
  font-size: 12px; color: var(--ink-3); padding: 8px 12px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s var(--ease);
}
.plt:hover { color: var(--ink-2); }
.plt.on { color: var(--ink); font-weight: 550; border-bottom-color: var(--accent); }
.pl-body { padding-top: 12px; }
.plt-panel { display: none; }
.plt-panel.on { display: block; }
.pl-empty { font-size: 11px; color: var(--ink-3); padding: 12px 2px; }
.pl-note { font-size: 11px; color: var(--ink-3); padding: 8px 2px 2px; line-height: 1.6; }

/* the technical statistics table */
.plt-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.plt-tbl th, .plt-tbl td { padding: 6px 4px; text-align: center; }
.plt-tbl thead th { font-size: 10px; color: var(--ink-3); font-weight: 500; }
.plt-tbl td.k { color: var(--ink-2); font-size: 11px; }
.plt-tbl td.v { font-weight: 700; color: var(--ink); width: 62px; }
.plt-tbl td.v.win { color: var(--accent); }
.plt-tbl td.v.lose { color: var(--ink-3); }
.plt-tbl tbody tr:nth-child(odd) { background: var(--surface-2); }

/* the line-up */
.lu-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lu-col {
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 9px 9px 11px; min-width: 0;
}
.lu-hd {
  font-size: 11px; font-weight: 650; color: var(--ink);
  padding-bottom: 7px; margin-bottom: 6px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: baseline; gap: 5px;
}
.lu-hd .fm { font-size: 10px; color: var(--ink-3); font-weight: 400; margin-left: auto; }
.lu-sec { font-size: 10px; color: var(--ink-3); margin: 8px 0 4px; font-weight: 600; }
.lu-row {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 12px; color: var(--ink-2); padding: 2px 0;
  white-space: nowrap; overflow: hidden;
}
.lu-no {
  flex: 0 0 20px; text-align: right; font-size: 11px;
  color: var(--accent); font-weight: 650;
}
.lu-nm { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.lu-pos {
  flex: 0 0 auto; font-size: 9px; color: var(--ink-3);
  border: 1px solid var(--hairline-2); border-radius: 3px; padding: 0 4px;
}
.lu-abs { color: var(--live); }
.lu-abs-item { padding: 2px 0 4px; }
.lu-abs-item .lu-reason { font-size: 10px; color: var(--ink-3); padding-left: 26px; line-height: 1.5; }

/* the event log */
.ev-list { display: flex; flex-direction: column; }
.ev-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; padding: 7px 2px; border-bottom: 1px solid var(--hairline);
}
.ev-row:last-child { border-bottom: none; }
.ev-min {
  flex: 0 0 38px; text-align: center; font-size: 11px;
  font-weight: 650; color: var(--ink-2);
}
.ev-ico {
  flex: 0 0 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff;
}
.ev-ico.goal { background: var(--accent); color: var(--accent-ink); }
.ev-ico.sub { background: var(--surface-3); color: var(--ink-2); }
.ev-ico.yellow { background: #d9a441; color: #241a04; }
.ev-ico.red { background: var(--live); }
.ev-ico.corner { background: #3d7d94; }
.ev-ico.event { background: var(--surface-3); color: var(--ink-2); }
.ev-txt {
  flex: 1; color: var(--ink-2); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ev-side { font-size: 10px; color: var(--ink-3); }

/* action buttons */
.p-actions {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 12px 0; flex-wrap: wrap;
}
.p-actions .act {
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius-sm); padding: 8px 18px; font-size: 13px;
  cursor: pointer; font-weight: 600;
  transition: filter .15s var(--ease);
}
.p-actions .act:hover { filter: brightness(1.08); }
.p-actions .act.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--hairline-2); font-weight: 500; }
.p-actions .act.ghost:hover { background: var(--surface-2); color: var(--ink); }
.p-actions .act:disabled { opacity: .5; cursor: default; }
.p-tip { font-size: 11px; color: var(--ink-3); margin-left: auto; }

/* ---------- the picture and its controls ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; }

/*
 * The picture.
 *
 * aspect-ratio keeps the 16:9 shape on every screen - the old
 * height:56vw / max-height:420px squashed it on a desktop and did not fill
 * a tablet.  The height now follows the width.
 */
.p-video {
  position: relative; margin: 10px 12px 8px; background: #000;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--hairline);
  -webkit-tap-highlight-color: transparent;
  /* the box keeps the 16:9 shape on its own, so it does not collapse when
     the player switches between the <video> and the <iframe> */
  aspect-ratio: 16 / 9;
}
.p-video video, .p-video iframe {
  width: 100%; height: 100%; aspect-ratio: auto; display: block;
  background: #000; border: none; object-fit: contain;
}
@media (min-width: 1024px) {
  .p-video { margin: 12px 0 8px; }
  .p-video video, .p-video iframe { max-height: 620px; }
}

/*
 * The status line over the picture.
 *
 * It used to be a full screen black curtain - which meant every switch of
 * line looked like the player had crashed.  It is now a small plate in the
 * centre: the picture stays visible, only the state is announced.
 */
.v-msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 8;
  display: none; align-items: center; gap: 8px;
  color: var(--ink); font-size: 12px; letter-spacing: .04em;
  background: rgba(10, 12, 11, .78);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--hairline-2);
  pointer-events: none; white-space: nowrap;
}
/* a small spinner, so the plate reads as "working" and not as an error */
.v-msg::before {
  content: ""; width: 11px; height: 11px; flex: none;
  border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .25);
  border-top-color: var(--accent);
  animation: vspin .7s linear infinite;
}
@keyframes vspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .v-msg::before { animation: none; }
}

/*
 * The frozen picture.
 *
 * A canvas that holds the last frame of the line we are leaving.  It sits
 * over the video so a switch shows the picture changing instead of the
 * screen going dark.
 */
.v-freeze {
  position: absolute; inset: 0; z-index: 5;
  width: 100%; height: 100%;
  object-fit: contain; background: #000;
  display: none; pointer-events: none;
}

/* the "tap to unmute" hint (mobile autoplay policies) */
.v-mute {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  background: rgba(10, 12, 11, .85); color: var(--ink);
  border: 1px solid var(--hairline-2);
  font-size: 12px; padding: 6px 15px; border-radius: 999px; cursor: pointer;
  display: none; z-index: 6;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.v-mute.on { display: block; }
.p-video.fs .v-mute { top: 54px; }

/* top overlay (fullscreen only) */
.v-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 6;
  display: none; align-items: center; gap: 10px;
  padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
  color: #fff;
}
.p-video.fs .v-top { display: flex; }
.v-top-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 2px 8px;
  border-radius: 4px; background: var(--live); color: #fff; flex: none;
}
.v-badge.pre { background: rgba(255, 255, 255, .2); }
.v-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-top-r { margin-left: auto; flex: none; }
.v-ts { font-size: 12px; opacity: .85; }

/* the control bar */
.v-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7;
  display: flex; align-items: center; gap: 4px;
  padding: 8px 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0, 0, 0, .8), rgba(0, 0, 0, 0));
  opacity: 0; transform: translateY(6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  pointer-events: none;
}
.p-video.show-bar .v-bar { opacity: 1; transform: none; pointer-events: auto; }
.vb {
  border: none; background: rgba(255, 255, 255, .12); color: #fff;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none;
  transition: background .15s var(--ease);
}
.vb:hover { background: rgba(255, 255, 255, .22); }
.vb.on { background: var(--accent); color: var(--accent-ink); }
.vb.off { opacity: .75; }
.vb-sp { flex: 1; }

.v-range {
  -webkit-appearance: none; appearance: none; width: 0; max-width: 88px;
  height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .5);
  outline: none; cursor: pointer; margin: 0 4px;
  transition: width .2s var(--ease), max-width .2s var(--ease);
  flex: none;
}
.p-video.show-bar:hover .v-range, .p-video.show-bar .v-range:focus { width: 88px; max-width: 88px; }
.v-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.v-range::-moz-range-thumb { width: 12px; height: 12px; border: none; background: #fff; border-radius: 50%; }

.vb-live {
  display: flex; align-items: center; gap: 5px; flex: none;
  font-size: 11px; color: #fff;
  padding: 3px 9px; background: rgba(0, 0, 0, .5); border-radius: 999px;
}
.vb-live .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--live); display: inline-block;
  animation: pulse 1.4s infinite;
}
.vb-live.off { display: none; }

/* the third party player has its own bar */
.p-video.embed #btnPlay, .p-video.embed #btnMute,
.p-video.embed #rngVol, .p-video.embed #vbLive { display: none; }

/* ---------- bottom sheet ---------- */
.sh-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px);
}
.sh {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 520px; margin: 0 auto;
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--hairline); border-bottom: none;
  padding-bottom: env(safe-area-inset-bottom);
  max-height: 76vh; overflow-y: auto;
  animation: shUp .22s var(--ease);
}
/* on a wide screen the sheet becomes a centred panel - a sheet that is
   anchored to the bottom of a 1440px screen looks broken */
@media (min-width: 1024px) {
  .sh {
    top: 50%; bottom: auto; transform: translateY(-50%);
    border-radius: var(--radius-lg); max-width: 420px; max-height: 80vh;
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  }
  @keyframes shUp { from { transform: translateY(calc(-50% + 14px)); opacity: .4; } }
  .sh-scrim { background: rgba(0, 0, 0, .6); }
}
@keyframes shUp { from { transform: translateY(14px); opacity: .4; } }
.sh-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 16px 9px; position: sticky; top: 0; background: var(--surface);
}
.sh-hd b { font-size: 14px; font-weight: 600; }
.sh-x {
  border: none; background: var(--surface-3); color: var(--ink-2);
  width: 28px; height: 28px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
}
.sh-grp { padding: 0 8px 8px; }
.sh-gt { font-size: 10px; color: var(--ink-3); padding: 9px 9px 5px; letter-spacing: .08em; text-transform: uppercase; }
.sh-it {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: none; background: none; text-align: left; cursor: pointer;
  padding: 11px 10px; border-radius: var(--radius-sm); color: var(--ink);
  transition: background .15s var(--ease);
}
.sh-it:hover { background: var(--surface-2); }
.sh-it:active { background: var(--surface-3); }
.sh-it.dis { opacity: .45; cursor: default; }
.sh-ic { width: 24px; flex: none; color: var(--ink-2); display: flex; }
.sh-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sh-tx b { font-size: 14px; font-weight: 500; }
.sh-tx i {
  font-style: normal; font-size: 11px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sh-ck { width: 20px; flex: none; color: var(--accent); }
.sh-ck .ic { width: 18px; height: 18px; }

/* ---------- modal ---------- */
.md {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 41; width: min(88vw, 340px);
  background: var(--surface); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--hairline-2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.md-bd { padding: 4px 18px 18px; }
.md-qr { text-align: center; }
.qr-holder {
  display: inline-block; padding: 10px; background: #fff;
  border-radius: var(--radius-sm);
}
.qr-holder canvas, .qr-holder img { display: block; width: 176px; height: 176px; }
.qr-fallback { padding: 40px 0; color: var(--ink-3); font-size: 13px; }
.md-url {
  margin-top: 10px; font-size: 11px; color: var(--ink-2);
  word-break: break-all; background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.md-tip { margin-top: 9px; font-size: 11px; color: var(--ink-3); line-height: 1.6; text-align: left; }
.md-slider { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.md-slider input {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px; background: var(--surface-3);
}
.md-slider input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent);
}
.md-val { font-size: 13px; color: var(--ink); font-weight: 600; min-width: 42px; text-align: right; }

/* ---------- toast ---------- */
.v-toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(8px);
  z-index: 60; background: var(--surface-3); color: var(--ink);
  font-size: 12px; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-2);
  opacity: 0; transition: opacity .2s var(--ease), transform .2s var(--ease);
  pointer-events: none; max-width: 80vw; text-align: center;
}
.v-toast.on { opacity: 1; transform: translateX(-50%); }

/* ---------- the floating mini window ---------- */
.mini {
  position: fixed; right: 12px; bottom: 84px; z-index: 50;
  width: 168px; border-radius: var(--radius); overflow: hidden;
  background: #000; border: 1px solid var(--hairline-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: shUp .2s var(--ease);
}
.mini.drag { opacity: .92; }
.mini-v video { width: 100%; height: 94px; display: block; background: #000; }
.mini-bar {
  display: flex; align-items: center; gap: 4px; padding: 5px 6px;
  background: var(--surface-2); color: var(--ink-2);
}
.mini-t { font-size: 10px; flex: 1; }
.mini-b {
  border: none; background: rgba(255, 255, 255, .1); color: var(--ink);
  width: 20px; height: 20px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
}
.mini-b .ic { width: 12px; height: 12px; }

/* ---------- fullscreen ---------- */
.p-video:fullscreen, .p-video:-webkit-full-screen {
  width: 100%; height: 100%; max-height: none; margin: 0; border-radius: 0;
  display: flex; align-items: center; justify-content: center; background: #000;
  border: none;
}
.p-video:fullscreen video, .p-video:-webkit-full-screen video,
.p-video:fullscreen iframe, .p-video:-webkit-full-screen iframe {
  width: 100%; height: 100%; max-height: none; object-fit: contain;
}

/* the picture turned by 90 degrees - the fallback for the browsers that
   cannot lock the screen orientation (iOS Safari, Firefox mobile) */
.p-video.v-rot90 video, .p-video.v-rot90 iframe {
  position: absolute; left: 50%; top: 50%;
  width: var(--rw, 100%); height: var(--rh, 100%);
  max-height: none; margin: 0;
  transform: translate(-50%, -50%) rotate(90deg);
  object-fit: contain;
}

.p-note { font-size: 11px; color: var(--ink-3); text-align: center; padding: 0 20px 30px; line-height: 1.7; }

/* ------------------------------------------------------------- adverts --- */

/*
 * An advertising slot.
 *
 * The position is reserved in the layout, but nothing about the slot is
 * visible until there is something to show.  An empty slot collapses to
 * nothing - the visitor never meets an "advertising space" frame, and the
 * page does not jump when the picture arrives, because the creative keeps
 * the size the server asked for.
 *
 * The click opens the server's redirect route - the advertiser's real
 * address never reaches the browser.
 */
.ad-slot {
  margin: 12px; border-radius: var(--radius-sm); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  /* the margin is outside the width - otherwise the slot is wider than
     the screen on a phone and the page scrolls sideways */
  width: calc(100% - 24px);
  max-width: 100%;
  background: transparent;
  border: none;
}
/* nothing to show - the slot takes up no room at all */
.ad-slot.empty { display: none; }
/* a creative gets a light plate, so the picture is not lost on a dark page */
.ad-slot.has-ad { background: #fff; }
.ad-slot img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  background: #fff;
}
.ad-slot a { display: block; width: 100%; height: 100%; }
.ad-slot .ad-tag {
  position: absolute; right: 0; bottom: 0; font-size: 9px; color: #64748b;
  background: rgba(255, 255, 255, .85); padding: 1px 5px; border-radius: 4px 0 0 0;
  pointer-events: none;
}
/*
 * The self promotion that fills a slot when no creative is running.  It is
 * a quiet one line strip - it must never compete with the games.
 */
.ad-slot.house {
  background: var(--surface-2); border: 1px solid var(--hairline);
  font-size: 11px; color: var(--ink-3); text-align: center;
  padding: 9px 12px; line-height: 1.6;
}

/* the inline slot inside the match list - it spans the whole row so the
   banner can use the full width of the column */
.list .ad-slot { margin: 0; grid-column: 1 / -1; }
@media (max-width: 619px) {
  .list .ad-slot { grid-column: auto; }
}
/* a banner never grows taller than a tenth of the column - the ratio
   comes from the size the server asked for */
.list .ad-slot { max-height: 120px; }
.list .ad-slot.has-ad { border-radius: var(--radius-sm); }

/* the sticky slot at the bottom of a phone */
.ad-slot.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  margin: 0; width: 100%; max-width: 100%;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
}
.ad-slot.sticky.empty { display: none; }

/* the page needs room at the bottom so the sticky slot does not cover
   the last card - only when the slot actually carries something */
body.has-sticky-ad .wrap { padding-bottom: 70px; }
