/* core.css — الأساس + متغيرات الثيم الافتراضية (aqua) — M0a
   العقد: كل ثيم يحدد المتغيرات الـ16 — المحرك يقرأها فقط (الخطة v2.1) */
:root {
  --bg: #D4F1F9;
  --bg2: #E0F7FA;
  --panel: #ffffff;
  --panel-border: #4FC3F7;
  --text: #0b3b4f;
  --accent: #0288D1;
  --correct: #2e7d32;
  --wrong: #c62828;
  --box: #0288D1;
  --box-border: #4FC3F7;
  --box-open: #78909c;
  --overlay: rgba(11, 59, 79, 0.55);
  --radius: 16px;
  --shadow: 0 4px 14px rgba(2, 136, 209, 0.25);
  --font-display: 'Baloo Bhaijaan 2', system-ui, sans-serif;
  --font-body: 'Almarai', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background: linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  direction: rtl;
  height: 100%;
  overflow: hidden;                 /* مبدأ بندر: كل العرض داخل الإطار — بلا تمرير صفحة */
}
#view { height: 100dvh; display: flex; flex-direction: column; }
.ui-shell { flex: 1; min-height: 0; }
.ui-main { flex: 1; min-height: 0; overflow-y: auto; }  /* تمرير داخلي فقط عند الحاجة (المكتبة/المولّد) */
/* أهداف لمس ≥64px + رد لمسي فقط (لا hover) */
button, .box { min-height: 64px; touch-action: manipulation; }
button:active, .box:active { transform: scale(0.97); }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px); border-bottom: 2px solid var(--panel-border);
}
.topbar h1 { font-family: var(--font-display); font-size: clamp(22px, 3vw, 32px); }
#view { padding: 24px; max-width: 1000px; margin: 0 auto; }
h2, h3 { font-family: var(--font-display); margin: 20px 0 12px; }
.card {
  background: var(--panel); border: 2px solid var(--panel-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.card-title { font-size: 20px; font-weight: 700; }
.card-meta { color: #546e7a; font-size: 15px; }
.btn {
  font-family: var(--font-body); font-size: 18px; padding: 10px 20px;
  border-radius: 12px; border: none; background: var(--accent); color: #fff;
  min-height: 48px; cursor: pointer;
}
.btn:disabled { background: #b0bec5; cursor: default; }
.icon-btn { font-size: 24px; background: none; border: none; min-height: 44px; cursor: pointer; }
#view > * { animation: fadeUp 0.35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #view > * { animation: none; } }

/* نمط المودال/التمرير الخفي (بوابة G1 + القواعد §14) */
.ui-main, .game-root { min-height: 0; }
.custom-scrollbar { scrollbar-width: thin; scrollbar-color: rgba(2, 136, 209, 0.18) transparent; }
.custom-scrollbar::-webkit-scrollbar { width: 4px; height: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(2, 136, 209, 0.18); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }

/* طباعة: خلفية بيضاء + إخفاء أزرار اللعب */
@media print {
  body { background: #fff; }
  .ui-top-actions, .ui-card-actions, .ui-actions, .icon-btn, .game-btn { display: none; }
}
