/* Modal Styles */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 255, 255, 0.9) 100%
    );
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: modal-slide-up 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

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

.modal-title {
    font-size: 2.5em;
    font-weight: 900;
    text-align: center;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Win Modal Specific */
.win-modal .modal-title {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stars-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    font-size: 3em;
}

.star {
    animation: star-pop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.5));
}

.star:nth-child(1) {
    animation-delay: 0.1s;
}

.star:nth-child(2) {
    animation-delay: 0.2s;
}

.star:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes star-pop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.star.empty {
    opacity: 0.3;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.modal-stat {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 100%
    );
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.modal-stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.modal-stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
}

.modal-btn {
    padding: 18px 30px;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.modal-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.modal-btn:active::before {
    width: 300px;
    height: 300px;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn.secondary {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(240, 240, 240, 0.9) 100%
    );
    color: #333;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.modal-btn.danger {
    background: linear-gradient(135deg, #ee5a6f 0%, #f093fb 100%);
    color: white;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.modal-btn:active {
    transform: translateY(0);
}

/* Settings Modal */
.settings-group {
    margin: 25px 0;
}

.settings-group h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(5px);
}

.settings-item span {
    color: #333;
    font-weight: 600;
    font-size: 1.1em;
}

.settings-item input[type="checkbox"] {
    width: 50px;
    height: 26px;
    appearance: none;
    background: #ccc;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-item input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.settings-item input[type="checkbox"]:checked::before {
    left: 27px;
}

.settings-item select {
    padding: 10px 15px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    background: white;
    color: #333;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Tutorial Modal */
.tutorial-modal .modal-content {
    max-width: 600px;
}

.tutorial-content {
    color: #333;
}

.tutorial-step {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.05) 0%, 
        rgba(118, 75, 162, 0.05) 100%
    );
    border-radius: 15px;
    border-left: 4px solid #667eea;
}

.step-number {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.step-content h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.2em;
}

.step-content p {
    color: #666;
    line-height: 1.6;
}

.tutorial-tips {
    background: linear-gradient(135deg, 
        rgba(56, 239, 125, 0.1) 0%, 
        rgba(17, 153, 142, 0.1) 100%
    );
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #38ef7d;
    margin-top: 20px;
}

.tutorial-tips h3 {
    color: #333;
    margin-bottom: 12px;
}

.tutorial-tips ul {
    list-style: none;
    padding: 0;
}

.tutorial-tips li {
    color: #666;
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.tutorial-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #38ef7d;
    font-weight: bold;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        padding: 30px 20px;
    }
    
    .modal-title {
        font-size: 2em;
    }
    
    .stars-display {
        font-size: 2.5em;
        gap: 10px;
    }
    
    .modal-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .modal-stat {
        padding: 15px;
    }
    
    .modal-btn {
        padding: 15px 25px;
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        padding: 25px 15px;
    }
    
    .modal-title {
        font-size: 1.8em;
    }
    
    .tutorial-step {
        flex-direction: column;
        gap: 15px;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
    }
}