:root{
  --highlight-home: #fff7d3;
  --highlight-away: #dff1c4;
}

.roundTableAll-wrap{
  margin-block: 2rem;
  padding-left: var(--padding-inline);
}
.roundTable-wrap{
  margin-block: 0 2rem;
  padding-left: var(--padding-inline);
}
@media screen and (max-width: 800px){
  .roundTable-wrap, .roundTableAll-wrap{
    margin-block: 2rem;
  }
}
.roudTable-info{
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  padding-right: var(--padding-inline);
}
.info-left{
  display: flex;
  gap: 1em;
}
.info-right{
  display: flex;
  gap: 0 1em;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.white-box, .blue-box {
  width: 16px;
  height: 14px;
  display: inline-block;
  margin-right: 4px;
}
.white-box {
  background-color: #ffffff;
  border: 1px solid #ccc;
}
.blue-box {
  background-color: #F3F8FF;
  border: 1px solid #BFD9FF;
}

.info-left div, .info-right div {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  line-height: 1;
}


.roudTableBox{
  display: grid;
  margin-right: var(--padding-inline);
  overflow: auto;
  max-height: 65svh;
  border: 1px solid #dadada;
}
.roudTable{

}
.header-cell{
  display: grid;
  grid-template-columns: 24px 40px 170px 49px repeat(var(--column), minmax(46px, 25%)) repeat(2 , 68px);
  grid-auto-flow: column;
  color: #fff;
  justify-content: start;
  justify-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
}
.header-cell .teamindex.active{
  background-color: #D9E9FF;
  color: var(--fontColor-usually);
}
.cell-vs .robin-home:hover,.cell-vs .robin-away:hover{
  text-decoration: underline;
}
.cell-vs:last-of-type {
  border-right: 5px solid red !important; /* 一時的に強制適用 */
  background-color: yellow !important; /* 視覚的に確認 */
}

/* 無効試合の要素はホバー時に下線を表示しない */
.cell-vs .gameInvalid:hover {
  text-decoration: none;
}

.roudTable > div:has(+ .active) .cell-vs,.roudTable > div:has(+ .active) .teamindex{
  /* border-bottom: 1px solid var(--colorRed-dark); */
}
.roudTable > div:has(+ .active) .teamRecord, .roudTable > .header-cell:has(+ .active) div:nth-child(4){
  border-bottom: 1px solid #E2AD1B;
}
.team-row .cell-vs.highlighted,.team-row .cell-vs:has(+ .highlighted){
  border-right: 1px solid var(--colorRed-dark);
}
.roudTableBox .team-row .teamRecord:has(+ .highlighted){
  /* border-right: 1px solid var(--colorRed-dark); */
}
.roudTableBox .team-row .teamRecord.has-shadow{
  box-shadow: 4px 0px 5px -2px #cbcbcb;
}
.cell-vs.highlighted .robin-home{
  background-color: var(--highlight-home);
}
.cell-vs.highlighted .robin-away{
  background-color: var(--highlight-away);
}
.teamindex{
  cursor: pointer;
}
.cell-vs,.teamindex{
  max-width: 100px;
}
.header-cell > div{
  background-color: var(--colorBlue);
  text-align: center;
  display: grid;
  align-content: center;
  --clamp-min: 13;
  --clamp-max: 13;
}
.header-cell > .header-teamRecord{
  padding: unset;
}
.header-teamRecord > div{
  border-bottom: 1px solid #dadada;
  padding: 2px;
}
.header-teamRecord div:last-child{
  border-bottom: none;
}
.matchInfo{
  padding: unset!important;
  grid-auto-rows: 1fr 1fr;
}
.matchInfo > div{
  display: grid;
  align-items: center;
}
.WL-box{
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #dadada;
  align-items: stretch!important;
}
.WL-box > div{
  display: grid;
  align-items: center;
}
.WL-box > div:first-child{
  border-right: 1px solid #dadada;
}
.team-row{
  display: grid;
  grid-template-columns: 24px 40px 170px 49px repeat(var(--column), minmax(46px, 25%)) repeat(4 , 34px);
  grid-auto-flow: column;
  justify-content: start;
  align-items: stretch;
  min-height: 82px;
  --clamp-min: 14;
  --clamp-max: 14;
  position: relative;
}
.team-row .teamNum{
  background-color: var(--colorBlue);
  color: #fff;
  cursor: pointer;
}
.team-row.active .teamNum{
  background-color: #D9E9FF;
  color: var(--fontColor-usually);
}
.team-row.active .teamName, .team-row.active .robin-teamRank{
  background-color: var(--highlight-home);
}
.team-row.active .teamRecord{
  border-color: #E2AD1B;
}
.team-row.active .teamRecord > div{
  border-color: #E2AD1B;
  background-color: #FFEAB2;
}
.team-row.active .cell-vs .robin-home{
  background-color: var(--highlight-home);
}
.team-row.active .cell-vs .robin-away{
  background-color: var(--highlight-away);
}
.team-row .teamRecord{
  background: #F8F8F8;
  padding: unset;
  grid-template-rows: 1fr 1fr 1fr;
}

.team-row.active::after{
  content: "";
  position: absolute;
  width: calc(100% - 24px);
  height: 100%;
  display: block;
  top: 0;
  left: 24px;
  border: 1px solid var(--colorRed-dark);
  pointer-events: none;
}
.teamRecord > div{
  border-left: 1px solid #E9E9E9;
  border-bottom: 1px solid #E9E9E9;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  height: 100%;
  justify-content: center;
}
.teamRecord > div:last-child{
  border-bottom: none;
}
.teamRecord .point em{
  color: var(--colorRed-dark);
  font-style: normal;
  font-weight: bold;
  font-size: 1.1em;
  margin-right: 0.05em;
}
.sicle2 .team-row .cell-vs{
  grid-template-rows: 1fr 1fr;
}
.team-row .cell-vs{
  padding: unset!important;
  align-items: stretch;
}
.cell-vs.none{
  background:repeating-linear-gradient(
  125deg,
  #ccc,
  #ccc 1px,
  #D6D6D6 0,
  #D6D6D6 8px
  );
}
.cell-vs a .robin-home,.cell-vs a .robin-away, .gameInvalid{
  height: 100%;
  display: grid;
  justify-items: center;
  align-items: center;
  align-content: center;
  padding-block: 0.35em;
  gap: 0.25em;
  line-height: 1;
  color: var(--fontColor-usually);
}
.sicle2 .cell-vs a{
    --clamp-min: 12;
    --clamp-max: 12;
}
.cell-vs a .robin-home.recent,.cell-vs a .robin-away.recent{
  font-weight: bold;
  --clamp-min: 14;
  --clamp-max: 14;
}
.cell-vs a .win,.cell-vs a .lose{
  color: var(--colorBlue);
  --clamp-min: 14;
  --clamp-max: 14;
}
.cell-vs .win img{
  width: 16px;
  aspect-ratio: 1;
}
.cell-vs .lose img{
  width: 13px;
  aspect-ratio: 1;
}
.cell-vs a .now{
  padding-block: 0;
  --clamp-min: 14;
  --clamp-max: 14;
}
.cell-vs .now span{
  background-color: var(--colorRed-dark);
  padding: 0.25em 0.35em;
  border-radius: 4px;
  color: white;
}
.cell-vs a .robin-away, div .robin-away{
  background-color: #F3F8FF;
  border-top: 1px solid #dadada;
}
.cell-vs a .robin-away-change{
	border-top: 1px solid #dadada;
}
.sicle1 .cell-vs a .robin-away{
  border-top: none;
}
.team-row.active .resultBox{
  background-color: var(--highlight-home);
}
.team-row > div, .header-cell > div{
  padding: 0.25em;
  overflow-wrap: break-word;
  border-bottom: 1px solid #dadada;
  border-right: 1px solid #dadada;
  width: 100%;
  text-align: center;
}

.header-cell > div .descBox{
  padding: 0.25em;
  overflow-wrap: break-word;
  border-bottom: 1px solid #dadada;
  width: 100%;
  text-align: center;
}

.header-cell > div .descBoxBottom{
  padding: 0.25em;
  overflow-wrap: break-word;
  width: 100%;
  text-align: center;
}

.team-row > div:last-child, .header-cell > div:last-child{
  border-right: none;
}
/* .team-row:last-child > div{
  border-bottom: 1px solid #dadada;
} */
.team-row > div{
  display: grid;
  align-items: center;
}
.team-row .teamName{
  text-align: left;
  border-right: none;
}
.team-row .teamName a{
  text-decoration: none;
  color: var(--fontColor-usually);
  display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5em;
    align-items: center;
}
.team-row .teamName a::after{
  content: "";
  aspect-ratio: 1;
  width: var(--icon-size);
  -webkit-mask: var(--chevron-right) no-repeat center / contain;
  mask: var(--chevron-right) no-repeat center / contain;
  background-color: currentColor;
}
@media (hover:hover){
  .team-row .teamName a:hover{
    color: var(--colorBlue);
  }
}
.team-row > div:nth-child(1), .header-cell > div:nth-child(1){
  position: sticky;
  left: 0;
  z-index: 1;
}
.team-row > div:nth-child(4), .header-cell > div:nth-child(4){
  position: sticky;
  left: 24px;
}
@media screen and (max-width: 800px){
  .btn-normal.allLink{
    display: none;
  }
}
.btn-normal.allLink{
  height: fit-content;
  width: fit-content;
  margin: 0 0 1rem auto;
  margin-right: var(--padding-inline);
}
.btn-normal.allLink a{
  font-size: 14px;
}

/*全画面ページ用*/
.allBox .pageTit-area{
  max-width: 800px;
  margin-inline: auto;
}
.allBox .roundTableAll-wrap{
  width: fit-content;
  margin-inline: auto;
}
.allBox .roudTableBox{
  max-height: 80svh;
}

/* マッチセル内の全要素にpointerカーソルを適用 */
.ls-roundrobin_overlayBtn,
.ls-roundrobin_overlayBtn *,
.cell-vs a,
.cell-vs a *,
.cell-vs a .robin-home,
.cell-vs a .robin-away,
.cell-vs a .robin-home *,
.cell-vs a .robin-away *,
.cell-vs a .win,
.cell-vs a .lose,
.cell-vs a .draw,
.cell-vs a .now,
.cell-vs a .recent {
  cursor: pointer !important;
}

/* iOS向けスクロール制御 */
@supports (-webkit-touch-callout: none) {
  .roudTableBox {
    -webkit-overflow-scrolling: auto !important;
    overscroll-behavior: none !important;
    touch-action: pan-x pan-y !important;
    overflow-x: auto;
    overflow-y: auto;
  }
  
  /* ヘッダーの固定を強化 */
  .header-cell {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
  }
  
  /* ヘッダーの各セルに背景色を明示的に設定 */
  .header-cell > div {
    background-color: var(--colorBlue) !important;
  }

  /* teamindex.activeの背景色を強制適用 */
  .header-cell .teamindex.active {
    background-color: #D9E9FF !important;
    color: var(--fontColor-usually) !important;
  }
  
  /* スクロール境界の制御 */
  .roudTable {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: auto;
  }
}

/* 全体的なスクロール制御の強化 */
.roudTableBox {
  overscroll-behavior: contain;
  scroll-behavior: auto;
}

/* iOS Safari特有の問題への対処 */
@media screen and (max-width: 800px) {
@supports (-webkit-touch-callout: none) {
    .roudTableBox {
      /* バウンススクロールを無効化 */ 
      -webkit-overflow-scrolling: auto;
    }
    
     テーブル全体の位置を固定 
    .roudTable {
      position: relative;
      min-width: 100%;
    }
  }
}

.custom-tooltip {
    position: relative !important;
    cursor: pointer !important;
}

.custom-tooltip:hover::after {
    content: attr(data-tooltip) !important;
    position: absolute !important;
    top: 105% !important;
    left: 0 !important;
    background: #333 !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    white-space: pre-line !important;
    z-index: 99999 !important;
    min-width: 200px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    display: block !important;
    text-align: left !important;
}

.custom-tooltip:hover::before {
    content: '' !important;
    position: absolute !important;
    top: 90% !important;
    left: 10px !important;
    border: 7px solid transparent !important;
    border-bottom-color: #333 !important;
    z-index: 99999 !important;
}