/* 통계 페이지 전용 스타일 */

.statistics-container {
    padding: 20px 10px;
    max-width: 100%;
    box-sizing: border-box;
}

.statistics-header {
    margin-bottom: 10px;
}

.statistics-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.statistics-header p {
    color: #666;
    font-size: 1rem;
}

.statistics-header p + .statistics-desc-note {
    margin-top: 0;
}

.statistics-header p:has(+ .statistics-desc-note) {
    margin-bottom: 2px;
}

/* 스킬 통계: 설명 리스트 (예전 스타일, 하위 호환) */
.statistics-header .statistics-desc-list {
    margin: 4px 0 0 0;
    padding-left: 20px;
    color: #666;
    font-size: 1rem;
}

.statistics-header .statistics-desc-list li {
    margin-bottom: 4px;
}

.statistics-header .statistics-desc-list li:last-child {
    margin-bottom: 0;
}

/* 스킬 통계: 주의사항 (PC에서만 표시) */
.statistics-header .statistics-desc-note {
    margin: 0;
    font-size: 0.7rem;
    color: #a3a3a3;
    line-height: 1.35;
}

#statisticsHelpBtn {
    flex-shrink: 0 !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    align-self: flex-end;
    margin-bottom: 4px;
}

#statisticsHelpBtn:hover,
#skillStatisticsHelpBtn:hover {
    background-color: #6b7280 !important;
    transform: scale(1.1);
}

#skillStatisticsHelpBtn {
    flex-shrink: 0 !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    align-self: flex-end;
    margin-bottom: 4px;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.stat-card-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.filter-section {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-row-set {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.filter-row-set > label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 5px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 200px;
}

/* 스킬 통계 세트 타일 그리드 (상세검색 스타일) */
.skill-set-filter-wrap .search-set-grid {
    min-width: 0;
    width: 100%;
}

.skill-set-filter-wrap .search-set-grid .set-tile.active {
    border-color: #c8e1ff !important;
    background: #f2f8ff !important;
}

.skill-set-filter-wrap .search-set-grid .set-tile.inactive {
    opacity: 0.4 !important;
    filter: grayscale(100%) !important;
}

/* 탭 네비게이션 */
.statistics-tab-navigation {
    position: relative;
    display: flex;
    gap: 10px;
    background: #fff;
    border-radius: 8px 8px 0 0;
    padding: 0;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.statistics-tab-navigation::-webkit-scrollbar {
    display: none;
}

.statistics-tab-btn {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    padding: 10px 10px;
    min-width: 80px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.statistics-tab-btn:hover:not(.active) {
    color: #333;
    background: rgba(0, 0, 0, 0.02);
}

.statistics-tab-btn.active {
    color: #667eea;
    font-weight: 600;
}

.statistics-tab-btn.disabled {
    color: #999;
    opacity: 0.5;
}

.statistics-tab-btn.disabled:hover {
    background: transparent;
    color: #999;
}

.statistics-tab-label {
    display: inline-block;
}

.statistics-tab-indicator {
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: #667eea;
    transition: all 0.3s ease;
    width: 0;
    z-index: 10;
}

.statistics-tab-content {
    display: none;
}

.statistics-tab-content.active {
    display: block;
}

.chart-container {
    background: #fff;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.leveling-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
}

.chart-wrapper {
    position: relative;
    height: 80px;
    margin-bottom: 20px;
}

/* 스킬 개화: 범례 + 샘플 바 같은 행 */
.chart-legend-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 16px 20px;
    margin-top: 15px;
    margin-bottom: 15px;
}

/* 스킬 개화: 샘플 100명 미만 시 표시 (회색: 실제, 짙은회색: 부족) */
.skill-sample-bar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.chart-legend-row .skill-sample-bar-wrap {
    margin-right: auto;
}

.skill-sample-bar {
    flex: 1;
    max-width: 200px;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    background-color: #e5e7eb;
}

.skill-sample-bar-actual {
    background-color: #d1d5db;
    min-width: 2px;
}

.skill-sample-bar-missing {
    background-color: #6b7280;
    min-width: 2px;
}

.skill-sample-bar-label {
    font-size: 0.85rem;
    color: #6b7280;
    white-space: nowrap;
}

.chart-legend-row .chart-legend {
    margin: 0;
}

.chart-legend {
    margin-top: 10px;
    margin-bottom: 15px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    justify-content: flex-end;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.chart-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.chart-legend-label {
    color: #4b5563;
    font-weight: 400;
}

.chart-legend-value {
    color: #6b7280;
    font-weight: 500;
    font-size: 0.8rem;
}

.statistics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.statistics-table th,
.statistics-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

/* 테이블 헤더 - 비교 페이지(장비 탭)와 동일한 디자인 */
.statistics-table th {
    background-color: #f8fafc;
    font-weight: 500;
    font-size: 13px;
    color: #475569;
    text-align: center;
    border: 1px solid #e2e8f0;
}
.statistics-table thead th:first-child {
    border-left: none;
}
.statistics-table thead th:last-child {
    border-right: none;
}

/* 세트 테이블: 순위(1), 이미지(2), 캐릭터 수(4), 사용률(5) 가운데 정렬 */
.statistics-table#setStatisticsTable th:nth-child(1),
.statistics-table#setStatisticsTable th:nth-child(2),
.statistics-table#setStatisticsTable th:nth-child(4),
.statistics-table#setStatisticsTable th:nth-child(5),
.statistics-table#setStatisticsTable td:nth-child(1),
.statistics-table#setStatisticsTable td:nth-child(2),
.statistics-table#setStatisticsTable td:nth-child(4),
.statistics-table#setStatisticsTable td:nth-child(5) {
    text-align: center;
}

/* 순위 컬럼 너비 줄이기 */
.statistics-table th:nth-child(1),
.statistics-table td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    padding: 12px 8px;
}

/* 이미지 컬럼 너비 줄이기 */
.statistics-table th:nth-child(2),
.statistics-table td:nth-child(2) {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    padding: 12px 8px;
}

/* 무기 테이블: 순위(1), 이미지(2), 무기 타입(4), 캐릭터 수(5), 사용률(6) 가운데 정렬 */
.statistics-table#weaponStatisticsTable th:nth-child(1),
.statistics-table#weaponStatisticsTable th:nth-child(2),
.statistics-table#weaponStatisticsTable th:nth-child(4),
.statistics-table#weaponStatisticsTable th:nth-child(5),
.statistics-table#weaponStatisticsTable th:nth-child(6),
.statistics-table#weaponStatisticsTable td:nth-child(1),
.statistics-table#weaponStatisticsTable td:nth-child(2),
.statistics-table#weaponStatisticsTable td:nth-child(4),
.statistics-table#weaponStatisticsTable td:nth-child(5),
.statistics-table#weaponStatisticsTable td:nth-child(6) {
    text-align: center;
}

/* 아바타 테이블: 순위(1), 캐릭터 수(3), 사용률(4) 가운데 정렬 */
.statistics-table#avatarStatisticsTable th:nth-child(1),
.statistics-table#avatarStatisticsTable th:nth-child(3),
.statistics-table#avatarStatisticsTable th:nth-child(4),
.statistics-table#avatarStatisticsTable td:nth-child(1),
.statistics-table#avatarStatisticsTable td:nth-child(3),
.statistics-table#avatarStatisticsTable td:nth-child(4) {
    text-align: center;
}

/* 엠블렘 테이블: 순위(1), 캐릭터 수(3), 사용률(4) 가운데 정렬 */
.statistics-table#emblemStatisticsTable th:nth-child(1),
.statistics-table#emblemStatisticsTable th:nth-child(3),
.statistics-table#emblemStatisticsTable th:nth-child(4),
.statistics-table#emblemStatisticsTable td:nth-child(1),
.statistics-table#emblemStatisticsTable td:nth-child(3),
.statistics-table#emblemStatisticsTable td:nth-child(4) {
    text-align: center;
}

/* 레벨링 통계 테이블: 순위(1), 사용률(4) 가운데 정렬 */
.statistics-table#titleLevelingTable th:nth-child(1),
.statistics-table#titleLevelingTable th:nth-child(4),
.statistics-table#titleLevelingTable td:nth-child(1),
.statistics-table#titleLevelingTable td:nth-child(4),
.statistics-table#creatureLevelingTable th:nth-child(1),
.statistics-table#creatureLevelingTable th:nth-child(4),
.statistics-table#creatureLevelingTable td:nth-child(1),
.statistics-table#creatureLevelingTable td:nth-child(4),
.statistics-table#fusionTable th:nth-child(1),
.statistics-table#fusionTable th:nth-child(4),
.statistics-table#fusionTable td:nth-child(1),
.statistics-table#fusionTable td:nth-child(4) {
    text-align: center;
}

/* 아바타 테이블 스타일 (엠블렘 테이블과 동일) */
.statistics-table#avatarStatisticsTable th:nth-child(1),
.statistics-table#avatarStatisticsTable td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    padding: 12px 8px;
}

/* 아바타 테이블 옵션명 컬럼 너비 (레벨링 테이블과 동일) */
.statistics-table#avatarStatisticsTable th:nth-child(2),
.statistics-table#avatarStatisticsTable td:nth-child(2) {
    min-width: 400px;
    padding: 12px 16px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.5;
    vertical-align: middle;
}

/* 아바타 테이블 캐릭터 수 컬럼 너비 (레벨링 테이블과 동일) */
.statistics-table#avatarStatisticsTable th:nth-child(3),
.statistics-table#avatarStatisticsTable td:nth-child(3) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 12px 8px;
    text-align: center;
}

/* 아바타 테이블 사용률 컬럼 너비 (레벨링 테이블과 동일) */
.statistics-table#avatarStatisticsTable th:nth-child(4),
.statistics-table#avatarStatisticsTable td:nth-child(4) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 12px 8px;
}

/* 엠블렘 테이블: 상의 아바타와 동일한 컬럼 스타일 */
.statistics-table#emblemStatisticsTable th:nth-child(1),
.statistics-table#emblemStatisticsTable td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    padding: 12px 8px;
}

.statistics-table#emblemStatisticsTable th:nth-child(2),
.statistics-table#emblemStatisticsTable td:nth-child(2) {
    min-width: 400px;
    padding: 12px 16px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.5;
    vertical-align: middle;
}

.statistics-table#emblemStatisticsTable th:nth-child(3),
.statistics-table#emblemStatisticsTable td:nth-child(3) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 12px 8px;
    text-align: center;
}

.statistics-table#emblemStatisticsTable th:nth-child(4),
.statistics-table#emblemStatisticsTable td:nth-child(4) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 12px 8px;
}

/* 레벨링 통계 테이블 컬럼 너비 (엠블렘 테이블과 동일한 스타일) */
.statistics-table#titleLevelingTable th:nth-child(1),
.statistics-table#titleLevelingTable td:nth-child(1),
.statistics-table#creatureLevelingTable th:nth-child(1),
.statistics-table#creatureLevelingTable td:nth-child(1),
.statistics-table#fusionTable th:nth-child(1),
.statistics-table#fusionTable td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    padding: 12px 8px;
}

.statistics-table#titleLevelingTable th:nth-child(2),
.statistics-table#titleLevelingTable td:nth-child(2),
.statistics-table#creatureLevelingTable th:nth-child(2),
.statistics-table#creatureLevelingTable td:nth-child(2),
.statistics-table#fusionTable th:nth-child(2),
.statistics-table#fusionTable td:nth-child(2) {
    min-width: 400px;
    padding: 12px 16px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.5;
    vertical-align: middle;
}

.statistics-table#titleLevelingTable th:nth-child(3),
.statistics-table#titleLevelingTable td:nth-child(3),
.statistics-table#creatureLevelingTable th:nth-child(3),
.statistics-table#creatureLevelingTable td:nth-child(3),
.statistics-table#fusionTable th:nth-child(3),
.statistics-table#fusionTable td:nth-child(3) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 12px 8px;
    text-align: center;
}

.statistics-table#titleLevelingTable th:nth-child(4),
.statistics-table#titleLevelingTable td:nth-child(4),
.statistics-table#creatureLevelingTable th:nth-child(4),
.statistics-table#creatureLevelingTable td:nth-child(4),
.statistics-table#fusionTable th:nth-child(4),
.statistics-table#fusionTable td:nth-child(4) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 12px 8px;
}

.statistics-table tr:hover {
    background-color: #f8f9fa;
}

.usage-percentage {
    color: #28a745;
    font-weight: 600;
}

/* 스킬 개화 테이블 - 각 행마다 하나의 가로 바 */
.statistics-table#skillEvolutionTable th:nth-child(1),
.statistics-table#skillEvolutionTable td:nth-child(1),
.statistics-table#skillEnhancementTable th:nth-child(1),
.statistics-table#skillEnhancementTable td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    text-align: center;
    padding: 12px 8px;
}

.statistics-table#skillEvolutionTable th:nth-child(2),
.statistics-table#skillEvolutionTable td:nth-child(2),
.statistics-table#skillEnhancementTable th:nth-child(2),
.statistics-table#skillEnhancementTable td:nth-child(2) {
    width: 48px;
    min-width: 48px;
    text-align: center;
    padding: 8px;
}
/* 스킬 개화·강화: 스킬 컬럼 헤더·데이터 가운데 정렬 */
.statistics-table#skillEvolutionTable th:nth-child(2),
.statistics-table#skillEvolutionTable td:nth-child(2),
.statistics-table#skillEnhancementTable th:nth-child(2),
.statistics-table#skillEnhancementTable td:nth-child(2) {
    text-align: center !important;
}
/* 스킬 컬럼 데이터(아이콘) 가운데 정렬 */
.statistics-table#skillEvolutionTable td.skill-icon-cell,
.statistics-table#skillEnhancementTable td.skill-icon-cell {
    display: flex;
    justify-content: center;
    align-items: center;
}

.skill-icon-cell {
    vertical-align: middle !important;
}

.skill-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: default;
}

.skill-icon-wrapper.skill-icon-empty {
    color: #999;
    font-size: 0.9rem;
}

.skill-evolution-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.statistics-table#skillEvolutionTable th:nth-child(3),
.statistics-table#skillEvolutionTable td:nth-child(3),
.statistics-table#skillEnhancementTable th:nth-child(3),
.statistics-table#skillEnhancementTable td:nth-child(3) {
    min-width: 220px;
    padding: 8px 12px;
}
/* 스킬 통계: 모든 헤더 가운데 정렬 (채택률 헤더 포함) */
.statistics-table#skillEvolutionTable th:nth-child(3),
.statistics-table#skillEnhancementTable th:nth-child(3) {
    text-align: center;
}

.statistics-table#skillEvolutionTable th:nth-child(4),
.statistics-table#skillEvolutionTable th:nth-child(5),
.statistics-table#skillEvolutionTable td:nth-child(4),
.statistics-table#skillEvolutionTable td:nth-child(5),
.statistics-table#skillEnhancementTable th:nth-child(4),
.statistics-table#skillEnhancementTable th:nth-child(5),
.statistics-table#skillEnhancementTable td:nth-child(4),
.statistics-table#skillEnhancementTable td:nth-child(5) {
    width: 60px;
    min-width: 60px;
    text-align: center;
    padding: 8px;
}

.skill-evolution-pct {
    font-weight: 500;
}

.skill-evolution-pct-cell {
    vertical-align: middle !important;
}

/* 스킬 개화 헤더 아이콘 (캐릭터 화면과 동일) */
.skill-evolution-header-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.statistics-table#skillEvolutionTable .skill-evolution-header-icon .skill-evolution-check-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.statistics-table#skillEvolutionTable .skill-evolution-header-icon .skill-evolution-check-fallback {
    display: none;
    width: 20px;
    height: 20px;
    border: 1px solid #666;
    border-radius: 50%;
}

/* 스킬 강화 헤더 아이콘: 동그랗게 잘라서 표시, 크기 확대 */
.statistics-table#skillEnhancementTable .skill-evolution-header-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin-top: 2px;
}
.statistics-table#skillEnhancementTable .skill-evolution-header-icon .skill-evolution-check-img {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    object-fit: cover;
    display: block;
}
/* 강화1: 빨간 필터 (캐릭터 화면과 동일) */
.statistics-table#skillEnhancementTable .skill-check-enhance-1 .skill-evolution-check-img {
    filter: sepia(0.55) hue-rotate(-18deg) saturate(1.08);
}
/* 강화2: 파란 필터 (캐릭터 화면과 동일) */
.statistics-table#skillEnhancementTable .skill-check-enhance-2 .skill-evolution-check-img {
    filter: sepia(0.15) hue-rotate(195deg) saturate(1.08);
}
.statistics-table#skillEnhancementTable .skill-evolution-header-icon .skill-evolution-check-fallback {
    display: none;
    width: 28px;
    height: 28px;
    border: 1px solid #666;
    border-radius: 50%;
}

.skill-evolution-row-bar-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-evolution-row-bar-wrap {
    flex: 1;
    min-width: 100px;
    height: 22px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.skill-evolution-seg {
    height: 100%;
    min-width: 0;
    transition: width 0.2s;
}

/* 부족한 자료: 매우 연한 톤 + 미세한 스트라이프 (1번·2번에 집중되도록) */
.skill-evolution-seg-shortfall {
    background-color: #f3f4f6;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(156, 163, 175, 0.30) 8px,
        rgba(156, 163, 175, 0.30) 9px
    );
}

.skill-evolution-row-count {
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.table-color-box {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.toast-color-box {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.score-toggle-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

.score-toggle-btn:hover {
    border-color: #007bff;
    color: #007bff;
}

.score-toggle-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner.active {
    display: block;
}

@media (max-width: 768px) {
    .statistics-header .statistics-desc-list,
    .statistics-header .statistics-desc-note {
        display: none !important;
    }
    
    .statistics-container {
        padding: 10px 5px;
    }
    
    .chart-container {
        padding: 10px 5px;
    }
    
    .filter-section {
        padding: 10px 5px 10 5px;
    }
    
    .statistics-grid {
        grid-template-columns: 1fr;
    }
    
    #statisticsHelpBtn {
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        min-height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
        flex-shrink: 0 !important;
    }
    
    .statistics-tab-btn {
        padding: 10px 5px;
        font-size: 0.85rem;
        white-space: normal;
        line-height: 1.3;
        min-width: 60px;
    }
    
    .statistics-tab-label {
        display: block;
        text-align: center;
    }
    
    .chart-wrapper {
        height: 80px;
    }
    
    .chart-title {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .chart-legend {
        gap: 12px 16px;
        font-size: 0.8rem;
    }
    
    .chart-legend-item {
        font-size: 0.75rem;
    }
    
    .chart-legend-color {
        width: 12px;
        height: 12px;
    }
    
    .filter-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-group {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px);
    }
    
    .filter-row-set {
        margin-top: 8px;
        padding-top: 8px;
    }

    /* 스킬 개화·강화: 모바일에서 채택률 바 길이 줄여 한 화면에 보이게 */
    .statistics-table#skillEvolutionTable th:nth-child(1),
    .statistics-table#skillEvolutionTable td:nth-child(1),
    .statistics-table#skillEnhancementTable th:nth-child(1),
    .statistics-table#skillEnhancementTable td:nth-child(1) {
        width: 12%;
        min-width: auto;
    }
    .statistics-table#skillEvolutionTable th:nth-child(2),
    .statistics-table#skillEvolutionTable td:nth-child(2),
    .statistics-table#skillEnhancementTable th:nth-child(2),
    .statistics-table#skillEnhancementTable td:nth-child(2) {
        width: 12%;
        min-width: 44px; /* 아이콘 40px + 패딩, 6px로 찌그러지지 않게 */
    }
    .statistics-table#skillEvolutionTable th:nth-child(3),
    .statistics-table#skillEvolutionTable td:nth-child(3),
    .statistics-table#skillEnhancementTable th:nth-child(3),
    .statistics-table#skillEnhancementTable td:nth-child(3) {
        width: 42%;
        min-width: auto;
        max-width: none;
    }
    .statistics-table#skillEvolutionTable th:nth-child(4),
    .statistics-table#skillEvolutionTable th:nth-child(5),
    .statistics-table#skillEvolutionTable td:nth-child(4),
    .statistics-table#skillEvolutionTable td:nth-child(5),
    .statistics-table#skillEnhancementTable th:nth-child(4),
    .statistics-table#skillEnhancementTable th:nth-child(5),
    .statistics-table#skillEnhancementTable td:nth-child(4),
    .statistics-table#skillEnhancementTable td:nth-child(5) {
        width: 15%;
        min-width: auto;
    }
    .statistics-table#skillEvolutionTable .skill-evolution-row-bar-wrap,
    .statistics-table#skillEnhancementTable .skill-evolution-row-bar-wrap {
        min-width: 80px;
        max-width: 120px;
        flex: 0 1 120px;
        height: 18px;
    }
    .statistics-table#skillEvolutionTable .skill-evolution-row-bar-cell,
    .statistics-table#skillEnhancementTable .skill-evolution-row-bar-cell {
        gap: 6px;
    }

    /* 스킬 개화·강화 모바일: 레벨·스킬 컬럼 패딩·정렬 */
    .statistics-table#skillEvolutionTable th:nth-child(1),
    .statistics-table#skillEvolutionTable td:nth-child(1),
    .statistics-table#skillEnhancementTable th:nth-child(1),
    .statistics-table#skillEnhancementTable td:nth-child(1) {
        padding-left: 3px;
        padding-right: 3px;
    }
    .statistics-table#skillEvolutionTable th:nth-child(2),
    .statistics-table#skillEvolutionTable td:nth-child(2),
    .statistics-table#skillEnhancementTable th:nth-child(2),
    .statistics-table#skillEnhancementTable td:nth-child(2) {
        text-align: center !important;
        padding-left: 3px;
        padding-right: 3px;
    }
    .statistics-table#skillEvolutionTable td.skill-icon-cell,
    .statistics-table#skillEnhancementTable td.skill-icon-cell {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .filter-group select {
        width: 100%;
        min-width: 0;
        font-size: 0.8rem;
        padding: 6px 6px;
        background-color: #fff;
        color: #333;
    }
    
    .statistics-table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 아바타, 엠블렘, 레벨링, 스킬 개화·강화 테이블은 화면에 맞게 표시 */
    .statistics-table#avatarStatisticsTable,
    .statistics-table#emblemStatisticsTable,
    .statistics-table#titleLevelingTable,
    .statistics-table#creatureLevelingTable,
    .statistics-table#fusionTable,
    .statistics-table#skillEvolutionTable,
    .statistics-table#skillEnhancementTable {
        display: table;
        overflow-x: visible;
        white-space: normal;
        width: 100%;
        table-layout: fixed;
    }
    
    .statistics-table th,
    .statistics-table td {
        padding: 8px 4px;
        min-width: 50px;
    }
    
    .statistics-table th:nth-child(1),
    .statistics-table td:nth-child(1) {
        min-width: 35px;
        width: 35px;
        max-width: 35px;
        padding: 8px 4px;
    }
    
    .statistics-table th:nth-child(2),
    .statistics-table td:nth-child(2) {
        min-width: 55px;
        width: 55px;
        max-width: 55px;
        padding: 8px 4px;
    }
    
    /* 아바타 테이블 모바일 스타일 - 엠블렘 테이블과 동일 */
    .statistics-table#avatarStatisticsTable {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    .statistics-table#avatarStatisticsTable th,
    .statistics-table#avatarStatisticsTable td {
        white-space: normal;
        word-break: break-word;
        line-height: 1.4;
    }
    
    .statistics-table#avatarStatisticsTable th:nth-child(1),
    .statistics-table#avatarStatisticsTable td:nth-child(1) {
        width: 15%;
        min-width: auto;
        max-width: none;
    }
    
    .statistics-table#avatarStatisticsTable th:nth-child(2),
    .statistics-table#avatarStatisticsTable td:nth-child(2) {
        width: 60%;
        min-width: auto;
        max-width: none;
        padding: 8px 8px;
    }
    
    .statistics-table#avatarStatisticsTable th:nth-child(4),
    .statistics-table#avatarStatisticsTable td:nth-child(4) {
        width: 25%;
        min-width: auto;
        max-width: none;
    }
    
    /* 엠블렘 테이블 모바일 스타일 - 화면에 맞게 표시 */
    .statistics-table#emblemStatisticsTable {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    .statistics-table#emblemStatisticsTable th,
    .statistics-table#emblemStatisticsTable td {
        white-space: normal;
        word-break: break-word;
        line-height: 1.4;
    }
    
    .statistics-table#emblemStatisticsTable th:nth-child(1),
    .statistics-table#emblemStatisticsTable td:nth-child(1) {
        width: 15%;
        min-width: auto;
        max-width: none;
    }
    
    .statistics-table#emblemStatisticsTable th:nth-child(2),
    .statistics-table#emblemStatisticsTable td:nth-child(2) {
        width: 60%;
        min-width: auto;
        max-width: none;
        padding: 8px 8px;
    }
    
    .statistics-table#emblemStatisticsTable th:nth-child(4),
    .statistics-table#emblemStatisticsTable td:nth-child(4) {
        width: 25%;
        min-width: auto;
        max-width: none;
    }
    
    /* 캐릭터 수 컬럼 숨기기 (모바일) */
    /* 세트 테이블: 캐릭터 수(4) */
    .statistics-table#setStatisticsTable th:nth-child(4),
    .statistics-table#setStatisticsTable td:nth-child(4) {
        display: none;
    }
    
    /* 무기 테이블: 캐릭터 수(5) */
    .statistics-table#weaponStatisticsTable th:nth-child(5),
    .statistics-table#weaponStatisticsTable td:nth-child(5) {
        display: none;
    }
    
    /* 아바타 테이블: 캐릭터 수(3) */
    .statistics-table#avatarStatisticsTable th:nth-child(3),
    .statistics-table#avatarStatisticsTable td:nth-child(3) {
        display: none;
    }
    
    /* 엠블렘 테이블: 캐릭터 수(3) */
    .statistics-table#emblemStatisticsTable th:nth-child(3),
    .statistics-table#emblemStatisticsTable td:nth-child(3) {
        display: none;
    }
    
    /* 레벨링 통계 테이블: 캐릭터 수(3) */
    .statistics-table#titleLevelingTable th:nth-child(3),
    .statistics-table#titleLevelingTable td:nth-child(3),
    .statistics-table#creatureLevelingTable th:nth-child(3),
    .statistics-table#creatureLevelingTable td:nth-child(3),
    .statistics-table#fusionTable th:nth-child(3),
    .statistics-table#fusionTable td:nth-child(3) {
        display: none;
    }
    
    .statistics-header h1 {
        font-size: 1.5rem;
    }
    
    .statistics-header p {
        font-size: 0.9rem;
        display: none;
    }
    
    /* 레벨링 통계 테이블 모바일 스타일 - 엠블렘 테이블과 동일 */
    .statistics-table#titleLevelingTable,
    .statistics-table#creatureLevelingTable,
    .statistics-table#fusionTable {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    .statistics-table#titleLevelingTable thead,
    .statistics-table#titleLevelingTable tbody,
    .statistics-table#creatureLevelingTable thead,
    .statistics-table#creatureLevelingTable tbody,
    .statistics-table#fusionTable thead,
    .statistics-table#fusionTable tbody {
        display: table-row-group;
        width: 100%;
    }
    
    .statistics-table#titleLevelingTable th,
    .statistics-table#titleLevelingTable td,
    .statistics-table#creatureLevelingTable th,
    .statistics-table#creatureLevelingTable td,
    .statistics-table#fusionTable th,
    .statistics-table#fusionTable td {
        white-space: normal;
        word-break: break-word;
        line-height: 1.4;
    }
    
    .statistics-table#titleLevelingTable th:nth-child(1),
    .statistics-table#titleLevelingTable td:nth-child(1),
    .statistics-table#creatureLevelingTable th:nth-child(1),
    .statistics-table#creatureLevelingTable td:nth-child(1),
    .statistics-table#fusionTable th:nth-child(1),
    .statistics-table#fusionTable td:nth-child(1) {
        width: 15%;
        min-width: auto;
        max-width: none;
    }
    
    .statistics-table#titleLevelingTable th:nth-child(2),
    .statistics-table#titleLevelingTable td:nth-child(2),
    .statistics-table#creatureLevelingTable th:nth-child(2),
    .statistics-table#creatureLevelingTable td:nth-child(2),
    .statistics-table#fusionTable th:nth-child(2),
    .statistics-table#fusionTable td:nth-child(2) {
        width: 60%;
        min-width: auto;
        max-width: none;
        padding: 8px 8px;
    }
    
    .statistics-table#titleLevelingTable th:nth-child(4),
    .statistics-table#titleLevelingTable td:nth-child(4),
    .statistics-table#creatureLevelingTable th:nth-child(4),
    .statistics-table#creatureLevelingTable td:nth-child(4),
    .statistics-table#fusionTable th:nth-child(4),
    .statistics-table#fusionTable td:nth-child(4) {
        width: 25%;
        min-width: auto;
        max-width: none;
    }
    
    /* 통계 도움말 모달 모바일 스타일 */
    #statisticsHelpModal .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    #statisticsHelpModal .modal-content {
        border-radius: 8px;
    }
    
    #statisticsHelpModal .modal-header {
        padding: 12px 15px;
    }
    
    #statisticsHelpModal .modal-title {
        font-size: 1rem;
        font-weight: 600;
    }
    
    #statisticsHelpModal .modal-body {
        padding: 15px !important;
        font-size: 0.85rem;
    }
    
    #statisticsHelpModal .modal-body h6 {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
    }
    
    #statisticsHelpModal .modal-body p {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
        margin-bottom: 8px !important;
    }
    
    #statisticsHelpModal .modal-body ul {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
        margin-bottom: 12px !important;
        padding-left: 20px !important;
    }
    
    #statisticsHelpModal .modal-body li {
        margin-bottom: 4px;
        line-height: 1.5 !important;
    }
    
    #statisticsHelpModal .modal-body .mb-4 {
        margin-bottom: 16px !important;
    }
    
    #statisticsHelpModal .modal-body .mb-3 {
        margin-bottom: 10px !important;
    }
    
    #statisticsHelpModal .modal-body .mb-2 {
        margin-bottom: 8px !important;
    }
    
    #statisticsHelpModal .modal-body .alert {
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
        margin-bottom: 12px !important;
    }
    
    #statisticsHelpModal .modal-body .alert ul {
        margin-top: 8px !important;
        margin-bottom: 0 !important;
        padding-left: 18px !important;
    }
    
    #statisticsHelpModal .modal-body .alert li {
        margin-bottom: 3px;
    }
    
    #statisticsHelpModal .modal-footer {
        padding: 10px 15px;
    }
    
    #statisticsHelpModal .modal-footer .btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}
