@import url("./design-tokens.css");

        /* ── Summary dashboard cards ── */
        :root {
            /* 레이아웃 오버라이드 */
            --card-width: 100%;
            --card-max-width: 1200px;
            --card-padding: 4px;
            --card-margin: 0 auto 4px auto;
            --card-background: rgba(255, 255, 255, 0.98);
            --card-backdrop-filter: blur(8px);
        }

        .summary-dashboard {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 12px;
            margin-bottom: 30px;
            min-height: auto;
            width: 100%;
            max-width: var(--card-max-width);
            margin-left: auto;
            margin-right: auto;
        }
        .summary-card {
            background: var(--bg-secondary);
            border-radius: 12px;
            padding: 18px 16px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
            text-align: center;
            transition: all 0.3s ease;
            cursor: pointer;
            min-height: 120px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        .summary-card:first-child {
            background: var(--card-background);
            backdrop-filter: var(--card-backdrop-filter);
            box-shadow: var(--card-shadow);
        }
        .summary-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        /* ── Game tab buttons ── */
        .game-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 18px;
            border-bottom: 1px solid #e5e7eb;
        }
        .game-tab-btn {
            padding: 10px 16px;
            background: none;
            border: none;
            color: #64748b;
            font-weight: 600;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
        }
        .game-tab-btn.active {
            color: #1e293b;
            border-bottom-color: #3b82f6;
        }
        .game-heading {
            color: #1e293b;
            font-size: 20px;
            margin-bottom: 18px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .game-heading .date-badge {
            font-size: 14px;
            color: #64748b;
            font-weight: normal;
            background: #f1f5f9;
            padding: 4px 10px;
            border-radius: 20px;
        }

        /* ── Period toggle button ── */
        .period-toggle-btn {
            background: linear-gradient(135deg, #28a745, #34ce57);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
            min-width: 220px;
            justify-self: center;
        }
        .period-toggle-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
        }

        /* ── Feedback button ── */
        .feedback-btn {
            display: inline-block;
            color: white;
            text-decoration: none;
            padding: 12px 24px;
            background: var(--primary-color);
            border-radius: 8px;
            transition: all 0.3s ease;
            font-weight: 500;
            box-shadow: 0 2px 8px rgba(26, 35, 126, 0.2);
        }
        .feedback-btn:hover {
            background: var(--primary-hover, #152080);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
        }

        /* CSS 리셋 및 기본 스타일 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        h3 {
            font-size: 1rem;
            font-weight: 400;
        }

        html {
            width: 100%;
            height: 100%;
        }

        body {
            font-family: 'Noto Sans KR', sans-serif;
            background: #f5f7fa;
            color: #333;
            line-height: 1.6;
            min-height: 100vh;
            width: 100%;
            margin: 0;
            padding: 0;
        }
        
        /* 승률별 색상 클래스 - 원래 녹색 테마 */
        .rate-excellent { background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c8 100%) !important; color: #2e7d32; font-weight: 600; }
        .rate-very-good { background: linear-gradient(135deg, #f1f8e9 0%, #dcedc8 100%) !important; color: #4caf50; font-weight: 600; }  
        .rate-good { background: linear-gradient(135deg, #f9fbe7 0%, #e6ee9c 100%) !important; color: #689f38; font-weight: 500; }
        .rate-decent { background: linear-gradient(135deg, #fefefe 0%, #f5f5f5 100%) !important; color: #666; font-weight: 500; }
        .rate-average { background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%) !important; color: #e65100; font-weight: 500; }
        .rate-below { background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%) !important; color: #f57c00; font-weight: 500; }
        .rate-poor { background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%) !important; color: #d32f2f; font-weight: 600; }
        .rate-very-poor { background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%) !important; color: #c2185b; font-weight: 600; }
        
        /* 시나리오 매트릭스 테이블 스타일 */
        .scenario-row:hover {
            background: rgba(76, 175, 80, 0.05) !important;
        }
        
        .win-rate-cell {
            transition: all 0.2s ease;
            border: 1px solid #dee2e6 !important;
        }
        
        .win-rate-cell:hover {
            box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
            z-index: 10;
            position: relative;
        }
        
        /* 매트릭스 헤더 스타일 */
        .matrix-header th {
            position: sticky;
            top: 0;
            z-index: 100;
            background: inherit !important;
        }
        
        /* 시나리오 매트릭스 스크롤바 스타일 */
        .scenario-matrix-container::-webkit-scrollbar {
            height: 8px;
            width: 8px;
        }
        
        .scenario-matrix-container::-webkit-scrollbar-track {
            background: #f5f5f5;
            border-radius: 4px;
        }
        
        .scenario-matrix-container::-webkit-scrollbar-thumb {
            background: #4caf50;
            border-radius: 4px;
        }
        
        .scenario-matrix-container::-webkit-scrollbar-thumb:hover {
            background: #388e3c;
        }
        
        /* 기본 레이아웃 */
        body {
            width: 100%;
            margin: 0;
            padding: 0;
        }
        
        .container {
            width: var(--card-width);
            max-width: var(--card-max-width);
            margin: 0 auto;
            padding: 0 20px;
            box-sizing: border-box;
        }
        
        /* 모바일에서 경우의 수 표 최적화 */
        @media (max-width: 768px) {
            body {
                max-width: 100vw !important;
            }
            
            .container {
                padding: 0 10px !important;
            }
            
            .scenario-section {
                max-width: 100% !important;
            }
            
            /* PC와 동일한 테이블 뷰 유지 - 모바일에서도 스크롤 가능 */
            #scenario-content {
                overflow-x: auto !important;
                -webkit-overflow-scrolling: touch !important;
                margin: 15px -10px !important; /* 좌우 마진 확장하여 스크롤 영역 확보 */
                padding: 0 10px !important;
                position: relative !important;
            }
            
            .scenario-matrix-container {
                overflow-x: auto !important;
                -webkit-overflow-scrolling: touch !important;
                margin: 0 -10px !important;
                padding: 0 10px !important;
                position: relative !important;
                border-radius: 12px !important;
                border: 1px solid #e0e0e0 !important;
                box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
                max-height: 80vh !important;
                background: white !important;
            }
            
            /* 경우의수 테이블을 PC와 동일한 스타일로 */
            .scenario-matrix-table {
                min-width: 100% !important;
                font-size: 0.75rem !important;
                border-collapse: collapse !important;
                width: 100% !important;
                background: white !important;
            }
            
            .scenario-matrix-table th,
            .scenario-matrix-table td {
                padding: 2px 1px !important;
                font-size: 0.7rem !important;
                border: 1px solid #dee2e6 !important;
                white-space: nowrap !important;
                text-align: center !important;
                color: #333 !important;
                line-height: 1.2 !important;
            }
            
            .scenario-matrix-table th {
                background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%) !important;
                color: white !important;
                font-weight: 600 !important;
                text-transform: none !important;
                letter-spacing: normal !important;
                border: 1px solid rgba(255, 255, 255, 0.2) !important;
                font-size: 0.7rem !important;
            }
            
            /* 모든 헤더 셀 기본 스타일 */
            .scenario-matrix-table thead th {
                padding: 2px 1px !important;
                font-size: 0.7rem !important;
                text-align: center !important;
                line-height: 1.2 !important;
                border: 1px solid rgba(255, 255, 255, 0.2) !important;
            }
            
            /* LG 헤더 색상 강제 적용 (2번째, 3번째 컬럼) */
            .scenario-matrix-table thead tr th:nth-child(2),
            .scenario-matrix-table thead tr th:nth-child(3) {
                background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%) !important;
                color: white !important;
            }
            
            /* 팀별 헤더 배경색 강제 적용 */
            .scenario-matrix-table thead tr th[colspan="2"] {
                background: linear-gradient(135deg, rgba(233, 236, 239, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%) !important;
            }
            
            .scenario-matrix-table th:last-child {
                border-right: none !important;
            }
            
            .scenario-matrix-table td {
                border-bottom: 1px solid #e2e8f0 !important;
            }
            
            /* 첫 번째 컬럼이 아닌 데이터 셀들의 기본 색상 */
            .scenario-matrix-table tbody tr td:not(:nth-child(1)) {
                color: #333 !important;
            }
            
            /* 모든 팀 컬럼에 일관된 스타일 적용 (LG 포함) - 명시적으로 비스티키 */
            .scenario-matrix-table tbody tr td:nth-child(2),
            .scenario-matrix-table tbody tr td:nth-child(3),
            .scenario-matrix-table tbody tr td:nth-child(4),
            .scenario-matrix-table tbody tr td:nth-child(5),
            .scenario-matrix-table tbody tr td:nth-child(6),
            .scenario-matrix-table tbody tr td:nth-child(7),
            .scenario-matrix-table tbody tr td:nth-child(8),
            .scenario-matrix-table tbody tr td:nth-child(9),
            .scenario-matrix-table tbody tr td:nth-child(10),
            .scenario-matrix-table tbody tr td:nth-child(11) {
                padding: 2px 1px !important;
                font-size: 0.7rem !important;
                border: 1px solid #dee2e6 !important;
                line-height: 1.2 !important;
                color: inherit !important; /* 승률별 색상 클래스 유지 */
                position: static !important; /* 명시적으로 비스티키 */
                left: auto !important;
                z-index: auto !important;
                box-shadow: none !important;
            }
            
            .scenario-matrix-table tr:hover {
                background: rgba(76, 175, 80, 0.05) !important;
            }
            
            /* 데이터 셀 색상 표시를 위해 배경 제거 */
            .scenario-matrix-table tbody tr:nth-child(even),
            .scenario-matrix-table tbody tr:nth-child(odd) {
                background-color: transparent !important;
            }
            
            .scenario-matrix-table tbody tr:nth-child(even) td,
            .scenario-matrix-table tbody tr:nth-child(odd) td {
                background-color: transparent !important;
            }
            
            /* 데이터 셀이 원래 색상을 유지하도록 */
            .win-rate-cell {
                padding: 2px 1px !important;
                font-size: 0.7rem !important;
                min-width: auto !important;
                background-color: inherit !important;
                color: inherit !important; /* 승률별 색상 클래스의 텍스트 색상 유지 */
                line-height: 1.2 !important;
                transition: all 0.2s ease !important;
                border: 1px solid #dee2e6 !important;
            }
            
            /* 좌측 첫 번째 컬럼만 스티키 스타일 유지 - 데이터 행만 */
            .scenario-matrix-table tbody tr td:nth-child(1) {
                background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
                color: #2E7D32 !important;
                position: sticky !important;
                left: 0 !important;
                z-index: 20 !important;
                box-shadow: 2px 0 6px rgba(0,0,0,0.15) !important;
                font-weight: 700 !important;
                min-width: 70px !important;
                width: 70px !important;
                border-right: 2px solid rgba(46, 125, 50, 0.2) !important;
                font-size: 0.8rem !important;
            }
            
            /* LG 컬럼들과 다른 팀 컬럼들은 명시적으로 비스티키 */
            .scenario-matrix-table tbody tr td:nth-child(n+2) {
                position: static !important;
                left: auto !important;
                z-index: auto !important;
                box-shadow: none !important;
            }
            
            /* 모바일에서 스크롤 힌트 */
            .scenario-section::after {
                content: "← 좌우로 스크롤하여 더 많은 데이터를 확인하세요 →";
                display: block;
                text-align: center;
                font-size: 11px;
                color: #666;
                margin-top: 10px;
                font-style: italic;
            }
        }
        
        /* 🎲 우승 & 포스트시즌 경우의 수 섹션 통합 스타일 */
        .scenario-section {
            position: relative;
        }
        
        .scenario-bg-accent {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 6px;
            background: linear-gradient(90deg, #4CAF50, #66BB6A);
            opacity: 0.8;
        }
        
        .scenario-section h2 {
            color: #2E7D32;
            text-shadow: 0 1px 2px rgba(46, 125, 50, 0.1);
            margin-top: 15px;
        }
        
        #scenario-content {
            overflow-x: auto;
            margin: 20px 0;
            position: relative;
        }
        
        /* 테이블 스티키 헤더 수정 */
        .scenario-matrix-container {
            position: relative !important;
        }
        
        .scenario-legend {
            background: #f8f9fa;
            padding: 12px 15px;
            border-radius: 6px;
            margin-top: 15px;
            border-left: 3px solid #4CAF50;
            font-size: 13px;
        }
        
        .scenario-legend h3 {
            margin: 0 0 10px 0;
            color: #2E7D32;
            font-weight: 600;
            font-size: 14px;
        }
        
        .scenario-legend .grid-layout {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        
        /* 1200px 최적화: 모바일에서는 1열로 */
        @media (max-width: 768px) {
            .scenario-legend .grid-layout,
            .championship-stats-grid {
                grid-template-columns: 1fr !important;
                gap: 10px !important;
            }
        }
        
        .scenario-button-area {
            margin-top: 15px;
            padding: 12px;
            background: #e8f5e9;
            border-radius: 6px;
            text-align: center;
            border: 1px solid #c8e6c9;
        }
        
        .scenario-button-area .button-description {
            color: #2E7D32;
            font-size: 13px;
            margin-bottom: 8px;
        }
        
        .scenario-full-view-button {
            padding: 10px 20px;
            background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
            white-space: nowrap;
        }
        /* === Magic/Tragic Matrix: uniform row height (high-specificity) === */
        #magicMatrixContent .magic-matrix-table { table-layout: fixed !important; width: 100%; }
        #magicMatrixContent .magic-matrix-table tbody tr { height: 28px !important; }
        #magicMatrixContent .magic-matrix-table tbody td {
          padding-top: 2px !important;
          padding-bottom: 2px !important;
          line-height: 24px !important; /* 28px row - 2px*2 padding = 24 */
          vertical-align: middle !important;
          white-space: nowrap !important;
          overflow: hidden !important;
          text-overflow: ellipsis !important;
        }

        /* === Scenario Table 클래스 기반 스타일 === */
        .scenario-table-compact { 
          table-layout: auto; 
          width: 100%; 
          border-collapse: collapse;
          border-spacing: 0;
        }
        .scenario-table-compact tbody tr { 
          height: auto;
          min-height: 14px;
        }
        .scenario-table-compact tbody td {
          padding: 1px 2px;
          line-height: 1;
          vertical-align: middle;
          white-space: nowrap;
          overflow: visible;
          text-overflow: clip;
          border-spacing: 0;
          min-width: auto;
        }
        
        /* 특정 열들의 최소 너비 보장 */
        .scenario-table-compact .team-column {
          min-width: 60px;
          width: auto;
        }
        .scenario-table-compact .record-column {
          min-width: 80px;
          width: auto;
        }
        .scenario-table-compact .percentage-column {
          min-width: 50px;
          width: auto;
        }
        
        /* 시나리오 테이블 헤더 스타일 */
        .scenario-table-compact thead {
          position: sticky;
          top: 0;
          z-index: 100;
        }
        
        .scenario-table-compact thead th {
          padding: 4px 6px;
          text-align: center;
          font-weight: 600;
          position: sticky;
          top: 0;
          z-index: 100;
        }
        
        /* 첫 번째 열 (고정 열) */
        .scenario-table-compact .sticky-left {
          position: sticky;
          left: 0;
          z-index: 110;
          min-width: 70px;
          width: 70px;
          background: inherit;
          border-right: 2px solid rgba(255,255,255,0.4);
          font-size: 0.7rem;
        }
        
        /* 헤더 행 스타일 */
        .scenario-table-compact .header-rank {
          background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
          color: white;
        }
        
        .scenario-table-compact .header-team {
          background: linear-gradient(135deg, rgba(233, 236, 239, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
          font-weight: 700;
          font-size: 0.8rem;
          white-space: nowrap;
          line-height: 1.2;
          padding: 6px 4px 3px 4px;
        }
        
        .scenario-table-compact .header-team.playoff-border {
          border-right: 4px solid #FF6B35;
        }
        
        .scenario-table-compact .header-team.team-border {
          border-right: 2px solid rgba(255,255,255,0.5);
        }
        
        /* 데이터 행 스타일 */
        .scenario-table-compact .scenario-row td {
          font-size: 0.8rem;
          padding: 0px 2px;
          font-weight: 700;
          background: white;
          border: 1px solid #dee2e6;
          text-align: center;
          line-height: 1;
        }
        
        /* 왼쪽 고정 셀 (승률) */
        .scenario-table-compact .rate-cell {
          color: #2E7D32;
          position: sticky;
          left: 0;
          z-index: 5;
          width: 60px;
          box-shadow: 2px 0 4px rgba(0,0,0,0.1);
        }
        
        /* 팀 승률 셀 - 기존 tbody td 설정을 오버라이드 */
        .scenario-table-compact .wins-cell,
        .scenario-table-compact .final-cell {
          padding: 0px 1px;
          line-height: 1;
          white-space: nowrap;
          vertical-align: top;
        }
        
        /* 셀 내부 텍스트 */
        .scenario-table-compact .cell-main {
          font-size: 0.8rem;
          font-weight: 600;
          margin: 0;
          line-height: 1;
        }
        
        .scenario-table-compact .cell-sub {
          font-size: 0.7rem;
          margin: 0;
          line-height: 1;
        }
        
        /* Team cell: center the whole block with Flex (replaces grid) */
        #magicMatrixContent td.matrix-team-info {
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          text-align: center !important;
          gap: 0;
          white-space: nowrap;
          overflow: hidden;
        }
        /* merged cells should not push row height */
        #magicMatrixContent .magic-cell { font-weight: 600; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
        /* header keep natural size */
        #magicMatrixContent .magic-matrix-table thead th { white-space: nowrap; }

        /* --- Magic/Tragic Matrix: banner cells & inline normalization --- */
        /* === Magic/Tragic Matrix: center-align team column via CSS (no inline emphasis) === */
        #magicMatrixContent .magic-matrix-table th,
        #magicMatrixContent .magic-matrix-table td { text-align: center; }

        /* Brand color handled via data attribute; fall back to default if missing */
        #magicMatrixContent .matrix-team-name { color: var(--team-color, #333); font-weight: 800; }
        /* Optional: apply data attribute color using inline CSS var if present elsewhere */
        /* If you later set style="--team-color: <hex>" on the TD, this will pick up automatically. */

        #magicMatrixContent td.matrix-team-info .matrix-team-name {
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          text-align: center;
          font-weight: 700;
          font-size: 12px;
          line-height: 14px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        #magicMatrixContent td.matrix-team-info .matrix-team-status {
          display: block;
          font-size: 10px;
          line-height: 12px;
          color: #666;
          margin-top: 2px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        #magicMatrixContent td.matrix-team-info .team-logo-small {
          max-height: 20px !important;
          height: 20px !important;
          width: auto;
        }

        /* Ensure merged cells and data cells are centered */
        #magicMatrixContent .magic-cell { text-align: center; }
        #magicMatrixContent .rank-cell, #magicMatrixContent .matrix-header-main { text-align: center; }
        
        /* Prevent long team names from shifting layout */
        #magicMatrixContent .matrix-team-name-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        #magicMatrixContent .magic-matrix-table tbody td.banner-top,
        #magicMatrixContent .magic-matrix-table tbody td.banner-mid,
        #magicMatrixContent .magic-matrix-table tbody td.banner-low {
          padding: 2px 8px !important;
          line-height: 24px !important; /* row: 28px, vertical padding 2px * 2 */
          vertical-align: middle !important;
          white-space: nowrap !important;
          overflow: hidden !important;
          text-overflow: ellipsis !important;
          font-size: 15px !important;   /* ⬆ 더 크게 조정 */
          font-weight: 700 !important;  /* clearer banner text */
          letter-spacing: 0.2px !important;
        }

        @media (max-width: 768px) {
          #magicMatrixContent .magic-matrix-table tbody td.banner-top,
          #magicMatrixContent .magic-matrix-table tbody td.banner-mid,
          #magicMatrixContent .magic-matrix-table tbody td.banner-low {
            font-size: 14px !important; /* 모바일도 더 크게 */
            padding: 2px 6px !important;
          }
        }

        /* Ensure inline elements inside cells don't override line-height, except for matrix-team-info */
        #magicMatrixContent .magic-matrix-table tbody td:not(.matrix-team-info) * {
          line-height: inherit !important;
        }

        /* Prevent accidental multi-line in banner note */
        #magicMatrixContent .magic-matrix-table .banner-note {
          margin-left: 6px;
          opacity: 0.9;
          white-space: nowrap !important;
          display: inline-block;
        }

        /* Guard against oversized logos/images affecting row height */
        #magicMatrixContent .magic-matrix-table tbody td img,
        #magicMatrixContent .magic-matrix-table tbody td svg {
          max-height: 20px !important;
          height: 20px !important;
        }

        /* mobile tuning */
        @media (max-width: 768px) {
          #magicMatrixContent .magic-matrix-table tbody tr { height: 22px !important; }
          #magicMatrixContent .magic-matrix-table tbody td { line-height: 18px !important; }
          #magicMatrixContent .team-logo-small { max-height: 16px !important; height: 16px !important; }
          
          /* Scenario table mobile */
          .scenario-table-compact tbody tr { 
            height: auto; 
            min-height: 12px; 
          }
          .scenario-table-compact tbody td { 
            padding: 0px 1px;
            font-size: 0.75em;
            line-height: 0.9;
          }
          
          .scenario-table-compact .cell-main {
            font-size: 0.75rem;
          }
          
          .scenario-table-compact .cell-sub {
            font-size: 0.65rem;
          }
        }

        /* === Magic/Tragic specific cell styles (ensure tragic shows as light red) === */
        #magicMatrixContent .magic-cell.magic-danger,
        #magicMatrixContent .magic-cell.tragic {
          background: #ffd9dc !important; /* 연한 붉은색 */
          color: #b71c1c !important;
          border: 1px solid rgba(183, 28, 28, 0.25) !important;
          font-weight: 700 !important;
        }
        #magicMatrixContent .magic-cell.magic-impossible {
          background: #f1aeb5 !important; /* 진한 붉은색 계열 */
          color: #7f1d1d !important;
          border: 1px solid rgba(127, 29, 29, 0.5) !important;
          font-weight: 800 !important;
        }
        #magicMatrixContent .magic-cell.magic-safe {
          background: #d1fae5 !important; /* 매직(녹색) */
          color: #155724 !important;
          border: 1px solid rgba(21,87,36,0.2) !important;
        }
        #magicMatrixContent .magic-cell.confirmed,
        #magicMatrixContent .magic-cell.magic-confirmed {
          background: #a7f3d0 !important; /* 확보/확정 */
          color: #065f46 !important;
          border: 1px solid rgba(6,95,70,0.25) !important;
          font-weight: 800 !important;
        }
        #magicMatrixContent .magic-cell.magic-selflimit { /* 자력 불가(잔여경기 초과) 표시용 노랑 */
          background: #fff59d !important;
          color: #7c5e10 !important;
          border: 1px solid rgba(124,94,16,0.25) !important;
          font-weight: 700 !important;
        }
        /* Playoff divider (left border before rank 5) - 강화된 구분선 */
        #magicMatrixContent .magic-matrix-table .magic-cell.playoff-divider-left:not(.banner-top):not(.banner-mid):not(.banner-low) {
          border-left: 5px solid #ff5500 !important;
          box-shadow: inset 3px 0 8px rgba(255, 85, 0, 0.3) !important;
          position: relative !important;
        }
        
        /* 5위 열 헤더 강조 */
        #magicMatrixContent .magic-matrix-table thead th.playoff-rank-header {
          background: linear-gradient(135deg, #ff8c00 0%, #ff6600 100%) !important;
          border-left: 5px solid #ff5500 !important;
          position: relative !important;
          color: #fff !important;
          text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
        }
        
        /* 5위 열 배경색 제거 - 구분선만 유지 */
        
        /* 포스트시즌 진출선 표시 텍스트 - PS는 1~5위 */
        #magicMatrixContent .magic-matrix-table thead th.playoff-rank-header::after {
          content: 'PS ➡';
          position: absolute;
          right: -32px;
          top: 50%;
          transform: translateY(-50%);
          font-size: 11px;
          color: #ff5500;
          font-weight: 900;
          white-space: nowrap;
          text-shadow: 0 0 4px rgba(255, 85, 0, 0.4);
          z-index: 10;
        }

        /* Task 4: inline-style migration from magic-number/index.html */
        .championship-section .stat-card {
            background: linear-gradient(135deg, rgba(26, 35, 126, 0.02) 0%, rgba(57, 73, 171, 0.06) 100%);
            border: 1px solid rgba(26, 35, 126, 0.15);
            border-top: 3px solid rgba(26, 35, 126, 0.4);
            transition: all 0.3s ease;
        }

        .championship-section .stat-card:hover {
            border-top-color: rgba(26, 35, 126, 0.7);
            box-shadow: 0 4px 12px rgba(26, 35, 126, 0.15);
            transform: translateY(-2px);
        }

        .championship-section .stat-value {
            color: #1a237e;
            text-shadow: 0 1px 2px rgba(26, 35, 126, 0.1);
        }

        .championship-bg-accent {
            background: linear-gradient(90deg, var(--team-color, #1a237e), var(--team-secondary-color, #3949ab)) !important;
        }

        .championship-main-display {
            background: linear-gradient(135deg, 
                rgba(var(--team-color-rgb, 26, 35, 126), 0.04) 0%,
                rgba(var(--team-color-rgb, 57, 73, 171), 0.08) 50%,
                rgba(var(--team-color-rgb, 26, 35, 126), 0.04) 100%) !important;
            border-color: rgba(var(--team-color-rgb, 26, 35, 126), 0.2) !important;
            box-shadow: 0 4px 12px rgba(var(--team-color-rgb, 26, 35, 126), 0.1),
                        inset 0 1px 3px rgba(255, 255, 255, 0.5) !important;
        }

        .chart-nav {
            display: grid !important;
            grid-template-columns: 1fr auto 1fr !important;
            align-items: center !important;
        }

        @media (max-width: 768px) {
            .chart-nav {
                display: flex !important;
                flex-direction: column !important;
                gap: 8px !important;
            }

            .chart-nav > div {
                width: 100% !important;
                display: flex !important;
                justify-content: center !important;
            }

            .chart-nav button {
                width: 100% !important;
                max-width: 280px !important;
            }

            #periodToggle {
                min-width: unset !important;
            }
        }

        @media (max-width: 480px) {
            .chart-nav {
                padding: 8px 5px !important;
            }

            .chart-nav button {
                padding: 10px 16px !important;
                font-size: 13px !important;
            }

            #periodToggle {
                padding: 12px 20px !important;
            }
        }

        .inline-style-0 {
            margin-bottom: 8px; padding: 8px; background: rgba(255,255,255,0.1); border-radius: 6px; border: 1px solid rgba(255,255,255,0.2);
        }
        .inline-style-1 {
            font-size: 0.8rem; margin-bottom: 4px;
        }
        .inline-style-2 {
            font-size: 0.75rem; line-height: 1.4;
        }
        .inline-style-3 {
            margin-top: 6px;
        }
        .inline-style-4 {
            color: #ffd700; text-decoration: underline; font-size: 0.75rem; font-weight: 500;
        }
        .inline-style-5 {
            color: var(--primary-color);
        }
        .inline-style-6 {
            color: var(--success-color);
        }
        .inline-style-7 {
            color: var(--warning-color);
        }
        .inline-style-8 {
            color: var(--danger-color);
        }
        .inline-style-9 {
            width: 100%; margin: 0 auto; margin-top: 20px;
        }
        .inline-style-10 {
            margin-bottom: 20px; background: white; padding: 20px; border-radius: 12px; border: 1px solid #e5e7eb;
        }
        .inline-style-11 {
            display: block;
        }
        .inline-style-12 {
            display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
        }
        .inline-style-13 {
            text-align: center; color: #6b7280; padding: 20px; grid-column: 1 / -1;
        }
        .inline-style-14 {
            display: none;
        }
        .inline-style-15 {
            position: relative;
        }
        .inline-style-16 {
            position: absolute; top: 0; left: 0; right: 0; height: 6px; background: linear-gradient(90deg, #1a237e, #3949ab); opacity: 0.8;
        }
        .inline-style-17 {
            color: #1a237e; text-shadow: 0 1px 2px rgba(26, 35, 126, 0.1); margin-top: 15px;
        }
        .inline-style-18 {
            text-align: center; margin-bottom: 24px;
        }
        .inline-style-19 {
            position: relative; text-align: center; padding: 28px 20px; margin-bottom: 20px; background: linear-gradient(135deg, rgba(26, 35, 126, 0.04) 0%, rgba(57, 73, 171, 0.08) 50%, rgba(26, 35, 126, 0.04) 100%); border: 2px solid rgba(26, 35, 126, 0.2); border-radius: 16px; box-shadow: 0 4px 12px rgba(26, 35, 126, 0.1), inset 0 1px 3px rgba(255, 255, 255, 0.5); transition: all 0.3s ease;
        }
        .inline-style-20 {
            display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px;
        }
        .inline-style-21 {
            display: inline-block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); position: relative; animation: logoGlow 3s ease-in-out infinite alternate;
        }
        .inline-style-22 {
            margin: 0; font-weight: 700;
        }
        .inline-style-23 {
            text-align: center; margin-bottom: 20px;
        }
        .inline-style-24 {
            font-weight: 800; display: inline-block; animation: magicPulse 3s ease-in-out infinite;
        }
        .inline-style-25 {
            text-align: center; color: #555; line-height: 1.8;
        }
        .inline-style-26 {
            margin-bottom: 8px;
        }
        .inline-style-27 {
            color: #666;
        }
        .inline-style-28 {
            color: #1a237e; margin-left: 8px;
        }
        .inline-style-29 {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; margin-bottom: 20px;
        }
        .inline-style-30 {
            font-size: 0.95rem;
        }
        .inline-style-31 {
            font-size: 1.15rem;
        }
        .inline-style-32 {
            text-align: center; padding: 20px; background: linear-gradient(135deg, rgba(26, 35, 126, 0.08), rgba(57, 73, 171, 0.12)); border-radius: 16px; border: 2px solid rgba(26, 35, 126, 0.2); box-shadow: 0 4px 12px rgba(26, 35, 126, 0.1); position: relative; transition: all 0.3s ease;
        }
        .inline-style-33 {
            position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--team-color, #1a237e), var(--team-secondary-color, #3949ab));
        }
        .inline-style-34 {
            font-size: 0.9rem; color: #666; margin-bottom: 8px; font-weight: 500;
        }
        .inline-style-35 {
            font-weight: 700; color: var(--team-color, #1a237e); text-shadow: 0 1px 2px rgba(26, 35, 126, 0.1); font-size: 1.2rem;
        }
        .inline-style-36 {
            background: #f8f9fa; padding: 12px 15px; border-radius: 6px; margin-top: 15px; border-left: 3px solid #ffd700; font-size: 13px;
        }
        .inline-style-37 {
            margin: 0 0 10px 0; color: #b8860b; font-weight: 600; font-size: 14px;
        }
        .inline-style-38 {
            display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
        }
        .inline-style-39 {
            color: #2d3748; font-size: 13px;
        }
        .inline-style-40 {
            margin: 6px 0 0 0; padding-left: 16px; line-height: 1.4; font-size: 12px;
        }
        .inline-style-41 {
            margin-top: 8px; font-size: 11px; color: #666;
        }
        .inline-style-42 {
            background: #f8f9fa; padding: 12px 15px; border-radius: 6px; margin-top: 15px; border-left: 3px solid #3498db; font-size: 13px;
        }
        .inline-style-43 {
            margin: 0 0 10px 0; color: #3498db; font-weight: 600; font-size: 14px;
        }
        .inline-style-44 {
            color: #2d3748;
        }
        .inline-style-45 {
            margin: 5px 0; padding-left: 20px;
        }
        .inline-style-46 {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.8) 0%, rgba(22, 163, 74, 0.9) 100%); color: white; padding: 2px 6px; border-radius: 3px; font-size: 11px;
        }
        .inline-style-47 {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(22, 163, 74, 0.12) 100%); color: #059669; padding: 2px 6px; border-radius: 3px; font-size: 11px;
        }
        .inline-style-48 {
            background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(245, 158, 11, 0.2) 100%); color: #d97706; padding: 2px 6px; border-radius: 3px; font-size: 11px;
        }
        .inline-style-49 {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.15) 100%); color: #dc2626; padding: 2px 6px; border-radius: 3px; font-size: 11px;
        }
        .inline-style-50 {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.8) 0%, rgba(220, 38, 38, 0.9) 100%); color: white; padding: 2px 6px; border-radius: 3px; font-size: 11px;
        }
        .inline-style-51 {
            background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(245, 158, 11, 0.25) 100%); color: #92400e; padding: 2px 6px; border-radius: 3px; font-size: 11px;
        }
        .inline-style-52 {
            margin: 5px 0; padding-left: 20px; font-size: 12px;
        }
        .inline-style-53 {
            border-left: 3px solid #f39c12; padding-left: 6px; margin-left: 3px;
        }
        .inline-style-54 {
            color: #6b7280;
        }
        .inline-style-55 {
            margin-top: 10px; padding-top: 8px; border-top: 1px solid #e2e8f0; font-size: 11px; color: #666; text-align: center;
        }
        .inline-style-56 {
            font-style: italic;
        }
        .inline-style-57 {
            color: #666; text-decoration: underline;
        }
        .inline-style-58 {
            background: #f8f9fa; padding: 12px 15px; border-radius: 6px; margin-top: 15px; border-left: 3px solid #ff6b35; font-size: 13px;
        }
        .inline-style-59 {
            margin: 0 0 10px 0; color: #ff6b35; font-weight: 600; font-size: 14px;
        }
        .inline-style-60 {
            margin-top: 8px; padding-top: 8px; border-top: 1px solid #e2e8f0; font-size: 12px;
        }
        .inline-style-61 {
            color: #059669; font-weight: 600; margin-left: 6px;
        }
        .inline-style-62 {
            color: #16a34a; font-weight: 600; margin-left: 6px;
        }
        .inline-style-63 {
            color: #d97706; font-weight: 600; margin-left: 6px;
        }
        .inline-style-64 {
            color: #dc2626; font-weight: 600; margin-left: 6px;
        }
        .inline-style-65 {
            margin-top: 8px; padding-top: 8px; border-top: 1px solid #e2e8f0; font-size: 11px; color: #666;
        }
        .inline-style-66 {
            margin-left: 6px;
        }
        .inline-style-67 {
            margin-top: 4px; font-size: 11px; color: #666;
        }
        .inline-style-68 {
            width: 72px;
        }
        .inline-style-69 {
            background: #f8f9fa; padding: 12px 15px; border-radius: 6px; margin-top: 15px; border-left: 3px solid #1a237e; font-size: 13px;
        }
        .inline-style-70 {
            margin: 0 0 10px 0; color: #1a237e; font-weight: 600; font-size: 14px;
        }
        .inline-style-71 {
            color: #6b7280; font-size: 11px;
        }
        .inline-style-72 {
            color: #1a237e; font-size: 13px;
        }
        .inline-style-73 {
            font-size: 12px;
        }
        .inline-style-74 {
            color: #16a34a; font-size: 12px;
        }
        .inline-style-75 {
            font-size: 11px;
        }
        .inline-style-76 {
            color: #dc2626; font-size: 12px;
        }
        .inline-style-77 {
            margin-bottom: 15px;
        }
        .inline-style-78 {
            display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 15px; padding: 10px;
        }
        .inline-style-79 {
            display: flex; justify-content: flex-end;
        }
        .inline-style-80 {
            background: #4CAF50; color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 14px; transition: all 0.3s ease;
        }
        .inline-style-81 {
            display: flex; justify-content: flex-start;
        }
        .inline-style-82 {
            text-align: center; margin: 0; height: 25px; font-size: 13px; color: #666; font-weight: 500; line-height: 25px; visibility: hidden;
        }
        .inline-style-83 {
            display: flex; justify-content: center; margin-bottom: 5px; gap: 4px;
        }
        .inline-style-84 {
            position: relative; height: 400px; padding: 5px 10px; min-height: 400px; max-height: 400px;
        }
        .inline-style-85 {
            margin-top: 3px; padding: 5px;
        }
        .inline-style-86 {
            background: #f8f9fa; padding: 12px 15px; border-radius: 6px; margin-top: 8px; border-left: 3px solid #FF6B35; font-size: 13px;
        }
        .inline-style-87 {
            margin: 0 0 10px 0; color: #FF6B35; font-weight: 600; font-size: 14px;
        }
        .inline-style-88 {
            background: #f8f9fa; padding: 12px 15px; border-radius: 6px; margin-top: 15px; border-left: 3px solid #16A34A; font-size: 13px;
        }
        .inline-style-89 {
            margin: 0 0 10px 0; color: #16A34A; font-weight: 600; font-size: 14px;
        }
        .inline-style-90 {
            background: #f8f9fa; padding: 12px 15px; border-radius: 6px; margin-top: 15px; border-left: 3px solid #22C55E; font-size: 13px;
        }
        .inline-style-91 {
            margin: 0 0 10px 0; color: #22C55E; font-weight: 600; font-size: 14px;
        }
        .inline-style-92 {
            text-align: center;
        }
        .inline-style-93 {
            font-size: 0.9rem; margin: 0 0 20px 0; color: var(--text-secondary); line-height: 1.5;
        }
        .inline-style-94 {
            opacity: 0.8;
        }
        .inline-style-95 {
            margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.1); display: none;
        }
        .inline-style-96 {
            background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.9); border: 1px solid rgba(255,255,255,0.2); padding: 8px 12px; border-radius: 6px; cursor: pointer; transition: all 0.3s ease; font-size: 0.8rem;
        }


        .inline-style-97 {
            color: #666;
        }
        .inline-style-98 {
            line-height: 1.3; text-align: center; color: #555;
        }
        .inline-style-99 {
            margin-bottom: 3px;
        }
        .inline-style-100 {
            color: #FFD700;
        }
        .inline-style-101 {
            color: #4CAF50;
        }
        .inline-style-102 {
            color: #999;
        }
        .inline-style-103 {
            display: flex; align-items: center; gap: 4px; justify-content: center;
        }
        .inline-style-104 {
            display: flex; align-items: center; gap: 2px;
        }
        .inline-style-105 {
            display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: 2px;
        }
        .inline-style-106 {
            display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap;
        }
        .inline-style-107 {
            color: #2563eb;
        }
        .inline-style-108 {
            color: #dc2626;
        }
        .inline-style-109 {
            text-align: center; color: #999; padding: 20px;
        }
        .inline-style-110 {
            color: var(--success-color);
        }
        .inline-style-111 {
            color: var(--danger-color);
        }
        .inline-style-112 {
            color: var(--success-color); font-weight: 600;
        }
        .inline-style-113 {
            color: var(--warning-color);
        }
        .inline-style-114 {
            color: #2ecc71;
        }
        .inline-style-115 {
            color: #e74c3c;
        }
        .inline-style-116 {
            text-align: center;
        }
        .inline-style-117 {
            text-align: center; font-weight: normal;
        }
        .inline-style-118 {
            display: flex; align-items: center; justify-content: center;
        }
        .inline-style-119 {
            line-height: 1.2; text-align: center; margin: 0; padding: 0;
        }
        .inline-style-120 {
            color: #555; margin: 0; padding: 0; font-size: 0.7rem;
        }
        .inline-style-121 {
            display: flex; align-items: center; gap: 3px; justify-content: center;
        }
        .inline-style-122 {
            overflow-x: auto; overflow-y: auto; border-radius: 12px; border: 1px solid #e0e0e0; box-shadow: 0 2px 8px rgba(0,0,0,0.1); max-height: 80vh; width: 100%; position: relative;
        }
        .inline-style-123 {
            background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%); color: white;
        }
        .inline-style-124 {
            position: sticky; left: 0; z-index: 110; min-width: 70px; width: 70px; padding: 4px 6px; text-align: center; font-weight: 600; border-right: 2px solid rgba(255,255,255,0.4); background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%); font-size: 0.7rem;
        }
        .inline-style-125 {
            font-size: 0.6rem;
        }
        .inline-style-126 {
            background: #f8f9fa; border: 1px solid #dee2e6;
        }
        .inline-style-127 {
            margin-bottom: 15px;
        }
        .inline-style-128 {
            color: #2E7D32; margin-bottom: 10px;
        }
        .inline-style-129 {
            font-size: 0.9rem; color: #666; margin-bottom: 15px;
        }
        .inline-style-130 {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px;
        }
        .inline-style-131 {
            margin: 0 0 10px 0; color: #333; text-align: center;
        }
        .inline-style-132 {
            text-align: center; margin-bottom: 10px; font-size: 0.9rem; color: #666;
        }
        .inline-style-133 {
            width: 100%; border-collapse: collapse; font-size: 0.8rem;
        }
        .inline-style-134 {
            background: rgba(0,0,0,0.05);
        }
        .inline-style-135 {
            padding: 4px; border: 1px solid #ccc;
        }
        .inline-style-136 {
            padding: 4px; border: 1px solid #ccc; text-align: center;
        }
        .inline-style-137 {
            padding: 4px; border: 1px solid #ccc; text-align: center; font-weight: 600;
        }

        /* Task 6: ui-magic-number.js semantic class migration completion */
        .team-font-18 {
            font-size: 18px;
            line-height: 1.2;
            font-weight: 700;
        }

        .team-font-16 {
            font-size: 16px;
            line-height: 1.25;
            font-weight: 700;
        }

        .team-font-14 {
            font-size: 14px;
            line-height: 1.3;
            font-weight: 700;
        }

        .team-font-12 {
            font-size: 12px;
            line-height: 1.35;
            font-weight: 600;
        }

        .team-margin-positive {
            color: #166534;
            font-weight: 700;
        }

        .team-margin-negative {
            color: #b91c1c;
            font-weight: 700;
        }

        .team-margin-even {
            color: #334155;
            font-weight: 600;
        }

        .magic-number-tight {
            background: linear-gradient(135deg, #dcfce7, #bbf7d0);
            color: #065f46;
            font-weight: 700;
        }

        .magic-number-medium {
            background: linear-gradient(135deg, #fffbeb, #fef3c7);
            color: #92400e;
            font-weight: 700;
        }

        .magic-number-loose {
            background: linear-gradient(135deg, #fee2e2, #fecaca);
            color: #9f1239;
            font-weight: 700;
        }

        .magic-number-default {
            background: transparent;
            color: #4b5563;
            font-weight: 600;
        }

        .team-rank-accent-border {
            box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
        }

        .scenario-section-hidden {
            display: none !important;
        }

        .scenario-team-name {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            flex-wrap: nowrap;
            white-space: nowrap;
            min-height: 32px;
            line-height: 1.2;
            font-weight: 600;
        }

        .scenario-team-name .team-logo {
            width: 20px;
            height: auto;
            object-fit: contain;
        }

        .scenario-team-header {
            background: linear-gradient(135deg, rgba(233, 236, 239, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
            vertical-align: middle;
            padding: 6px 4px 3px;
        }

        .scenario-win-column {
            background: linear-gradient(135deg, rgba(236, 253, 245, 0.95), rgba(209, 250, 229, 0.95));
            color: #065f46;
            white-space: nowrap;
            min-width: 72px;
            padding: 4px 3px 2px;
            font-size: 0.65rem;
            line-height: 1.2;
            border-right: 1px solid rgba(16, 185, 129, 0.4);
            text-align: center;
        }

        .scenario-final-column {
            background: linear-gradient(135deg, #f8fafc, #f1f5f9);
            color: #1f2937;
            white-space: nowrap;
            min-width: 88px;
            padding: 4px 3px 2px;
            font-size: 0.65rem;
            line-height: 1.2;
            border-right: 1px solid rgba(148, 163, 184, 0.35);
            text-align: center;
        }

        .scenario-win-column .inline-style-125,
        .scenario-final-column .inline-style-125 {
            display: block;
            line-height: 1.1;
            margin-top: 1px;
        }

        .scenario-rate-cell {
            text-align: center;
        }

        .scenario-rate-empty {
            background: #fafafa;
            color: #9ca3af;
        }

        .scenario-rate-win {
            background: linear-gradient(135deg, #eaffea, #dcfce7);
            color: #166534;
        }

        .scenario-rate-loss {
            background: linear-gradient(135deg, #fee2e2, #fecaca);
            color: #991b1b;
        }

        .scenario-rate-even {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            color: #92400e;
        }

        .scenario-remaining-none {
            background: #f8fafc;
            color: #64748b;
            font-style: italic;
        }

        .scenario-remaining-zero {
            background: #f8fafc;
            color: #475569;
            font-weight: 700;
        }

        .scenario-remaining-low {
            background: linear-gradient(135deg, #dcfce7, #bbf7d0);
            color: #166534;
            font-weight: 700;
        }

        .scenario-remaining-mid {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            color: #92400e;
            font-weight: 700;
        }

        .scenario-remaining-high {
            background: linear-gradient(135deg, #fee2e2, #fecaca);
            color: #991b1b;
            font-weight: 700;
        }

        .scenario-record-empty {
            text-align: center;
            color: #d1d5db;
            font-size: 0.7rem;
            background: #f8fafc;
            min-width: 70px;
        }

        .scenario-record-text {
            margin: 0;
            color: #334155;
            line-height: 1.2;
            font-size: 0.75rem;
            text-wrap: nowrap;
        }

        .scenario-record-text-with-star {
            color: #166534;
            font-weight: 700;
        }

        .scenario-record-summary {
            line-height: 1.2;
            margin: 0;
            padding: 0;
        }

        .scenario-detail-card {
            background: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 10px 12px;
            box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .scenario-detail-card:hover {
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
        }

        .scenario-detail-card-0 {
            border-left: 4px solid #2563eb;
            background: linear-gradient(180deg, rgba(59, 130, 246, 0.07), #ffffff);
        }

        .scenario-detail-card-1 {
            border-left: 4px solid #16a34a;
            background: linear-gradient(180deg, rgba(34, 197, 94, 0.07), #ffffff);
        }

        .scenario-detail-card-2 {
            border-left: 4px solid #ca8a04;
            background: linear-gradient(180deg, rgba(234, 179, 8, 0.07), #ffffff);
        }

        .scenario-detail-card-3 {
            border-left: 4px solid #ea580c;
            background: linear-gradient(180deg, rgba(249, 115, 22, 0.07), #ffffff);
        }

        .scenario-detail-card-4 {
            border-left: 4px solid #dc2626;
            background: linear-gradient(180deg, rgba(239, 68, 68, 0.07), #ffffff);
        }

        .scenario-detail-rate-highest {
            color: #065f46;
            background: #dcfce7;
            font-weight: 700;
        }

        .scenario-detail-rate-very-good {
            color: #166534;
            background: #dcfce7;
            font-weight: 700;
        }

        .scenario-detail-rate-good {
            color: #15803d;
            background: #ecfccb;
            font-weight: 700;
        }

        .scenario-detail-rate-average {
            color: #92400e;
            background: #fef3c7;
            font-weight: 600;
        }

        .scenario-detail-rate-decency {
            color: #a16207;
            background: #fef3c7;
            font-weight: 600;
        }

        .scenario-detail-rate-warning {
            color: #b45309;
            background: #fed7aa;
            font-weight: 600;
        }

        .scenario-detail-rate-low {
            color: #c2410c;
            background: #ffedd5;
            font-weight: 600;
        }

        .scenario-detail-rate-lowest {
            color: #991b1b;
            background: #fee2e2;
            font-weight: 700;
        }

        .scenario-detailed-row {
            transition: background-color 0.2s ease;
        }

        .scenario-detailed-row.scenario-detail-rate-highest,
        .scenario-detailed-row.scenario-detail-rate-very-good,
        .scenario-detailed-row.scenario-detail-rate-good,
        .scenario-detailed-row.scenario-detail-rate-average,
        .scenario-detailed-row.scenario-detail-rate-decency,
        .scenario-detailed-row.scenario-detail-rate-warning,
        .scenario-detailed-row.scenario-detail-rate-low,
        .scenario-detailed-row.scenario-detail-rate-lowest {
            color: #111827;
        }

        .scenario-detailed-row.scenario-detail-rate-highest td,
        .scenario-detailed-row.scenario-detail-rate-very-good td {
            background: #d1fae5;
            color: #065f46;
        }

        .scenario-detailed-row.scenario-detail-rate-good td,
        .scenario-detailed-row.scenario-detail-rate-average td,
        .scenario-detailed-row.scenario-detail-rate-decency td {
            background: #fef3c7;
            color: #92400e;
        }

        .scenario-detailed-row.scenario-detail-rate-warning td,
        .scenario-detailed-row.scenario-detail-rate-low td,
        .scenario-detailed-row.scenario-detail-rate-lowest td {
            background: #fee2e2;
            color: #991b1b;
        }

        .scenario-matrix-width-1 {
            min-width: 180px;
        }

        .scenario-matrix-width-2 {
            min-width: 260px;
        }

        .scenario-matrix-width-3 {
            min-width: 340px;
        }

        .scenario-matrix-width-4 {
            min-width: 420px;
        }

        .scenario-matrix-width-5 {
            min-width: 500px;
        }

        .scenario-matrix-width-6 {
            min-width: 600px;
        }

        .scenario-matrix-width-7 {
            min-width: 700px;
        }

        .scenario-matrix-width-8 {
            min-width: 800px;
        }

        .scenario-matrix-width-9 {
            min-width: 900px;
        }

        .scenario-matrix-width-10 {
            min-width: 980px;
        }

        .scenario-popup-body {
            max-width: min(1280px, 100%);
            margin: 0 auto;
            padding: 24px;
            background: #f5f7fa;
            color: #1f2937;
        }

        .scenario-popup-header {
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid #d1d5db;
        }

        .scenario-popup-title {
            margin: 0 0 8px 0;
            font-size: 1.4rem;
            color: #166534;
        }

        .scenario-popup-subtitle,
        .scenario-popup-subtext,
        .scenario-popup-meta {
            margin: 2px 0;
            color: #334155;
            line-height: 1.4;
            font-size: 0.95rem;
        }

        .scenario-popup-meta {
            font-size: 0.85rem;
            color: #64748b;
        }

        .scenario-popup-matrix-wrapper {
            overflow-x: auto;
            background: #fff;
            padding: 12px;
            border-radius: 10px;
            border: 1px solid #e5e7eb;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        }

        .clipboard-copy-fallback {
            position: absolute !important;
            left: -9999px !important;
            opacity: 0;
            width: 1px;
            height: 1px;
            padding: 0;
            border: 0;
        }

        .share-button-copied {
            background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%) !important;
            color: #ffffff !important;
            border-color: rgba(34, 197, 94, 0.4) !important;
            box-shadow: 0 2px 6px rgba(34, 197, 94, 0.35) !important;
        }
