:root {
    --bg-color: #1a202c;
    --card-back: #4a5568;
    --card-front: #edf2f7;
    --text-color: #edf2f7;
    --accent-color: #ed8936;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.home-btn, .icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
}

.stats-bar {
    display: flex;
    gap: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 20px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 500px;
    perspective: 1000px;
}

.card {
    background-color: transparent;
    aspect-ratio: 1; /* Square cards */
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card.flipped {
    transform: rotateY(180deg);
    cursor: default;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card-front {
    background-color: var(--card-back);
    color: transparent;
}

.card-front::after {
    content: '?';
    color: rgba(255,255,255,0.5);
    font-size: 2rem;
}

.card-back {
    background-color: var(--card-front);
    color: #1a202c;
    transform: rotateY(180deg);
}

.action-btn {
    background-color: var(--accent-color);
    border: none;
    color: white;
    padding: 10px 30px;
    border-radius: 20px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: inherit;
    font-weight: bold;
}

.action-btn:hover {
    transform: scale(1.05);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #2d3748;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid var(--accent-color);
}

@media (max-width: 500px) {
    .game-grid {
        gap: 10px;
    }
    .card-face {
        font-size: 2rem;
    }
}
