body {
    margin: 0;
    padding: 0;
    background: #0f0c29; /* لون ليل الواحة */
    background: linear-gradient(to bottom, #24243e, #302b63, #0f0c29);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* لتجنب قص الشاشة بعد تكبير الألعاب */
    overflow-y: auto; /* السماح بالتمرير إذا كانت الشاشة صغيرة */
}

.menu-container {
    text-align: center;
    animation: fadeIn 1.5s ease-in;
}

.title {
    font-size: 3.5rem;
    color: #00d4ff;
    text-shadow: 0 0 20px #00d4ff;
    margin-bottom: 10px;
}

/* 1. جعل أزرار الألعاب في صف أفقي */
.buttons-grid {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap; /* يسمح بنزول الأزرار للسطر الثاني في شاشات الجوال */
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.game-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #00d4ff;
    border-radius: 20px;
    padding: 30px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
}

.game-card:hover {
    transform: translateY(-10px);
    background: #ff007f;
    border-color: white;
}

.game-card .icon { font-size: 3rem; }
.game-card .text { font-size: 1.2rem; font-weight: bold; margin-top: 10px; }

/* 2. تكبير حاوية لعبة الشطرنج */
#chess-container {
    display: none;
    width: 95%;
    max-width: 600px; /* تم التكبير إلى 600 بكسل */
    margin: 20px auto;
    text-align: center;
}

/* 3. تكبير شاشة لعبة الثعبان وصيد الثمار */
canvas {
    border: 5px solid #00d4ff;
    box-shadow: 0 0 30px #00d4ff;
    background: #000;
    width: 100%;
    max-width: 600px; /* تم التكبير إلى 600 بكسل */
    height: auto;
    border-radius: 10px;
}

.back-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background: #ff007f;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: 0.3s;
}

.back-btn:hover {
    background: #00d4ff;
    color: #0f0c29;
}

/* إضافة تأثير الظهور (Animation) */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}