/* Base */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a2e;
    background-image: url('./media/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #fff;
    overflow: hidden;
}

/* Main wrapper */
.game-container {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 40px 30px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Header */
h1 {
    margin: 0 0 20px;
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #fff, #ddd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Score bar */
.score-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1.2rem;
}

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

/* Buttons */
button {
    background: #e67e22;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

button:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4);
}

/* Card grid */
#grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
#grid img {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    background: #2c3e50;
}

#grid img:hover {
    transform: scale(1.08);
    border-color: #e67e22;
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.6);
}

/* Matched cards */
.matched {
    opacity: 0.6;
    border-color: #27ae60 !important;
    cursor: default;
    filter: grayscale(20%);
}

/* Win message */
#win-message {
    margin-top: 30px;
    padding: 20px;
    background: rgba(39, 174, 96, 0.15);
    border-radius: 12px;
    border: 2px solid #27ae60;
    animation: fadeIn 0.5s ease-in;
}

#win-message h2 {
    margin: 0 0 10px;
    font-size: 2rem;
    color: #27ae60;
}

#win-message p {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.hidden {
    display: none !important;
}

/* Fade-in animation (reused from grid cards if needed) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2rem;
    }

    #grid img {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .score-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px 20px;
    }

    #grid {
        gap: 10px;
    }

    #grid img {
        width: 75px;
        height: 75px;
        border-width: 2px;
    }

    #win-message h2 {
        font-size: 1.5rem;
    }
}