/* ===== طبقة التجربة الفريدة — سماء، حديقة ذكر، مستويات، مشاركة ===== */

:root {
  --fx-gold: #d4af37;
  --fx-gold-soft: #e8cf7a;
  --fx-night-1: #06141f;
  --fx-night-2: #0a2333;
  --fx-glow: 0 0 24px rgba(212, 175, 55, .35);
}

/* ---------- السماء المتحركة ---------- */
.fx-sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(13, 84, 73, .35), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(23, 42, 88, .4), transparent 60%),
    linear-gradient(180deg, var(--fx-night-1), var(--fx-night-2));
}
html[data-theme="light"] .fx-sky {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(178, 226, 213, .5), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(196, 214, 240, .5), transparent 60%),
    linear-gradient(180deg, #eef7f4, #e3eef7);
}

.fx-stars, .fx-stars2 {
  position: absolute;
  inset: -50%;
  background-repeat: repeat;
  opacity: .8;
}
.fx-stars {
  background-image:
    radial-gradient(1.6px 1.6px at 22px 34px, #fff, transparent),
    radial-gradient(1.2px 1.2px at 130px 90px, #ffe9b0, transparent),
    radial-gradient(1px 1px at 300px 160px, #fff, transparent),
    radial-gradient(1.4px 1.4px at 420px 60px, #cfe8ff, transparent),
    radial-gradient(1px 1px at 520px 220px, #fff, transparent),
    radial-gradient(1.3px 1.3px at 640px 120px, #ffe9b0, transparent);
  background-size: 700px 300px;
  animation: fxTwinkle 5s ease-in-out infinite alternate, fxDrift 240s linear infinite;
}
.fx-stars2 {
  background-image:
    radial-gradient(1px 1px at 60px 140px, #fff, transparent),
    radial-gradient(1.8px 1.8px at 240px 40px, #fff, transparent),
    radial-gradient(1px 1px at 380px 240px, #cfe8ff, transparent),
    radial-gradient(1.2px 1.2px at 560px 180px, #fff, transparent);
  background-size: 620px 260px;
  animation: fxTwinkle 7s ease-in-out infinite alternate-reverse, fxDrift 320s linear infinite reverse;
}
html[data-theme="light"] .fx-stars, html[data-theme="light"] .fx-stars2 { opacity: .12; }

@keyframes fxTwinkle { from { opacity: .45; } to { opacity: .95; } }
@keyframes fxDrift { from { transform: translate3d(0,0,0); } to { transform: translate3d(-700px,0,0); } }

.fx-aurora {
  position: absolute;
  width: 60vmax; height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .35;
  mix-blend-mode: screen;
}
html[data-theme="light"] .fx-aurora { opacity: .18; mix-blend-mode: normal; }
.fx-aurora.a1 { background: radial-gradient(circle, #0e6e5c, transparent 60%); top: -20vmax; right: -15vmax; animation: fxFloat1 26s ease-in-out infinite alternate; }
.fx-aurora.a2 { background: radial-gradient(circle, #14467c, transparent 60%); bottom: -25vmax; left: -18vmax; animation: fxFloat2 32s ease-in-out infinite alternate; }
.fx-aurora.a3 { background: radial-gradient(circle, rgba(212,175,55,.55), transparent 60%); top: 30%; left: 35%; width: 34vmax; height: 34vmax; animation: fxFloat1 40s ease-in-out infinite alternate-reverse; }
@keyframes fxFloat1 { from { transform: translate(0,0) scale(1); } to { transform: translate(-8vmax, 6vmax) scale(1.15); } }
@keyframes fxFloat2 { from { transform: translate(0,0) scale(1.1); } to { transform: translate(9vmax, -5vmax) scale(.95); } }

/* مطر خفيف اختياري مع الصوت */
.fx-rain { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s; }
.fx-rain.on { opacity: .5; }
.fx-rain i {
  position: absolute; top: -12vh;
  width: 1px; height: 9vh;
  background: linear-gradient(transparent, rgba(190, 220, 255, .8));
  animation: fxDrop linear infinite;
}
@keyframes fxDrop { to { transform: translateY(115vh); } }

/* ---------- بطاقات زجاجية ---------- */
.card, .stat-card, .challenge-card, .day-cell, .ad-slot, .quiz-box {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html[data-theme="dark"] .card, html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .challenge-card, html[data-theme="dark"] .quiz-box {
  background: rgba(10, 30, 43, .55);
  border: 1px solid rgba(212, 175, 55, .18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
html[data-theme="dark"] .card:hover, html[data-theme="dark"] .challenge-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, .45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45), var(--fx-glow);
}

/* ---------- شارة المستوى والسلسلة ---------- */
.fx-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 10px 0 0; }
.fx-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  font-size: .85rem; font-weight: 700;
  color: var(--fx-gold-soft);
  background: rgba(212, 175, 55, .1);
  border: 1px solid rgba(212, 175, 55, .35);
}
html[data-theme="light"] .fx-chip { color: #7a5c00; background: rgba(212,175,55,.14); }
.fx-chip svg { flex: none; }

/* ---------- العداد العالمي الحي ---------- */
.fx-global {
  margin: 18px auto 4px;
  text-align: center;
  padding: 18px 22px;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, .3);
  background: linear-gradient(160deg, rgba(212,175,55,.12), rgba(14,110,92,.12));
  max-width: 640px;
}
.fx-global .num {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 900;
  color: var(--fx-gold);
  text-shadow: 0 0 18px rgba(212,175,55,.45);
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
}
.fx-global .lbl { font-size: .95rem; opacity: .85; margin-top: 2px; }
.fx-global .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #35d07f; margin-inline-start: 6px;
  box-shadow: 0 0 10px #35d07f;
  animation: fxPulse 1.6s ease-in-out infinite;
}
@keyframes fxPulse { 50% { opacity: .35; } }

/* ---------- حديقة الذكر الحية ---------- */
.fx-garden {
  position: relative;
  height: 190px;
  margin: 22px auto 6px;
  max-width: 720px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(212,175,55,.25);
  background: linear-gradient(180deg, rgba(6,20,31,.0) 40%, rgba(10,60,45,.35));
}
html[data-theme="light"] .fx-garden { background: linear-gradient(180deg, transparent 40%, rgba(120,190,160,.25)); }
.fx-garden .ground {
  position: absolute; bottom: 0; left: 0; right: 0; height: 46px;
  background: linear-gradient(180deg, rgba(24, 90, 66, .9), rgba(13, 54, 40, 1));
  border-top: 2px solid rgba(212,175,55,.35);
}
.fx-plant { position: absolute; bottom: 40px; transform-origin: bottom center; animation: fxSway 4.5s ease-in-out infinite alternate; }
@keyframes fxSway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
.fx-firefly {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--fx-gold-soft);
  box-shadow: 0 0 12px 3px rgba(232, 207, 122, .8);
  animation: fxFly 9s ease-in-out infinite;
  opacity: .9;
}
@keyframes fxFly {
  0%,100% { transform: translate(0,0); opacity: .2; }
  25% { transform: translate(14px,-26px); opacity: 1; }
  50% { transform: translate(-10px,-44px); opacity: .5; }
  75% { transform: translate(8px,-20px); opacity: .95; }
}
.fx-garden .stage-lbl {
  position: absolute; top: 10px; inset-inline-start: 12px;
  font-size: .8rem; font-weight: 700; color: var(--fx-gold-soft);
  background: rgba(6,20,31,.5); padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(212,175,55,.3);
}
html[data-theme="light"] .fx-garden .stage-lbl { background: rgba(255,255,255,.6); color: #7a5c00; }

/* ---------- زر التسبيح المتوهج ---------- */
.counter-btn, .big-counter-btn {
  box-shadow: 0 0 0 0 rgba(212,175,55,.5), 0 12px 34px rgba(0,0,0,.35);
  animation: fxBreath 3.2s ease-in-out infinite;
  transition: transform .12s ease;
}
.counter-btn:active, .big-counter-btn:active { transform: scale(.94); }
@keyframes fxBreath {
  50% { box-shadow: 0 0 34px 4px rgba(212,175,55,.35), 0 12px 34px rgba(0,0,0,.35); }
}
.fx-ripple {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(212,175,55,.5), transparent 65%);
  animation: fxRipple .7s ease-out forwards;
  z-index: 60;
}
@keyframes fxRipple { from { transform: scale(.2); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }

/* ---------- نافذة بطاقة المشاركة ---------- */
.fx-share-back {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(3, 10, 16, .7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.fx-share-box {
  background: #0a1e2b;
  border: 1px solid rgba(212,175,55,.4);
  border-radius: 20px;
  padding: 18px;
  max-width: 340px; width: 100%;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.fx-share-box canvas { width: 100%; border-radius: 14px; display: block; }
.fx-share-box .row { display: flex; gap: 8px; margin-top: 14px; }
.fx-share-box button {
  flex: 1; padding: 11px 8px; border-radius: 12px; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: .92rem;
}
.fx-share-box .share-go { background: var(--fx-gold); color: #241a00; }
.fx-share-box .share-dl { background: rgba(212,175,55,.15); color: var(--fx-gold-soft); border: 1px solid rgba(212,175,55,.4); }
.fx-share-box .share-x { background: transparent; color: #9fb4c0; }

/* زر بطاقة المشاركة في الصفحات */
.fx-share-open {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(212,175,55,.45);
  background: linear-gradient(160deg, rgba(212,175,55,.18), rgba(212,175,55,.06));
  color: var(--fx-gold-soft);
  font-family: inherit; font-weight: 800; font-size: .9rem;
}
html[data-theme="light"] .fx-share-open { color: #7a5c00; }

/* عنوان البطل بتدرج ذهبي */
.hero h1, .fx-grad {
  background: linear-gradient(120deg, var(--fx-gold-soft), var(--fx-gold) 45%, #f5e6bd 70%, var(--fx-gold));
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fxShine 6s linear infinite;
}
@keyframes fxShine { to { background-position: 220% center; } }

@media (prefers-reduced-motion: reduce) {
  .fx-stars, .fx-stars2, .fx-aurora, .fx-plant, .fx-firefly,
  .counter-btn, .big-counter-btn, .hero h1, .fx-grad { animation: none !important; }
}
