/* ==========================================================================
   OBJECT-268 / live data layer
   Free mode: CS2 auto-synced via Liquipedia; BWF links to the official feed.
   ========================================================================== */

.live-section {
  position: relative;
  overflow: hidden;
}

.live-section::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100%, var(--max));
  height: 1px;
  content: "";
  background: var(--paper-line);
  transform: translateX(-50%);
}

.live-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.4rem;
}

.live-head .eyebrow time {
  color: var(--red-deep);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
}

.live-head h2 {
  margin: 0.5rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5.4vw, 5.1rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.live-head h2 .serif-en {
  color: var(--red-deep);
  font-family: var(--font-serif-en);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.04em;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.5rem;
  padding: 0.25rem 0.4rem 0.25rem 0.8rem;
  border: 1px solid var(--paper-line-strong);
  background: rgba(255, 255, 255, 0.2);
  color: var(--paper-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.3;
  white-space: nowrap;
}

.live-status [data-live-status] {
  min-width: 8.6rem;
}

.live-status .is-error {
  color: var(--red-deep);
}

.live-dot {
  display: inline-block;
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 91, 79, 0.38);
  animation: live-pulse 2.2s ease-out infinite;
}

.live-refresh {
  min-height: 1.8rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--paper-line-strong);
  color: var(--paper-ink);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.live-refresh:hover,
.live-refresh:focus-visible {
  color: var(--paper);
  background: var(--paper-ink);
}

.live-refresh:disabled {
  cursor: wait;
  opacity: 0.6;
}

.live-intro {
  max-width: 66ch;
  margin: 0 0 2rem auto;
  color: var(--paper-muted);
  font-size: 0.86rem;
  line-height: 1.8;
}

.live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.75fr);
  border-top: 1px solid var(--paper-line-strong);
}

.live-panel {
  min-width: 0;
  padding: 1.3rem 0 0;
}

.live-panel--cs2 {
  padding-right: clamp(1.4rem, 3.2vw, 3.4rem);
  border-right: 1px solid var(--paper-line);
}

.live-panel--bwf {
  display: flex;
  flex-direction: column;
  align-self: start;
  margin-top: 1.3rem;
  padding: 1.4rem;
  color: var(--cream);
  background: var(--paper-ink);
}

.live-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.live-panel-head h3 {
  margin: 0.25rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.live-kicker,
.live-source {
  display: block;
  color: var(--paper-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-source {
  flex: 0 0 auto;
  padding-top: 0.3rem;
  color: var(--red-deep);
  letter-spacing: 0.1em;
}

.live-panel--bwf .live-kicker {
  color: rgba(242, 238, 225, 0.56);
}

.live-panel--bwf .live-source {
  color: var(--acid);
}

.live-group-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.2rem 0 0;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--paper-line-strong);
  color: var(--paper-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-group-label > span:first-child {
  color: var(--paper-ink);
  font-weight: 700;
}

.live-group-label.is-live > span:first-child {
  color: var(--red-deep);
}

.live-group-label.is-live > span:first-child::before {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--red);
  content: "";
  vertical-align: 0.05em;
  animation: live-pulse 2.2s ease-out infinite;
}

.live-match {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.82rem 0.5rem;
  border-bottom: 1px solid var(--paper-line);
  color: var(--paper-ink);
  text-decoration: none;
  transition: background 160ms ease, padding 160ms ease;
}

.live-match:hover,
.live-match:focus-visible {
  background: var(--acid);
  padding-left: 0.8rem;
  padding-right: 0.8rem;
}

.live-match-time {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  font-family: var(--font-mono);
  line-height: 1.2;
}

.live-match-time strong {
  font-size: 0.78rem;
  font-weight: 700;
}

.live-match-time small {
  color: var(--paper-muted);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
}

.live-match:hover .live-match-time small,
.live-match:focus-visible .live-match-time small {
  color: rgba(16, 19, 14, 0.66);
}

.live-match-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.32rem;
}

.live-match-teams {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
  font-family: var(--font-latin);
  font-size: 1rem;
  line-height: 1.15;
}

.live-team {
  overflow: hidden;
  max-width: 48%;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-team.is-winner {
  color: var(--red-deep);
}

.live-match:hover .live-team.is-winner,
.live-match:focus-visible .live-team.is-winner {
  color: var(--paper-ink);
}

.live-versus {
  color: var(--paper-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
}

.live-match-tour {
  overflow: hidden;
  color: var(--paper-muted);
  font-size: 0.65rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-match-side {
  display: flex;
  min-width: 3.4rem;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.16rem;
  font-family: var(--font-mono);
  line-height: 1.1;
  text-align: right;
}

.live-match-side strong {
  font-size: 0.78rem;
  font-weight: 700;
}

.live-match-side small {
  color: var(--paper-muted);
  font-size: 0.52rem;
  letter-spacing: 0.06em;
}

.live-match.is-live {
  background: rgba(255, 91, 79, 0.06);
  box-shadow: inset 2px 0 0 var(--red);
}

.live-match.is-live .live-match-side strong,
.live-match.is-live .live-match-time small {
  color: var(--red-deep);
}

.live-match:hover .live-match-side small,
.live-match:focus-visible .live-match-side small {
  color: rgba(16, 19, 14, 0.66);
}

.live-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.1rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--paper-line);
  color: var(--paper-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  line-height: 1.45;
}

.live-panel-foot a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.live-panel-foot a:hover {
  color: var(--paper-ink);
}

.live-panel--bwf .live-panel-foot {
  border-top-color: rgba(242, 238, 225, 0.2);
  color: rgba(242, 238, 225, 0.58);
}

.live-panel--bwf .live-panel-foot a:hover {
  color: var(--acid);
}

.live-bwf-copy {
  margin: 0.2rem 0 1.1rem;
  color: rgba(242, 238, 225, 0.76);
  font-size: 0.8rem;
  line-height: 1.8;
}

.live-bwf-button {
  width: 100%;
  margin-bottom: 1.2rem;
}

.live-bwf-next {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(242, 238, 225, 0.2);
}

.live-bwf-next .live-kicker {
  color: rgba(242, 238, 225, 0.5);
}

.live-bwf-next p {
  margin: 0.35rem 0 1rem;
  color: var(--cream);
  font-size: 0.82rem;
  line-height: 1.65;
}

.live-bwf-next strong {
  color: var(--acid);
  font-family: var(--font-latin);
  font-size: 1.05rem;
  font-weight: 600;
}

.live-loading,
.live-error {
  margin: 1.2rem 0 0.4rem;
  padding: 1.2rem 0;
  color: var(--paper-muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.live-error {
  color: var(--red-deep);
}

.live-panel .text-link {
  display: inline-block;
  margin-top: 0.2rem;
}

.live-section .section-intro {
  color: var(--paper-muted);
}

.archive-disclosure {
  border-top: 1px solid var(--paper-line);
  background: var(--paper);
  color: var(--paper-ink);
}

.archive-disclosure > summary {
  list-style: none;
  cursor: pointer;
}

.archive-disclosure > summary::-webkit-details-marker {
  display: none;
}

.archive-summary {
  display: flex;
  width: 100%;
  max-width: var(--max);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  padding: 1.2rem var(--gutter);
}

.archive-summary .eyebrow {
  margin: 0;
}

.archive-summary-title {
  color: var(--paper-ink);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.archive-summary-plus {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--red-deep);
  font-family: var(--font-mono);
  font-size: 1rem;
  transition: transform 180ms ease;
}

.archive-disclosure[open] .archive-summary-plus {
  transform: rotate(45deg);
}

.archive-disclosure .board-section {
  padding-top: 0;
}

.archive-disclosure .archive-head {
  display: none;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 91, 79, 0.38); }
  65% { box-shadow: 0 0 0 0.42rem rgba(255, 91, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 91, 79, 0); }
}

@media (max-width: 1020px) {
  .live-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(16rem, 0.75fr);
  }

  .live-panel--cs2 {
    padding-right: 1.4rem;
  }

  .live-panel--bwf {
    padding: 1.1rem;
  }

  .live-match {
    grid-template-columns: 3.8rem minmax(0, 1fr) auto;
  }

  .live-match-teams {
    font-size: 0.92rem;
  }
}

@media (max-width: 820px) {
  .live-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .live-grid {
    grid-template-columns: 1fr;
  }

  .live-panel--cs2 {
    padding-right: 0;
    border-right: 0;
  }

  .live-panel--bwf {
    margin-top: 1.2rem;
  }

  .live-intro {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .live-section {
    padding-top: 3.2rem;
    padding-bottom: 3.6rem;
  }

  .archive-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .archive-summary-title {
    font-size: 0.95rem;
  }

  .live-head h2 {
    font-size: clamp(2.35rem, 12vw, 3.4rem);
  }

  .live-status {
    width: 100%;
    justify-content: space-between;
  }

  .live-status [data-live-status] {
    min-width: 0;
    flex: 1;
  }

  .live-panel {
    padding-top: 0.9rem;
  }

  .live-panel--bwf {
    padding: 1.1rem;
  }

  .live-panel-head h3 {
    font-size: 1.8rem;
  }

  .live-match {
    grid-template-columns: 3.3rem minmax(0, 1fr) auto;
    gap: 0.55rem;
    padding: 0.75rem 0.2rem;
  }

  .live-match:hover,
  .live-match:focus-visible {
    padding-left: 0.42rem;
    padding-right: 0.42rem;
  }

  .live-match-teams {
    gap: 0.35rem;
    font-size: 0.86rem;
  }

  .live-team {
    max-width: 46%;
  }

  .live-match-tour {
    font-size: 0.61rem;
  }

  .live-match-side {
    min-width: 2.9rem;
  }

  .live-panel-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .live-bwf-button {
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot {
    animation: none;
  }

  .live-match,
  .live-refresh {
    transition: none;
  }
}
