/* Modal Styles */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    margin: 20px;
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
    border: 2px solid #3498db;
}

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

.modal-header {
    padding: 25px 30px 20px;
    border-bottom: 2px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #3498db;
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
}

.close {
    color: #bdc3c7;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 30px;
    color: #ecf0f1;
}

.modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid #34495e;
}

/* Settings Modal Specific */
.setting-group {
    margin-bottom: 25px;
}

.setting-group label {
    display: block;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 15px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    color: #ecf0f1;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 0;
}

.radio-group input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
    accent-color: #3498db;
}

input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #34495e;
    border-radius: 8px;
    background: #2c3e50;
    color: #ecf0f1;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* Game Over Modal Specific */
#winner-announcement {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 20px;
}

#final-scores {
    background: rgba(44, 62, 80, 0.8);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

#final-scores h3 {
    color: #3498db;
    margin-bottom: 15px;
    text-align: center;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #34495e;
}

.score-row:last-child {
    border-bottom: none;
}

.score-row .player-name {
    font-weight: bold;
    color: #ecf0f1;
}

.score-row .player-score {
    font-weight: bold;
    color: #e74c3c;
    font-size: 1.2rem;
}

.score-row.winner {
    background: rgba(39, 174, 96, 0.2);
    border-radius: 5px;
    padding: 15px 10px;
}

.score-row.winner .player-name {
    color: #27ae60;
}

/* Rules Modal Specific */
.rules-content {
    line-height: 1.6;
}

.rules-content h3 {
    color: #3498db;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.rules-content h3:first-child {
    margin-top: 0;
}

.rules-content ul, .rules-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.rules-content li {
    margin-bottom: 8px;
    color: #ecf0f1;
}

.rules-content p {
    margin-bottom: 15px;
    color: #ecf0f1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 20px 25px 15px;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 25px;
    }
    
    .modal-footer {
        padding: 15px 25px 25px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .radio-group {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 5px;
        width: calc(100% - 10px);
        border-radius: 10px;
    }
    
    .modal-header {
        padding: 15px 20px 10px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 10px 20px 20px;
    }
    
    .close {
        font-size: 1.5rem;
    }
    
    #winner-announcement {
        font-size: 1.3rem;
    }
}

/* Feedback Modal Specific */
.feedback-content {
    max-width: 500px;
}

.feedback-content p {
    color: #bdc3c7;
    margin-bottom: 20px;
    line-height: 1.5;
}

.feedback-content h2 {
    color: #3498db;
    margin-bottom: 20px;
    padding: 25px 30px 20px;
    border-bottom: 2px solid #3498db;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #ecf0f1;
    font-weight: bold;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #34495e;
    border-radius: 4px;
    background-color: #2c3e50;
    color: #ecf0f1;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.feedback-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

.feedback-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.feedback-status.sending {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
