/* ================== بستان العربية | مع الهدهد فصيح ================== */
:root {
  --green: #2e7d32;
  --green-d: #1b5e20;
  --gold: #f39c12;
  --gold-d: #b7791f;
  --teal: #00897b;
  --teal-d: #004d40;
  --terracotta: #d35400;
  --dark: #201a15;
  --cream: #fff9ed;
  --shadow: rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  font-family: 'Cairo', Tahoma, sans-serif;
  color: var(--dark);
  background: #1b3820 url(assets/bg.jpg) center/cover fixed;
  overflow-x: hidden;
  user-select: none;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: rgba(10, 30, 15, 0.08);
}

#app { max-width: 1100px; margin: 0 auto; padding: 12px; min-height: 100vh; }
.screen { display: none; animation: fadeIn .35s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.muted { color: #5a6b5c; margin-bottom: 12px; font-weight: 600; }

/* ---------- أزرار عامة ---------- */
.btn {
  font-family: inherit; font-weight: 800; font-size: 1.05rem; color: #fff;
  border: none; border-radius: 16px; padding: 12px 22px; cursor: pointer;
  background: linear-gradient(180deg, #43a047, var(--green));
  box-shadow: 0 5px 0 var(--green-d), 0 8px 18px rgba(0,0,0,.25);
  transition: transform .08s, box-shadow .08s, filter .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-d); }

.btn-primary { background: linear-gradient(180deg, #ffb300, var(--gold)); box-shadow: 0 5px 0 var(--gold-d), 0 8px 18px rgba(0,0,0,.2); }
.btn-primary:active { box-shadow: 0 1px 0 var(--gold-d); }

.btn-secondary { background: linear-gradient(180deg, #26a69a, var(--teal)); box-shadow: 0 5px 0 var(--teal-d), 0 8px 18px rgba(0,0,0,.2); }
.btn-secondary:active { box-shadow: 0 1px 0 var(--teal-d); }

.btn-ghost { background: #fff; color: var(--dark); box-shadow: 0 5px 0 #d0dcd0, 0 8px 18px rgba(0,0,0,.12); }
.btn-ghost:active { box-shadow: 0 1px 0 #d0dcd0; }

.btn-green { background: linear-gradient(180deg, #4caf50, #2e7d32); box-shadow: 0 5px 0 #1b5e20; }
.btn-danger { background: linear-gradient(180deg, #e53935, #c62828); box-shadow: 0 5px 0 #8e0000; }

.btn-xl { font-size: 1.4rem; padding: 16px 40px; border-radius: 20px; }
.btn-lg { font-size: 1.2rem; padding: 14px 28px; }
.btn-sm { font-size: .95rem; padding: 8px 16px; border-radius: 12px; }

.icon-btn {
  width: 46px; height: 46px; border-radius: 14px; border: none; background: #fff; cursor: pointer;
  font-size: 1.3rem; font-family: inherit; font-weight: 900; color: var(--dark);
  box-shadow: 0 4px 0 #c8d6c8; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c8d6c8; }
.icon-btn.off { opacity: .5; }

.feathers-pill {
  background: linear-gradient(180deg, #fff8e1, #ffe082); color: #8d6e00; font-weight: 900;
  border-radius: 999px; padding: 6px 18px; box-shadow: 0 3px 0 #d4a017;
  display: inline-flex; align-items: center; gap: 6px; font-size: 1.1rem; white-space: nowrap;
}

.glass {
  background: rgba(255, 252, 242, 0.95);
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35), inset 0 0 0 3px rgba(255,255,255,.7);
}

/* ---------- القائمة الرئيسية ---------- */
#scr-menu.active { display: grid; place-items: center; min-height: calc(100vh - 24px); }
.top-controls { position: fixed; top: 14px; right: 14px; display: flex; gap: 8px; align-items: center; z-index: 1000; }
.menu-card {
  max-width: 580px; width: 100%; text-align: center; padding: 28px 24px; margin-top: 70px; position: relative;
}
.menu-card .feathers-pill { position: absolute; top: 16px; left: 16px; }

.mascot-badge {
  position: relative; display: inline-block; margin-top: -95px; margin-bottom: 6px;
}
.mascot-avatar {
  width: 155px; height: 155px; border-radius: 50%; object-fit: cover;
  border: 6px solid #fff; box-shadow: 0 12px 28px rgba(0,0,0,.3);
  animation: floatBird 3.2s ease-in-out infinite;
}
.crest-sparkle {
  position: absolute; top: 0; right: 0; font-size: 2rem;
  animation: pulse 1.5s infinite;
}
@keyframes floatBird { 50% { transform: translateY(-9px) rotate(2deg); } }

.logo {
  font-size: 3.1rem; font-weight: 900; line-height: 1.15; margin: 4px 0 2px;
  color: var(--green-d); text-shadow: 0 3px 0 #c8e6c9;
}
.logo span { color: var(--gold-d); text-shadow: 0 3px 0 #ffe082; }
.tagline { font-size: 1.15rem; color: #4e5d4f; margin-bottom: 8px; }
.tagline b { color: var(--green-d); }
.hello { font-weight: 800; font-size: 1.15rem; margin-bottom: 16px; min-height: 1.6em; }
.hello button { background: none; border: none; cursor: pointer; font-size: 1.05rem; margin-right: 4px; }

/* بطاقات اختيار الوضع */
.modes-selection { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 20px; }
.mode-card {
  background: #fff; border-radius: 22px; padding: 18px 14px; text-align: right;
  border: none; cursor: pointer; color: var(--dark); font-family: inherit;
  box-shadow: 0 6px 0 #d0dfd0, 0 10px 22px rgba(0,0,0,.15);
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden;
}
.mode-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 8px;
}
.mode-hunter::before { background: linear-gradient(90deg, #ff9800, #f57c00); }
.mode-sentence::before { background: linear-gradient(90deg, #4caf50, #2e7d32); }
.mode-card:hover { transform: translateY(-5px); box-shadow: 0 10px 0 #c0d0c0, 0 16px 30px rgba(0,0,0,.22); }
.mode-card:active { transform: translateY(2px); box-shadow: 0 3px 0 #c0d0c0; }

.mode-icon { font-size: 2.8rem; line-height: 1; align-self: flex-start; }
.mode-info h3 { font-size: 1.35rem; font-weight: 900; margin-bottom: 4px; }
.mode-hunter h3 { color: #d35400; }
.mode-sentence h3 { color: #1b5e20; }
.mode-info p { font-size: .88rem; color: #617362; font-weight: 600; line-height: 1.5; }
.arrow-badge {
  align-self: flex-end; background: #e8f5e9; color: var(--green-d);
  font-weight: 900; font-size: 1.2rem; border-radius: 50%; width: 34px; height: 34px;
  display: grid; place-items: center; box-shadow: 0 2px 5px rgba(0,0,0,.1);
}
.mode-hunter .arrow-badge { background: #fff3e0; color: #e65100; }

.menu-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- الشريط العلوي ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  background: rgba(255, 252, 242, 0.96); border-radius: 20px; padding: 10px 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.topbar h2 { flex: 1; font-size: 1.4rem; color: var(--green-d); font-weight: 900; }

/* ---------- شبكة المستويات ---------- */
.levels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.level-card {
  position: relative; font-family: inherit; border: none; cursor: pointer; color: var(--dark);
  background: #fff; border-radius: 24px; padding: 22px 16px 18px; text-align: center; overflow: hidden;
  box-shadow: 0 7px 0 var(--c), 0 14px 26px rgba(0,0,0,.25); transition: transform .15s;
}
.level-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 80px; background: var(--c); opacity: .16; }
.level-card:hover { transform: translateY(-5px); }
.lc-icon { font-size: 3.3rem; position: relative; }
.lc-title { font-weight: 900; font-size: 1.3rem; color: var(--c); filter: brightness(.8); margin: 6px 0 2px; }
.lc-desc { font-size: .92rem; color: #5a6b5c; min-height: 2.8em; font-weight: 600; }
.lc-stars { font-size: 1.6rem; letter-spacing: 2px; margin: 4px 0; }
.on { color: #f5b400; text-shadow: 0 2px 0 #c98a00; }
.off { color: #dcd0be; }
.lc-best { font-weight: 700; color: #7d6b52; min-height: 1.5em; font-size: .95rem; }
.lc-lock {
  position: absolute; inset: 0; background: rgba(25, 38, 26, 0.82); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 2.4rem;
}
.lc-lock small { font-size: .9rem; padding: 0 14px; font-weight: 700; line-height: 1.4; }

/* ---------- HUD للعب ---------- */
.hud {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
  background: rgba(255, 252, 242, 0.96); border-radius: 18px; padding: 8px 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.hud-title { font-weight: 900; font-size: 1.15rem; color: var(--green-d); }
.dots { display: flex; gap: 7px; flex: 1; justify-content: center; flex-wrap: wrap; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: #dcd6c8; transition: .3s; }
.dots i.current { background: #fff; box-shadow: 0 0 0 3px var(--gold); transform: scale(1.25); }
.dots i.perfect { background: #2ecc71; }
.dots i.ok { background: #f1c40f; }
.dots i.fail { background: #e74c3c; }

/* ---------- مسرح البستان (Garden Stage) ---------- */
.garden-stage {
  position: relative; width: 100%; height: min(68vh, 620px);
  background: url(assets/bg.jpg) center/cover no-repeat;
  border-radius: 26px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.45);
  display: flex; flex-direction: column; justify-content: space-between;
}
.decor-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.decor-item { position: absolute; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); animation: pop .4s both; }

/* ---------- لوحة الهدف (صيد الحروف) ---------- */
.target-panel {
  position: relative; z-index: 5;
  margin: 12px; background: rgba(255, 252, 242, 0.94); border-radius: 20px; padding: 10px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); display: flex; align-items: center; gap: 14px;
}
.target-image {
  font-size: 3.4rem; width: 68px; height: 68px; border-radius: 16px; background: #fff;
  display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0,0,0,.15); flex-shrink: 0;
}
.target-details { flex: 1; }
.target-hint { font-size: 1rem; color: #5a6b5c; font-weight: 700; margin-bottom: 6px; }
.target-hint b { color: var(--terracotta); }
.speak-btn {
  background: linear-gradient(180deg, #ffca28, #ffb300); color: #5d4037;
  box-shadow: 0 4px 0 #c67c00; font-size: 1.4rem;
}

/* خانات الحروف */
.letter-slots { display: flex; gap: 8px; flex-wrap: wrap; }
.slot {
  width: 48px; height: 54px; border-radius: 12px; background: #fff; border: 3px dashed #b0c4b0;
  display: grid; place-items: center; font-size: 1.9rem; font-weight: 900; color: var(--green-d);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.1); transition: all .2s;
}
.slot.filled {
  border-style: solid; border-color: var(--gold); background: #fff8e1; color: var(--gold-d);
  box-shadow: 0 4px 0 var(--gold-d); animation: pop .3s cubic-bezier(.3,1.8,.5,1);
}
.slot.active-target {
  border-color: #2ecc71; box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.4); animation: pulse 1.2s infinite;
}

/* ---------- سماء الحروف الطائرة ---------- */
.sky-area {
  position: relative; flex: 1; width: 100%; overflow: hidden; z-index: 4;
}

/* فقاعات الحروف الطائرة */
.bubble-letter {
  position: absolute; width: 72px; height: 72px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: 2.3rem; font-weight: 900; color: #fff;
  background: radial-gradient(circle at 35% 30%, #a5d6a7, #2e7d32 60%, #1b5e20);
  box-shadow: 0 8px 18px rgba(0,0,0,.3), inset 0 -4px 6px rgba(0,0,0,.2), inset 0 4px 8px rgba(255,255,255,.6);
  border: 3px solid rgba(255,255,255,.8);
  transition: transform .1s;
  animation: floatUp linear forwards;
}
.bubble-letter::after {
  content: ''; position: absolute; top: 10px; right: 14px; width: 14px; height: 8px;
  background: rgba(255,255,255,.85); border-radius: 50%; transform: rotate(-35deg);
}
.bubble-letter:active { transform: scale(.9); }

.bubble-letter.b-orange {
  background: radial-gradient(circle at 35% 30%, #ffcc80, #f57c00 60%, #e65100);
}
.bubble-letter.b-blue {
  background: radial-gradient(circle at 35% 30%, #90caf9, #1976d2 60%, #0d47a1);
}
.bubble-letter.b-purple {
  background: radial-gradient(circle at 35% 30%, #ce93d8, #7b1fa2 60%, #4a148c);
}
.bubble-letter.b-gold {
  background: radial-gradient(circle at 35% 30%, #ffe082, #ffa000 60%, #ff6f00);
}

@keyframes floatUp {
  from { transform: translateY(110%) scale(.9); }
  to { transform: translateY(-130%) scale(1.05); }
}

/* فرقعة الحرف */
.bubble-letter.popped {
  animation: bubblePop .25s ease-out forwards; pointer-events: none;
}
@keyframes bubblePop {
  50% { transform: scale(1.35); opacity: .8; filter: brightness(1.5); }
  100% { transform: scale(0); opacity: 0; }
}

/* ---------- شخصية فصيح ورسائل التشجيع ---------- */
.fassih-corner {
  position: relative; z-index: 5; margin: 12px;
  display: flex; align-items: flex-end; gap: 10px; pointer-events: none;
}
.fassih-corner img {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 4px solid #fff; box-shadow: 0 6px 18px rgba(0,0,0,.3); flex-shrink: 0;
  animation: birdWiggle 4s ease-in-out infinite; pointer-events: auto;
}
@keyframes birdWiggle {
  2% { transform: rotate(-8deg); }
  4% { transform: rotate(8deg); }
  6% { transform: rotate(-4deg); }
  8% { transform: rotate(0); }
}
.fassih-bubble {
  background: rgba(255, 252, 242, 0.95); border-radius: 18px; padding: 10px 16px;
  font-weight: 700; font-size: 1.05rem; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  max-width: 75%; line-height: 1.5; color: var(--dark); border-right: 5px solid var(--green);
  pointer-events: auto; animation: pop .3s both;
}
.fassih-bubble.good { border-color: #2ecc71; background: #f0fff4; }
.fassih-bubble.bad { border-color: #e74c3c; background: #fff5f5; }

/* ---------- شاشة ترتيب الجملة (مطابقة تماماً للصورة) ---------- */
.exact-screen-wrapper {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 6px 12px 14px;
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.exact-exit-btn {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #e0a840;
  color: #1b5e20;
  font-weight: 900;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform .1s;
}
.exact-exit-btn:hover { transform: scale(1.08); background: #fff; }
.exact-exit-btn:active { transform: scale(.9); }

/* الشريط العلوي */
.exact-top-bar {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 14px;
  padding: 0 4px;
}

.exact-score-pill {
  display: inline-flex;
  direction: ltr;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 2.5px solid #e6a73c;
  border-radius: 999px;
  padding: 4px 14px 4px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.star-gold-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe082, #ffb300 65%, #f57f17);
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(212, 140, 0, 0.4);
  color: #fff;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.round-number-text {
  font-size: 1.35rem;
  font-weight: 900;
  color: #1b5e20;
  min-width: 28px;
  text-align: center;
}
.olive-leaf { font-size: 1.15rem; }

.exact-dots-bar {
  display: flex;
  direction: ltr;
  align-items: center;
  gap: 10px;
}
.exact-dots-bar .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d8ceba;
  transition: all 0.3s;
}
.exact-dots-bar .dot.current {
  width: 18px;
  height: 18px;
  background: #fff;
  border: 4px solid #e6a73c;
  transform: scale(1.15);
}
.exact-dots-bar .dot.perfect { background: #2ecc71; }
.exact-dots-bar .dot.ok { background: #f1c40f; }

.exact-level-banner {
  display: inline-flex;
  direction: rtl;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #1b5e20, #0f4014);
  border: 2.5px solid #f2c94c;
  border-radius: 999px;
  padding: 6px 22px;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.15rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.banner-leaf-l, .banner-leaf-r { font-size: 1.05rem; }

/* البطاقة الرئيسية الكبيرة */
.exact-main-card {
  position: relative;
  width: 100%;
  background: rgba(255, 253, 247, 0.96);
  border: 3.5px solid #e2a844;
  border-radius: 32px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.32), inset 0 0 0 2px rgba(255, 255, 255, 0.85);
  padding: 16px 24px 22px;
  display: flex;
  flex-direction: column;
}

.card-inner-header {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 6px;
}

.exact-speaker-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(180deg, #1d6e24, #0d3f13);
  border: 3px solid #e8b248;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  color: #fff;
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.1s;
}
.exact-speaker-btn:hover { transform: scale(1.06); }
.exact-speaker-btn:active { transform: scale(0.92); }

.exact-theme-badge {
  display: inline-flex;
  direction: rtl;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 2px solid #e6a73c;
  border-radius: 999px;
  padding: 6px 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  font-size: 1.25rem;
  font-weight: 800;
  color: #1b5e20;
}
.theme-title-txt { color: #1b5e20; }
.theme-name-txt { color: #143d18; font-weight: 900; }
.star-badge-orange {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff9800;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.exact-instruction-line {
  text-align: center;
  color: #1b5e20;
  font-weight: 800;
  font-size: 1.3rem;
  margin: 10px 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.finger-pointing {
  font-size: 1.45rem;
  display: inline-block;
  animation: bounceFinger 1.2s infinite;
}
@keyframes bounceFinger {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* خانات الكلمات الفارغة (Slots) */
.exact-slots-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 20px;
}
.exact-slot {
  flex: 1;
  max-width: 145px;
  height: 84px;
  background: #fffcf4;
  border: 2px solid #e5ad48;
  border-radius: 14px;
  box-shadow: inset 0 2px 6px rgba(220, 160, 50, 0.12);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: #19401b;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  padding: 4px 6px;
  text-align: center;
}
.exact-slot.has-word {
  background: linear-gradient(180deg, #ffffff, #fff7e4);
  border-color: #d49320;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1), inset 0 0 0 2px rgba(255,255,255,0.85);
  animation: pop 0.25s cubic-bezier(.3,1.8,.5,1);
}
.exact-slot.has-word:hover {
  border-color: #e57373;
  color: #c62828;
}
.exact-slot.correct-slot {
  background: #e8f5e9;
  border-color: #2e7d32;
  color: #1b5e20;
  box-shadow: 0 4px 10px rgba(46, 125, 50, 0.25);
}

/* بنك الكلمات المبعثرة (مطابقة للإطار الأندلسي في الصورة) */
.exact-bank-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.exact-word-tile {
  position: relative;
  background: #fffefb;
  border: 2px solid #d8c29d;
  border-radius: 14px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 900;
  color: #1e3a1e;
  cursor: pointer;
  box-shadow: 0 4px 0 #bca075, 0 6px 14px rgba(0,0,0,0.08);
  transition: transform 0.1s, box-shadow 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 95px;
}
.exact-word-tile::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1.5px solid #6b9e73;
  border-radius: 10px;
  pointer-events: none;
}
.exact-word-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 #a88c60, 0 10px 18px rgba(0,0,0,0.12);
}
.exact-word-tile:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #a88c60;
}
.exact-word-tile.is-used {
  visibility: hidden;
  pointer-events: none;
}

/* أزرار الإجراء السفلية */
.exact-buttons-row {
  display: flex;
  direction: ltr;
  justify-content: center;
  align-items: center;
  gap: 22px;
  width: 100%;
  margin-top: 4px;
}
.btn-exact-reset {
  background: linear-gradient(180deg, #ffffff, #fff6e8);
  border: 2px solid #dfa53d;
  border-radius: 999px;
  padding: 10px 32px;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  color: #1b5e20;
  box-shadow: 0 4px 0 #c89530, 0 8px 16px rgba(0,0,0,0.12);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-exact-reset:hover { filter: brightness(1.04); }
.btn-exact-reset:active { transform: translateY(3px); box-shadow: 0 1px 0 #c89530; }
.btn-exact-reset .spin-icon { font-size: 1.35rem; font-weight: 900; }

.btn-exact-check {
  background: linear-gradient(180deg, #1b7325, #0f4e17);
  border: 2.5px solid #f2c94c;
  border-radius: 999px;
  padding: 10px 42px;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 4px 0 #092e0e, 0 8px 20px rgba(0,0,0,0.22);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-exact-check:hover { filter: brightness(1.08); }
.btn-exact-check:active { transform: translateY(3px); box-shadow: 0 1px 0 #092e0e; }
.btn-exact-check .check-icon { font-size: 1.35rem; }

/* شارة الإرشاد السفلية في الركن الأيمن */
.exact-bottom-helper {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  margin: 14px auto 0;
  padding-right: 6px;
}
.helper-banner-box {
  background: #ffffff;
  border: 2px solid #e2a844;
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1b5e20;
  display: inline-flex;
  direction: rtl;
  align-items: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.star-mini { color: #f39c12; font-size: 1.15rem; }
.helper-trophy-box {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffde7, #fff9c4 60%, #fff176);
  border: 3px solid #e2a844;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: grid;
  place-items: center;
  position: relative;
}
.trophy-ico { font-size: 1.8rem; }
.laurel-wreath { position: absolute; bottom: -2px; font-size: 1.2rem; }

@media (max-width: 768px) {
  .exact-main-card { padding: 12px 14px 16px; border-radius: 24px; }
  .exact-theme-badge { font-size: 1rem; padding: 4px 12px; }
  .exact-slot { height: 64px; font-size: 1.25rem; }
  .exact-word-tile { font-size: 1.25rem; padding: 8px 14px; min-width: 70px; }
  .btn-exact-check { font-size: 1.15rem; padding: 8px 24px; }
  .btn-exact-reset { font-size: 1.1rem; padding: 8px 20px; }
  .exact-level-banner { font-size: 1rem; padding: 4px 14px; }
  .exact-instruction-line { font-size: 1.1rem; }
}

/* ---------- شاشة النتيجة ---------- */
.result-card {
  max-width: 560px; margin: 80px auto 20px; text-align: center; padding: 26px;
}
.result-card h2 { margin: 10px 0 4px; font-size: 1.8rem; color: var(--green-d); }
.big-stars { font-size: 4.2rem; letter-spacing: 8px; margin: 6px 0; }
.big-stars span { display: inline-block; animation: starPop .55s cubic-bezier(.3,1.8,.5,1) both; }
@keyframes starPop { from { transform: scale(0) rotate(-180deg); } to { transform: none; } }
.r-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.r-stat { background: #fff; border-radius: 16px; padding: 10px; box-shadow: 0 4px 0 #c8d8c8; font-weight: 700; }
.r-stat b { display: block; font-size: 1.6rem; color: var(--gold-d); }
.new-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.badge { background: #fff; border-radius: 14px; padding: 6px 12px; font-weight: 800; box-shadow: 0 3px 0 #c8d8c8; }
.badge small { display: block; font-weight: 600; font-size: .75rem; color: #5a6b5c; }
.badge.locked { filter: grayscale(1); opacity: .45; }
.badge.new { animation: pop .5s .8s both; background: #fff9c4; border: 2px solid #fbc02d; }
.r-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.record, .unlock-msg { font-weight: 900; animation: pulse 1s infinite; margin-bottom: 4px; font-size: 1.15rem; }
.record { color: #d35400; }
.unlock-msg { color: var(--green-d); }

/* ---------- تزيين البستان ---------- */
.garden-preview { height: min(45vh, 400px); margin-bottom: 16px; }
.static-fassih { position: absolute; bottom: 8px; right: 8px; }
.d-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.d-card { background: #fff; border-radius: 20px; padding: 14px; text-align: center; box-shadow: 0 6px 0 #c8d8c8; }
.d-card.owned { background: #e8f5e9; }
.d-emo { font-size: 3rem; line-height: 1.3; }
.d-name { font-weight: 800; margin-bottom: 8px; font-size: 1.05rem; }
.d-owned { color: var(--green-d); font-weight: 800; }

/* ---------- فضاء الأولياء ---------- */
.p-wrap { display: grid; gap: 14px; }
.p-section { background: rgba(255, 252, 242, 0.97); border-radius: 20px; padding: 16px; box-shadow: 0 10px 26px rgba(0,0,0,.25); }
.p-section h3 { margin-bottom: 10px; color: var(--green-d); font-size: 1.25rem; font-weight: 900; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.p-card { background: #fff; border-radius: 16px; padding: 12px; box-shadow: 0 4px 0 #c8d8c8; }
.p-card.empty { opacity: .6; }
.p-head { display: flex; justify-content: space-between; align-items: center; font-weight: 900; margin-bottom: 6px; }
.p-head .lc-stars { font-size: 1.1rem; }
.p-bar { margin: 6px 0; }
.p-bar-top { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; }
.p-track { height: 10px; background: #e8ede8; border-radius: 99px; overflow: hidden; }
.p-track div { height: 100%; border-radius: 99px; }
.p-meta { display: flex; justify-content: space-between; font-size: .85rem; color: #5a6b5c; margin-top: 8px; font-weight: 600; }
.p-summary { display: flex; gap: 10px; flex-wrap: wrap; }
.p-summary .r-stat { flex: 1; min-width: 120px; text-align: center; }
.advice { padding-right: 20px; }
.advice li { margin: 6px 0; line-height: 1.8; font-weight: 600; }
.badges-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.switch-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #e0eae0; flex-wrap: wrap; font-weight: 700;
}
.switch-row:last-child { border-bottom: none; }

/* ---------- النوافذ المنبثقة ---------- */
.modal { position: fixed; inset: 0; background: rgba(10, 25, 15, 0.65); display: none; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(4px); }
.modal.show { display: grid; }
.modal-card {
  background: var(--cream); border-radius: 26px; padding: 24px; max-width: 420px; width: 100%;
  text-align: center; animation: pop .3s; box-shadow: 0 20px 50px rgba(0,0,0,.4);
}
.modal-card h2 { margin: 6px 0; color: var(--green-d); font-size: 1.5rem; }
.modal-card p { margin-bottom: 12px; font-weight: 600; }
.modal-card input {
  width: 100%; font-family: inherit; font-size: 1.3rem; font-weight: 700; padding: 12px;
  border-radius: 14px; border: 3px solid #a5d6a7; text-align: center; margin-bottom: 14px; outline: none;
}
.modal-card input:focus { border-color: var(--green); }
.modal-mascot { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.gate-q { font-size: 2.1rem; margin: 8px 0 14px; direction: ltr; font-weight: 900; color: var(--terracotta); }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.modal .choice { min-width: 90px; font-size: 1.4rem; padding: 8px 18px; border-radius: 14px; border: none; background: #fff; box-shadow: 0 4px 0 #b0c4b0; font-family: inherit; font-weight: 900; cursor: pointer; }

/* ---------- حركات ومؤثرات ---------- */
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.08); } }
.confetti { position: fixed; top: -20px; width: 10px; height: 16px; border-radius: 2px; z-index: 100; pointer-events: none; animation: confFall linear forwards; }
@keyframes confFall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }
.float-text {
  position: fixed; transform: translate(-50%, 0); font-size: 2.2rem; font-weight: 900;
  color: #2e7d32; text-shadow: 0 3px 0 #fff, 0 0 12px #fff; pointer-events: none; z-index: 90;
  animation: floatUpText 1.2s ease-out forwards;
}
@keyframes floatUpText { to { transform: translate(-50%, -90px); opacity: 0; } }
.shake { animation: shake .45s; }
@keyframes shake { 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 150%); opacity: 0;
  background: #1b3820; color: #fff; padding: 12px 24px; border-radius: 999px; font-weight: 800;
  z-index: 120; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: 92vw; text-align: center;
}
.toast.show { animation: toast 2.6s ease forwards; }
@keyframes toast { 0% { transform: translate(-50%, 150%); opacity: 0; } 10%, 85% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, 150%); opacity: 0; } }

/* ---------- التوافق مع شاشات الهواتف ---------- */
@media (max-width: 640px) {
  #app { padding: 8px; }
  .modes-selection { grid-template-columns: 1fr; }
  .logo { font-size: 2.4rem; }
  .target-panel { padding: 8px 12px; gap: 8px; }
  .target-image { font-size: 2.6rem; width: 54px; height: 54px; }
  .slot { width: 40px; height: 46px; font-size: 1.6rem; }
  .bubble-letter { width: 62px; height: 62px; font-size: 1.9rem; }
  .word-tile { font-size: 1.3rem; padding: 8px 14px; }
  .fassih-corner img { width: 56px; height: 56px; }
  .fassih-bubble { font-size: .92rem; }
  .theme-text { font-size: 1.05rem; }
}

/* زر العودة لأكاديمية النابغة الصغير (ثابت وبارز ومثالي للهاتف والحاسوب) */
.btn-academy-hub {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  color: #ffffff !important;
  border: 2px solid #ffca28;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn-academy-hub:hover, .btn-academy-hub:active {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, #2d6a4f, #1b4332);
}
.btn-academy-hub .hub-arrow {
  font-size: 1.1rem;
  color: #ffca28;
}
@media (max-width: 640px) {
  .top-controls {
    top: 10px;
    right: 10px;
    gap: 6px;
  }
  .btn-academy-hub {
    padding: 6px 12px;
    font-size: 0.82rem;
    gap: 4px;
  }
}

