/* 결과 컨테이너 */
.result-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* 매치 제목 */
.result-container h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 32px 0;
    line-height: 1.5;
}

/* 승자 배지 */
.winner-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 16px;
    font-size: 14px;
    margin: 0 8px;
    font-weight: 500;
}

/* 스코어 테이블 */
#score-table {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.game-table {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.game-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.game-score {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

/* 스코어 테이블 내부 */
.game-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-spacing: 4px;
}

.game-table th,
.game-table td {
    padding: 12px;
    text-align: center;
    font-size: 15px;
}

.game-table th.participant {
    text-align: left;
    color: var(--text-color);
    font-weight: 500;
    min-width: 120px;
}

.game-table td {
    color: var(--text-muted);
    background-color: var(--bg-light);
    border-radius: 6px;
}

/* Primary 버튼 */
.primary-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn:hover {
    background-color: var(--primary-hover-color);
}

/* 점수 입력 다이얼로그 */
#scoreDialog {
    padding: 0;
    max-width: 90%;
    width: 400px;
    margin: auto;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    background: var(--bg-color);
}

#scoreDialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

/* 헤더 영역 */
#scoreDialog h2 {
    margin: 0;
    padding: 20px 24px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

/* 매치 정보 */
#score_dialog_match {
    margin: 0;
    padding: 12px 24px;
    font-size: 14px;
    text-align: center;
    color: var(--primary-hover-color);
    background: var(--bg-light);
}

/* 게임 수 입력 영역 */
#scoreDialog label {
    flex: 1;
    display: block;
    margin: 20px 24px 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

#scoreGames {
    width: calc(100% - 48px);
    margin: 0 24px 20px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-color);
    background: white;
}

#scoreGames:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(34, 86, 178, 0.1);
}

/* 스코어 테이블 */
#scoreInputsContainer {
    width: calc(100% - 48px);
    margin: 0 24px 24px;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

#scoreInputsContainer th {
    padding: 12px;
    background: var(--bg-light);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-color);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

#scoreInputsContainer td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

#scoreInputsContainer tr:last-child td {
    border-bottom: none;
}

.score-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    color: var(--text-color);
}

.score-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(34, 86, 178, 0.1);
}

.game-column {
    width: 60px;
}

.team-column {
    width: calc((100% - 60px) / 2);
}

/* 다이얼로그 버튼 */
.dialog-buttons {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

#scoreDialogCancelBtn,
#scoreDialogConfirmBtn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#scoreDialogCancelBtn {
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
}

#scoreDialogCancelBtn:hover {
    background: var(--bg-light);
    border-color: var(--text-muted);
}

#scoreDialogConfirmBtn {
    border: none;
    background: var(--primary-color);
    color: white;
}

#scoreDialogConfirmBtn:hover {
    background: var(--primary-hover-color);
}

/* 버튼 컨테이너 */
.button-container {
    display: flex;
    gap: 12px;
    margin: 24px 0;
}

.button-container .secondary-btn {
    margin: 0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .result-container {
        padding: 16px;
    }

    .result-container h2 {
        font-size: 20px;
        margin: 24px 0;
    }

    .game-table {
        padding: 16px;
    }

    .game-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .game-title {
        font-size: 16px;
    }

    .game-score {
        font-size: 18px;
    }

    .game-table th,
    .game-table td {
        padding: 8px;
        font-size: 14px;
    }

    .game-table th.participant {
        min-width: 100px;
    }
    
    .button-container {
        flex-direction: column;
    }
}

/* 스크롤바 스타일 */
.game-table > div {
    scrollbar-width: thin;
    scrollbar-color: #ddd #f1f1f1;
}

.game-table > div::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.game-table > div::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.game-table > div::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.game-table > div::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.confirm-dialog {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: dialogSlide 0.3s ease;
}

.confirm-dialog-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    padding: 12px;
    background-color: rgba(241, 196, 15, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--warning-color);
}

.confirm-dialog-title {
    color: var(--text-color);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.confirm-dialog-content {
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.confirm-dialog-message {
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 8px;
    text-align: center;
}

.confirm-dialog-submessage {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.confirm-dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.confirm-dialog-button {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.confirm-dialog-button.primary {
    background-color: var(--primary-color);
    color: white;
}

.confirm-dialog-button.primary:hover {
    background-color: var(--primary-hover-color);
}

.confirm-dialog-button.secondary {
    background-color: var(--bg-light);
    color: var(--text-color);
}

.confirm-dialog-button.secondary:hover {
    background-color: var(--bg-heavy-light);
}

@keyframes dialogSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .confirm-dialog {
        padding: 20px;
    }
    
    .confirm-dialog-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 12px;
    }
    
    .confirm-dialog-title {
        font-size: 18px;
    }
    
    .confirm-dialog-message {
        font-size: 14px;
    }
    
    .confirm-dialog-submessage {
        font-size: 13px;
    }
    
    .confirm-dialog-button {
        padding: 8px 20px;
        font-size: 13px;
    }
}

/* 승부차기 체크박스 스타일 */
.penalty-checkbox {
    display: flex;
    gap: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.penalty-checkbox:hover {
    background-color: var(--bg-heavy-light);
}

.penalty-checkbox label {
    display: flex !important;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin: 0 !important;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
}

.penalty-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background-color: white;
    flex-shrink: 0;
}

.penalty-checkbox input[type="checkbox"]:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 86, 178, 0.1);
}

.penalty-checkbox input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.penalty-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#penaltyScore td:first-child {
    font-size: smaller;
    white-space: nowrap;
}

.forfeit-teams {
    margin: 12px 24px;
    padding: 12px;
    background-color: var(--bg-heavy-light);
    border-radius: 8px;
    display: none;
}

.forfeit-teams label {
    display: block;
    margin: 2px 0 12px 3px !important;
    font-size: 14px;
    color: var(--text-color);
}

.forfeit-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forfeit-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.forfeit-option:hover {
    background-color: var(--bg-light);
}

.forfeit-option input[type="radio"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    appearance: none;
    cursor: pointer;
    position: relative;
}

.forfeit-option input[type="radio"]:checked {
    border-color: var(--primary-color);
}

.forfeit-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.forfeit-option label {
    margin-bottom: 0 !important;
    cursor: pointer;
}

@media (max-width: 500px) {
    .forfeit-teams {
        margin: 12px 16px;
        padding: 10px;
    }
    
    .forfeit-option {
        padding: 6px 10px;
    }

    #scoreDialog label {
        margin: 16px 20px 8px;
    }
}

.hidden {
    display: none !important;
}

.winner-selection {
    margin: 12px 20px 15px 20px;
}

.winner-selection > label {
    display: block;
    margin: 0 0 10px 0 !important;
    font-weight: bold;
}

.winner-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.winner-option-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 !important;
    text-align: center;
}

.winner-option-label:hover {
    border-color: var(--accent-color);
}

.winner-radio {
    display: none;
}

.winner-name {
    font-size: 1.1em;
    font-weight: 500;
    padding: 5px 10px;
}

/* 선택된 승자 스타일 */
.winner-radio:checked + .winner-option-label {
    border-color: var(--accent-color);
    background-color: var(--accent-color);
    color: white;
}

.winner-radio:checked + .winner-option-label .winner-name {
    color: white;
}

#scoreInputsContainer td:first-child {
    font-size: smaller;
    white-space: nowrap;
}
