/* مسرح عوني في الصفحة الرئيسية — @see js/awny-mascot.js */
.awny-stage { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; margin: 0 auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.awny-stage.dragging { cursor: grabbing; }

/* الخلفية: قرص دافي نضيف (ضوء من فوق) وعوني رجليه طالعة برّه + حلقة نور رفيعة + مدار + نجوم */
.awny-st-back { position: absolute; inset: 0; pointer-events: none; will-change: transform;
  --plate-hi: color-mix(in srgb, var(--peach) 55%, #fff); --plate-lo: color-mix(in srgb, var(--peach) 30%, var(--brand-soft)); --plate-rim: rgba(255, 255, 255, .9); }
:root[data-theme="dark"] .awny-st-back { --plate-hi: #4a2c1c; --plate-lo: #22150e; --plate-rim: rgba(247, 186, 132, .22); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .awny-st-back { --plate-hi: #4a2c1c; --plate-lo: #22150e; --plate-rim: rgba(247, 186, 132, .22); } }
.awny-st-blob { position: absolute; left: 13%; top: 5%; width: 74%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 22%, var(--plate-hi), var(--plate-lo) 78%);
  box-shadow: inset 0 2px 0 var(--plate-rim), inset 0 -30px 60px rgba(61, 32, 17, .12), 0 40px 70px -30px rgba(61, 32, 17, .35); }
/* هالة دافية ورا راسه بتتنفّس */
.awny-st-blob::after { content: ''; position: absolute; inset: 8% 14% 30%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--orange) 26%, transparent), transparent 70%); animation: awny-glow 6s ease-in-out infinite; }
.awny-st-ring { position: absolute; left: 10%; top: 2%; width: 80%; aspect-ratio: 1; border-radius: 50%; opacity: .75;
  background: conic-gradient(from 0deg, var(--orange), var(--peach) 30%, #fff0 45%, #fff0 55%, var(--sky) 70%, var(--orange));
  -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, #0000 calc(100% - 3px), #000 calc(100% - 2px));
  animation: awny-spin 18s linear infinite; }
.awny-st-ring2 { display: none; }
.awny-st-orbit { position: absolute; left: 6%; width: 88%; top: 66%; height: 22%; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--brand) 22%, transparent); }
.awny-st-spark { position: absolute; width: 18px; aspect-ratio: 1; background: linear-gradient(135deg, #fff, var(--peach)); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: awny-twinkle 2.6s ease-in-out infinite; opacity: 0; }
.awny-st-spark:nth-child(5) { left: 12%; top: 14%; }
.awny-st-spark:nth-child(6) { left: 84%; top: 22%; width: 12px; animation-delay: .7s; }
.awny-st-spark:nth-child(7) { left: 6%; top: 48%; width: 10px; animation-delay: 1.4s; }
.awny-st-spark:nth-child(8) { left: 90%; top: 54%; animation-delay: .35s; }
.awny-st-spark:nth-child(9) { left: 28%; top: 2%; width: 11px; animation-delay: 1.9s; }
.awny-st-spark:nth-child(10) { left: 70%; top: 4%; width: 14px; animation-delay: 1.1s; }

/* عوني نفسه */
.awny-m { position: absolute; left: 24%; bottom: 9%; width: 52%; aspect-ratio: 2 / 3; z-index: 5; perspective: 900px; cursor: pointer; }
.awny-stage.ready .awny-m { animation: awny-drop 1s cubic-bezier(.34, 1.56, .64, 1) both; }
.awny-m-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.awny-m-body { position: absolute; inset: 0; animation: awny-float 5s ease-in-out infinite; transform-origin: 50% 100%; }
.awny-m-pose { position: absolute; top: 0; left: -25%; width: 150%; height: 100%; object-fit: contain; object-position: 50% 100%; visibility: hidden; filter: drop-shadow(0 20px 22px rgba(61, 32, 17, .22)); pointer-events: none; }
/* الفريمات متطابقة غير في الراس/الوش — التبديل اللحظي هو اللي بيبان حركة (التلاشي كان بيعمل شبح) */
.awny-m-pose.on { visibility: visible; }
.awny-m.hop .awny-m-body { animation: awny-hop .65s cubic-bezier(.34, 1.56, .64, 1); }
.awny-m-shadow { position: absolute; left: 20%; right: 20%; bottom: -3%; height: 8%; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(61, 32, 17, .28), transparent 70%); animation: awny-shadow 5s ease-in-out infinite; }
.awny-fallback { position: absolute; left: 24%; bottom: 9%; width: 52%; aspect-ratio: 2 / 3; transition: opacity .5s ease; }
.awny-fallback img { position: absolute; left: 50%; width: auto; max-width: none; }
/* الصورة الثابتة والفيديو في نفس المكان بالظبط ⇐ الصورة بتختفي بالراحة والفيديو بيظهر مكانها (من غير «نطّة» الوقوع) */
.awny-stage.ready .awny-fallback { opacity: 0; pointer-events: none; }
.awny-stage.ready.awny-video .awny-m { animation: awny-in .5s ease both; }
@keyframes awny-in { from { opacity: 0; } to { opacity: 1; } }

/* الخدمات اللي بتلف حواليه (بتعدّي ورا وقدام) */
.awny-orb { position: absolute; left: 0; top: 0; z-index: 2; width: clamp(50px, 16%, 88px); aspect-ratio: 1; border-radius: 50%; background: #fff; border: 3px solid #fff; overflow: hidden; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(61, 32, 17, .2), 0 0 0 1px rgba(61, 32, 17, .06); will-change: transform, opacity; transition: box-shadow .2s; }
.awny-orb img { width: 84%; height: 84%; object-fit: contain; pointer-events: none; }
.awny-orb.awny-cover img { width: 100%; height: 100%; object-fit: cover; }
.awny-orb.hot, .awny-orb:focus-visible { box-shadow: 0 0 0 4px var(--orange), 0 14px 30px rgba(226, 87, 41, .4); outline: none; }
.awny-stage:not(.ready) .awny-orb { opacity: 0; }

/* كارت الخدمة اللي قدام دلوقتي */
.awny-st-card { position: absolute; z-index: 9; top: 4%; inset-inline-end: 0; display: flex; align-items: center; gap: 10px; max-width: 48%; padding: 8px 14px 8px 8px; border-radius: 18px; color: var(--ink); background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(61, 32, 17, .14); opacity: 0; transform: translateY(-8px) scale(.96); transition: opacity .2s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1); }
[dir="rtl"] .awny-st-card { padding: 8px 8px 8px 14px; }
.awny-st-card.on { opacity: 1; transform: none; }
.awny-st-card img { flex: none; width: 46px; height: 46px; border-radius: 12px; object-fit: contain; background: #fff; }
.awny-st-card.awny-cover img { object-fit: cover; }
.awny-st-card span { display: grid; min-width: 0; }
.awny-st-card b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.awny-st-card small { white-space: nowrap; font-size: 12px; color: var(--brand); font-weight: 700; }
.awny-st-card i { font-style: normal; color: var(--brand); font-weight: 800; transition: transform .2s; }
.awny-st-card:hover i { transform: translateX(-4px); }
[dir="ltr"] .awny-st-card:hover i { transform: translateX(4px); }

/* فقاعة الكلام */
.awny-m-bubble { position: absolute; z-index: 9; top: 6%; inset-inline-start: 0; max-width: 46%; padding: 10px 16px; border-radius: 20px 20px 6px 20px; background: linear-gradient(135deg, var(--orange), var(--brand)); color: #fff; font-weight: 700; font-size: 15px; line-height: 1.45; box-shadow: 0 14px 30px rgba(226, 87, 41, .32); opacity: 0; transform: translateY(10px) scale(.8); transform-origin: 0 100%; transition: opacity .2s ease, transform .4s cubic-bezier(.34, 1.7, .64, 1); pointer-events: none; }
[dir="rtl"] .awny-m-bubble { border-radius: 20px 20px 20px 6px; transform-origin: 0 100%; }
[dir="ltr"] .awny-m-bubble { transform-origin: 100% 100%; }
.awny-m-bubble.on { opacity: 1; transform: none; }
.awny-m-bubble .ghost { visibility: hidden; }
.awny-m-bubble .typed { position: absolute; inset: 10px 16px; }

/* المؤثرات: شرار العدّة لما تدوس عليه، ودايرة لما يغيّر وضعه */
.awny-st-fx { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.awny-st-p { position: absolute; font-size: 24px; line-height: 1; animation: awny-burst 1.1s cubic-bezier(.2, .8, .3, 1) forwards; }
.awny-st-poof { position: absolute; width: 40%; aspect-ratio: 1; margin: -20% 0 0 -20%; border-radius: 50%; border: 3px solid var(--orange); animation: awny-poof .55s ease-out forwards; }

@keyframes awny-spin { to { transform: rotate(1turn); } }
@keyframes awny-glow { 0%, 100% { opacity: .7; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes awny-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(90deg); } }
@keyframes awny-drop { 0% { opacity: 0; transform: translateY(-40%) scale(.7); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes awny-float { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-12px) scaleY(1.015); } }
@keyframes awny-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.82); opacity: .65; } }
@keyframes awny-hop { 0% { transform: translateY(0) scale(1); } 25% { transform: translateY(6px) scale(1.07, .9); } 55% { transform: translateY(-34px) scale(.95, 1.06) rotate(-3deg); } 80% { transform: translateY(2px) scale(1.04, .96); } 100% { transform: none; } }
@keyframes awny-burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 15% { opacity: 1; } 65% { opacity: 1; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1); } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 50px)) rotate(var(--r)) scale(.7); } }
@keyframes awny-poof { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(1.5); border-width: 1px; } }

@media (max-width: 560px) {
  .awny-m-bubble { font-size: 13px; padding: 8px 12px; max-width: 50%; top: 2%; }
  .awny-m-bubble .typed { inset: 8px 12px; }
  .awny-st-card { top: 2%; gap: 8px; max-width: 48%; }
  .awny-st-card img { width: 36px; height: 36px; }
  .awny-st-card b { font-size: 12px; }
  .awny-st-card small { font-size: 11px; }
  .awny-m, .awny-fallback { left: 27%; width: 46%; }
}
@media (prefers-reduced-motion: reduce) {
  .awny-st-blob::after, .awny-st-ring, .awny-st-ring2, .awny-st-spark, .awny-m-body, .awny-m-shadow, .awny-stage.ready .awny-m, .awny-m.hop .awny-m-body { animation: none; }
  .awny-st-spark { opacity: .7; }
  .awny-m-tilt, .awny-m-pose, .awny-m-bubble, .awny-st-card { transition: none; }
}

/* عوني «عرايس» (js/awny-rig.js): كل طبقة بحجم الشخصية كلها وبتلف حوالين مفصلها من الجافاسكربت */
.awny-rig-host { position: absolute; inset: 0; filter: drop-shadow(0 20px 22px rgba(61, 32, 17, .22)); }
.awny-rig-part { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; pointer-events: none; }
.awny-rig-part img { position: absolute; display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
.awny-m-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }

/* عوني فيديو (js/awny-video.js): الكانفس أعرض من صندوق عوني (الإيد بتطلع برّه وهو بيلوّح) — متوسّط ورجليه على الأرض */
.awny-clips-host { overflow: visible; }
.awny-clips { position: absolute; bottom: 0; left: 50%; height: 100%; width: auto; transform: translateX(-50%); display: block; pointer-events: none; }

/* من غير الشخصية (data-no-character): لوجو عوني في نص القرص — القرص فاتح دايمًا (الكتابة البني مابتبانش على الغامق) */
.awny-stage.awny-stage[data-no-character] .awny-st-back { --plate-hi: #fff; --plate-lo: color-mix(in srgb, var(--peach) 35%, #fff); --plate-rim: rgba(255, 255, 255, .9); }
.awny-logo { position: absolute; left: 50%; top: 42%; width: 56%; aspect-ratio: 1000 / 992; transform: translate(-50%, -50%); z-index: 5; perspective: 1100px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* طبقات اللوجو بنسب الصورة الأصلية (1000×992): الشباك (الدايرة الزرقا)، عوني طالع منه، والكتابة تحت */
.al-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.al-win { position: absolute; left: 24.4%; top: 7%; width: 59.4%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #8ad8e3, #6ac6d3 55%, #4fb0c0); box-shadow: inset 0 -14px 30px rgba(0, 60, 80, .18); transform: translateZ(-10px) scale(0); animation: al-pop .7s .1s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.al-sill { position: absolute; left: 0; right: 0; top: -30%; height: 101.37%; overflow: hidden; transform: translateZ(30px); pointer-events: none; }
.al-fig { position: absolute; left: 9.3%; width: 85.1%; top: 29.6%; height: 70.4%; }
.al-rise, .al-lean, .al-sway, .al-body, .al-hop { position: absolute; inset: 0; transform-origin: 50% 100%; }
.al-rise { transform: translateY(75%); animation: al-rise .9s .45s cubic-bezier(.22, 1.3, .4, 1) forwards; }
.al-body { animation: al-breathe 4.2s 1.5s ease-in-out infinite; }
.al-sway { animation: al-sway 7s 1.5s ease-in-out infinite; }
.al-lean { transition: transform .7s cubic-bezier(.34, 1.4, .64, 1), filter .7s ease; }
.al-lean.out { transform: translateY(-3%) scale(1.07); filter: drop-shadow(0 26px 22px rgba(0, 0, 0, .35)); }
.al-hop.go { animation: al-hop .7s cubic-bezier(.34, 1.56, .64, 1); }
.al-fig img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: drop-shadow(0 14px 16px rgba(61, 32, 17, .22)); user-select: none; -webkit-user-drag: none; }
.al-glint { position: absolute; inset: 0; -webkit-mask: var(--m) center / 100% 100% no-repeat; mask: var(--m) center / 100% 100% no-repeat; clip-path: inset(19.8% 35.7% 69.6% 32%); pointer-events: none; overflow: hidden; }
.al-glint::before { content: ''; position: absolute; top: 0; bottom: 0; width: 12%; left: 25%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .8), transparent); transform: skewX(-20deg); opacity: 0; animation: al-glint 5.5s 2.4s ease-in-out infinite; }
.al-word { position: absolute; left: 0; width: 100%; height: auto; top: 76.31%; transform: translateZ(10px) translateY(14%); opacity: 0; animation: al-word .7s 1.05s ease forwards; }
@keyframes al-pop { to { transform: translateZ(-10px) scale(1); } }
@keyframes al-rise { to { transform: none; } }
@keyframes al-breathe { 0%, 100% { transform: none; } 50% { transform: scale(1.006, 1.016); } }
@keyframes al-sway { 0%, 100% { transform: none; } 30% { transform: rotate(-1.4deg); } 70% { transform: rotate(1.2deg); } }
@keyframes al-hop { 25% { transform: translateY(2%) scale(1.05, .94); } 55% { transform: translateY(-9%) scale(.97, 1.04); } 80% { transform: translateY(1%) scale(1.02, .98); } }
@keyframes al-glint { 0% { left: 25%; opacity: 1; } 22% { left: 70%; opacity: 1; } 23%, 100% { left: 70%; opacity: 0; } }
@keyframes al-word { to { opacity: 1; transform: translateZ(10px); } }
@media (prefers-reduced-motion: reduce) {
  .al-win, .al-rise, .al-word { animation: none; transform: none; opacity: 1; }
  .al-body, .al-sway, .al-glint::before { animation: none; }
}
