/* 모달 스타일 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

.modal.large-modal {
    max-width: 1000px;
    width: 95%;
}

.modal.small-modal {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem 2rem 1rem;
    border-bottom: 2px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 2px solid #e1e8ed;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* 체크박스 스타일 - 개선된 버전 */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
    user-select: none;
    margin: 8px 0;
    padding: 4px 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label:hover .checkmark {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

/* 포커스 상태 */
.checkbox-label:focus-within .checkmark {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 대회 상세 모달 스타일 */
.tournament-detail-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tournament-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e1e8ed;
}

.tournament-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e1e8ed;
}

.section-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
}

/* 🔥 참가선수 목록 - 심플하고 스크롤 가능 */
.participants-grid {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 8px;
}

.participants-grid::-webkit-scrollbar {
    width: 6px;
}

.participants-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.participants-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.participants-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.participant-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    min-height: 40px;
}

.participant-card:last-child {
    margin-bottom: 0;
}

.participant-card:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateX(2px);
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.participant-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 60px;
}

.participant-details {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.participant-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.participant-edit {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.participant-edit:hover {
    background: #218838;
    transform: scale(1.1);
}

.participant-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.participant-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* 🔥 참가자 헤더 정보 */
.participants-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
    font-size: 12px;
}

.participants-count {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.participants-scroll-hint {
    color: #6c757d;
    font-style: italic;
}

/* 🔥 참가자 빈 상태 */
.participants-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    height: 100%;
    min-height: 120px;
}

.participants-empty-state .empty-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.participants-empty-state .empty-text {
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 4px;
}

.participants-empty-state .empty-hint {
    font-size: 12px;
    color: #9ca3af;
}

/* 🔥 선수 성별 색상 구분 (기존 코트배정과 동일한 색상) */
.player-name.gender-male:not(.mercenary), .match-player.gender-male:not(.mercenary) {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
    font-weight: 500;
}

.player-name.gender-female:not(.mercenary), .match-player.gender-female:not(.mercenary) {
    background: #fce4ec;
    color: #c2185b;
    border: 1px solid #f8bbd9;
    font-weight: 500;
}

/* 🔥 용병 선수 스타일 - 회색 계통으로 최우선 적용 */
.player-name.mercenary, .match-player.mercenary,
.player-name.gender-male.mercenary, .match-player.gender-male.mercenary,
.player-name.gender-female.mercenary, .match-player.gender-female.mercenary {
    background: #f5f5f5 !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
    font-weight: 500 !important;
}

/* 기본 선수 스타일 (성별 미지정시) */
.player-name:not(.gender-male):not(.gender-female):not(.mercenary), 
.match-player:not(.gender-male):not(.gender-female):not(.mercenary) {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

/* 🔥 코트배정 미사용시 선수 이름 스타일 - 코트배정시와 동일하게 */
.simple-match .player-name {
    display: inline-block;
    padding: 0.25rem 0.5rem !important; /* 코트배정시와 동일한 패딩 */
    margin: 0.1rem;
    border-radius: 4px;
    font-size: 0.85rem !important; /* 코트배정시와 동일한 폰트 크기 */
    font-weight: 500;
    text-align: center;
    cursor: grab;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
    min-width: 60px; /* 최소 너비 보장 */
    min-height: 24px; /* 🔥 코트배정시와 동일한 높이 */
    line-height: 1.2; /* 텍스트 세로 중앙 정렬 */
    box-sizing: border-box; /* 패딩 포함 크기 계산 */
}

/* 호버 효과 */
.player-name:hover, .match-player:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    z-index: 10;
    transition: all 0.2s ease;
}

/* 드래그 중일 때 */
.player-name.dragging, .match-player.dragging {
    opacity: 0.7;
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 1000;
}

/* 성별 구분 범례 추가용 스타일 */
.gender-legend {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    font-size: 12px;
    align-items: center;
}

.gender-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gender-legend-color {
    width: 20px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.gender-legend-color.male {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
}

.gender-legend-color.female {
    background: #fce4ec;
    border: 1px solid #f8bbd9;
}

.gender-legend-color.mercenary {
    background: #f5f5f5;
    border: 1px solid #ddd;
}

/* 🔥 선수 수정 모달 - 다른 모든 모달보다 위에 표시 + 화면 중앙 정렬 */
#edit-participant-modal {
    display: none !important; /* 🔥 기본적으로 숨김 */
    z-index: 1100 !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 500px !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
}

#edit-participant-modal.modal {
    z-index: 1100 !important;
}

/* 참가자 선택 모달 */
.participant-search {
    margin-bottom: 1rem;
}

.available-players {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 1rem;
}

.available-player {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.available-player:hover {
    background: #f8f9fa;
}

.available-player.selected {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.available-player input[type="checkbox"] {
    margin-right: 1rem;
}

.available-player-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.available-player-name {
    font-weight: 600;
    color: #2c3e50;
}

.available-player-details {
    font-size: 0.875rem;
    color: #6c757d;
}

/* 대진표 컨테이너 */
.bracket-container {
    width: 100%;
    margin-bottom: 2rem;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 2rem;
    overflow-x: auto;
}

/* 반응형: 모바일에서 패딩 줄이기 */
@media (max-width: 768px) {
    .bracket-container {
        padding: 1rem;
    }
}

/* 대진표 테이블 래퍼 (스크롤 가능) */
.bracket-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* 스크롤바 스타일링 */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

.bracket-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.bracket-table-wrapper::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 4px;
}

.bracket-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.bracket-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.bracket-table {
    width: 100%;
    min-width: 600px; /* 최소 너비 보장 */
    border-collapse: collapse;
    margin: 0;
}

.bracket-table th,
.bracket-table td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.bracket-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 10;
}

.bracket-table.simple-bracket {
    min-width: auto;
}

/* 라운드 헤더 - sticky 고정 제거 */
.round-header {
    min-width: 80px;
    background: #2c3e50 !important;
    color: white !important;
    /* position: sticky; left: 0; z-index: 11; 제거 - 가로 스크롤 시 함께 이동 */
}

/* 코트 헤더 */
.court-header {
    min-width: 200px;
    background: #34495e !important;
    color: white !important;
}

/* 라운드 셀 - sticky 고정 제거 */
.round-cell {
    min-width: 80px;
    background: #ecf0f1;
    font-weight: 600;
    color: #2c3e50;
    /* position: sticky; left: 0; z-index: 5; 제거 - 가로 스크롤 시 함께 이동 */
}

/* 매치 셀 */
.match-cell {
    min-width: 200px;
    max-width: 280px;
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    min-height: 70px; /* 높이 감소 */
}

/* 코트 배정이 없는 경우의 매치 셀 */
.simple-bracket .match-cell {
    min-height: 60px;
    min-width: 250px;
}

/* 빈 코트 */
.empty-court {
    background: #f8f9fa;
    color: #6c757d;
    font-style: italic;
}

.empty-match {
    padding: 1.5rem 0;
    color: #6c757d;
    font-size: 1.2rem;
}

/* 매치 내용 */
.match-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem; /* 행 간 간격 감소 */
    min-height: 50px;
    justify-content: center;
    padding: 0.25rem;
}

/* 매치 행 (선수1 vs 선수3, 선수2 선수4) */
.match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* VS 중앙 표시 */
.vs-center {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
}

/* VS 공간 (두 번째 줄) */
.vs-spacer {
    min-width: 20px;
    flex-shrink: 0;
}

/* 드래그 앤 드롭 관련 스타일 */
.match-player {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
    white-space: nowrap;
    flex: 1;
    max-width: 100px; /* 최대 너비 제한 */
    cursor: grab; /* 드래그 가능 표시 */
    user-select: none; /* 텍스트 선택 방지 */
    transition: all 0.2s ease;
    position: relative;
}

.match-player:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1;
}

.match-player:active {
    cursor: grabbing;
}

.match-player.dragging {
    opacity: 0.6;
    transform: rotate(3deg) scale(1.1);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.match-player.drag-over {
    background: #fff3cd !important;
    border: 2px dashed #856404 !important;
    transform: scale(1.1);
    animation: pulse 0.5s ease-in-out infinite alternate;
}

.match-player.drop-target {
    background: #d1ecf1 !important;
    border: 2px solid #0c5460 !important;
    transform: scale(1.05);
}

/* 드래그 앤 드롭 애니메이션 */
@keyframes pulse {
    from {
        box-shadow: 0 0 0 0 rgba(133, 100, 4, 0.4);
    }
    to {
        box-shadow: 0 0 0 8px rgba(133, 100, 4, 0);
    }
}

/* 드래그 힌트 제거됨 - 상단 안내문구로 대체 */

/* 🔥 기존 중복 스타일 제거 및 통합 - 용병 스타일 최우선 적용 */
.match-player.mercenary,
.player-name.mercenary {
    background: #f5f5f5 !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
    font-weight: 500 !important;
}

/* 행 스타일 */
.bracket-row:nth-child(even) {
    background: #f8f9fa;
}

.bracket-row:hover {
    background: #e3f2fd;
}

.bracket-row:hover .round-cell {
    background: #d1ecf1;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .bracket-table-wrapper {
        border-radius: 4px;
    }
    
    .bracket-table th,
    .bracket-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
    }
    
    .match-cell {
        min-width: 180px;
        min-height: 50px;
        padding: 0.5rem 0.25rem;
    }
    
    .simple-bracket .match-cell {
        min-width: 200px;
    }
    
    .match-content {
        gap: 0.25rem;
        padding: 0.2rem;
    }
    
    .match-row {
        gap: 0.3rem;
    }
    
    .match-player {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
        min-width: 50px;
        max-width: 80px;
    }
    
    .vs-center {
        font-size: 0.65rem;
        min-width: 18px;
    }
    
    .vs-spacer {
        min-width: 18px;
    }
    
    .court-header {
        min-width: 180px;
    }
    
    .round-header,
    .round-cell {
        min-width: 60px;
    }
}

/* 인쇄용 스타일 */
@media print {
    .bracket-table-wrapper {
        overflow: visible;
        border: none;
        box-shadow: none;
    }
    
    .bracket-table {
        min-width: auto;
        width: 100%;
    }
    
    .bracket-table th,
    .bracket-table td {
        position: static;
        font-size: 0.75rem;
        padding: 0.25rem;
    }
}

.court-label {
    font-weight: 600;
    color: #667eea;
    background: #f0f4ff;
    padding: 0.5rem;
    border-radius: 4px;
}

.round-label {
    font-weight: 600;
    color: #2c3e50;
}

/* 브래킷 액션 버튼들 */
.bracket-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
}

/* 모달 헤더 액션 버튼들 */
.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 4px;
    white-space: nowrap;
}

/* 편집 모드 버튼 스타일 */
#save-tournament-edit-btn {
    background-color: #28a745;
    color: white;
    border: 1px solid #28a745;
}

#save-tournament-edit-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

#cancel-edit-btn {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

#cancel-edit-btn:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* 대회 정보 섹션 */
.tournament-info-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.tournament-info-section h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

/* 편집 폼 스타일 */
.tournament-edit-form {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-options .form-group {
    margin: 0;
}

/* 간단한 대진표 스타일 (코트배정 없는 경우) */
.simple-bracket .round-cell {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
    font-weight: bold;
    background-color: #f8f9fa;
}

.simple-match-content {
    padding: 8px 12px;
    line-height: 1.4;
    font-size: 0.9rem;
}

.simple-match-content .player-name {
    display: inline-block;
    padding: 0.25rem 0.5rem; /* 코트배정시와 동일한 패딩 */
    margin: 0.1rem;
    border-radius: 4px;
    font-size: 0.85rem; /* 코트배정시와 동일한 폰트 크기 */
    font-weight: 500;
    text-align: center;
    cursor: grab;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
    min-width: 60px; /* 최소 너비 보장 */
}

.simple-match-content .player-name:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    z-index: 10;
}

/* 🔥 용병 스타일이 성별 스타일보다 우선 적용되도록 */
.simple-match-content .player-name.mercenary {
    background: #f5f5f5 !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
    font-weight: 500 !important;
}

.simple-match-content .player-name.gender-male:not(.mercenary) {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.simple-match-content .player-name.gender-female:not(.mercenary) {
    background: #fce4ec;
    color: #c2185b;
    border: 1px solid #f8bbd9;
}

.simple-match-content .vs-text {
    font-weight: bold;
    color: #666;
    margin: 0 8px;
    font-size: 0.85rem;
}

/* 선수 교체 모달 스타일 */
.player-search-section {
    position: relative;
    margin: 1rem 0;
}

.player-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.player-suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #e3f2fd;
}

.suggestion-item.mercenary {
    background-color: #fff3e0;
    border-left: 3px solid #ff9800;
}

.suggestion-item.mercenary:hover,
.suggestion-item.mercenary.selected {
    background-color: #ffe0b2;
}

.suggestion-player-info {
    display: flex;
    flex-direction: column;
}

.suggestion-player-name {
    font-weight: 500;
    color: #333;
}

.suggestion-player-name.mercenary {
    color: #e65100;
}

.suggestion-player-details {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

.suggestion-player-badge {
    background: #2196f3;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.suggestion-player-badge.mercenary {
    background: #ff9800;
}

.suggestion-player-badge.male {
    background: #1976d2;
}

.suggestion-player-badge.female {
    background: #c2185b;
}

/* 검색 입력창 포커스 시 */
.search-input:focus + .player-suggestions {
    border-color: #2196f3;
}

/* 스크롤바 스타일 */
.player-suggestions::-webkit-scrollbar {
    width: 6px;
}

.player-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.player-suggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.player-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
#player-swap-modal {
    z-index: 1060; /* 다른 모달보다 위에 표시 */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

#player-swap-modal .modal-content {
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid #007bff;
    border-radius: 8px;
    margin: 0; /* 기본 마진 제거 */
}

/* 🔧 모달 오버레이 투명도 조정 */
.modal-overlay.active {
    background-color: rgba(0, 0, 0, 0.3); /* 기존보다 더 투명하게 */
}

.swap-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.swap-info p {
    margin: 0.5rem 0;
    color: #495057;
}

.player-search-section {
    position: relative;
    margin-bottom: 1rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item.mercenary-result {
    background-color: #f8f9fa;
    border-left: 3px solid #6c757d;
}

.search-result-item.mercenary-result:hover {
    background-color: #e9ecef;
}

.search-result-item.mercenary-result .search-result-name {
    color: #6c757d;
    font-style: italic;
}

.search-result-item.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

.search-result-name {
    font-weight: 500;
    color: #2c3e50;
}

.search-result-details {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.selected-player-info {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #e8f5e8;
    border-radius: 6px;
    border: 1px solid #28a745;
}

.selected-player-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.selected-player-card .player-info {
    flex: 1;
}

.selected-player-card .player-name {
    font-weight: 600;
    color: #155724;
    font-size: 1.1rem;
}

.selected-player-card .player-details {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* 대진표 표시 옵션 스타일 */
.bracket-options {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.options-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-label {
    font-weight: 500;
    color: #495057;
    margin-right: 0.5rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.radio-option input[type="radio"] {
    margin: 0;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-option input[type="checkbox"] {
    margin: 0;
}

/* 경기번호 표시 스타일 */
.game-number {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
    transition: all 0.3s ease;
}

/* 기준게임수 초과 경기번호 */
.game-number.over-limit {
    background: #dc3545;
    color: white;
    animation: pulse-warning 2s infinite;
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.6);
    border: 2px solid #fff;
}

/* 기준게임수 초과 경기번호 애니메이션 */
@keyframes pulse-warning {
    0% { 
        background: #dc3545;
        transform: scale(1);
        box-shadow: 0 0 6px rgba(220, 53, 69, 0.6);
    }
    50% { 
        background: #c82333;
        transform: scale(1.1);
        box-shadow: 0 0 10px rgba(220, 53, 69, 0.8);
    }
    100% { 
        background: #dc3545;
        transform: scale(1);
        box-shadow: 0 0 6px rgba(220, 53, 69, 0.6);
    }
}

/* 기준게임수 초과 경기번호 호버 효과 */
.game-number.over-limit:hover {
    background: #c82333;
    cursor: help;
    animation-play-state: paused;
    transform: scale(1.15);
}

.player-name, .match-player {
    position: relative;
}

/* 실력 표시 스타일 */
.skill-suffix {
    font-size: 0.8em;
    font-weight: bold;
    color: #6c757d;
    margin-left: 2px;
}

/* 인쇄 시 경기번호 숨기기 */
@media print {
    .game-number {
        display: none !important;
    }
}

/* 드래그 앤 드롭 스타일 */
.simple-match-content .player-name.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.simple-match-content .player-name.drag-over {
    background-color: #fff9c4 !important;
    border-color: #f9a825 !important;
    transform: scale(1.05);
}

/* 대진표 관련 스타일 */
.bracket-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bracket-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 반응형 개선 */
@media (max-width: 768px) {
    .modal-header-actions {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .modal-header-actions .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* 토스트 알림 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    animation: toastSlideIn 0.3s ease-out;
}

.toast.error {
    background: #dc3545;
}

.toast.warning {
    background: #ffc107;
    color: #212529;
}

.toast.info {
    background: #17a2b8;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 드래그 앤 드롭 */
.drag-over {
    border: 2px dashed #667eea !important;
    background: #f0f4ff !important;
}

.dragging {
    opacity: 0.5;
}

/* 반응형 모달 */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 1rem;
    }
    
    .tournament-info-grid {
        grid-template-columns: 1fr;
    }
    
    .participants-grid {
        grid-template-columns: 1fr;
    }
    
    .bracket-table {
        font-size: 0.875rem;
    }
    
    .bracket-table th,
    .bracket-table td {
        padding: 0.5rem;
    }
    
    .bracket-actions {
        align-items: stretch;
    }
    
    .bracket-options {
        justify-content: center;
    }
    
    .bracket-buttons {
        justify-content: center;
    }
    
    .checkbox-label {
        font-size: 0.85rem;
    }
}

/* 위험 구역 스타일 */
.danger-zone {
    border: 2px solid #ff4757;
    border-radius: 8px;
    padding: 1rem;
    background: #fff5f5;
}

.danger-zone label {
    color: #d63031;
    font-weight: 600;
}

.danger-text {
    color: #d63031 !important;
    font-weight: 500;
}

.btn-danger {
    background: linear-gradient(135deg, #ff4757, #d63031);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d63031, #b71c1c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(214, 48, 49, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(214, 48, 49, 0.2);
}

/* 확인 모달 스타일 */
.confirm-modal .modal-body {
    text-align: center;
    padding: 2rem;
}

.confirm-modal .confirm-icon {
    font-size: 4rem;
    color: #ff4757;
    margin-bottom: 1rem;
}

.confirm-modal .confirm-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 1rem;
}

.confirm-modal .confirm-message {
    color: #636e72;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.confirm-modal .confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
/* 선수 검색 및 하이라이트 스타일 */
.player-search-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-search-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    min-width: 150px;
}

.player-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 3px;
    min-width: auto;
}

/* 선수 하이라이트 스타일 */
.player-highlighted {
    background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
    color: #333 !important;
    font-weight: bold !important;
    border: 2px solid #f39c12 !important;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5) !important;
    animation: highlightPulse 2s ease-in-out infinite;
}

.match-highlighted {
    background: rgba(255, 215, 0, 0.1) !important;
    border: 2px solid #ffd700 !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3) !important;
}

@keyframes highlightPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 15px rgba(243, 156, 18, 0.8);
    }
}

/* 검색 결과 정보 */
.search-result-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #1976d2;
}

/* 옵션 그룹 간격 조정 */
.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-group:last-child {
    margin-left: auto;
}
/* 드래그앤드롭 스타일 */
.bracket-row, .match-cell {
    transition: all 0.2s ease;
    cursor: grab;
    position: relative;
}

.bracket-row:active, .match-cell:active {
    cursor: grabbing;
}

.bracket-row.dragging, .match-cell.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 2px dashed #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.bracket-row.drag-over, .match-cell.drag-over {
    border: 2px solid #28a745;
    background: rgba(40, 167, 69, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.bracket-row.drop-target, .match-cell.drop-target {
    border: 2px dashed #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

/* 매치 셀 드래그 영역 표시 */
.match-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    border: 1px dashed transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1;
}

.match-cell:hover::before {
    border-color: rgba(0, 123, 255, 0.3);
    background: rgba(0, 123, 255, 0.05);
}

/* 드래그 가이드 메시지 */
.drag-guide {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1001;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.drag-guide.show {
    opacity: 1;
    transform: translateY(0);
}

/* 테이블 행 드래그 스타일 */
.bracket-table tbody tr {
    transition: all 0.2s ease;
}

.bracket-table tbody tr.dragging {
    opacity: 0.5;
    background: rgba(0, 123, 255, 0.1);
    border: 2px dashed #007bff;
}

.bracket-table tbody tr.drag-over {
    background: rgba(40, 167, 69, 0.1);
    border-top: 3px solid #28a745;
    border-bottom: 3px solid #28a745;
}

/* 드래그 중 커서 스타일 */
.dragging-active {
    cursor: grabbing !important;
}

.dragging-active * {
    cursor: grabbing !important;
}

/* 모바일 터치 지원 */
@media (max-width: 768px) {
    .bracket-row.dragging, .match-cell.dragging {
        transform: scale(0.9);
    }
}
/* 간단한 매치 스타일 (코트 배정 미사용) */
.simple-match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    min-height: 40px;
}

.simple-match .match-teams {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.simple-match .team {
    display: flex;
    gap: 4px;
}

.simple-match .vs {
    font-weight: bold;
    color: #6c757d;
    margin: 0 4px;
}

.simple-match .match-info {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
}

.simple-match .match-round,
.simple-match .match-court {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}
/* 선수 드래그앤드롭 스타일 */
.player-name, .match-player {
    transition: all 0.2s ease;
    cursor: grab !important; /* 선수 드래그 커서 강제 적용 */
    position: relative;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid transparent;
    z-index: 10; /* 매치 셀보다 위에 표시 */
}

.player-name:active, .match-player:active {
    cursor: grabbing !important;
}

.player-name.dragging, .match-player.dragging {
    opacity: 0.6;
    transform: scale(0.9);
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px dashed #007bff;
    background: rgba(0, 123, 255, 0.2);
    border-radius: 4px;
}

.player-name.drag-over, .match-player.drag-over {
    border: 2px solid #28a745;
    background: rgba(40, 167, 69, 0.2);
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.4);
    border-radius: 4px;
}

/* 선수 이름 호버 효과 */
.player-name:hover, .match-player:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
    cursor: grab !important;
}

/* 드래그 중 선수 구분 */
.player-name.dragging::before, .match-player.dragging::before {
    content: '👤';
    position: absolute;
    top: -5px;
    left: -5px;
    font-size: 12px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

/* 매칭 드래그와 선수 드래그 구분 */
.match-cell.dragging {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.match-cell.dragging::before {
    content: '🏸 매칭 교체';
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 193, 7, 0.9);
    color: #333;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    z-index: 1002;
}
/* 빈 코트 드래그 스타일 */
.empty-court {
    cursor: grab !important;
    transition: all 0.2s ease;
    border: 1px dashed #dee2e6;
    background: #f8f9fa;
}

.empty-court:hover {
    border-color: rgba(0, 123, 255, 0.5);
    background: rgba(0, 123, 255, 0.05);
    transform: translateY(-1px);
}

.empty-court.dragging {
    opacity: 0.6;
    transform: scale(0.95);
    border: 2px dashed #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.empty-court.drag-over {
    border: 2px solid #28a745;
    background: rgba(40, 167, 69, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}
/* 대진표 안내문구 */
.bracket-guide {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bracket-guide h4 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.guide-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.guide-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.guide-text {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

.guide-text strong {
    color: #495057;
    font-weight: 600;
}

/* 반응형 - 모바일에서는 세로 배치 */
@media (max-width: 768px) {
    .bracket-guide {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .bracket-guide h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .guide-text {
        font-size: 12px;
    }
    
    .guide-icon {
        font-size: 14px;
        width: 18px;
    }
}

/* 대형 화면에서는 가로 배치 */
@media (min-width: 992px) {
    .guide-items {
        flex-direction: row;
        justify-content: space-between;
        gap: 16px;
    }
    
    .guide-item {
        flex: 1;
        justify-content: flex-start;
    }
}

/* 컨텍스트 메뉴 스타일 */
.context-menu {
    position: fixed;
    z-index: 2000;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    max-width: 250px;
    padding: 4px 0;
    font-size: 14px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.context-menu.show {
    opacity: 1;
    transform: scale(1);
}

.context-menu-content {
    display: flex;
    flex-direction: column;
}

.context-menu-section {
    display: flex;
    flex-direction: column;
}

.context-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.context-menu-item:hover {
    background-color: #f8f9fa;
}

.context-menu-item:active {
    background-color: #e9ecef;
}

.context-icon {
    margin-right: 8px;
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.context-menu-separator {
    height: 1px;
    background-color: #dee2e6;
    margin: 4px 0;
}

.context-menu-item.disabled {
    color: #6c757d;
    cursor: not-allowed;
}

.context-menu-item.disabled:hover {
    background-color: transparent;
}

.context-menu-item[data-action="delete-match"] {
    color: #dc3545;
}

.context-menu-item[data-action="delete-match"]:hover {
    background-color: #f8d7da;
    color: #721c24;
}

/* 🔥 라운드 추가 버튼 스타일 */
.add-round-container {
    display: flex;
    justify-content: center;
    margin: 16px 0;
    padding: 12px;
    border-top: 2px dashed #dee2e6;
}

.add-round-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-round-btn:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.add-round-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.add-round-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 🔥 라운드 셀 우클릭 스타일 */
.round-cell {
    cursor: context-menu;
    transition: background-color 0.2s ease;
}

.round-cell:hover {
    background-color: #f8f9fa !important;
}
/* 🔥 간단한 대진표 드래그 스타일 */
.simple-bracket .bracket-row {
    transition: all 0.2s ease;
}

.simple-bracket .bracket-row.dragging {
    opacity: 0.6;
    transform: scale(0.98);
    background: rgba(0, 123, 255, 0.1) !important;
    border: 2px dashed #007bff !important;
}

.simple-bracket .bracket-row.drag-over {
    background: rgba(40, 167, 69, 0.1) !important;
    border: 2px solid #28a745 !important;
    transform: scale(1.02);
}

.simple-bracket .bracket-row:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    cursor: grab;
}

.simple-bracket .bracket-row:active {
    cursor: grabbing;
}
/* 선수 테이블 스타일 */
.players-container {
    width: 100%;
}

.players-count-info {
    margin-bottom: 1rem;
    text-align: right;
}

.count-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-header {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sort-status {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s;
}

.sort-status.active {
    color: var(--primary-color);
    font-weight: 600;
}

.players-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed; /* 고정 테이블 레이아웃으로 컬럼 너비 제어 */
}

.players-table thead {
    background: var(--primary-color);
    color: white;
}

.players-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    white-space: nowrap; /* 헤더 텍스트 줄바꿈 방지 */
}

/* 컬럼별 너비 설정 */
.players-table th:nth-child(1), /* 선수명 */
.players-table td:nth-child(1) {
    width: 25%;
    min-width: 150px;
}

.players-table th:nth-child(2), /* 성별 */
.players-table td:nth-child(2) {
    width: 10%;
    min-width: 70px;
}

.players-table th:nth-child(3), /* 나이 */
.players-table td:nth-child(3) {
    width: 20%;
    min-width: 120px;
}

.players-table th:nth-child(4), /* 등록급수 */
.players-table td:nth-child(4) {
    width: 12%;
    min-width: 90px;
}

.players-table th:nth-child(5), /* 현재실력 */
.players-table td:nth-child(5) {
    width: 12%;
    min-width: 90px;
}

.players-table th:nth-child(6), /* 관리 */
.players-table td:nth-child(6) {
    width: 21%;
    min-width: 120px;
}

.players-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    position: relative;
}

.players-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 현재 정렬된 컬럼 강조 */
.players-table th.sort-active {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 700;
}

.players-table th.sort-active:hover {
    background: rgba(255, 255, 255, 0.2);
}

.actions-header {
    text-align: center;
}

.sort-icon {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.7;
    display: inline-block;
    min-width: 1rem;
    text-align: center;
    transition: all 0.2s;
    font-weight: normal;
}

/* 정렬 아이콘 상태별 스타일 - 이모지 아이콘 최적화 */
.sort-icon.sort-asc {
    opacity: 1 !important;
    font-weight: normal !important; /* 이모지는 bold 불필요 */
    transform: scale(1.3) !important;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5)) !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border-radius: 4px !important;
    padding: 0.2rem 0.3rem !important;
    display: inline-block !important;
    min-width: 1.2rem !important;
    text-align: center !important;
    margin-left: 0.5rem !important;
}

.sort-icon.sort-desc {
    opacity: 1 !important;
    font-weight: normal !important; /* 이모지는 bold 불필요 */
    transform: scale(1.3) !important;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5)) !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border-radius: 4px !important;
    padding: 0.2rem 0.3rem !important;
    display: inline-block !important;
    min-width: 1.2rem !important;
    text-align: center !important;
    margin-left: 0.5rem !important;
}

/* 호버 시 정렬 아이콘 강조 */
.players-table th.sortable:hover .sort-icon {
    opacity: 1;
    transform: scale(1.05);
}

/* 활성 정렬 헤더의 아이콘은 항상 보이도록 */
.players-table th.sort-active .sort-icon {
    opacity: 1 !important;
    font-weight: bold !important;
}

.players-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    word-wrap: break-word; /* 긴 텍스트 줄바꿈 허용 */
}

.player-row:hover {
    background: #f9fafb;
}

.player-row:nth-child(even) {
    background: #fafafa;
}

.player-row:nth-child(even):hover {
    background: #f0f0f0;
}

.player-name strong {
    display: block;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.125rem;
    line-height: 1.3;
}

.player-memo {
    display: block;
    color: #6b7280;
    font-size: 0.75rem;
    font-style: italic;
    line-height: 1.2;
    margin-top: 0.25rem;
}

.player-gender,
.player-grade,
.player-skill {
    text-align: center;
}

.player-age {
    text-align: center;
    font-weight: 500;
    line-height: 1.3;
}

.player-actions {
    text-align: center;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.375rem;
    margin: 0 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
}

.btn-icon:hover {
    background: #f3f4f6;
    transform: scale(1.1);
}

.btn-icon.edit:hover {
    background: #dbeafe;
}

.btn-icon.delete:hover {
    background: #fee2e2;
}

/* 컴팩트 배지 스타일 */
.badge.compact {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    min-width: 2.5rem;
    text-align: center;
    display: inline-block;
}

/* 반응형 테이블 */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }
    
    .players-table {
        min-width: 700px; /* 최소 너비 증가 */
    }
    
    .players-table th,
    .players-table td {
        padding: 0.5rem 0.75rem;
    }
    
    .player-memo {
        display: none;
    }
    
    /* 모바일에서 컬럼 너비 재조정 */
    .players-table th:nth-child(1),
    .players-table td:nth-child(1) {
        min-width: 120px;
    }
    
    .players-table th:nth-child(3),
    .players-table td:nth-child(3) {
        min-width: 100px;
    }
    
    .players-table th:nth-child(6),
    .players-table td:nth-child(6) {
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .players-table th,
    .players-table td {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    .btn-icon {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
        margin: 0 0.125rem;
    }
    
    .players-table {
        min-width: 600px;
    }
}
/* 참가자 헤더 정보 스타일 */
.participants-header-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid #e5e7eb;
}

.participants-count {
    font-size: 0.875rem;
    color: #ffffff !important;
    font-weight: 600;
    background: #3b82f6 !important; /* 파란색 배경 */
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    display: inline-block;
    border: 1px solid #2563eb; /* 테두리 추가 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* 그림자 추가 */
}

.participants-header-info .btn {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    background: #6b7280 !important;
    color: #ffffff !important;
    border: 1px solid #4b5563 !important;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.participants-header-info .btn:hover {
    background: #4b5563 !important;
    border-color: #374151 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.participants-header-info .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* 참가자 섹션 헤더 개선 */
.participants-section .section-header {
    padding-bottom: 0;
}

.participants-section .section-header h4 {
    margin-bottom: 0;
}

/* 반응형 - 모바일에서 헤더 정보 세로 배치 */
@media (max-width: 480px) {
    .participants-header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .participants-header-info .btn {
        align-self: stretch;
        text-align: center;
    }
}
/* 대진표 버튼 스타일 개선 */
.bracket-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.bracket-buttons .btn-sm {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border: 1px solid;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.bracket-buttons .btn-primary.btn-sm {
    background: #3b82f6 !important; /* 파란색 배경 */
    border-color: #2563eb !important;
    color: #ffffff !important; /* 흰색 글자 */
}

.bracket-buttons .btn-primary.btn-sm:hover {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bracket-buttons .btn-secondary.btn-sm {
    background: #6b7280 !important; /* 회색 배경 */
    border-color: #4b5563 !important;
    color: #ffffff !important; /* 흰색 글자 */
}

.bracket-buttons .btn-secondary.btn-sm:hover {
    background: #4b5563 !important;
    border-color: #374151 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 반응형 - 모바일에서 버튼 세로 배치 */
@media (max-width: 480px) {
    .bracket-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .bracket-buttons .btn-sm {
        width: 100%;
        text-align: center;
    }
}
/* 간단한 대진표 (코트배정 미사용) 스타일 */
.simple-bracket {
    width: 100%;
    border-collapse: collapse;
}

.simple-bracket th:first-child,
.simple-bracket .round-cell {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    text-align: center;
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 0.25rem;
}

.simple-bracket .match-cell {
    width: calc(100% - 30px);
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: middle;
}

/* 한 줄 매치 표시 스타일 */
.match-teams-inline {
    display: inline-block;
    width: 100%;
    line-height: 1.5;
    font-size: 0.9rem;
}

.vs-inline {
    font-weight: 600;
    margin: 0 0.5rem;
    color: #6b7280;
}

/* 선수 이름 간격 조정 - 자동 쉼표 제거 */
.simple-match .player-name {
    margin-right: 0.25rem;
}

/* 급수/실력 표시 스타일 - 깔끔한 검정색 */
.player-name, .match-player {
    word-spacing: 3px; /* 이름과 급수 사이 간격 */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 급수 표시 색상 - 검정색으로 통일 */
.player-name:not(.mercenary), 
.match-player:not(.mercenary) {
    color: inherit; /* 기본 텍스트 색상 유지 */
}

/* 급수가 포함된 선수 이름의 급수 부분만 검정색 강조 */
.grade-text {
    color: #333 !important;
    font-weight: 500;
}

/* 자동 쉼표 추가 제거 (JavaScript에서 처리) */
/* .simple-match .player-name:not(:last-child):after {
    content: ",";
    margin-right: 0.25rem;
} */

/* 성별 구분 색상 */
.simple-match .gender-male {
    color: #3b82f6;
    font-weight: 500;
}

.simple-match .gender-female {
    color: #ec4899;
    font-weight: 500;
}

.simple-match .mercenary {
    color: #ef4444;
    font-weight: 500;
    font-style: italic;
}
/* 드래그 가이드 스타일 */
.drag-guide {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    transition: all 0.2s ease;
}

.drag-guide.info {
    background: #3b82f6;
    color: white;
    border: 1px solid #2563eb;
}

.drag-guide.error {
    background: #ef4444;
    color: white;
    border: 1px solid #dc2626;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    25% { transform: translateX(-50%) translateY(-2px); }
    75% { transform: translateX(-50%) translateY(2px); }
}

/* 드래그 오버 스타일 개선 */
.drag-over {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 2px dashed #3b82f6 !important;
    border-radius: 4px;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.drag-over-invalid {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 2px dashed #ef4444 !important;
    border-radius: 4px;
    transform: scale(1.02);
    transition: all 0.2s ease;
    cursor: not-allowed !important;
}

/* 드래그 중인 요소 스타일 */
.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    transition: all 0.2s ease;
}
/* 이미지 생성 로딩 토스트 스타일 */
.toast.info {
    background: #3b82f6;
    color: white;
    border-left: 4px solid #2563eb;
}

.toast.info::before {
    content: "ℹ️";
    margin-right: 0.5rem;
}

/* 선수 이름 클릭 검색 관련 스타일 */
.match-player, .player-name {
    cursor: pointer !important;
    transition: all 0.2s ease;
}

.match-player:hover:not(.mercenary), 
.player-name:hover:not(.mercenary) {
    background-color: rgba(0, 123, 255, 0.1) !important;
    border-color: rgba(0, 123, 255, 0.3) !important;
    transform: scale(1.02);
}

/* 검색 피드백 스타일 - 클릭 위치 기반 */
.search-feedback {
    position: fixed;
    z-index: 1000;
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInScale 0.3s ease-out;
    font-size: 0.85em;
    white-space: nowrap;
    pointer-events: none; /* 마우스 이벤트 차단 */
}

.feedback-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.feedback-icon {
    font-size: 1.1em;
}

.feedback-text {
    font-weight: 500;
}

@keyframes fadeInScale {
    from {
        transform: translateX(-50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

/* 기존 슬라이드 애니메이션 제거 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 선수 클릭 가능 표시 */
.match-player:not(.mercenary)::after,
.player-name:not(.mercenary)::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #007bff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.match-player:not(.mercenary):hover::after,
.player-name:not(.mercenary):hover::after {
    opacity: 0.7;
}

/* 용병은 클릭 불가 표시 */
.match-player.mercenary,
.player-name.mercenary {
    cursor: default !important;
}
/* 참가자 선택 모달 스타일 */
.participant-search {
    margin-bottom: 1rem;
}

.search-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.search-row .search-input {
    flex: 1;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.btn-outline {
    background-color: white;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.filtered-count {
    margin-left: auto;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}
/* 선수풀 관리 화면 검색/필터 스타일 */
.search-section .search-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.search-section .filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-count {
    margin-left: auto;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    padding: 0.5rem;
}

/* 폼 도움말 텍스트 스타일 */
.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.25;
}
/* 엑셀 관련 버튼 스타일 */
.btn-outline {
    background-color: white;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-actions .btn {
    white-space: nowrap;
}

/* 파일 입력 숨김 */
#excel-file-input {
    display: none !important;
}
