* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a, #1e1b4b);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 420px;
    max-width: 100%;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.game-container h2 {
    color: #38bdf8;
    margin-bottom: 15px;
    font-size: 24px;
}

.controls-bar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

#themeSelect {
    flex: 1;
    background: #0f172a;
    color: #fff;
    border: 1px solid #334155;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-size: 13px;
}

.controls-bar button {
    background: #38bdf8;
    color: #0f172a;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: 0.3s;
}

.controls-bar button:hover {
    background: #0ea5e9;
}

.stats {
    display: flex;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.6);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #cbd5e1;
}

.stats span {
    font-weight: 600;
    color: #38bdf8;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.card {
    background-color: #334155;
    height: 80px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    transition: transform 0.2s, background-color 0.3s;
}

.card:hover {
    transform: scale(1.05);
}

.card.flipped {
    background-color: #1e293b;
    border: 2px solid #38bdf8;
    cursor: default;
}

.card span {
    display: none;
}

.card.flipped span {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s ease;
}

.modal.show {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background: #1e293b;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    width: 320px;
    max-width: 90%;
    border: 1px solid #334155;
}

.modal-content i {
    font-size: 50px;
    color: #facc15;
    margin-bottom: 15px;
}

.modal-content h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 22px;
}

.modal-content p {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-content button {
    background: #38bdf8;
    color: #0f172a;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

/* Extra Responsive Adjustments for Small Mobiles */
@media screen and (max-width: 400px) {
    body {
        padding: 10px;
    }
    .game-container {
        padding: 15px;
    }
    .card {
        height: 65px;
        font-size: 26px;
    }
}