/* ===== Common Styles for All Games ===== */

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #E8F4F8 0%, #F5F5F0 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    overflow-x: hidden;
}

/* ===== Screen Management ===== */
.screen {
    display: none;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ===== Common Color Palette ===== */
:root {
    --primary-color: #FF8B6A;
    --secondary-color: #7A9CB8;
    --success-color: #4CAF50;
    --error-color: #E57373;
    --text-dark: #333;
    --text-light: #666;
    --background-light: #F5F5F0;
    --white: #ffffff;
}

/* ===== Common Button Styles ===== */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

button:active {
    transform: scale(0.98);
}

/* ===== Modal Styles ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.5s ease;
}

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

.victory-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.modal-content h2 {
    font-size: 42px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.victory-message {
    font-size: 22px;
    color: var(--text-light);
    margin-bottom: 35px;
}

.stats-display {
    background: var(--background-light);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
}

.stat-item .stat-label {
    color: var(--text-light);
    font-weight: 600;
}

.stat-item .stat-value {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 24px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.modal-btn {
    flex: 1;
    min-width: 180px;
    padding: 18px 30px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--success-color) 0%, #45A049 100%);
    color: white;
}

.modal-btn.primary:hover {
    background: linear-gradient(135deg, #5CBF60 0%, #55B059 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.modal-btn.secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #6B8BA8 100%);
    color: white;
}

.modal-btn.secondary:hover {
    background: linear-gradient(135deg, #8AACC8 0%, #7B9BB8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ===== Accessibility ===== */
button:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .modal-content {
        padding: 40px 25px;
    }

    .modal-content h2 {
        font-size: 32px;
    }

    .victory-message {
        font-size: 18px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-btn {
        min-width: 100%;
    }
}
