:root {
    --bg: #0f172a; /* Portal Arka Planı */
    --card-bg: #1e293b; /* Portal Kart Arka Planı */
    --primary: #8b5cf6; /* Portal Vurgu Rengi */
    --accent: #10b981; /* Başarı Yeşili */
    --text: #f8fafc;
    --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.game-body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    padding-top: 100px; /* Header için yer */
}

/* Oyun Header */
.game-header {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #334155;
    padding: 15px 0;
    position: fixed; top: 0; width: 100%; z-index: 1000;
}
.game-title { font-weight: 700; color: #fff; }
.exit-btn { text-decoration: none; color: #ef4444; font-weight: 700; font-size: 0.9rem; }

/* İstatistik Barı */
.game-stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}
.stat-label { font-size: 0.7rem; color: #94a3b8; letter-spacing: 2px; font-weight: 700; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); display: block; }

/* OYUN IZGARASI (Kartlar) */
.memory-game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4x4 veya 6x6 gibi ayarlanabilir */
    gap: 15px;
    perspective: 1000px; /* 3D efekt için */
}

/* Kart Temeli */
.memory-card {
    background: var(--card-bg);
    aspect-ratio: 1; /* Kare kartlar */
    border-radius: var(--radius);
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Kart Döndürme Efekti */
.memory-card.flip { transform: rotateY(180deg); }

/* Kartın Ön ve Arka Yüzleri */
.front-face, .back-face {
    width: 100%; height: 100%;
    padding: 20px;
    position: absolute;
    border-radius: var(--radius);
    backface-visibility: hidden; /* Arkasını gösterme */
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; /* Emojiler için büyük boy */
}

.front-face {
    transform: rotateY(180deg); /* Başlangıçta ters duruyor */
    background: #2dd4bf; /* Eşleşince açılacak renk */
    color: #fff;
}

.back-face {
    background: linear-gradient(135deg, var(--primary), #1e293b);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Modal Stilleri */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.8);
    display: none; align-items: center; justify-content: center; z-index: 2000;
}
.modal.active { display: flex; animation: fadeIn 0.3s ease; }
.modal-content {
    background: var(--card-bg); padding: 50px; border-radius: 30px;
    text-align: center; border: 2px solid var(--primary);
}
.modal h2 { font-size: 2.5rem; color: #fff; margin-bottom: 10px; }
.modal-actions { margin-top: 30px; display: flex; gap: 15px; justify-content: center; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Mobil Ayarlar */
@media (max-width: 600px) {
    .memory-game-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-value { font-size: 1.5rem; }
    .game-header .container { padding: 0 10px; }
}