/* SPORTS INTEL MOBILE APP V14.1 — LIVE AWAY BORDER HOTFIX */
@media (max-width:720px){

  /*
   * LIVE odds rows can contain only H/A for non-football sports.
   * Older LIVE CSS/markup may still size children as 3-column/fixed-width,
   * which pushes the AWAY box a few pixels past the right edge.
   * This patch normalizes BOTH flex and grid implementations.
   */

  #live-list .odds,
  #live-list .live-odds,
  #live-list .odds-row,
  #live-list .live-odds-row,
  #live-list [class*="odds-grid"],
  #live-list [class*="odds-pick"],
  #live-list [class*="betting"]{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }

  /* Direct odds-button container: remove fixed child widths */
  #live-list .odds > *,
  #live-list .live-odds > *,
  #live-list .odds-row > *,
  #live-list .live-odds-row > *,
  #live-list [class*="odds-grid"] > *,
  #live-list [class*="odds-pick"] > *,
  #live-list [class*="betting"] > *{
    min-width:0!important;
    max-width:none!important;
    width:auto!important;
    box-sizing:border-box!important;
    flex:1 1 0!important;
  }

  /*
   * When there are exactly two odds buttons (HOME/AWAY),
   * explicitly switch to two equal columns.
   */
  #live-list .odds:has(> :first-child:nth-last-child(2)),
  #live-list .live-odds:has(> :first-child:nth-last-child(2)),
  #live-list .odds-row:has(> :first-child:nth-last-child(2)),
  #live-list .live-odds-row:has(> :first-child:nth-last-child(2)),
  #live-list [class*="odds-grid"]:has(> :first-child:nth-last-child(2)){
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:5px!important;
    padding-left:0!important;
    padding-right:1px!important;
  }

  /* Fallback for browsers/markup where :has() matching is not applied. */
  #live-list .odds,
  #live-list .live-odds,
  #live-list .odds-row,
  #live-list .live-odds-row{
    gap:5px!important;
    padding-right:1px!important;
  }

  /* Protect the AWAY/right-most box itself. */
  #live-list .odds > :last-child,
  #live-list .live-odds > :last-child,
  #live-list .odds-row > :last-child,
  #live-list .live-odds-row > :last-child,
  #live-list [class*="odds-grid"] > :last-child,
  #live-list [class*="odds-pick"] > :last-child{
    margin-right:0!important;
    right:auto!important;
    transform:none!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  /* LIVE card inner panel must leave one physical pixel for the right border. */
  #live-list article,
  #live-list .live-card,
  #live-list [class*="live-card"],
  #live-list [class*="fixture-card"]{
    padding-right:max(1px, env(safe-area-inset-right))!important;
    box-sizing:border-box!important;
  }
}

@media (max-width:390px){
  #live-list .odds,
  #live-list .live-odds,
  #live-list .odds-row,
  #live-list .live-odds-row,
  #live-list [class*="odds-grid"]{
    gap:4px!important;
    padding-right:2px!important;
  }
}

/* V14.1.2 LIVE RIGHT BORDER HARD FIX */
@media (max-width:720px){

  .live-game-v31 .live-values > span:last-child{
    border-right:1px solid #29445f !important;
    border-top-right-radius:8px !important;
    border-bottom-right-radius:8px !important;
  }

  .live-ai-v31 .live-values > span:last-child,
  .live-odds-v31 .live-values > span:last-child{
    border-right-width:1px !important;
    border-right-style:solid !important;
    border-right-color:#29445f !important;
  }

  .live-ai-v31,
  .live-odds-v31,
  .live-ai-v31 .live-values,
  .live-odds-v31 .live-values{
    overflow:visible !important;
    padding-right:1px !important;
  }
}

/* V14.1.3 LIVE RIGHT BORDER DESKTOP + MOBILE FIX */

/* AI 승률 / 배당 공통 마지막 칸 우측 border */
.live-game-v31 .live-values > span:last-child{
  border-right:1px solid #29445f !important;
  border-top-right-radius:8px !important;
  border-bottom-right-radius:8px !important;
  box-sizing:border-box !important;
}

/* 혹시 개별 영역 CSS가 덮어쓰는 경우 */
.live-ai-v31 .live-values > span:last-child,
.live-odds-v31 .live-values > span:last-child{
  border-right-width:1px !important;
  border-right-style:solid !important;
  border-right-color:#29445f !important;
}

/* 부모 clipping 방지 */
.live-ai-v31,
.live-odds-v31,
.live-ai-v31 .live-values,
.live-odds-v31 .live-values{
  overflow:visible !important;
  box-sizing:border-box !important;
}

/* PC에서 마지막 칸이 부모 폭 끝까지 정확히 맞도록 */
@media (min-width:721px){
  .live-ai-v31 .live-values,
  .live-odds-v31 .live-values{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }

  .live-ai-v31 .live-values > span,
  .live-odds-v31 .live-values > span{
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  .live-ai-v31 .live-values > span:last-child,
  .live-odds-v31 .live-values > span:last-child{
    margin-right:0 !important;
    transform:none !important;
  }
}
