/*
 * lazareta-open-live.css — live Beach Volley (2vs2) results sections
 * (/lazareta-open/#live). Linked from the page body. Reuses the site design
 * tokens (--heading-color, --accent-color, --surface-color, --heading-font,
 * --default-color); adds the ranking table, the placement bracket (by section)
 * and the team rosters. Rendered client-side by assets/js/lazareta-open-results.js.
 */

/* --- Status bar ----------------------------------------------------------- */
.lo-status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--surface-color);
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
}
.lo-updated,
.lo-error-pill {
  font-size: 13px;
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.lo-updated {
  color: var(--heading-color);
  background: color-mix(in srgb, var(--heading-color), transparent 90%);
}
.lo-error-pill {
  color: #b54708;
  background: color-mix(in srgb, #db8a33, transparent 86%);
}
.lo-champion {
  margin: 14px 0 0;
  text-align: center;
  font-family: var(--heading-font);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-color);
}
/* Team members drop to their own row under the champions line. */
.lo-champion-players {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--heading-color);
}

/* --- Final ranking table -------------------------------------------------- */
.lo-ranking-wrap {
  overflow-x: auto; /* six columns — never let the table push the page wide */
}
.lo-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  background: var(--surface-color);
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 86%);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
}
.lo-rank-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  text-align: center;
  padding: 10px 8px;
}
.lo-rank-table th:first-child,
.lo-rank-table th:nth-child(2) {
  text-align: left;
}
.lo-rank-table td {
  padding: 9px 8px;
  text-align: center;
  border-top: 1px solid color-mix(in srgb, var(--heading-color), transparent 90%);
  font-variant-numeric: tabular-nums;
  color: var(--default-color);
}
.lo-rank-pos {
  width: 64px;
  text-align: left;
  font-weight: 700;
  color: var(--heading-color);
}
.lo-rank-team {
  text-align: left;
  font-weight: 600;
  color: var(--heading-color);
}
.lo-rank-table tr.top td {
  background: color-mix(in srgb, var(--accent-color), transparent 92%);
}
.lo-rank-table tr.pend td {
  color: #9aa3af;
}

/* --- Bracket: sections of match rows -------------------------------------- */
.lo-bracket-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
}
.lo-hr {
  border: 0;
  border-top: 1px dashed color-mix(in srgb, var(--heading-color), transparent 78%);
  margin: 10px 0 4px;
}
.lo-section {
  background: var(--surface-color);
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 86%);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
}
.lo-section-title {
  margin: 0 0 8px;
  font-family: var(--heading-font);
  font-size: 15px;
  font-weight: 700;
  color: var(--heading-color);
  padding-bottom: 8px;
  border-bottom: 2px solid color-mix(in srgb, var(--accent-color), transparent 78%);
}
.lo-section-list {
  display: grid;
  gap: 6px;
}
.lo-match {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-top: 1px solid color-mix(in srgb, var(--heading-color), transparent 92%);
}
.lo-match:first-child {
  border-top: 0;
}
.lo-m-when {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.lo-m-date {
  font-size: 11px;
  color: #9aa3af;
  font-variant-numeric: tabular-nums;
}
.lo-m-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--default-color);
  font-size: 13px;
}
.lo-m-no {
  font-size: 11px;
  color: #9aa3af;
}
.lo-m-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.lo-m-team {
  font-size: 13.5px;
  color: var(--default-color);
  overflow-wrap: anywhere;
}
.lo-m-team.a {
  text-align: right;
}
.lo-m-team.b {
  text-align: left;
}
.lo-m-team.win {
  font-weight: 700;
  color: var(--heading-color);
}
.lo-m-team.pend {
  color: #9aa3af;
  font-style: italic;
}
.lo-m-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
}
.lo-m-score b {
  font-weight: 700;
  color: var(--accent-color);
  white-space: nowrap;
}
.lo-m-detail {
  display: block;
  color: #9aa3af;
  font-size: 10.5px;
}
.lo-m-vs {
  color: #9aa3af;
  padding: 0 4px;
}
.lo-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.lo-badge.up {
  background: #eceff3;
  color: #64748b;
}
.lo-badge.live {
  background: #dcfce7;
  color: #15803d;
}
.lo-badge.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: lo-pulse 1.4s ease-in-out infinite;
}
.lo-badge.done {
  background: color-mix(in srgb, var(--heading-color), transparent 82%);
  color: var(--heading-color);
}
@keyframes lo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.65); }
}
@media (prefers-reduced-motion: reduce) {
  .lo-badge.live::before { animation: none; }
}

/* --- Athlete names (gender-coloured) + team links ------------------------- */
.lo-ath {
  font-weight: 600;
}
.lo-ath.male {
  color: color-mix(in srgb, #1da6d8, white 32%);
}
.lo-ath.female {
  color: color-mix(in srgb, #db27b7, white 32%);
}
.lo-teamref {
  text-decoration: none;
  color: inherit;
}
.lo-teamref:hover .lo-ath,
.lo-teamref:focus .lo-ath {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lo-m-team.win .lo-ath {
  font-weight: 800;
}

/* --- Team rosters --------------------------------------------------------- */
.lo-team-card {
  height: 100%;
  background: var(--surface-color);
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 86%);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
  scroll-margin-top: calc(var(--header-height, 120px) + 14px);
}
/* Brief highlight when reached via a team-name link from the ranking/bracket. */
.lo-team-card:target {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}
.lo-team-name {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--heading-color);
  display: flex;
  align-items: center;
  gap: 8px;
}
.lo-team-name::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent-color);
  flex: 0 0 auto;
}
.lo-team-players {
  margin: 0;
  font-size: 13.5px;
  color: var(--default-color);
}

/* --- Skeleton / empty ----------------------------------------------------- */
.lo-skeleton,
.lo-empty {
  color: #9aa3af;
  font-size: 14px;
  text-align: center;
  padding: 18px 0;
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 575px) {
  /* Squeeze the six ranking columns onto a phone: fixed layout with explicit
     widths for the numeric columns (auto layout won't wrap the team names —
     it sizes columns to their unwrapped text), slimmer paddings, and a team
     cell free to run onto two lines. */
  .lo-rank-table { font-size: 13.5px; table-layout: fixed; }
  .lo-rank-table th { padding-left: 4px; padding-right: 4px; }
  .lo-rank-table td { padding: 9px 4px; }
  .lo-rank-pos { width: 42px; }
  .lo-rank-table th:nth-child(3) { width: 30px; }
  .lo-rank-table th:nth-child(4) { width: 40px; }
  .lo-rank-table th:nth-child(5) { width: 38px; }
  .lo-rank-table th:nth-child(6) { width: 54px; }
  .lo-rank-team { overflow-wrap: anywhere; }
  /* Stack each match vertically: "time · №" header, then team A / score / team B
     (each full width), then the badge — readable instead of a cramped 3-col row. */
  .lo-match { grid-template-columns: 1fr; gap: 6px; text-align: center; padding: 12px 2px; }
  .lo-m-when { flex-direction: row; justify-content: center; align-items: baseline; gap: 6px; }
  .lo-m-body { grid-template-columns: 1fr; gap: 3px; }
  .lo-m-team.a,
  .lo-m-team.b { text-align: center; }
  .lo-m-score { padding: 0; }
  .lo-badge { justify-self: center; }
}

/* --- Merged event page (#live section) -------------------------------------
   The status bar lost its lo-status-title h2 (the section-title heading covers
   it) and instead hosts the live-score shortcut next to the status pills:
   centre the content, and swap the surface background for a neutral tint that
   stays visible on both the plain and the alternated section backgrounds. */
.lo-status-bar {
  flex-direction: column;
  justify-content: center;
  background: color-mix(in srgb, var(--default-color), transparent 94%);
  box-shadow: none;
}
/* The status pills sit on their own row below the live-score button. */
.lo-status-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}
/* Collapse the empty pills row so the button stays centred until a pill shows. */
.lo-status-pills:not(:has(> :not([hidden]))) {
  display: none;
}
