/* SCOREBOOK_LIVESCORE_LOAD_FREEZE_GUARD_CSS_V16_4_7_4 */
:root {
  --sb-v16474-shell-width: 1440px;
  --sb-v16474-shell-gutter: 36px;
  --sb-v16474-left-width: 270px;
  --sb-v16474-right-width: 168px;
  --sb-v16474-gap: 18px;
}

/*
 * Home / Community template geometry:
 * shell 1440px, left 270px, right 168px, gaps 18px.
 * The center column is therefore 966px at the full desktop shell width.
 *
 * V16.4.7.2 used a near-viewport-width wrapper and fixed 854px center.
 * That made the live-score body begin at a different horizontal position
 * from the header, Home, and Community pages.
 */
@media (min-width: 1440px) {
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .classic-portal-layout {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns:
      var(--sb-v16474-left-width)
      minmax(0, 1fr)
      var(--sb-v16474-right-width) !important;
    gap: var(--sb-v16474-gap) !important;
    align-items: start !important;
    justify-content: stretch !important;
    width: min(
      var(--sb-v16474-shell-width),
      calc(100% - var(--sb-v16474-shell-gutter))
    ) !important;
    max-width: var(--sb-v16474-shell-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 22px 0 56px !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .classic-left-rail {
    display: grid !important;
    grid-column: 1 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .classic-center-stage {
    display: block !important;
    grid-column: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .classic-right-rail,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .scorebook-right-rail,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-scorebook-right-rail],
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-portal-right-rail],
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-v1647-right-rail="1"],
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-v16472-right-rail="1"],
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-v16473-right-rail="1"] {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    grid-column: 3 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-content: start !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .classic-center-stage .shell {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .scorebook-iframe-shell,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .scorebook-content-frame,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  #scorebook-content-frame {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /*
   * Fallback for the original #container / #aside / #frame structure.
   * Use the same centered 1440px shell rather than viewport-wide alignment.
   */
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  #container:not(.classic-center-stage) {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns:
      var(--sb-v16474-left-width)
      minmax(0, 1fr)
      var(--sb-v16474-right-width) !important;
    gap: var(--sb-v16474-gap) !important;
    align-items: start !important;
    justify-content: stretch !important;
    width: min(
      var(--sb-v16474-shell-width),
      calc(100% - var(--sb-v16474-shell-gutter))
    ) !important;
    max-width: var(--sb-v16474-shell-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  #aside {
    display: block !important;
    grid-column: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  #frame {
    display: block !important;
    grid-column: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  #frame iframe,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  #content {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .right-rail-ad,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-ad-slot^="right_rail"],
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-ad-slot*="right-rail"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 100% !important;
  }
}

/*
 * 1025–1439px:
 * Keep the same left/body alignment rules as the standard responsive portal.
 * The right rail remains hidden, matching the existing V16.4.7 behavior.
 */
@media (min-width: 1025px) and (max-width: 1439px) {
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .classic-portal-layout,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  #container:not(.classic-center-stage) {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns:
      250px
      minmax(0, 1fr) !important;
    gap: 16px !important;
    width: min(
      1280px,
      calc(100% - 36px)
    ) !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: stretch !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .classic-left-rail,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  #aside {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .classic-center-stage,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  #frame {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .classic-right-rail,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  .scorebook-right-rail,
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-scorebook-right-rail],
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-portal-right-rail],
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-v1647-right-rail="1"],
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-v16472-right-rail="1"],
  html.sb-livescore-wide-v1645.sb-livescore-load-guard-v16474
  [data-v16473-right-rail="1"] {
    display: none !important;
  }
}

/* Existing V16.4.6 mobile/tablet rules remain authoritative. */
@media (max-width: 1024px) {
  html.sb-livescore-load-guard-v16474 {
    --sb-v16474-shell-width: 100%;
  }
}
