/* =============================================================
   achv.me - scoreboard.css
   Scoreboard list, box score detail
   @import common.css - loaded from PHP
   ============================================================= */

/* --- Filters --- */
.achv-sb-filters {
    display: flex;
    gap: 8px;
    margin-bottom: var(--achv-sp-4);
    flex-wrap: wrap;
    align-items: center;
}

/* 입력·선택 규격은 common.css 의 .achv-form__input / .achv-select-native 가 맡는다.
   여기서 background 를 다시 적으면 공통 화살표가 지워진다. */
.achv-sb-filters__select {
    min-width: 160px;
}

.achv-sb-filters__date {
    min-width: 150px;
}

/* --- Date Group --- */
.achv-sb-date-group {
    margin-bottom: var(--achv-sp-5);
}

.achv-sb-date-group__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--achv-text-secondary);
    margin-bottom: var(--achv-sp-2);
    padding-bottom: var(--achv-sp-1);
    border-bottom: 1px solid var(--achv-border);
}

/* --- Game Card --- */
.achv-sb-game-card {
    padding: var(--achv-sp-3) var(--achv-sp-4);
    background: var(--achv-bg);
    border: 1px solid var(--achv-border);
    border-radius: var(--achv-radius);
    margin-bottom: var(--achv-sp-2);
    box-shadow: var(--achv-shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.achv-sb-game-card:hover {
    border-color: var(--achv-primary);
    box-shadow: var(--achv-shadow);
}
.achv-sb-game-card--live {
    border-color: var(--achv-danger);
    border-width: 2px;
    position: relative;
}
.achv-sb-game-card__link {
    display: block; text-decoration: none; color: inherit;
}
.achv-sb-game-card__link:hover { text-decoration: none; }
.achv-sb-game-card__live-badge {
    display: inline-block; font-size: 12px; font-weight: 700; color: #fff;
    background: var(--achv-danger); padding: 1px 8px; border-radius: 3px; margin-bottom: 6px;
    animation: achv-pulse 1.5s infinite;
}
@keyframes achv-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

.achv-sb-game-card__teams {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--achv-sp-4);
}

.achv-sb-game-card__team {
    font-weight: 600;
    font-size: 15px;
    min-width: 100px;
    color: var(--achv-text);
}

.achv-sb-game-card__team:first-child {
    text-align: right;
}

.achv-sb-game-card__team:last-child {
    text-align: left;
}

.achv-sb-game-card__score {
    font-size: 20px;
    font-weight: 700;
    color: var(--achv-primary);
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    text-align: center;
}

.achv-sb-game-card__venue {
    display: block;
    text-align: center;
    font-size: 13px;
    color: var(--achv-text-muted);
    margin-top: var(--achv-sp-1);
}

/* Inning Score Table (dark header) */

.achv-sb-innings__table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.achv-sb-innings__table th,
.achv-sb-innings__table td {
    padding: 6px 10px;
    border: 1px solid #334155;
    text-align: center;
    font-size: 13px;
}

.achv-sb-innings__table th {
    background: #1e293b;
    color: #fff;
    font-weight: 600;
}

.achv-sb-innings__table td {
    border-color: var(--achv-border);
}

.achv-sb-innings__table td:first-child {
    text-align: left;
    font-weight: 600;
    background: var(--achv-surface);
    color: var(--achv-text);
}

/* Total columns (R, H, E) */
.achv-sb-innings__table th:nth-last-child(-n+3) {
    background: #334155;
}

.achv-sb-innings__table td:nth-last-child(-n+3) {
    font-weight: 700;
    background: var(--achv-surface-alt);
}

/* --- Box Score Stats Table --- */
.achv-sb-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.achv-sb-stats-table th,
.achv-sb-stats-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--achv-border);
    text-align: center;
    font-size: 14px;
}

.achv-sb-stats-table th {
    background: var(--achv-surface);
    font-weight: 600;
    color: var(--achv-text);
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.achv-sb-stats-table tbody tr:nth-child(even) {
    background: var(--achv-surface);
}

.achv-sb-stats-table tbody tr:hover {
    background: var(--achv-surface-alt);
}

.achv-sb-stats-table td:first-child {
    text-align: left;
}

.achv-sb-stats-table a {
    color: var(--achv-secondary);
    text-decoration: none;
}

.achv-sb-stats-table a:hover {
    text-decoration: underline;
}

/* Section headings within box score */
.achv-sb-section-title {
    font-size: 16px;
    font-weight: 600;
    margin: var(--achv-sp-4) 0 var(--achv-sp-2);
    color: var(--achv-text);
    padding-bottom: var(--achv-sp-1);
    border-bottom: 2px solid var(--achv-primary);
}

/* --- Highlights Cards --- */
.achv-sb-highlights {
    margin-bottom: var(--achv-sp-4);
}

.achv-sb-highlights__list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.achv-sb-highlights__card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--achv-bg);
    border: 1px solid var(--achv-border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--achv-text);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.achv-sb-highlights__card:hover {
    border-color: var(--achv-primary);
    box-shadow: var(--achv-shadow-sm);
    text-decoration: none;
}

.achv-sb-highlights__icon {
    font-size: 16px;
    flex-shrink: 0;
}

.achv-sb-highlights__card--hr {
    border-color: var(--achv-primary);
    background: #fef2f2;
}

.achv-sb-highlights__card--shutout {
    border-color: #f59e0b;
    background: #fffbeb;
}

.achv-sb-highlights__card--decision {
    background: var(--achv-surface);
}

/* --- Stats table improvements --- */
.achv-sb-stats-table td a {
    color: var(--achv-secondary);
    text-decoration: none;
}

.achv-sb-stats-table td a:hover {
    text-decoration: underline;
}

.achv-sb-stats-table .achv-sb-td--bold {
    font-weight: 700;
}

.achv-sb-stats-table .achv-sb-td--accent {
    font-weight: 700;
    color: var(--achv-primary);
}

.achv-sb-stats-table .achv-sb-td--win {
    font-weight: 700;
    color: var(--achv-success);
}

.achv-sb-stats-table .achv-sb-td--loss {
    color: var(--achv-text-muted);
}

.achv-sb-stats-table .achv-sb-td--rate {
    background: rgba(0,0,0,0.02);
    font-variant-numeric: tabular-nums;
}

/* --- Responsive: Small Mobile --- */
@media (max-width: 480px) {
    /* Game card: team names shouldn't overflow */
    .achv-sb-game-card {
        padding: var(--achv-sp-3);
    }

    .achv-sb-game-card__teams {
        gap: var(--achv-sp-2);
    }

    .achv-sb-game-card__team {
        min-width: 70px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .achv-sb-game-card__score {
        font-size: 18px;
        min-width: 50px;
    }

    /* Inning score table: smaller font, sticky team col */
    .achv-sb-innings__table th,
    .achv-sb-innings__table td {
        padding: 4px 6px;
        font-size: 11px;
    }

    .achv-sb-innings__table td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        min-width: 60px;
        font-size: 12px;
    }

    .achv-sb-innings__table th:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        min-width: 60px;
    }

    /* Box score stats: smaller padding (sticky 좌측 컬럼은 .achv-sb-stats-table--batting/--pitching 규칙으로 처리) */
    .achv-sb-stats-table th,
    .achv-sb-stats-table td {
        padding: 4px 6px;
        font-size: 14px;
    }

    /* Detail title */
}

/* --- Box Score: Matchup Header Card --- */
.achv-sb-matchup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 12px;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.achv-sb-matchup__side {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 100px;
}

.achv-sb-matchup__side--away {
    justify-content: flex-end;
}

.achv-sb-matchup__team-link {
    text-decoration: none;
    color: inherit;
}

.achv-sb-matchup__side--away .achv-sb-matchup__team-link {
    text-align: right;
}

.achv-sb-matchup__team-name {
    font-size: 16px;
    font-weight: 700;
}

.achv-sb-matchup__logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
}

.achv-sb-matchup__logo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #6b7280;
}

.achv-sb-matchup__center {
    text-align: center;
    min-width: 80px;
}

.achv-sb-matchup__final-score {
    font-size: 28px;
    font-weight: 900;
    color: #e60200;
    font-variant-numeric: tabular-nums;
}

.achv-sb-matchup__info {
    font-size: 13px;
    color: #9ca3af;
}

.achv-sb-matchup__live-badge {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 4px;
    display: inline-block;
}

.achv-sb-matchup__status {
    font-size: 13px;
    color: #9ca3af;
}

/* --- Box Score: Tabs --- */
.achv-sb-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin: 16px 0 12px;
}

.achv-sb-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: var(--achv-text-secondary);
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.achv-sb-tab:hover {
    color: var(--achv-text);
}

.achv-sb-tab--active {
    color: var(--achv-primary);
    font-weight: 600;
    border-bottom-color: var(--achv-primary);
}

/* --- Box Score: Summary Score --- */
.achv-sb-summary-score {
    text-align: center;
    margin-bottom: 16px;
}

.achv-sb-summary-score__number {
    font-size: 32px;
    font-weight: 900;
    color: #1f2937;
    font-variant-numeric: tabular-nums;
}

.achv-sb-summary-score__label {
    font-size: 14px;
    color: #6b7280;
}

/* --- Team Section + 하위 탭 (양팀 간이기록 — 상위 탭 톤 통일) --- */
.achv-sb-team-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin: 28px 0 12px;
}
.achv-sb-team-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: var(--achv-text-secondary);
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.achv-sb-team-tab:hover {
    color: var(--achv-text);
}
.achv-sb-team-tab--active {
    color: var(--achv-primary);
    font-weight: 600;
    border-bottom-color: var(--achv-primary);
}
.achv-sb-team-section {
    padding-top: 8px;
}

/* --- Box Score: Decision Badges (W/L/SV/HLD) --- */
.achv-sb-decisions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.achv-sb-decision {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
}

.achv-sb-decision--win {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.achv-sb-decision--loss {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.achv-sb-decision--save {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.achv-sb-decision--hold {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
}

.achv-sb-decision__type--win { color: #16a34a; }
.achv-sb-decision__type--loss { color: #dc2626; }
.achv-sb-decision__type--save { color: #1d4ed8; }
.achv-sb-decision__type--hold { color: #7c3aed; }

.achv-sb-decision__detail {
    color: #6b7280;
}

/* --- 라인업 탭 --- */
.achv-sb-lineup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 12px;
}
.achv-sb-lineup-team {
    background: var(--achv-bg-soft, #f8fafc);
    border: 1px solid var(--achv-border, #e2e8f0);
    border-radius: 6px;
    padding: 12px;
}
.achv-sb-lineup-team__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--achv-text, #1e293b);
}
.achv-sb-lineup-team__side {
    font-size: 13px;
    color: var(--achv-text-dim, #64748b);
    font-weight: 400;
    margin-left: 4px;
}
.achv-sb-lineup-empty {
    padding: 16px;
    text-align: center;
    color: var(--achv-text-dim, #64748b);
    font-size: 14px;
}
.achv-sb-lineup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.achv-sb-lineup-table th,
.achv-sb-lineup-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--achv-border, #e2e8f0);
    text-align: left;
}
.achv-sb-lineup-table th {
    font-weight: 700;
    color: var(--achv-text-dim, #64748b);
    background: var(--achv-bg-soft, #f1f5f9);
}
.achv-sb-lineup-table tr:last-child td {
    border-bottom: none;
}
/* 선수 cell — 좌측 프로필 사진 + 이름 + 우측 등번호 괄호 */
.achv-sb-lineup-player-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.achv-sb-lineup-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--achv-bg-soft, #f1f5f9);
    flex-shrink: 0;
    display: inline-block;
}
.achv-sb-lineup-avatar--blank {
    border: 1px dashed var(--achv-border, #e2e8f0);
}
.achv-sb-lineup-name {
    font-weight: 600;
}
.achv-sb-lineup-uniform {
    color: var(--achv-text-dim, #64748b);
    font-size: 13px;
    font-weight: 600;
}
.achv-sb-lineup-pitcher {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--achv-bg-soft, #fff);
    border: 1px solid var(--achv-border, #e2e8f0);
    border-left: 3px solid var(--achv-primary, #e60200);
    border-radius: 4px;
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 13px;
}
.achv-sb-lineup-pitcher__label {
    font-weight: 700;
    color: var(--achv-primary, #e60200);
    flex-shrink: 0;
}
/* --- 전력분석 탭 --- */
.achv-sb-preview-placeholder {
    padding: 32px;
    text-align: center;
    color: var(--achv-text-dim, #64748b);
    font-size: 14px;
    background: var(--achv-bg-soft, #f8fafc);
    border: 1px dashed var(--achv-border, #e2e8f0);
    border-radius: 6px;
    margin-top: 12px;
}
.achv-sb-preview {
    margin-top: 12px;
}
.achv-sb-preview__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--achv-text, #1e293b);
}
.achv-sb-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.achv-sb-preview-table th,
.achv-sb-preview-table td {
    padding: 8px 10px;
    border: 1px solid var(--achv-border, #e2e8f0);
    text-align: center;
}
.achv-sb-preview-table th {
    background: var(--achv-bg-soft, #f1f5f9);
    font-weight: 700;
    color: var(--achv-text-dim, #64748b);
}
.achv-sb-preview-table td:nth-child(2) {
    background: var(--achv-bg-soft, #f8fafc);
    font-weight: 600;
    color: var(--achv-text-dim, #64748b);
}
.achv-sb-preview .achv-sb-preview__title {
    margin-top: 18px;
}
.achv-sb-preview .achv-sb-preview__title:first-child {
    margin-top: 0;
}
/* 주요 선수 카드 */
.achv-sb-preview-key {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}
.achv-sb-preview-key-team {
    background: var(--achv-bg-soft, #f8fafc);
    border: 1px solid var(--achv-border, #e2e8f0);
    border-radius: 6px;
    padding: 12px;
}
.achv-sb-preview-key-team__name {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--achv-text, #1e293b);
    border-bottom: 1px solid var(--achv-border, #e2e8f0);
    padding-bottom: 6px;
}
.achv-sb-preview-key-player {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 6px 10px;
    margin-bottom: 8px;
    align-items: baseline;
}
.achv-sb-preview-key-player:last-child {
    margin-bottom: 0;
}
.achv-sb-preview-key-player__role {
    font-size: 13px;
    font-weight: 700;
    color: var(--achv-primary, #e60200);
    grid-row: 1 / 3;
    align-self: center;
    text-align: center;
    background: #fee2e2;
    padding: 2px 4px;
    border-radius: 4px;
}
.achv-sb-preview-key-player__name {
    font-weight: 600;
    color: var(--achv-text, #1e293b);
}
.achv-sb-preview-key-player__stat {
    font-size: 13px;
    color: var(--achv-text-dim, #64748b);
}
.achv-sb-preview-key-empty {
    font-size: 13px;
    color: var(--achv-text-dim, #64748b);
    text-align: center;
    padding: 8px 0;
}
@media (max-width: 480px) {
    .achv-sb-preview-key {
        grid-template-columns: 1fr;
    }
}

/* --- 심판 및 기록원 표 (요약 panel 하단) --- */
.achv-sb-officials-panel {
    margin-top: 20px;
    padding: 12px 14px;
    background: var(--achv-bg-soft, #f8fafc);
    border: 1px solid var(--achv-border, #e2e8f0);
    border-radius: 6px;
}
.achv-sb-officials-panel__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--achv-text, #1e293b);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--achv-border, #e2e8f0);
}
.achv-sb-officials-panel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 6px 16px;
}
.achv-sb-officials-panel__row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.achv-sb-officials-panel__label {
    flex: 0 0 60px;
    font-weight: 700;
    color: #0284c7;       /* sky-600 — 라이트 테마용 (기록지 표 #7dd3fc 대비 가독성) */
    text-align: center;
}
.achv-sb-officials-panel__value {
    flex: 1;
    color: var(--achv-text, #1e293b);
}

/* --- Box Score: Key Players Section --- */
.achv-sb-key-players {
    margin-bottom: 12px;
}

.achv-sb-section-title--sm {
    font-size: 14px;
    margin: 12px 0 6px;
    border-bottom-width: 1px;
    padding-bottom: 4px;
}

.achv-sb-key-players__list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.achv-sb-key-player-card {
    flex: 1;
    min-width: 130px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.achv-sb-key-player-card__role {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

.achv-sb-key-player-card__role--batter { color: #f59e0b; }
.achv-sb-key-player-card__role--pitcher { color: #3b82f6; }

.achv-sb-key-player-card__name {
    font-weight: 700;
    font-size: 15px;
}

.achv-sb-key-player-card__stats {
    font-size: 13px;
    color: #374151;
    margin-top: 4px;
}

.achv-sb-key-player-card__highlight {
    font-size: 18px;
    font-weight: 800;
    color: #e60200;
    margin-top: 2px;
}

/* ============================================================
 * Box Score: 양팀 간이기록 (타격 / 투수 테이블)
 * ============================================================ */

/* 표 wrapper — 가로 스크롤 + iOS 관성 */
.achv-sb-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    margin-bottom: var(--achv-sp-4);
    border-radius: 6px;
    border: 1px solid var(--achv-border);
}

/* 타입별 modifier — 표 layout fixed + tabular numerics 통일 */
.achv-sb-stats-table--batting,
.achv-sb-stats-table--pitching {
    table-layout: fixed;
    width: 100%;
    font-size: 14px;
}
.achv-sb-stats-table--pitching {
    white-space: nowrap;
}

/* --- 컬럼 너비 (colgroup) --- */
/* 타격 */
.achv-sb-col--bo   { width: 38px; }
.achv-sb-col--pos  { width: 38px; }
.achv-sb-col--name { width: 96px; }
.achv-sb-col--inn  { width: 56px; }
.achv-sb-col--stat { width: 40px; }
.achv-sb-col--rate { width: 50px; }
/* 투수 */
.achv-sb-col--decision { width: 44px; }
.achv-sb-col--ip       { width: 48px; }

/* --- 헤더 셀 정렬 (좌측 고정 컬럼) --- */
.achv-sb-th--name { text-align: left !important; }
.achv-sb-th--bo,
.achv-sb-th--pos { font-size: 14px; color: var(--achv-text-muted); }

/* --- 타격 행 셀 --- */
.achv-sb-batting__bo {
    text-align: center;
    color: #9ca3af;
}
.achv-sb-batting__pos {
    text-align: center;
    font-weight: 600;
    color: var(--achv-text-dim);
}
.achv-sb-batting__name {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.achv-sb-batting__name a { color: inherit; }
.achv-sb-batting__name small {
    color: #9ca3af;
    margin-left: 2px;
}

/* 이닝 셀: 결과 텍스트 (기존 break-all → 더 부드러운 break-word) */
.achv-sb-batting__inn-cell {
    font-size: 13px;
    overflow-wrap: break-word;
    line-height: 1.35;
}
.achv-sb-batting__inn-cell--empty { color: #d1d5db; }

/* 교체 선수 행 — 좌측 액센트로 시각적 indent */
.achv-sb-batting__sub-row {
    color: var(--achv-text-dim);
    font-style: italic;
}
.achv-sb-batting__sub-row .achv-sb-batting__name { padding-left: 18px !important; position: relative; }
.achv-sb-batting__sub-row .achv-sb-batting__name::before {
    content: '↳';
    position: absolute;
    left: 6px;
    color: var(--achv-text-muted);
    font-style: normal;
}

/* 멀티히트(3안타+) 행 강조 — 본 규칙은 아래 specificity 보강 버전에서 처리 */
.achv-sb-batting__row--multihit:hover { background: #fde68a !important; }

/* 합계 행 */
.achv-sb-batting__total-row {
    font-weight: 700;
    background: var(--achv-surface) !important;
    border-top: 2px solid var(--achv-text);
}
.achv-sb-batting__total-row td { border-bottom: none; }
.achv-sb-batting__total-label { text-align: left; }

/* --- 투수 행 셀 --- */
.achv-sb-pitching__name {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 결과(W/L/SV/HLD) 행 좌측 액센트 + 미세 배경 — :nth-child(even) 보다 우선 적용 */
.achv-sb-stats-table--pitching tbody tr.achv-sb-pitching__row--win {
    background: linear-gradient(90deg, #d1fae5 0, #f0fdf4 8px, transparent 8px);
}
.achv-sb-stats-table--pitching tbody tr.achv-sb-pitching__row--loss {
    background: linear-gradient(90deg, #fee2e2 0, #fef2f2 8px, transparent 8px);
}
.achv-sb-stats-table--pitching tbody tr.achv-sb-pitching__row--save {
    background: linear-gradient(90deg, #fef3c7 0, #fffbeb 8px, transparent 8px);
}
.achv-sb-stats-table--pitching tbody tr.achv-sb-pitching__row--hold {
    background: linear-gradient(90deg, #ddd6fe 0, #f5f3ff 8px, transparent 8px);
}
/* 멀티히트 행도 :nth-child(even) 보다 우선 */
.achv-sb-stats-table--batting tbody tr.achv-sb-batting__row--multihit {
    background: #fef9c3;
}

/* HLD 셀 색 */
.achv-sb-stats-table .achv-sb-td--hold {
    color: #7c3aed;
    font-weight: 700;
}

/* --- 모바일: 좌측 컬럼 sticky (가로 스크롤 시 선수 식별 유지) --- */
@media (max-width: 768px) {
    /* 타격: 타순(28) + 포지션(32) + 선수(96) — 총 156px 좌측 고정 */
    .achv-sb-stats-table--batting tbody td.achv-sb-batting__bo,
    .achv-sb-stats-table--batting thead th.achv-sb-th--bo {
        position: sticky; left: 0; z-index: 2;
        background: var(--achv-bg);
    }
    .achv-sb-stats-table--batting tbody td.achv-sb-batting__pos,
    .achv-sb-stats-table--batting thead th.achv-sb-th--pos {
        position: sticky; left: 38px; z-index: 2;
        background: var(--achv-bg);
    }
    .achv-sb-stats-table--batting tbody td.achv-sb-batting__name,
    .achv-sb-stats-table--batting thead th.achv-sb-th--name {
        position: sticky; left: 76px; z-index: 2;
        background: var(--achv-bg);
        box-shadow: 1px 0 0 0 var(--achv-border);
    }
    /* 짝수행/헤더는 다른 배경 — sticky 시 그 배경 유지 */
    .achv-sb-stats-table--batting thead th.achv-sb-th--bo,
    .achv-sb-stats-table--batting thead th.achv-sb-th--pos,
    .achv-sb-stats-table--batting thead th.achv-sb-th--name { background: var(--achv-surface); z-index: 3; }
    .achv-sb-stats-table--batting tbody tr:nth-child(even) td.achv-sb-batting__bo,
    .achv-sb-stats-table--batting tbody tr:nth-child(even) td.achv-sb-batting__pos,
    .achv-sb-stats-table--batting tbody tr:nth-child(even) td.achv-sb-batting__name { background: var(--achv-surface); }
    .achv-sb-stats-table--batting .achv-sb-batting__row--multihit td.achv-sb-batting__bo,
    .achv-sb-stats-table--batting .achv-sb-batting__row--multihit td.achv-sb-batting__pos,
    .achv-sb-stats-table--batting .achv-sb-batting__row--multihit td.achv-sb-batting__name { background: #fef9c3; }
    .achv-sb-stats-table--batting .achv-sb-batting__total-row td { background: var(--achv-surface) !important; }

    /* 투수: 선수 컬럼 좌측 고정 */
    .achv-sb-stats-table--pitching tbody td.achv-sb-pitching__name,
    .achv-sb-stats-table--pitching thead th.achv-sb-th--name {
        position: sticky; left: 0; z-index: 2;
        background: var(--achv-bg);
        box-shadow: 1px 0 0 0 var(--achv-border);
    }
    .achv-sb-stats-table--pitching thead th.achv-sb-th--name { background: var(--achv-surface); z-index: 3; }
    .achv-sb-stats-table--pitching tbody tr:nth-child(even) td.achv-sb-pitching__name { background: var(--achv-surface); }
}

/* --- Box Score: Validation Warning --- */
.achv-sb-validation {
    margin-top: 16px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.achv-sb-validation__title {
    margin: 0 0 6px;
    font-size: 13px;
    color: #dc2626;
}

.achv-sb-validation__list {
    margin: 0;
    padding-left: 16px;
    font-size: 13px;
    color: #dc2626;
}

/* --- Box Score: Bottom Nav --- */
.achv-sb-bottom-nav {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.achv-sb-bottom-nav__copy-btn {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

/* --- Responsive: Tablet+ --- */
@media (min-width: 768px) {
    .achv-sb-game-card__team {
        min-width: 140px;
    }

    .achv-sb-game-card__score {
        font-size: 24px;
    }
}

/* =============================================================
   Play-by-Play Timeline — 통합 UI (achv-tl__*, 밝은 테마)
   ============================================================= */
.achv-tl__empty {
    font-size: 13px;
    color: var(--achv-text-muted, #6b7280);
    text-align: center;
    padding: 16px 0;
}

.achv-tl__inning {
    margin-bottom: 2px;
}
.achv-tl__inning-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--achv-surface-alt, #f3f4f6);
    border-radius: var(--achv-radius-sm, 4px);
    color: var(--achv-text, #1f2937);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
    list-style: none;
}
.achv-tl__inning-header::-webkit-details-marker { display: none; }
.achv-tl__inning--top > .achv-tl__inning-header { border-left: 3px solid #f59e0b; }
.achv-tl__inning--bot > .achv-tl__inning-header { border-left: 3px solid #22c55e; }
.achv-tl__inning-header:hover { background: var(--achv-surface-dim, #e5e7eb); }

.achv-tl__inning-label { font-weight: 700; }
.achv-tl__inning-now {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}
.achv-tl__inning-count {
    font-size: 13px;
    color: var(--achv-text-muted, #6b7280);
    margin-left: auto;
}
.achv-tl__inning-body { padding: 2px 0 4px; }

/* 타석 항목 */
.achv-tl__entry {
    padding: 8px 10px;
    border-bottom: 1px solid var(--achv-border, #e5e7eb);
}
.achv-tl__entry:last-child { border-bottom: none; }

.achv-tl__entry-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.achv-tl__batter {
    font-weight: 700;
    color: var(--achv-text, #1f2937);
    font-size: 13px;
}
.achv-tl__result {
    font-weight: 700;
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: var(--achv-text, #1f2937);
    white-space: nowrap;
}
.achv-tl__result--hit { color: #16a34a; background: rgba(34,197,94,0.12); }
.achv-tl__result--out { color: #dc2626; background: rgba(239,68,68,0.1); }
.achv-tl__result--walk { color: #2563eb; background: rgba(59,130,246,0.12); }

.achv-tl__score {
    font-weight: 700;
    font-size: 13px;
    color: #d97706;
    background: rgba(251,191,36,0.12);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: auto;
}

/* 투구 시퀀스 */
.achv-tl__pitches { margin-top: 4px; padding-left: 4px; }
.achv-tl__pitch-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
    font-size: 13px;
}
.achv-tl__pitch-num {
    color: var(--achv-text-muted, #6b7280);
    min-width: 20px;
    font-size: 13px;
}
.achv-tl__pitch {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    background: #f3f4f6;
    color: var(--achv-text-muted, #6b7280);
}
.achv-tl__pitch--b { background: rgba(34,197,94,0.12); color: #16a34a; }
.achv-tl__pitch--s { background: rgba(249,115,22,0.12); color: #ea580c; }
.achv-tl__pitch--bat { background: rgba(59,130,246,0.12); color: #2563eb; }
.achv-tl__pitch--ev { background: rgba(234,179,8,0.12); color: #ca8a04; }

/* 주자 */
.achv-tl__runners { margin-top: 4px; padding-left: 4px; }
.achv-tl__runner {
    font-size: 13px;
    color: var(--achv-text-muted, #6b7280);
    padding: 1px 0;
}

/* 교체 이벤트 */
.achv-tl__subst {
    border-left: 3px solid #8b5cf6;
    background: rgba(139,92,246,0.06);
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 4px;
}
.achv-tl__subst-title {
    font-size: 13px;
    color: #7c3aed;
    font-weight: 600;
}
.achv-tl__subst-desc {
    font-size: 12px;
    color: var(--achv-text-muted, #6b7280);
}

/* =============================================================
   박스스코어 표 — 숫자 칸 오른쪽 정렬 (2026-09-18 UI 통일)
   이닝별 결과 칸(1~9)은 짧은 한글 표기라 가운데를 유지한다.
   ⚠ 이닝 점수판(.achv-sb-innings__table)과 기록지 SVG 는 야구 기록지 관례라 손대지 않는다.
   ============================================================= */
.achv-sb-stats-table--batting td:nth-last-child(-n+7),
.achv-sb-stats-table--batting th:nth-last-child(-n+7) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.achv-sb-stats-table--pitching td:nth-child(n+3),
.achv-sb-stats-table--pitching th:nth-child(n+3) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* 선수 이름은 줄바꿈하지 않는다 — 표는 가로 스크롤 안에 있다 */
.achv-sb-stats-table td:nth-child(3),
.achv-sb-lineup-table td:nth-child(2) {
    white-space: nowrap;
}
