/* SerieAGoal 1.72 | three-column width, raised modules, fixture hover,
   formation/player flattening and safe mobile gutters. LOAD AFTER v1.71.
   Server-side scope: football pages only. News and article singles excluded.
   No changes to entitlement, AI Premium gate, payments, predictions, ads logic. */

/* A. WIDER THREE-COLUMN FRAME: match the reference's visual proportions.
   Do not force the right rail onto laptop/tablet widths. */
@media (min-width:1241px) {
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-shell {
    width:100%!important;
    max-width:1540px!important;
    margin-inline:auto!important;
    display:grid!important;
    grid-template-columns:216px minmax(0,1fr)!important;
    gap:18px!important;
    padding:18px 18px 36px!important;
    box-sizing:border-box!important;
  }
  /* The Pronostici hub formerly forced a single-wide shell, leaving the
     left sidebar nonfunctional. Restore the actual sidebar/feed split. */
  html[data-sg-theme] body.sg-body.sgw-editorial-mode:is(.sg-page-pronostici,.sg-page-fantacalcio) .sg-shell:not(.sg-account-shell) {
    grid-template-columns:216px minmax(0,1fr)!important;
  }
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-content-grid:has(>.sgw-right-rail) {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 302px!important;
    gap:20px!important;
    justify-content:stretch!important;
    min-width:0!important;
  }
  html[data-sg-theme] body.sg-body.sgw-editorial-mode :is(.sg-topbar-inner,.sg-sportbar-inner) {
    max-width:1540px!important;
    width:100%!important;
    padding-inline:18px!important;
    box-sizing:border-box!important;
  }
}
@media (min-width:1241px) and (max-width:1380px) {
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-shell {
    grid-template-columns:190px minmax(0,1fr)!important;
    gap:14px!important;
    padding-inline:14px!important;
  }
  html[data-sg-theme] body.sg-body.sgw-editorial-mode:is(.sg-page-pronostici,.sg-page-fantacalcio) .sg-shell:not(.sg-account-shell) {
    grid-template-columns:190px minmax(0,1fr)!important;
  }
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-content-grid:has(>.sgw-right-rail) {
    grid-template-columns:minmax(0,1fr) 275px!important;
    gap:14px!important;
  }
}

/* B. THE ONLY INTENTIONALLY RAISED SURFACES: lateral LIVE/featured,
   free verdict/results, and the AI Premium surface. Not center sections. */
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-sidebar .sgw-raised,
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-sidebar .sg-sidebar-featured,
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-right-rail .sgw-raised,
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg110-verdict-card,
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main #sg110-premium-analysis.sg-ai-premium-panel {
  background:var(--sgw-raised)!important;
  border:1px solid var(--sgw-hairline)!important;
  border-radius:18px!important;
  box-shadow:0 12px 30px rgba(24,34,51,.085),0 2px 8px rgba(24,34,51,.025)!important;
}
html[data-sg-theme="dark"] body.sg-body.sgw-editorial-mode .sg-sidebar .sgw-raised,
html[data-sg-theme="dark"] body.sg-body.sgw-editorial-mode .sg-sidebar .sg-sidebar-featured,
html[data-sg-theme="dark"] body.sg-body.sgw-editorial-mode .sgw-right-rail .sgw-raised,
html[data-sg-theme="dark"] body.sg-body.sgw-editorial-mode .sg-main .sg110-verdict-card,
html[data-sg-theme="dark"] body.sg-body.sgw-editorial-mode .sg-main #sg110-premium-analysis.sg-ai-premium-panel {
  box-shadow:0 14px 32px rgba(0,0,0,.26),0 2px 7px rgba(0,0,0,.12)!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-sidebar .sgw-raised,
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-right-rail .sgw-raised {
  padding:19px 17px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-sidebar .sg-sidebar-featured {
  padding:16px 13px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-module-heading {
  margin-bottom:15px!important;gap:10px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-module-heading strong {
  font-size:13px!important;line-height:1.4!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-live-team {
  grid-template-columns:27px minmax(0,1fr) auto!important;gap:9px!important;
  padding-block:7px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-live-team img {
  width:27px!important;height:27px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-live-team b {
  font-size:12px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-free-match {
  grid-template-columns:108px minmax(0,1fr)!important;gap:11px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-gauge {
  width:108px!important;height:108px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-gauge>span {
  font-size:24px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sgw-free-copy strong {
  font-size:12.5px!important;line-height:1.35!important;
}
/* Surface of the *selected* AI verdict is functional, not a decorative card.
   Do not touch gated descendants, blur masks, paywall buttons or pointer-events. */

/* C. FIXTURE ROW HOVER: the row is still part of the page canvas at rest.
   Only pointer/keyboard interaction raises a rounded white/dark surface. */
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-row-wrap {
  position:relative!important;
  border-radius:15px!important;
  transition:background-color .18s ease,box-shadow .18s ease!important;
}
@media (hover:hover) and (pointer:fine) {
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-feed .sg-match-row-wrap:not(#sg110-premium-analysis):is(:hover,:focus-within) {
    background:var(--sgw-raised)!important;
    border-radius:15px!important;
    box-shadow:0 8px 22px rgba(16,24,40,.09),0 1px 4px rgba(16,24,40,.025)!important;
    z-index:2!important;
  }
  html[data-sg-theme="dark"] body.sg-body.sgw-editorial-mode .sg-main .sg-feed .sg-match-row-wrap:not(#sg110-premium-analysis):is(:hover,:focus-within) {
    box-shadow:0 10px 28px rgba(0,0,0,.22)!important;
  }
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-feed .sg-match-row-wrap:not(#sg110-premium-analysis):is(:hover,:focus-within) .sg-match-row {
    background:transparent!important;
  }
}

/* D. FORMATIONS + PLAYERS: remove the actual nested white/dark panels,
   including the inner line-up lists, headers, rating-team slabs and strips.
   Preserve the tactical PITCH, player photos, ratings and row separators. */
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel :is(
  .sg-lineup-card,.sg-lineup-board,.sg-lineup-formbar,.sg-lineup-pitch-scroll,
  .sg-lineup-teamstrip,.sg-lineup-dual-title,.sg-lineup-lists,.sg-lineup-changegrid,
  .sg-lineup-coaches,.sg-lineup-list,.sg-lineup-changes,.sg-lineup-coach,
  .sg-lineup-list>header,.sg-lineup-changes>header,.sg-lineup-coach>header,
  .sg-lineup-team,.sg-lineups-grid,.sg-lineup-team>header,
  .sg-player-teams,.sg-player-team-block,.sg-player-team-title,.sg-player-table,
  .sg-player-head,.sg-player-row,.sg-player-team-head
) {
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
  outline:0!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel :is(
  .sg-lineup-board,.sg-lineup-formbar,.sg-lineup-teamstrip,.sg-lineup-dual-title,
  .sg-lineup-lists,.sg-lineup-changegrid,.sg-lineup-coaches,
  .sg-lineup-list,.sg-lineup-changes,.sg-lineup-coach,
  .sg-player-team-block,.sg-player-team-title,.sg-player-head
) {
  border-top:0!important;border-left:0!important;border-right:0!important;
  border-radius:0!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel .sg-lineup-board {
  padding:0!important;margin:0!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel .sg-lineup-pitch-scroll {
  background:transparent!important;
  padding:9px 0 12px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel :is(.sg-lineup-lists,.sg-lineup-changegrid,.sg-lineup-coaches,.sg-lineups-grid) {
  background:transparent!important;
  column-gap:16px!important;
  row-gap:12px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel .sg-player-team-block + .sg-player-team-block {
  border:0!important;
  margin-top:20px!important;
  padding-top:4px!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel .sg-player-team-title {
  background:transparent!important;
  border-bottom:1px solid var(--sgw-hairline)!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel .sg-player-head {
  background:transparent!important;
  border-bottom:1px solid var(--sgw-hairline)!important;
}
html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel .sg-player-row {
  background:transparent!important;
  border-bottom:1px solid var(--sgw-hairline)!important;
}
/* Never flatten the actual pitch (formation field) or role badges and votes. */

/* E. MOBILE GUTTERS: text and horizontal tabs never touch the device edge.
   Use a structural shell gutter, NOT background panels or global text padding.
   Leave News/article pages unchanged by the server-side mode class. */
@media(max-width:760px) {
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-shell:not(.sg-account-shell) {
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    padding-left:max(12px,env(safe-area-inset-left))!important;
    padding-right:max(12px,env(safe-area-inset-right))!important;
  }
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main,
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-feed {
    min-width:0!important;
    max-width:100%!important;
  }
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-modern-v2225 .sg-match-primary-tabs.sg-match-tabs-modern {
    box-sizing:border-box!important;
    padding-left:4px!important;
    padding-right:4px!important;
    scroll-padding-inline:10px!important;
    min-width:0!important;
  }
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main :is(
    .sg-match-tab-panel,.sg-lineup-card,.sg-lineup-board,.sg-player-teams,
    .sg-player-team-block,.sg-player-table,.sg-content-grid
  ) {min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel :is(.sg-lineup-lists,.sg-lineup-changegrid,.sg-lineup-coaches,.sg-lineups-grid) {
    column-gap:8px!important;row-gap:10px!important;
  }
  /* Only a few extra pixels inside headings when legacy CSS negates
     the shell gutter. Avoid adding another 12px to every nested element. */
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main :is(
    .sg-match-meta-line,.sg-match-center-head,.sg-page-intro,.sg-compact-league-head
  ) {padding-inline:6px!important;box-sizing:border-box!important}
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel .sg-player-team-title,
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-tab-panel .sg-lineup-list>header {
    padding-inline:10px!important;
  }
}
@media (prefers-reduced-motion:reduce) {
  html[data-sg-theme] body.sg-body.sgw-editorial-mode .sg-main .sg-match-row-wrap {transition:none!important}
}
