/* ── 호프스 국가대표 선발전 전용 추가 스타일 (52nd-main.css 기반) ── */

/* 조 선택 버튼 */
#hopes-group-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 16px;
  background: #f8f9fb;
  border-bottom: 1px solid #ddd;
  flex-wrap: wrap;
}

.hopes-grp-btn {
  padding: 4px 14px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: bold;
}

.hopes-grp-btn:hover {
  background: #e8f0fe;
  border-color: #3b78d8;
}

.hopes-grp-btn.active {
  background: #1a3a6b;
  color: #fff;
  border-color: #1a3a6b;
}

/* 콘텐츠 영역 */
#hopes-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}

/* 패널 */
.main-panel { display: none; }
.main-panel.active { display: block; }
.main-sub-view { display: none; }
.main-sub-view.active { display: block; }

/* 예선/본선 공통 테이블 */
.hopes-roster-table th,
.hopes-roster-table td {
  padding: 5px 8px;
  border: 1px solid #ddd;
  text-align: left;
  font-size: 12px;
}

.hopes-match-table th,
.hopes-match-table td {
  padding: 4px 6px;
  border: 1px solid #ddd;
  text-align: center;
  font-size: 12px;
}

.hopes-match-table .winner {
  background: #fff5e0;
  font-weight: bold;
}

.hopes-match-table .forfeit {
  text-decoration: line-through;
  color: #999;
}

.hopes-match-table .score-detail {
  font-family: monospace;
  font-size: 11px;
  color: #555;
}

.hopes-match-table .score-cell {
  font-weight: bold;
  min-width: 40px;
}

/* 매트릭스 */
.hopes-matrix-table th,
.hopes-matrix-table td {
  padding: 4px 6px;
  border: 1px solid #ddd;
  text-align: center;
  min-width: 28px;
  font-size: 11px;
}

.hopes-matrix-table .matrix-self { background: #ddd; }
.hopes-matrix-table .matrix-cell { font-family: monospace; }
.hopes-matrix-table .forfeit {
  text-decoration: line-through;
  color: #999;
}
/* 기권자 column header (xlsx 샘플 §4 — 가로 헤더 학교명·이름도 strike) */
.hopes-matrix-table th.matrix-header.forfeit {
  text-decoration: line-through;
  color: #999;
}
/* 기권자 셀 (rowSeed 또는 colSeed 기권 시) */
.hopes-matrix-table td.matrix-cell.forfeit {
  color: #999;
}

/* 결과 저장 버튼 */
.hopes-match-save-btn {
  padding: 3px 10px;
  font-size: 11px;
  background: #1a3a6b;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.hopes-match-save-btn:hover {
  background: #2a5298;
}

/* 빈 상태 */
.empty-msg {
  color: #999;
  text-align: center;
  padding: 20px;
  font-size: 13px;
}

/* 기권 관리 패널 */
#forfeit-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 20px;
  width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* 인쇄 버튼 영역 */
.hopes-print-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.hopes-print-bar button {
  padding: 6px 14px;
  background: #fff;
  color: #1a3a6b;
  border: 1px solid #1a3a6b;
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
  font-family: inherit;
}

.hopes-print-bar button:hover {
  background: #e8f0fe;
}

.hopes-print-bar .btn-danger {
  color: #c44;
  border-color: #c44;
}

.hopes-print-bar .btn-danger:hover {
  background: #ffeaea;
}

/* 섹션 제목 */
.hopes-section-title {
  font-size: 14px;
  font-weight: bold;
  color: #1a3a6b;
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ddd;
}

/* ── 조 선택 후 액션 버튼 바 ── */
#hopes-action-bar {
  display: flex;
  gap: 8px;
  padding: 6px 16px;
  background: #f0f4fa;
  border-bottom: 1px solid #ddd;
  flex-wrap: wrap;
  align-items: center;
}

#hopes-action-bar button {
  padding: 4px 12px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}

#hopes-action-bar button:hover {
  background: #e8f0fe;
  border-color: #3b78d8;
}

#hopes-action-bar .btn-danger {
  color: #c44;
  border-color: #c44;
}

#hopes-action-bar .btn-danger:hover {
  background: #ffeaea;
}

/* ── 매트릭스 = 52nd-main.css 의 .matrix-table 룰 (table-layout: fixed + 28x28 셀 + matrix-diag 대각선) 그대로 적용. hopes-matrix-table 보조 클래스만 forfeit 시각화 보강. ── */
/* hopes 한정 = 기권 선수 있을 때 cell 폭 좁아서 "3-W/O" 표시 짤림 → cell width 40px 으로 확장 */
.hopes-matrix-table.matrix-table th:not(:nth-child(-n+3)),
.hopes-matrix-table.matrix-table td:not(:nth-child(-n+3)) {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  font-size: 10px;
}

#main-league-wrap {
  align-items: start;
}

#main-matrix-wrap {
  min-width: 0;
  overflow: visible !important;
}

.hopes-matrix-scroll {
  width: 100%;
  max-height: calc(100vh - 260px);
  overflow: auto;
}

/* ── 패널 타이틀 (조 편성 / 리그전 순번 / 리그전 결과) — 52nd 룰 override + 진하게 ── */
.hopes-matrix-table ~ .panel-title,
#panel-roster .panel-title,
#panel-schedule .panel-title,
#panel-matrix .panel-title,
.main-panel .panel-title {
  font-size: 13px !important;
  font-weight: bold !important;
  color: #fff !important;
  background: #1a3a6b !important;
  padding: 5px 10px !important;
  margin-bottom: 8px !important;
  border-radius: 4px 4px 0 0 !important;
  border-bottom: none !important;
  display: block !important;
}

/* ── 콘텐츠 영역 패딩 — action-bar 와 좌우 동일 (보스 정책 2026-06-02 silk 복원 2026-06-03) ── */
body:has(#hopes-action-bar) #content-area {
  padding: 6px 0 !important;
}
#content-area > .main-panel {
  padding: 12px 16px;
}

/* ── 시상 (상장대장) — 2026-06-08 도입. 본선 standings 남/여 1~6위 자동 채움. PDF 양식 그대로. ── */
.hopes-aw-table {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.hopes-aw-table td,
.hopes-aw-table th {
  border: 1px solid #333;
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  word-break: keep-all;
}
.hopes-aw-title {
  font-size: 18px;
  font-weight: bold;
  padding: 14px !important;
  background: #f0f4fa;
  border: 2px solid #333 !important;
  letter-spacing: 2px;
}
.hopes-aw-rank-hdr {
  background: #1a3a6b;
  color: #fff;
  font-weight: bold;
  width: 80px;
  padding: 10px !important;
}
.hopes-aw-gender-hdr {
  background: #1a3a6b;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 4px;
  padding: 10px !important;
}
.hopes-aw-rank {
  background: #f5f5f5;
  font-weight: bold;
  font-size: 16px;
  width: 80px;
}
.hopes-aw-label {
  background: #f9f9f9;
  font-weight: bold;
  font-size: 12px;
  color: #333;
  width: 60px;
}
.hopes-aw-val {
  min-height: 28px;
  font-size: 13px;
  color: #1a3a6b;
}
