/* =============================================
   Baseball Scorecard — フロントエンドスタイル
   ============================================= */

.bsc-scorecard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    max-width: 700px;
    margin: 1.5rem auto;
    color: #111827;
    box-sizing: border-box;
}
.bsc-scorecard *, .bsc-scorecard *::before, .bsc-scorecard *::after {
    box-sizing: border-box;
}

/* メタバー */
.bsc-meta-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}
.bsc-series { font-size: 12px; color: #6B7280; }
.bsc-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

/* メインスコア */
.bsc-main-score {
    display: flex !important;
    align-items: center;
    justify-content: space-around;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 1.25rem 1rem;
    margin-bottom: 12px;
    gap: 8px;
}
.bsc-team-block { text-align: center; flex: 1; }
.bsc-team-logo {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex !important; align-items: center; justify-content: center;
    font-size: 22px;
    margin: 0 auto 8px;
}
.bsc-team-abbr { font-size: 15px; font-weight: 600; }
.bsc-team-name { font-size: 11px; color: #6B7280; margin-top: 2px; }
.bsc-score-center {
    display: flex !important;
    align-items: center;
    gap: 10px;
}
.bsc-score-num { font-size: 52px; font-weight: 600; line-height: 1; }
.bsc-score-vs  { font-size: 14px; color: #9CA3AF; }

/* セクション共通 */
.bsc-section {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 10px;
}
.bsc-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

/* ─── スコアボード（テーブル干渉対策：div+flexで完全再現）─── */
.bsc-sb-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bsc-sb-table { min-width: 100%; }
.bsc-sb-row {
    display: flex !important;
    align-items: stretch;
    border-bottom: 1px solid #F3F4F6;
}
.bsc-sb-row:last-child { border-bottom: none; }
.bsc-sb-head { background: transparent; }
.bsc-sb-cell {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 6px 4px !important;
    font-size: 12px;
    min-width: 28px;
    flex-shrink: 0;
    color: #374151;
    border: none !important;
    background: transparent !important;
}
.bsc-sb-cell-team {
    min-width: 70px;
    max-width: 120px;
    flex: 0 0 auto;
    justify-content: flex-start !important;
    font-weight: 600;
    font-size: 13px;
    padding-left: 0 !important;
}
.bsc-sb-cell-head {
    font-size: 11px;
    color: #9CA3AF;
    font-weight: 500;
}
.bsc-sb-cell-sep {
    border-left: 1px solid #E5E7EB !important;
    font-weight: 700;
    min-width: 32px;
}
.bsc-sb-cell-score-on  { font-weight: 700; }
.bsc-sb-cell-score-off { color: #9CA3AF; }

/* ─── ラインナップ ─── */
.bsc-lineup-wrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.bsc-lineup-header {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.bsc-dot { display: inline-block !important; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ラインナップテーブル — tr/td/th を強制的にテーブル表示 */
.bsc-scorecard .bsc-lineup-table {
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    display: table !important;
    table-layout: fixed !important;
}
.bsc-scorecard .bsc-lineup-table thead { display: table-header-group !important; }
.bsc-scorecard .bsc-lineup-table tbody { display: table-row-group !important; }
.bsc-scorecard .bsc-lineup-table tr {
    display: table-row !important;
    background: transparent !important;
}
.bsc-scorecard .bsc-lineup-table tr th,
.bsc-scorecard .bsc-lineup-table tr td {
    display: table-cell !important;
    text-align: left !important;
    padding: 5px 4px !important;
    border: none !important;
    border-bottom: 1px solid #F9FAFB !important;
    background: transparent !important;
    vertical-align: middle !important;
    word-break: normal !important;
    width: auto !important;
    font-size: 12px !important;
    color: #374151 !important;
    white-space: nowrap;
}
.bsc-scorecard .bsc-lineup-table tr th {
    font-size: 10px !important;
    color: #9CA3AF !important;
    font-weight: 500 !important;
    border-bottom: 1px solid #F3F4F6 !important;
}
.bsc-scorecard .bsc-lineup-table th:first-child { width: 20px !important; min-width: 20px !important; max-width: 20px !important; text-align: center !important; padding: 4px 2px !important; }
.bsc-scorecard .bsc-lineup-table th:nth-child(2) { width: 40px !important; min-width: 40px !important; max-width: 50px !important; padding: 4px 3px !important; }
.bsc-scorecard .bsc-lineup-table th:nth-child(3) { width: auto; }
.bsc-scorecard .bsc-lineup-table td:first-child { width: 20px !important; min-width: 20px !important; max-width: 20px !important; text-align: center !important; color: #9CA3AF !important; padding: 5px 2px !important; }
.bsc-scorecard .bsc-lineup-table td:nth-child(2) { width: 40px !important; min-width: 40px !important; max-width: 50px !important; padding: 5px 3px !important; }
.bsc-scorecard .bsc-lineup-table td:nth-child(3) { width: auto; white-space: normal; word-break: break-all; }

.bsc-scorecard .bsc-pitcher-sep td {
    border-top: 1px solid #E5E7EB !important;
    border-bottom: none !important;
    padding: 0 !important;
    height: 6px !important;
    background: transparent !important;
}
.bsc-pos-badge {
    display: inline-block !important;
    font-size: 11px !important;
    padding: 1px 5px !important;
    border-radius: 3px;
    font-weight: 500;
    white-space: nowrap;
}

/* 投手成績 */
.bsc-pitcher-wrap { display: flex !important; gap: 10px; flex-wrap: wrap; }
.bsc-pitcher-card { flex: 1; min-width: 100px; background: #F9FAFB; border-radius: 8px; padding: 10px 12px; }
.bsc-pitcher-role { font-size: 11px; color: #6B7280; margin-bottom: 4px; }
.bsc-pitcher-name { font-size: 13px; font-weight: 600; }
.bsc-pitcher-stat { font-size: 12px; color: #6B7280; margin-top: 2px; }

/* ハイライト */
.bsc-highlight-item {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid #F3F4F6;
    font-size: 13px;
}
.bsc-highlight-item:last-child { border-bottom: none; }
.bsc-inn-tag { font-size: 11px; color: #9CA3AF; min-width: 36px; flex-shrink: 0; }
.bsc-type-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 500; white-space: nowrap; flex-shrink: 0; }
.bsc-highlight-desc { flex: 1; }

/* 試合情報グリッド */
.bsc-info-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; }
.bsc-info-label { display: block !important; font-size: 11px; color: #9CA3AF; margin-bottom: 2px; }

/* 注意書き */
.bsc-notice { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin: 10px 0; line-height: 1.6; }

/* エラー */
.bsc-error { color: #DC2626; font-size: 13px; padding: 8px; }

/* ─── レスポンシブ ─── */
@media (max-width: 520px) {
    .bsc-score-num { font-size: 36px; }
    .bsc-main-score { padding: 1rem 0.75rem; }
    .bsc-lineup-wrap { grid-template-columns: 1fr !important; }
    .bsc-info-grid { grid-template-columns: 1fr !important; }
    .bsc-scorecard .bsc-lineup-table tr th,
    .bsc-scorecard .bsc-lineup-table tr td { font-size: 12px !important; padding: 5px 3px !important; }
}
