  
    body { font-family: system-ui, "Segoe UI", Roboto, Arial; direction: rtl; }
    .game-container { 
      padding: 1.5rem; 
      display: flex; 
      flex-direction: column; 
      align-items: center; 
      justify-content: center; 
      min-height: 360px;
    }
    .options, .choices { 
      display:flex; 
      gap:0.8rem; 
      justify-content:center; 
      flex-wrap:wrap; 
      margin-top:1rem; 
    }
    .objects { 
      display:flex; 
      gap:0.8rem; 
      justify-content:center; 
      flex-wrap:wrap; 
      margin:1rem 0; 
    }
    .obj { 
      font-size:2.5rem; 
      cursor:pointer; 
      user-select:none; 
    }
    .card { 
      min-height: 420px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    .card-body {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center; /* إضافة لتوسيط المحتوى أفقيًا */
    }
    h1 { 
      margin-bottom:1.5rem; 
      font-size: 2.2rem;
		
    }
body.dark-mode .card-title {color: black;}
    .card-title {
      font-size: 1.5rem;
      text-align: center;
      margin-bottom: 1.2rem;
      width: 100%;
    }
    .msg { 
      margin-top:1rem; 
      min-height:1.8rem; 
      font-weight:600; 
      font-size: 1.2rem;
      text-align: center;
      width: 100%;
    }


    /* Memory game - تحسينات */
    .memory-grid { 
      display:grid; 
      grid-template-columns:repeat(4, 80px); /* تقليل الحجم من 90px إلى 80px */
      gap:10px; 
      justify-content:center; 
      margin:1rem auto; 
      width: 100%;
    }
    .memory-card {
      width:80px; /* تقليل الحجم من 90px إلى 80px */
      height:80px; /* تقليل الحجم من 90px إلى 80px */
      border-radius:10px; 
      display:flex; 
      align-items:center; 
      justify-content:center;
      background:#f1f3f5; 
      font-size:2rem; /* تقليل حجم الخط قليلاً */
      cursor:pointer; 
      user-select:none;
      margin: 0 auto; /* تأكد من توسيط كل بطاقة */
    }
    .memory-card .emoji { display:none; }
    .memory-card .back { display:block; font-size:1.5rem; color:#6c757d; }
    .memory-card.flipped { background:#ffffff; }
    .memory-card.flipped .emoji { display:block; }
    .memory-card.flipped .back { display:none; }
    .memory-card.matched { background:#c3f0c7; cursor:default; }
    
    .colour-btn { 
      width:70px; 
      height:70px; 
      border-radius:10px; 
      border:0; 
      cursor:pointer; 
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    .btn-outline-primary {
      font-size: 1.4rem;
      padding: 0.6rem 1.2rem;
      border-radius: 10px;
    }
    
    p.fs-3, p.fs-4 {
      font-size: 2.5rem !important;
      text-align: center;
      margin: 0.8rem 0;
      width: 100%;
    }
    
    .text-center {
      text-align: center !important;
    }

/* Add to kg1games.css */
body.dark-mode .card-title {
  color: black!important;
}

body.dark-mode .msg {
  color: #a0d2eb !important;
}

body.dark-mode .memory-card {
  background: #2d3748;
}

body.dark-mode .memory-card .back {
  color: #cbd5e0;
}

body.dark-mode .btn-outline-primary {
  color: #000;
  border-color: #000;
}

body.dark-mode .btn-outline-primary:hover {
  background-color: #a0d2eb;
  color: #2d3748;
}
body.dark-mode p{color: black;}
body.dark-mode .msg{color: black;}

body.dark-mode #msg1, #msg2, #msg3, #msg4, #msg5, #msg6, #msg7, #msg8, #msg9 {
	color: black !important;
}

body.dark-mode #para{color: white;}



  