/* 인쇄용 스타일 */
@media print {
    /* 기본 페이지 설정 */
    @page {
        size: A4;
        margin: 1cm;
    }
    
    /* 불필요한 요소 숨기기 */
    .app-header,
    .page-header,
    .modal-overlay,
    .btn,
    .card-actions,
    .bracket-actions,
    .participant-remove,
    .nav-btn,
    .search-section,
    .page-actions,
    .bracket-table-wrapper,
    .game-number,
    .gender-legend {
        display: none !important;
    }
    
    /* 기본 스타일 재설정 */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.3;
    }
    
    /* 대진표 컨테이너 */
    .bracket-container {
        background: white !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        width: 100% !important;
        overflow: visible !important;
    }
    
    /* 대진표 테이블 */
    .bracket-table {
        width: 100% !important;
        min-width: auto !important;
        border-collapse: collapse !important;
        margin: 0 !important;
        font-size: 9pt !important;
        table-layout: fixed !important;
    }
    
    /* 테이블 헤더 및 셀 */
    .bracket-table th,
    .bracket-table td {
        border: 1px solid #000 !important;
        padding: 3pt !important;
        text-align: center !important;
        vertical-align: middle !important;
        background: white !important;
        position: static !important;
        overflow: hidden !important;
        word-wrap: break-word !important;
    }
    
    /* 헤더 스타일 */
    .bracket-table th {
        background: #f0f0f0 !important;
        font-weight: bold !important;
        font-size: 10pt !important;
        color: black !important;
    }
    
    /* 라운드 헤더 및 셀 */
    .round-header,
    .round-cell {
        width: 8% !important;
        min-width: auto !important;
        background: #e8e8e8 !important;
        font-weight: bold !important;
        color: black !important;
    }

    /* 🔥 간단한 대진표 (코트배정 없는 경우) 스타일 */
    .simple-bracket {
        table-layout: fixed !important;
        width: 100% !important;
        border-collapse: collapse !important;
    }

    /* 간단한 대진표 헤더 - 번호 열 매우 좁게 */
    .simple-bracket th:first-child {
        width: 20px !important;
        min-width: 20px !important;
        max-width: 20px !important;
        text-align: center !important;
        font-size: 8pt !important;
        padding: 2pt 1pt !important;
        word-wrap: break-word !important;
        overflow: hidden !important;
    }

    .simple-bracket th:last-child {
        width: calc(100% - 20px) !important;
        text-align: left !important;
        padding-left: 6pt !important;
        font-size: 9pt !important;
    }
    
    /* 번호 열 - 최소한의 너비로 고정 */
    .simple-bracket .round-cell {
        width: 20px !important;
        min-width: 20px !important;
        max-width: 20px !important;
        font-size: 7pt !important;
        text-align: center !important;
        padding: 2pt 1pt !important;
        font-weight: bold !important;
        background: #f5f5f5 !important;
        word-wrap: break-word !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    /* 매치 셀 - 거의 모든 공간 사용 */
    .simple-bracket .match-cell {
        width: calc(100% - 20px) !important;
        padding: 3pt 6pt !important;
        text-align: left !important;
        vertical-align: middle !important;
        overflow: hidden !important;
    }

    .simple-bracket tbody tr {
        page-break-inside: avoid !important;
        height: auto !important;
        min-height: 16pt !important;
    }

    .simple-bracket tbody td {
        vertical-align: middle !important;
        overflow: hidden !important;
        border: 1px solid #ccc !important;
    }

    /* 🔥 매치 내용 1줄 표시 개선 */
    .simple-match {
        display: block !important;
        width: 100% !important;
        line-height: 1.2 !important;
        overflow: hidden !important;
    }

    .match-teams-inline {
        display: inline !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        font-size: 8pt !important;
        line-height: 1.2 !important;
        width: 100% !important;
    }

    .vs-inline {
        font-weight: bold !important;
        margin: 0 2pt !important;
        color: #333 !important;
    }

    /* 선수 이름 스타일 */
    .simple-match .player-name {
        font-size: 8pt !important;
        line-height: 1.2 !important;
    }

    /* 성별 구분 색상 (인쇄시에도 유지) */
    .simple-match .gender-male {
        color: #1e40af !important;
        font-weight: 500 !important;
    }

    .simple-match .gender-female {
        color: #be185d !important;
        font-weight: 500 !important;
    }

    .simple-match .mercenary {
        color: #dc2626 !important;
        font-weight: 500 !important;
        font-style: italic !important;
    }

    .simple-match .match-teams {
        display: inline-block !important;
        width: 100% !important;
        white-space: nowrap !important;
    }

    .simple-match .team {
        display: inline !important;
        white-space: nowrap !important;
    }

    .simple-match .vs {
        display: inline !important;
        margin: 0 4pt !important;
        font-weight: bold !important;
        color: black !important;
    }

    /* 선수 이름 1줄 표시 */
    .simple-match .player-name {
        display: inline !important;
        background: none !important;
        border: none !important;
        color: black !important;
        font-weight: normal !important;
        padding: 0 !important;
        margin: 0 1pt !important;
        font-size: 9pt !important;
        white-space: nowrap !important;
    }

    /* 팀 내 선수 구분자 (+ 기호) */
    .simple-match .team .player-name:not(:last-child)::after {
        content: "+";
        margin: 0 2pt !important;
        font-weight: normal !important;
        color: black !important;
    }

    /* 용병 선수 표시 */
    .simple-match .player-name.mercenary {
        font-style: italic !important;
        color: #666 !important;
    }

    /* 매치 정보 숨기기 */
    .simple-match .match-info {
        display: none !important;
    }
    
    /* 코트 헤더 */
    .court-header {
        width: auto !important;
        min-width: auto !important;
        background: #d0d0d0 !important;
        color: black !important;
    }
    
    /* 매치 셀 - 코트배정 있는 경우 */
    .match-cell {
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
        padding: 2pt !important;
        vertical-align: middle !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    /* 빈 코트 */
    .empty-court {
        background: #f8f8f8 !important;
        color: #666 !important;
        font-style: italic !important;
    }
    
    /* 매치 내용 */
    .match-content {
        padding: 1pt !important;
        font-size: 8pt !important;
        line-height: 1.1 !important;
    }
    
    .match-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin: 1pt 0 !important;
    }
    
    .match-player {
        background: none !important;
        border: none !important;
        color: black !important;
        font-weight: normal !important;
        padding: 0 !important;
        margin: 0 1pt !important;
        font-size: 8pt !important;
        flex: 1 !important;
        text-align: center !important;
    }
    
    .match-player.mercenary {
        font-style: italic !important;
        color: #666 !important;
    }
    
    .vs-center,
    .vs-spacer {
        font-weight: bold !important;
        color: black !important;
        font-size: 7pt !important;
        margin: 0 1pt !important;
    }
    
    /* 기타 숨길 요소들 */
    .player-highlight,
    .match-highlighted {
        background: transparent !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    .search-result-info,
    .player-search-group {
        display: none !important;
    }
}
