/*
 * Functional fallback styles only.
 *
 * The visual RLB design belongs in the ORSV child theme. Keeping these rules
 * small means the plugin remains usable with another WordPress theme: controls
 * are reachable, focus is visible and wide result tables remain scrollable.
 */
.rlb,
.rlb-mini,
.rlb-portal,
.rlb-league-page,
.rlb-legal { box-sizing: border-box; max-width: 100%; }

.rlb__select,
.rlb__btn,
.rlb__tab,
.rlb__detailRow--action,
.rlb__back { font: inherit; }

.rlb__tablewrap,
.rlb__boutTableWrap,
.rlb-compact-table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}

.rlb__table,
.rlb-compact-table table {
  min-width: 760px;
}

.rlb__detailRow--action:focus-visible,
.rlb__back:focus-visible,
.rlb__select:focus-visible,
.rlb__btn:focus-visible,
.rlb__tab:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .rlb__field,
  .rlb__field--btn,
  .rlb__select,
  .rlb__btn { box-sizing: border-box; width: 100%; }

  .rlb__tablewrap,
  .rlb__boutTableWrap,
  .rlb-compact-table {
    overflow-x: scroll;
    touch-action: pan-x pan-y;
    width: 100%;
  }
}

/* Logo-first team labels. The child theme adds the visual treatment. */
.rlb-team-badge { align-items: center; display: inline-flex; gap: .45rem; line-height: 1.2; min-width: 0; vertical-align: middle; }
.rlb-team-logo { background: #fff; border: 1px solid rgba(17,18,22,.14); border-radius: 50%; flex: 0 0 auto; height: 1.8rem; object-fit: contain; padding: .12rem; width: 1.8rem; }
.rlb-team-name { min-width: 0; }
.rlb-team-separator { display: inline-block; margin: 0 .5rem; }
.rlb-wrestler-status { border-bottom: 1px dotted currentColor; cursor: help; font-size: .82em; font-weight: 800; white-space: nowrap; }
.rlb-wrestler-weight { color: #5d6470; font-size: .88em; white-space: nowrap; }

.rlb-portal,
.rlb-league-page,
.rlb-legal { display: grid; gap: 1.5rem; }
.rlb-portal__head h1,
.rlb-league-page__head h1,
.rlb-legal h1 { margin: 0; }
.rlb-portal__layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 2fr) minmax(280px, .9fr); }
.rlb-portal__layout--single { grid-template-columns: minmax(0, 1fr); }
.rlb-portal__sidebar,
.rlb-league-page__grid,
.rlb-legal__grid { display: grid; gap: 1rem; }
.rlb-portal__links,
.rlb-league-page__jump { display: flex; flex-wrap: wrap; gap: .75rem; }
.rlb-portal__links a,
.rlb-league-page__jump a { border: 1px solid currentColor; color: inherit; padding: .5rem .75rem; text-decoration: none; }
.rlb-league-page__facts { display: grid; gap: .75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rlb-league-page__facts div { border: 1px solid currentColor; padding: .85rem; }
.rlb-league-page__facts strong,
.rlb-league-page__facts span { display: block; }
.rlb-league-page__section { display: grid; gap: 1rem; }
.rlb-legal { line-height: 1.55; }
.rlb-legal a { color: inherit; font-weight: 700; }
.rlb-match-page { box-sizing: border-box; padding: clamp(2rem, 5vw, 4rem) 1rem; }
.rlb-match-page__inner { box-sizing: border-box; margin: 0 auto; max-width: 1180px; width: 100%; }
.rlb-mini--match { display: grid; gap: 1rem; }
.rlb-mini--match .rlb-mini__match--detail { display: grid; gap: 1rem; }
.rlb-mini__live-detail { margin-top: .6rem; }
.rlb-mini__live-toggle { border: 1px solid currentColor; cursor: pointer; display: inline-flex; font-weight: 800; list-style: none; padding: .35rem .55rem; text-transform: uppercase; }
.rlb-mini__live-toggle::-webkit-details-marker { display: none; }
.rlb-mini__live-panel { display: grid; gap: .65rem; margin-top: .55rem; }
.rlb-mini__live-head { align-items: center; background: #111216; color: #fff; display: flex; justify-content: space-between; gap: .75rem; padding: .65rem .75rem; }
.rlb-mini__live-head span { font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.rlb-mini__live-head strong { font-size: 1.2rem; font-weight: 900; white-space: nowrap; }
.rlb-mini__live-empty { margin: 0; }

/* Encounter detail: semantic details elements keep the scoring history usable
 * even when the active theme does not ship a dedicated design layer. */
.rlb-match-detail__utility { display: flex; justify-content: flex-start; }
.rlb-match-detail__back { align-items: center; color: inherit; display: inline-flex; font-weight: 800; gap: .4rem; text-decoration: none; }
.rlb-match-detail__back::before { content: '<'; }
.rlb-match-detail__table table { min-width: 900px; }
.rlb-match-detail__more { min-width: 8rem; white-space: normal; }
.rlb-match-detail__live { align-self: flex-start; background: #c8102e; color: #fff; display: inline-flex; font-size: .78rem; font-weight: 900; letter-spacing: .08em; padding: .4rem .6rem; text-transform: uppercase; }
.rlb__detailItem { display: grid; gap: .45rem; }
.rlb__startHint { color: #8e0920; display: inline-flex; font-size: .78rem; font-weight: 800; margin-left: .65rem; white-space: nowrap; }
.rlb__calendar { align-items: center; border: 1px solid currentColor; color: inherit; display: inline-flex; font-size: .75rem; font-weight: 800; justify-self: start; padding: .38rem .55rem; text-decoration: none; text-transform: uppercase; }
.rlb__calendar:hover { background: #111216; color: #fff; }
.rlb__fixtureDate,
.rlb__rescheduled,
.rlb-mini__rescheduled { color: #565b64; font-size: .78rem; margin: 0; }
.rlb__rescheduled,
.rlb-mini__rescheduled { border-left: 3px solid #c8102e; padding-left: .55rem; }
.rlb__rescheduled span,
.rlb-mini__rescheduled span { color: #a80f29; font-weight: 900; text-transform: uppercase; }
.rlb-bout-detail { min-width: 7rem; }
.rlb-bout-detail summary { cursor: pointer; font-weight: 800; list-style: none; }
.rlb-bout-detail summary::-webkit-details-marker { display: none; }
.rlb-bout-detail summary::after { content: '+'; display: inline-block; margin-left: .35rem; }
.rlb-bout-detail[open] summary::after { content: '-'; }
.rlb-bout-detail__panel { display: grid; gap: .6rem; margin-top: .65rem; min-width: 13rem; }
.rlb-bout-detail__facts { display: grid; gap: .35rem; margin: 0; }
.rlb-bout-detail__facts div { align-items: baseline; display: flex; gap: .5rem; justify-content: space-between; }
.rlb-bout-detail__facts dt { font-size: .75rem; font-weight: 700; }
.rlb-bout-detail__facts dd { margin: 0; }
.rlb-bout-detail__events { display: grid; gap: .35rem; }
.rlb-bout-detail__events > span { font-size: .75rem; font-weight: 700; }
.rlb-bout-detail__events > div { display: flex; flex-wrap: wrap; gap: .25rem; }
.rlb-bout-detail__events b { align-items: center; border: 1px solid currentColor; display: inline-flex; font-size: .75rem; height: 1.5rem; justify-content: center; min-width: 1.5rem; }
.rlb-bout-detail__events b.is-red { color: #b92035; }
.rlb-bout-detail__events b.is-blue { color: #315c7c; }

@media (max-width: 900px) {
  .rlb-portal__layout,
  .rlb-league-page__facts,
  .rlb-legal__grid { grid-template-columns: 1fr; }

  .rlb__startHint { margin-left: 0; margin-top: .35rem; }
}
