* { box-sizing: border-box; }
body { margin: 0; background: #161d27; color: #e5e7eb; font-family: -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }
.top { padding: 22px 18px 10px; max-width: 1040px; margin: 0 auto; }
.top h1 { margin: 0; font-size: 26px; color: #f3f4f6; }
.sub { color: #9aa3af; margin: 6px 0 0; }
main { max-width: 1040px; margin: 0 auto; padding: 10px 18px 30px; }
.controls { background: #1f2630; border: 1px solid #2c3440; border-radius: 14px; padding: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
/* 날짜 내비게이션: 이전/오늘/다음 버튼 + 날짜 입력칸 */
.date-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.date-controls input[type="date"] { padding: 7px 10px; color-scheme: dark; }
button, select, input[type="date"] { background: #262e3a; color: #e5e7eb; border: 1px solid #3a4452; border-radius: 8px; padding: 8px 12px; font-size: 14px; }
button { cursor: pointer; }
button:hover { background: #2e3745; }
.refresh-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 12px; color: #cbd5e1; font-size: 14px; }
.auto { display: flex; gap: 6px; align-items: center; }
.last-updated { color: #9aa3af; font-size: 13px; }
.live-note { color: #ef4444; margin: 10px 0 0; font-size: 14px; }
.error { background: #3a1d1d; border: 1px solid #7f1d1d; color: #fca5a5; padding: 12px; border-radius: 10px; }
/* 로딩 표시: .games-wrap 위에 겹쳐 보여서 목록을 밀지 않는다 */
.games-wrap { position: relative; min-height: 80px; }
.loading { position: absolute; top: 16px; left: 0; right: 0; z-index: 2; color: #9aa3af; text-align: center; padding: 12px 0; }
.empty { color: #9aa3af; text-align: center; padding: 30px 0; }
/* 스코어보드: 한 줄에 1경기씩, 하나의 어두운 카드 안에 세로 리스트 */
.games { display: block; background: #1f2630; border: 1px solid #2c3440; border-radius: 14px; margin-top: 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.score-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px repeat(var(--nq, 4), 44px); column-gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid #2c3440; font-size: 11px; color: #9aa3af; }
.score-head .q-head-total { text-align: center; }
.score-head .q-head { text-align: center; }
.game-block { display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px repeat(var(--nq, 4), 44px); grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #2c3440; cursor: pointer; background: #1f2630; }
.game-block:last-child { border-bottom: none; }
.game-block:hover { background: #262e3a; }
/* 왼쪽 상태/시간 열: 두 팀 행에 걸쳐 세로 중앙 */
.game-side { grid-column: 1; grid-row: 1 / 3; text-align: center; font-size: 13px; font-weight: 700; color: #e5e7eb; white-space: nowrap; }
.game-side.in { color: #ef4444; font-size: 12px; }
.game-side.post { color: #9aa3af; font-weight: 500; }
/* 팀 행: 로고 + 팀명 (+ 홈 배지) */
.team-row-line { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 36px; grid-column: 2; }
.team-row-line.away { grid-row: 1; }
.team-row-line.home { grid-row: 2; }
.team-row-line .team-name { font-size: 16px; font-weight: 700; color: #f3f4f6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.home-badge { flex-shrink: 0; padding: 1px 6px; border-radius: 999px; background: #262e3a; border: 1px solid #3a4452; color: #9aa3af; font-size: 11px; font-weight: 700; }
/* 총점 */
.total-cell { grid-column: 3; text-align: center; }
.total-cell.away { grid-row: 1; }
.total-cell.home { grid-row: 2; }
.game-score { font-size: 14px; font-weight: 700; color: #f3f4f6; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.game-score.win { font-weight: 800; color: #ffffff; }
.game-score.lose { font-weight: 400; color: #6b7280; }
.game-score.live { color: #ef4444; }
/* 쿼터별 점수: .game-block 그리드의 직접 자식으로, 머리글과 같은 열에 배치 */
.q-cell { text-align: center; font-size: 14px; color: #cbd5e1; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 경기 전: 점수/쿼터 자리 중앙에 파란 "예정" 1번만 */
.pre-label { grid-column: 3 / -1; grid-row: 1 / 3; display: flex; align-items: center; justify-content: center; color: #60a5fa; font-size: 15px; font-weight: 800; }
.team { flex: 1; min-width: 0; }
.team .ko { font-size: 17px; font-weight: 700; color: #f3f4f6; }
.team .en { color: #9aa3af; font-size: 12px; }
.team-row { display: flex; align-items: center; gap: 8px; }
.team-row.right { justify-content: flex-end; text-align: right; }
/* 팀 로고: 밝은 배경 칩을 깔아 어두운 배경에서도 잘 보이게 한다 */
.team-logo { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.team-logo.lg { width: 40px; height: 40px; }
.team-abbr-badge { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: #262e3a; border: 1px solid #3a4452; color: #cbd5e1; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.badge { display: inline-block; margin-top: 10px; padding: 3px 9px; border-radius: 999px; font-size: 12px; background: #262e3a; border: 1px solid #3a4452; color: #cbd5e1; }
.badge.live { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
.badge.done { background: #052e16; border-color: #166534; color: #86efac; }
footer { max-width: 1040px; margin: 0 auto; padding: 0 18px 30px; color: #9aa3af; font-size: 13px; line-height: 1.6; }
footer a { color: #60a5fa; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow: auto; z-index: 10; }
.modal[hidden] { display: none; }
.modal-card { background: #1f2630; border: 1px solid #2c3440; border-radius: 14px; width: 100%; max-width: 860px; padding: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-head h2 { margin: 0; font-size: 20px; line-height: 1.4; color: #f3f4f6; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-sub { color: #9aa3af; margin: 6px 0 0; }
.tabs { display: flex; gap: 8px; margin: 16px 0; }
.tab { padding: 8px 16px; }
.tab.active { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.tab-panel { line-height: 1.6; }
.tab-panel a { color: #60a5fa; }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0 18px; background: #1f2630; }
th, td { border-bottom: 1px solid #2c3440; padding: 7px 6px; text-align: right; color: #e5e7eb; }
th:first-child, td:first-child { text-align: left; }
th { color: #9aa3af; }
.player-ko { font-weight: 600; color: #f3f4f6; }
.player-en { color: #9aa3af; font-size: 12px; display: block; }
h3 { margin: 18px 0 6px; font-size: 16px; color: #f3f4f6; }
h4 { margin: 12px 0 6px; font-size: 15px; color: #e5e7eb; }
.lineup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .lineup-grid { grid-template-columns: 1fr; } .score-head, .game-block { grid-template-columns: 52px minmax(0, 1fr) 36px repeat(var(--nq, 4), 36px); column-gap: 5px; padding: 8px 8px; } .team-row-line { min-height: 32px; } .team-row-line .team-name { font-size: 14px; } .game-score { font-size: 12px; } .q-cell { font-size: 12px; } .game-side { font-size: 12px; } .team-logo { width: 24px; height: 24px; } .pre-label { font-size: 14px; } }
.note { color: #9aa3af; }
.recent-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 1px solid #2c3440; }
/* 최근 전적·맞대결 점수: 승패 표시를 기준으로 점수 정렬 (고정 너비 그리드) */
.score-line { display: inline-grid; grid-template-columns: 20px 30px 8px 30px; align-items: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.score-line .score-result { text-align: center; }
.score-line .score-my { text-align: right; }
.score-line .score-colon { text-align: center; color: #9aa3af; }
.score-line .score-opp { text-align: left; }
.score-line .game-score { font-size: 14px; }
.win { color: #4ade80; font-weight: 700; }
.loss { color: #ef4444; font-weight: 700; }
.lineup-box { background: #16233a; border: 1px solid #2b3f5c; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.lineup-box h3 { margin-top: 0; }
.lineup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lineup-head h3 { margin: 0; }
.lineup-refresh { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lineup-refresh button { padding: 6px 12px; font-size: 13px; font-weight: 700; color: #60a5fa; background: #262e3a; border: 1px solid #3a4452; border-radius: 8px; }
.lineup-refresh button:hover:not(:disabled) { background: #2e3745; }
.lineup-refresh button:disabled { opacity: 0.6; cursor: wait; }
.lineup-box .badge { margin-top: 0; background: #1e3a5f; border-color: #2b4a73; color: #93c5fd; }
.rw-player { padding: 4px 0; color: #e5e7eb; }
.out-player .player-ko { color: #9aa3af; }
.rw-pos { display: inline-block; width: 26px; font-weight: 700; color: #cbd5e1; font-size: 12px; }
.rw-inj { color: #fbbf24; font-size: 12px; font-weight: 700; }
