/* =========================
   기본 초기화
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 전역 변수 */
/* :root {
   헤더 높이 
  --header-height: 100px;  
  /* 스코어보드 상단 Team 칸 전체 폭 */
/* --team-width: 250px;      
} */

/* 메인 구조 */
main {
  padding-top: var(--header-height);
  padding-bottom: 40px;
}



/* 스코어보드 전체 */
/* .scoreboard {
  margin: 0 200px;          /* 좌우 여백 고정 
  padding: 20px 24px;       /* 내부 여백 
  border-radius: 8px;
  min-height: 100px;
  display: flex;
  flex-wrap: wrap;          /* 줄바꿈 허용 
  gap: 16px;                /* 블록 간격 
  align-items: flex-start;  /* 상단 정렬 
  justify-content: space-between;
  overflow-anchor: none;    /* 새로고침 시 점프 방지 
  text-align: center;
} */

/* 상단 텍스트/표 블록은 한 줄 전체 차지 */
/* .scoreboard > .result,
.scoreboard > .result_table,
.scoreboard > .result_table_bottom {
  flex: 1 1 100%;
  max-width: 100%;
}

/* 제목 */
/* .result p { */
/* font-size: 32px; */
/* font-weight: bold; */
/* margin-bottom: 12px; 
  text-align: left;
  background-color: red;
} */

/* =========================
   1. 상단 스코어 테이블
   ========================= */
.result_table {
  padding-top: 8px;
  margin-bottom: 30px;
}

.scoreboard .review {
  font-size: 23px;
  font-weight: bold;
  margin-bottom: 12px;
  text-align: left;
}

/* 표 기본 스타일 */
.result_table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 2px solid #000;
  background: #fff;
}

/* 열 비율 */
.result_table col.col-1 {
  width: calc(var(--team-width) * 0.30);
}

.result_table col.col-2 {
  width: calc(var(--team-width) * 0.70);
}

.result_table col.col-rest {
  width: calc((100% - var(--team-width)) / 16);
}

/* 셀 공통 스타일 */
.result_table td,
.result_table th {
  border: 1px solid #000;
  padding: 8px 10px;
  text-align: center;
  word-break: keep-all;
}

/* 헤더 행 (Team) 강조 */
.result_table .team {
  width: var(--team-width);
  font-weight: 700;
  background: #f6f6f6;
}

/* Team A/B 행 강조 */
.result_table tr:nth-child(n+2) td:nth-child(2) {
  font-weight: 600;
}

/* =========================
   2. 하단 주요 기록 표
   ========================= */
.result_table_bottom table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 2px solid #000;
  background: #fff;
  height: 400px;
  margin-bottom: 50px;
  text-align: center;
}

.result_table_bottom td,
.result_table_bottom th {
  border: 1px solid #000;
  padding: 8px 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* 첫 번째 열 라벨 */
.result_table_bottom tr td:first-child {
  width: 200px;
  font-weight: 700;
  background: #f6f6f6;
  text-align: center;
}

/* 줄간 강조 */
.result_table_bottom tr:nth-child(odd) td:nth-child(2) {
  background: #fafafa;
}

/* =========================
   3. 타자 기록 표 2개 (A/B)
   ========================= */
.teamA_hitter_result,
.teamB_hitter_result {
  flex: 0 0 48%;
  max-width: 48%;
  box-sizing: border-box;
  padding-top: 8px;
  margin-bottom: 50px;
}

.teamA_hitter_result {
  padding-right: 1%;
}

.teamB_hitter_result {
  padding-left: 1%;
}

.teamA_hitter_result table,
.teamB_hitter_result table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: center;
  border: 2px solid #000;
}

.teamA_hitter_result td,
.teamB_hitter_result td {
  border: 1px solid #000;
  padding: 6px;
  word-break: keep-all;
}

.teamA_hitter_result>p,
.teamB_hitter_result>p {
  font-size: 23px;
  font-weight: bold;
  margin-bottom: 12px;
  text-align: left;
}

/* 첫 번째 열 굵게 */
.teamA_hitter_result tr td:nth-child(1),
.teamB_hitter_result tr td:nth-child(1) {
  font-weight: bold;
}

/* 헤더 행 굵게 */
.teamA_hitter_result tr:nth-child(1),
.teamB_hitter_result tr:nth-child(1) {
  font-weight: bold;
}

/* =========================
   4. 투수 기록 표 2개 (A/B)
   ========================= */
.teamA_pitcher_result,
.teamB_pitcher_result {
  padding-top: 8px;
  margin-bottom: 30px;
}

.teamA_pitcher_result>p,
.teamB_pitcher_result>p {
  font-size: 23px;
  font-weight: bold;
  margin-bottom: 12px;
  text-align: left;
}

.teamA_pitcher_result table,
.teamB_pitcher_result table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 2px solid #000;
  background: #fff;
  height: 200px;
}

.teamA_pitcher_result td,
.teamA_pitcher_result th,
.teamB_pitcher_result td,
.teamB_pitcher_result th {
  border: 1px solid #000;
  padding: 8px 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.teamA_pitcher_result tr:last-child td,
.teamA_pitcher_result tr:first-child td,
.teamB_pitcher_result tr:last-child td,
.teamB_pitcher_result tr:first-child td {
  height: 40px;
  padding: 4px 8px;
  text-align: center;
  font-weight: bold;
}

/* =========================
   반응형
   ========================= */

/* ✅ PC 버전 (≥769px) */
@media (min-width: 769px) {
  .scoreboard {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin: 0;

  }

  .line1_player {
    margin-top: 10px;
    border-top: 3px solid #000080;
    margin-bottom: 10px;

  }

  .scoreboard>.result_table,
  .scoreboard>.result_table_bottom {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .teamA_hitter_result,
  .teamB_hitter_result {
    flex: 0 0 48%;
    max-width: 48%;
    padding: 0 1%;
  }



  .teamA_hitter_result>p,
  .teamB_hitter_result>p,
  .teamA_pitcher_result>p,
  .teamB_pitcher_result>p {
    font-size: 22px;
  }

  .date_review_group {
    display: flex;
    flex-direction: column;
    /* 세로 스택 */
    /* gap: 12px; */
    /* 블록 사이 간격 */
    width: 100%;

    /* 부모가 flex(row)일 때 한 줄 전체 확보 */
    flex: 1 1 100%;
    max-width: 100%;

    /* 부모가 grid일 때 한 줄 전체 확보 */
    grid-column: 1 / -1;

  }

  /*1117*/
  .result_date {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
  }

  .result_date .nav-btn {
    background: none;
    border: none;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    padding: 5px 10px;
    transition: 0.2s;
  }

  /* 비활성화 버튼 스타일 */
  .result_date .nav-btn.disabled,
  .result_date .nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
  }

  .result {
    /* font-size: 32px; */
    /* font-weight: bold; */
    /* background-color: red; */
    /* margin-left: -15px; */
    width: calc(100% + 15px);
  }

  .result p {
    margin: 0;
    padding-top: 5px;
    font-size: 28px;
    font-weight: bold;

  }

  /*1116*/
  /* 오른쪽 정렬용 래퍼 */
  .select_date {
    position: relative;
    margin-left: auto;
    width: 40px;
    height: 40px;
  }

  /* 보이는 아이콘 버튼 */
  .calendar_btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #000;
    border-radius: 6px;
    background-color: #fff;
    padding: 0;
    cursor: pointer;

    /* 클릭은 뒤의 input이 받게 하기 위해 이벤트 무시 */
    pointer-events: none;
  }

  .calendar_btn i {
    font-size: 20px;
    color: #000;
  }


  .calendar_input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;

    opacity: 0;
    /* 보이지 않음 */
    border: none;
    background: transparent;
    margin: 0;
    padding: 0;
    cursor: pointer;

    /* 중요! 브라우저 기본 스타일도 숨겨야 함 */
    appearance: none;
    -webkit-appearance: none;
  }

  .calendar_btn i {
    font-size: 22px;
    color: #0B3D91;

  }

}



/* ✅ 모바일 버전 (≤768px) */
@media (max-width: 768px) {
  main {
    padding-top: 0;
  }

  .line1_player {
    margin-top: 5px;
    border-top: 3px solid #000080;
    width: 100%;
    /* 부모 영역 가득 */
    display: block;
    /* 혹시 inline이면 표시 안 될 수 있음 */
    height: 0;

  }


  /*1117*/
  .result_date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
  }

  .result_date h2 {
    text-align: center;
    font-size: 20px;
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  .result_date .nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    background: none;
    border: none;
    padding: 0;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;

    /* 모바일 기본 버튼 제거 */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: none;
    outline: none;
  }

  .result_date .nav-btn i {
    line-height: 1;
    display: block;
  }

  /* 비활성화 */
  .result_date .nav-btn.disabled,
  .result_date .nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
  }


  .scoreboard {
    margin: 0 12px;
    padding: 0;
    /* display: flex; */
    flex-wrap: wrap;
    gap: 5px;
    align-items: stretch;
    justify-content: flex-start;
  }

  .scoreboard>.result,
  .scoreboard>.result_table,
  .scoreboard>.result_table_bottom {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* 타자/투수 표 세로 1열 */
  .teamA_hitter_result,
  .teamB_hitter_result,
  .teamA_pitcher_result,
  .teamB_pitcher_result {
    flex: 1 1 100%;
    max-width: 100%;
    padding: 0;
    margin-bottom: 16px;
  }

  /* 표 가로 스크롤 허용 */
  .result_table,
  .result_table_bottom,
  .teamA_hitter_result,
  .teamB_hitter_result,
  .teamA_pitcher_result,
  .teamB_pitcher_result {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 최소 폭 확보 */
  .result_table table {
    min-width: 920px;
  }

  .result_table_bottom table {
    min-width: 520px;
  }

  .teamA_hitter_result table,
  .teamB_hitter_result table {
    min-width: 720px;
  }

  .teamA_pitcher_result table,
  .teamB_pitcher_result table {
    min-width: 980px;
  }

  /* Team 열 폭 조정 */
  .result_table col.col-1 {
    width: 64px;
  }

  .result_table col.col-2 {
    width: 120px;
  }

  /* 폰트 및 패딩 축소 */
  /* 1121 */
 .result p {
    margin-top: 20px;
    font-size: 28px;
    font-weight: bold;
    text-align: left;
  }

  .scoreboard .review,
  .teamA_hitter_result>p,
  .teamB_hitter_result>p,
  .teamA_pitcher_result>p,
  .teamB_pitcher_result>p {
    font-size: 22px;
  }

  .result_table td,
  .result_table th,
  .result_table_bottom td,
  .result_table_bottom th,
  .teamA_hitter_result td,
  .teamB_hitter_result td,
  .teamA_pitcher_result td,
  .teamB_pitcher_result td {
    padding: 6px 8px;
    font-size: 13px;
  }

  /* .result_table_bottom tr td:first-child {
    width: 160px;
  } */
  .result_table_bottom table td:first-child {
    width: 80px;
    /* 원하는 만큼 줄이기 */
    white-space: nowrap;
    /* 줄바꿈 방지 */
  }

  .result_table_bottom table td:last-child {
    width: auto;
    /* 나머지 칸은 자동으로 채움 */
  }

  .teamA_pitcher_result table td:first-child,
  .teamB_pitcher_result table td:first-child {
    /* background-color: red; */
    width: 70px;
  }

  /*1116*/

  .date_review_group {
    display: flex;
    flex-direction: column;
  }

  /* 박스 오른쪽 정렬 */
  .select_date {
    position: relative;
    margin-left: auto;
    width: 40px;
    height: 40px;
  }

  /* 보이는 아이콘 버튼 */
  .calendar_btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #000;
    border-radius: 6px;
    background-color: #fff;
    padding: 0;
    cursor: pointer;

    /* 클릭은 뒤의 input이 받게 하기 위해 이벤트 무시 */
    pointer-events: none;
  }

  .calendar_btn i {
    font-size: 20px;
    color: #000;
  }

  /* 🔥 진짜 input: 완전히 숨기고 클릭만 받도록 */
  .calendar_input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;

    opacity: 0;
    /* 보이지 않음 */
    border: none;
    background: transparent;
    margin: 0;
    padding: 0;
    cursor: pointer;

    /* 중요! 브라우저 기본 스타일도 숨겨야 함 */
    appearance: none;
    -webkit-appearance: none;
  }


}