/*
 * lazareta-open-bracket.css — the connected "ταμπλό" view (lo-bk-*) for the live
 * results section of the event page. Pairs with assets/js/lazareta-open-bracket.js. Reuses the same
 * design tokens as lazareta-open-live.css (--accent-color, --heading-color,
 * --surface-color, --heading-font, --default-color). The bracket is an
 * absolutely-positioned canvas inside a horizontally + vertically scrollable
 * frame; the Λίστα view (lo-section cards) stays as the small-screen fallback.
 */

/* --- Ταμπλό / Λίστα toggle ------------------------------------------------- */
.lo-bk-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--heading-color), transparent 92%);
}
.lo-bk-toggle button {
  border: 0;
  background: transparent;
  color: var(--default-color);
  font-family: var(--heading-font);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.lo-bk-toggle button[aria-pressed="true"] {
  background: var(--accent-color);
  color: #fff;
}
.lo-bk-toggle button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* --- Scroll frame + canvas ------------------------------------------------- */
.lo-bk-wrap {
  position: relative;
  overflow: auto;
  /* Break out of the narrow page .container to use the viewport width, so big
     screens fit the whole bracket without horizontal scroll. The inline
     max-width (= bracket width, set by the JS) keeps it from over-widening; the
     JS also zoom-fits whatever still doesn't fit. */
  left: 50%;
  transform: translateX(-50%);
  width: 92vw;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
  border-radius: 14px;
  background:
    linear-gradient(var(--surface-color), var(--surface-color)) padding-box,
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--heading-color), transparent 96%) 0 1px, transparent 1px 36px);
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
  -webkit-overflow-scrolling: touch;
}
.lo-bk-stage {
  position: relative;
  margin: 0 auto;
}
.lo-bk-links {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.lo-bk-link {
  stroke: color-mix(in srgb, var(--heading-color), transparent 62%);
  stroke-width: 1.5px;
}
.lo-bk-link.drop {
  stroke-dasharray: 3 3;
  stroke: color-mix(in srgb, var(--heading-color), transparent 74%);
}
.lo-bk-link.on {
  stroke: var(--accent-color);
  stroke-width: 2px;
  stroke-dasharray: none;
}

/* --- Column headers ------------------------------------------------------- */
.lo-bk-colhead {
  position: absolute;
  top: 12px;
  text-align: center;
  font-family: var(--heading-font);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--heading-color), transparent 25%);
}

/* Caption above a box (the two finals) so they read clearly regardless of the
   column header they sit under. */
.lo-bk-cap {
  position: absolute;
  z-index: 1;
  text-align: center;
  font-family: var(--heading-font);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Match box ------------------------------------------------------------ */
.lo-bk-match {
  position: absolute;
  z-index: 1;
  background: var(--surface-color);
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 84%);
  border-radius: 9px;
  padding: 4px 7px 5px;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.06);
  font-size: 12px;
  /* Explicit, tight line-height so the 2-line stacked names don't inherit the
     site's tall body line-height — keeps box height compact and predictable
     (the stacked finals depend on it not overflowing). */
  line-height: 1.2;
}
.lo-bk-match.is-final {
  border-color: color-mix(in srgb, var(--accent-color), transparent 45%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color), transparent 60%), 0 1px 6px rgba(15, 23, 42, 0.08);
}
.lo-bk-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  line-height: 1;
}
.lo-bk-no {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-color);
}
.lo-bk-time {
  font-size: 10px;
  color: #9aa3af;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lo-bk-badge {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.lo-bk-badge.up { background: transparent; }
.lo-bk-badge.live {
  background: #dcfce7;
  color: #15803d;
}
.lo-bk-badge.done {
  background: color-mix(in srgb, var(--heading-color), transparent 86%);
  color: var(--heading-color);
}

.lo-bk-side {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
}
.lo-bk-side.a { border-bottom: 1px dashed color-mix(in srgb, var(--heading-color), transparent 90%); }
.lo-bk-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--default-color);
}
.lo-bk-side.win .lo-bk-name { font-weight: 700; color: var(--heading-color); }
.lo-bk-side.pend .lo-bk-name { color: #aab1bb; font-style: italic; }
.lo-bk-sets {
  flex: 0 0 auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--heading-color);
  min-width: 10px;
  text-align: right;
}
.lo-bk-side.win .lo-bk-sets { color: var(--accent-color); }
.lo-bk-detail {
  margin-top: 2px;
  font-size: 9.5px;
  color: #9aa3af;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keep the team-name links visually identical to the list view. */
.lo-bk-name .lo-teamref { white-space: nowrap; }

/* --- Round selector (Όλα · 1ος Γύρος · … · Τελικός, with ‹ › arrows) ------- */
.lo-bk-rnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 auto 14px;
}
.lo-bk-rnav-tabs {
  margin: 0;
  position: relative; /* offsetLeft reference for the JS active-tab centering */
  flex: 0 1 auto;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  border-radius: 20px;
}
.lo-bk-rnav-tabs button { font-size: 12.5px; padding: 6px 13px; }
.lo-bk-rnav-arrow {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 82%);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--heading-color);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.lo-bk-rnav-arrow:hover:not(:disabled) { background: color-mix(in srgb, var(--heading-color), transparent 92%); }
.lo-bk-rnav-arrow:disabled { opacity: 0.35; cursor: default; }
.lo-bk-rnav-arrow:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }

/* --- Per-phase bracket (selected phase + the boxes its winners feed) -------- */
/* Same absolute-canvas machinery as the full ταμπλό, with bigger boxes. */
.lo-bk-phase .lo-bk-match { font-size: 13px; }
.lo-bk-phase .lo-bk-detail { font-size: 10.5px; }
/* Box captions (the ΜΙΚΡΟΣ ΤΕΛΙΚΟΣ tag in the semifinals view) read as quiet
   labels here — the accent version stays for the full ταμπλό's finals. */
.lo-bk-phase .lo-bk-cap { color: color-mix(in srgb, var(--heading-color), transparent 35%); }
/* Emphasized box (the final proper): wider via the JS, plus a size step up —
   one step above the surrounding boxes in each view (12→13px on the full
   ταμπλό, 13→14px on the phase views). */
.lo-bk-match.lo-bk-big {
  font-size: 13px;
  padding: 5px 8px 6px;
}
.lo-bk-match.lo-bk-big .lo-bk-detail { font-size: 10px; }
.lo-bk-phase .lo-bk-match.lo-bk-big {
  font-size: 14px;
  padding: 6px 9px 7px;
}
.lo-bk-phase .lo-bk-big .lo-bk-detail { font-size: 11px; }

/* --- Hint + reduced motion ------------------------------------------------ */
.lo-bk-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: #9aa3af;
}
@media (max-width: 575px) {
  .lo-bk-wrap { border-radius: 12px; }
  .lo-bk-hint::before { content: "↔ "; }
  /* Phones: keep the selector on one row — the arrows flank a horizontally
     scrollable tab strip, and the JS keeps the active tab centred in view. */
  .lo-bk-rnav { flex-wrap: nowrap; gap: 6px; }
  .lo-bk-rnav-tabs {
    flex: 1 1 auto;
    min-width: 0; /* allow the strip to shrink below its content and scroll */
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .lo-bk-rnav-tabs::-webkit-scrollbar { display: none; }
  .lo-bk-rnav-tabs button { flex: 0 0 auto; padding: 6px 11px; font-size: 12px; }
}
