:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --accent-color: #8b5cf6;
    --card-bg-front: #ffffff;
    --card-bg-back: var(--accent-color);
    --border-color: rgba(0, 0, 0, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

header {
    text-align: center;
    width: 100%;
}

.back-btn {
    display: inline-block;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.3s;
    width: 100%;
    text-align: left;
    font-weight: 500;
}

.back-btn:hover {
    opacity: 1;
    color: var(--accent-color);
}

h1 {
    font-weight: 800;
    letter-spacing: 2px;
}

h1 span {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

.status-board {
    display: flex;
    gap: 2rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.03);
    padding: 1rem 2rem;
    border-radius: 15px;
}

.status-board h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

#restartBtn {
    padding: 0.5rem 1.5rem;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#restartBtn:hover {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    perspective: 1000px;
}

.card {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
}

.card.flip {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.card-front {
    background: var(--card-bg-front);
    transform: rotateY(180deg);
}

.card-back {
    background: var(--card-bg-back);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.2) 10px, rgba(255,255,255,0.2) 20px);
}

.card-back:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.4);
}

@media (max-width: 500px) {
    .card {
        width: 60px;
        height: 60px;
    }
    .card-face {
        font-size: 1.8rem;
    }
    .status-board {
        flex-direction: column;
        gap: 0.5rem;
    }
}
