/* Locked ("live") mode: the bong shown against the actual league table.
   Layered on top of ranking.css (header, hero, buttons, forms, emblems,
   flags, fixture circles and tooltips come from there). Every class here is
   prefixed "live-" so nothing leaks into the open-mode ranking page. */

.live-page .hero {
  padding-bottom: clamp(4.5rem, 7vw, 5.5rem);
}

.live-phases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}

.live-phases li {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 1rem 0.4rem 0.5rem;
  border: 1px dashed rgb(255 255 255 / 38%);
  border-radius: 999px;
  color: #d9d7f0;
  font-size: 0.9rem;
  font-weight: 700;
}

.live-phases li.is-done {
  border-style: solid;
  border-color: rgb(255 255 255 / 22%);
  background: rgb(255 255 255 / 8%);
}

.live-phases li.is-current {
  border: 0;
  background: white;
  color: var(--navy);
}

.live-phase-dot {
  display: inline-grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border: 1px solid currentcolor;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
}

.is-done .live-phase-dot {
  border-color: transparent;
  background: var(--direct);
  color: var(--direct-strong);
}

.is-current .live-phase-dot {
  border-color: transparent;
  background: var(--lime);
  color: var(--navy);
}

.live-phase-note {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
}

/* ---- cards ---- */

.live-card,
.live-section {
  margin: 1.4rem max(1rem, calc((100vw - 1180px) / 2)) 0;
}

.live-card {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.live-first {
  margin-top: -3.5rem;
  position: relative;
}

.live-card h2 {
  font-size: 1.4rem;
}

.live-lead {
  max-width: 70ch;
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.live-active {
  margin: 0 0 0.8rem;
}

.live-delivered {
  color: var(--muted);
}

.live-no-bong {
  margin-top: 1rem;
}

.live-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.2rem;
  margin-bottom: 0.9rem;
}

.live-section-head a {
  color: var(--purple-dark);
  font-weight: 650;
}

/* ---- summary ---- */

.live-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
}

.live-stat {
  display: flex;
  flex: 1 1 16rem;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 1.4rem 1.5rem;
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
}

.live-stat-points {
  background: var(--navy);
  color: white;
}

.live-stat-rank {
  background: var(--lime);
  color: var(--ink);
  flex-basis: 18rem;
}

.live-stat-label {
  font-size: 0.85rem;
  font-weight: 700;
}

.live-stat-points .live-stat-label,
.live-stat-points .live-stat-note {
  color: #d6d1f5;
}

.live-stat-rank .live-stat-label,
.live-stat-rank .live-stat-note {
  color: #2c3a05;
}

.live-stat-note {
  font-size: 0.88rem;
}

.live-stat-rank .live-stat-note {
  font-weight: 650;
}

.live-stat-number {
  font-size: clamp(3.8rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.live-stat-points .live-stat-number {
  color: var(--lime);
}

.live-stat-rank-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.8rem;
}

.live-stat-rank-of {
  font-size: 1.25rem;
  font-weight: 700;
}

.live-board {
  display: flex;
  flex: 1.3 1 20rem;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.live-board .live-stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-board-list {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-board-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.6rem;
}

.live-board-list li.is-me {
  background: var(--lime);
}

.live-board-rank {
  width: 1.6rem;
  font-weight: 800;
  text-align: right;
}

.live-board-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
}

.live-board-points {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.live-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.live-tile {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}

.live-tile-label {
  color: var(--purple-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.live-tile-value {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.live-tile-max {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
}

.live-tile-bar {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #ecebf5;
}

.live-tile-bar > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--purple);
}

.live-tile-hint {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---- table controls ---- */

.live-table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.9rem 1.5rem;
}

.live-sort {
  display: inline-flex;
  gap: 4px;
  margin-top: 0.7rem;
  padding: 4px;
  border-radius: 14px;
  background: #e6e4f2;
}

.live-sort[hidden] {
  display: none;
}

.live-sort button {
  min-height: 40px;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #3a3b57;
  font-weight: 700;
}

.live-sort button[aria-pressed="true"] {
  background: var(--navy);
  color: white;
}

.live-legend {
  margin: 0;
}

.live-banner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1rem 0 0;
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  background: var(--direct-strong);
  color: white;
  font-weight: 700;
}

.live-banner[hidden] {
  display: none;
}

.live-banner-check {
  display: inline-grid;
  flex: none;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--direct-strong);
  font-size: 1.1rem;
  font-weight: 800;
}

.live-banner-extra {
  font-weight: 500;
}

/* ---- the table ---- */

.live-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.live-table {
  --live-columns: 64px minmax(0, 1fr) 150px;
  min-width: 720px;
}

.live-table[data-has-bong="true"] {
  --live-columns: 34px 64px minmax(0, 1.7fr) 150px 84px 90px 56px minmax(0, 1.3fr);
  min-width: 1040px;
}

.live-table[data-has-bong="false"] [data-col="bong"] {
  display: none;
}

.live-head,
.live-row {
  display: grid;
  grid-template-columns: var(--live-columns);
  column-gap: 1rem;
  align-items: center;
  padding: 0.6rem 1.4rem;
}

.live-head {
  align-items: end;
  padding-top: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-head-points {
  grid-column: span 2;
}

.live-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-band {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.4rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.live-band-range {
  font-weight: 600;
  opacity: 0.85;
}

.live-band.zone-direct {
  background: var(--direct);
  color: var(--direct-strong);
}

.live-band.zone-playoff {
  background: var(--playoff);
  color: var(--playoff-strong);
}

.live-band.zone-eliminated {
  background: var(--eliminated);
  color: var(--eliminated-strong);
}

.live-row {
  border-bottom: 1px solid #efeef6;
  background: var(--surface);
}

/* The point of the page: a club that currently gives "sonepoeng" gets a
   green row, so a glance down the table shows what is going well. */
.live-row[data-hit="true"] {
  border-bottom-color: #b4e2bf;
  background: #d9f5df;
}

.live-check {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1.5px dashed #c9c8d8;
  border-radius: 50%;
  color: white;
  font-size: 0.95rem;
  font-weight: 800;
}

.live-row[data-hit="true"] .live-check {
  border: 0;
  background: var(--direct-strong);
}

.live-pos,
.live-tip {
  display: grid;
  width: 52px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 800;
}

.live-pos.zone-direct,
.live-tip.zone-direct {
  background: var(--direct);
  color: var(--direct-strong);
}

.live-pos.zone-playoff,
.live-tip.zone-playoff {
  background: var(--playoff);
  color: var(--playoff-strong);
}

.live-pos.zone-eliminated,
.live-tip.zone-eliminated {
  background: var(--eliminated);
  color: var(--eliminated-strong);
}

/* "Mitt tips" is outlined so it can never be mistaken for the real position. */
.live-tip {
  box-sizing: border-box;
  border: 2px solid currentcolor;
  background: white !important;
  font-size: 1rem;
  font-weight: 700;
}

.live-club {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.65rem;
}

.live-club .club-emblem {
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
}

.live-club .club-emblem img {
  width: 44px;
  height: 44px;
}

.live-pot {
  color: var(--muted);
  font-size: 0.78rem;
}

.live-fixtures {
  display: flex;
}

.live-delta {
  font-size: 0.9rem;
  font-weight: 700;
}

.live-delta.is-hit {
  color: var(--direct-strong);
}

.live-pts {
  display: grid;
  min-width: 46px;
  height: 36px;
  padding: 0 0.5rem;
  box-sizing: border-box;
  place-items: center;
  border-radius: 10px;
  background: var(--eliminated);
  color: var(--eliminated-strong);
  font-size: 1.05rem;
  font-weight: 800;
}

.live-pts.is-some {
  background: white;
  box-shadow: inset 0 0 0 1px #9fd4ad;
  color: #1d5a2f;
}

.live-pts.is-good {
  background: #cfc7ff;
  color: #2d2280;
}

.live-pts.is-jackpot {
  background: var(--lime);
  color: var(--ink);
}

.live-chips {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
}

.live-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--eliminated);
  color: #4b4e5f;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.live-chip.is-zone-hit {
  background: var(--direct-strong);
  color: white;
}

.live-chip.is-zone-miss {
  background: white;
  box-shadow: inset 0 0 0 1px #c9c8d8;
  color: var(--eliminated-strong);
}

.live-chip.is-exact {
  background: white;
  box-shadow: inset 0 0 0 1px #9fd4ad;
  color: #1d5a2f;
}

.live-chip.is-bonus {
  background: var(--lime);
  color: var(--ink);
}

.live-footnote {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---- nations ---- */

.live-nations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.live-nations li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 600;
}

.live-nations li.is-swept {
  border-color: #b4e2bf;
  background: #d9f5df;
}

.live-nations .flag {
  width: 32px;
  height: 24px;
}

.live-nations-points {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--eliminated);
  color: var(--eliminated-strong);
  font-weight: 800;
}

.is-swept .live-nations-points {
  background: var(--direct-strong);
  color: white;
}

.live-section {
  padding-bottom: 0.2rem;
}

.live-section > h2 {
  margin-bottom: 0.2rem;
}

/* ---- narrow screens: each club becomes a small card ---- */

@media (max-width: 1100px) {
  .live-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .live-card,
  .live-section {
    margin-right: 1rem;
    margin-left: 1rem;
  }

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

  .live-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .live-table,
  .live-table[data-has-bong="true"] {
    min-width: 0;
  }

  .live-head {
    display: none;
  }

  .live-rows {
    display: grid;
    gap: 0.5rem;
  }

  .live-band {
    margin-top: 0.6rem;
    border: 0;
    border-radius: 0.7rem;
  }

  .live-row {
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    grid-template-areas:
      "pos club club pts"
      "fix fix tip delta"
      "chips chips chips chips";
    gap: 0.5rem 0.75rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
  }

  .live-row[data-hit="true"] {
    border-color: #9fd4ad;
  }

  .live-table[data-has-bong="false"] .live-row {
    grid-template-areas:
      "pos club club club"
      "fix fix fix fix";
  }

  .live-check {
    display: none;
  }

  .live-pos {
    grid-area: pos;
    width: 44px;
    height: 34px;
  }

  .live-club {
    grid-area: club;
  }

  .live-fixtures {
    grid-area: fix;
  }

  .live-pts {
    grid-area: pts;
  }

  .live-tip {
    grid-area: tip;
    justify-self: end;
    width: 44px;
    height: 30px;
  }

  .live-delta {
    grid-area: delta;
    min-width: 2.6rem;
  }

  .live-chips {
    grid-area: chips;
  }

  .live-club .club-emblem {
    width: 40px;
    height: 40px;
  }

  .live-club .club-emblem img {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .live-first {
    margin-top: -2.5rem;
  }

  .live-stat-number {
    font-size: 3.6rem;
  }
}

/* ---- placement round by round ---- */

.live-history-panel {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.live-history-panel .live-lead {
  margin: 0 0 0.8rem;
}

.live-history-chart {
  overflow-x: auto;
}

.live-history-chart svg {
  display: block;
  width: 100%;
  min-width: 540px;
  height: auto;
  overflow: visible;
}

.live-history-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.live-history-axis,
.live-history-round {
  fill: var(--muted);
  font-size: 12px;
}

.live-history-round.is-future {
  opacity: 0.55;
}

.live-history-line {
  fill: none;
  stroke: var(--purple);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.live-history-dot {
  fill: var(--surface);
  stroke: var(--purple);
  stroke-width: 3;
}

.live-history-dot.is-latest {
  fill: var(--purple);
}

.live-history-future {
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 3 4;
}

.live-history-rank {
  fill: var(--navy);
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
}

.live-history-table-wrap {
  margin-top: 0.6rem;
  overflow-x: auto;
}

.live-history-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.live-history-table th,
.live-history-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.live-history-table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-history-table tbody th {
  font-weight: 650;
}

.live-history-table .is-up {
  color: var(--direct-strong);
  font-weight: 700;
}

.live-history-table .is-down {
  color: var(--doom-red-dark);
  font-weight: 700;
}

.live-history-table tbody tr:last-child th,
.live-history-table tbody tr:last-child td {
  background: rgb(88 68 216 / 7%);
  font-weight: 750;
}

.live-history-prizes {
  fill: var(--direct);
}

.live-history-prize-label {
  fill: var(--direct-strong);
  font-size: 11px;
  font-weight: 700;
}
