/*
 * «لوّن وارسم» — قسم التلوين بنوافذ (S.colorhub في app.js، 2026-11-18). الشاشة 100vw × 56.25vw.
 * ورق منوّر: عنوان بضربة فرشاة، ٣ نوافذ كروت ملزوقة، شرايح فلترة، ولوحة كروت بتتمرّر لوحدها (.pscroll زي ركن الأهل).
 * كل كارت: «قبل وبعد» على القطر (نص ملوّن ونص خطوط)، ونوع النشاط، والاسم، والتقدّم الحقيقي.
 * من غير grid/gap، والمقاسات vw، وضل صلب من غير blur، والتحديد = --focus-ring-on-light (حبر + دهبي).
 * وكمان: إضافات «لوّن بالأرقام» جوه شاشة التلوين نفسها (.dn-color.num) في آخر الملف.
 */
.ch { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; direction: rtl; text-align: right; color: #22195A;
  background: radial-gradient(40% 45% at 88% 0%, rgba(255, 200, 61, .34), rgba(255, 200, 61, 0) 70%), radial-gradient(34% 40% at 4% 92%, rgba(229, 72, 108, .14), rgba(229, 72, 108, 0) 70%), #FCEBD3; }
.ch * { box-sizing: border-box; }

/* ── العنوان: «لوّن وارسم» بضربة فرشاة، ونور بيشاور على الشمال ── */
.ch-head { position: absolute; left: 3vw; right: 3vw; top: 1.1vw; height: 8.6vw; text-align: center; }
.ch-head h1 { display: block; width: fit-content; width: -webkit-fit-content; margin: 0 auto; padding: .1vw 2.6vw .5vw; font-size: 3.5vw; font-weight: 900; line-height: 1.3; color: #22195A;
  word-spacing: .14em; transform: rotate(-1.2deg);
  background: center / 100% 100% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'%3E%3Cpath d='M7 33 C22 17 62 15 110 15 C170 12 232 9 287 16 C297 18 299 26 292 30 C299 36 294 45 281 47 C220 53 150 50 90 53 C50 54 20 55 8 48 C1 44 2 38 7 33 Z' fill='%23FFC83D' fill-opacity='.62'/%3E%3C/svg%3E"); }
.ch-head h1 em { font-style: normal; color: #E5486C; }
.ch-head p { margin: .5vw 0 0; font-size: 1.5vw; font-weight: 600; color: #4E4585; }
.ch-guide { position: absolute; left: 0; top: .2vw; width: 23vw; height: 7vw; }
.ch-guide img { position: absolute; left: 0; top: 0; width: 6vw; animation: hb-bob 2.6s ease-in-out infinite alternate; }
.ch-bub { position: absolute; left: 6.6vw; top: .9vw; max-width: 16vw; padding: .5vw 1vw .65vw; border-radius: 1.2vw 1.2vw 1.2vw .3vw; background: #fff; color: #22195A;
  font-size: 1.4vw; font-weight: 800; line-height: 1.4; text-align: right; box-shadow: 0 .3vw 0 rgba(34, 25, 90, .14); animation: hb-pop .45s cubic-bezier(.34, 1.56, .64, 1) .3s both; }

/* ── النوافذ: ٣ كروت ملزوقة؛ المفتوحة وردي فاتح بخط مرجاني ولزق دهبي ── */
.ch-tabs { position: absolute; left: 3vw; right: 3vw; top: 10.4vw; height: 6.6vw; display: flex; justify-content: space-between; }
.ch-tab { position: relative; flex: none; width: 29.6vw; height: 6.2vw; display: flex; align-items: center; padding: 0 1.6vw; border-radius: 1.8vw; background: #fff; cursor: pointer;
  box-shadow: 0 .4vw 0 rgba(34, 25, 90, .12); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.ch-tab:nth-child(1) { transform: rotate(-.8deg); }
.ch-tab:nth-child(2) { transform: rotate(.7deg); }
.ch-tab:nth-child(3) { transform: rotate(-.5deg); }
.ch-ti { flex: none; width: 4.6vw; height: 4.6vw; margin-left: 1.2vw; padding: .5vw; border-radius: 1.3vw; background: #FFF3DD; }
.ch-ti .ch-ico { display: block; width: 100%; height: 100%; }
.ch-tt { flex: 1; min-width: 0; }
.ch-tt b { display: block; font-size: 2.1vw; font-weight: 900; line-height: 1.25; }
.ch-tt small { display: block; font-size: 1.35vw; font-weight: 700; color: #4E4585; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-tab.is-sel { background: #FFE4EC; box-shadow: 0 0 0 .3vw #E5486C, 0 .4vw 0 .3vw rgba(229, 72, 108, .3); }
.ch-tab.is-sel .ch-ti { background: #fff; }
.ch-tab.is-sel:before { content: ""; position: absolute; left: 50%; top: -1vw; width: 8vw; height: 1.9vw; margin-left: -4vw; border-radius: .3vw; transform: rotate(-3deg);
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0, rgba(255, 255, 255, .5) .35vw, rgba(255, 255, 255, 0) .35vw, rgba(255, 255, 255, 0) .7vw), #FFD66B; }

/* ── الفلاتر (شرايح) ── */
.ch-chips { position: absolute; left: 3vw; right: 3vw; top: 17.9vw; height: 4vw; display: flex; justify-content: center; }
.ch-chip { flex: none; display: flex; align-items: center; height: 3.6vw; margin: 0 .55vw; padding: 0 1.4vw 0 1.6vw; border-radius: 2vw; background: #fff; color: #22195A; cursor: pointer;
  font-size: 1.55vw; font-weight: 800; white-space: nowrap; box-shadow: 0 .3vw 0 rgba(34, 25, 90, .12); }
.ch-chip .ch-ico { width: 2.2vw; height: 2.2vw; margin-left: .6vw; }
.ch-chip.is-sel { background: #6A48D6; color: #fff; box-shadow: 0 .3vw 0 #4A2FA8; }

/* ── اللوحة: بتتمرّر لوحدها (باللمس وبالتحديد)، والصفحة ثابتة ── */
.ch-panel { position: absolute; left: 2vw; right: 2vw; top: 21.6vw; bottom: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  padding: 2.8vw 1vw 2.4vw; }
.ch:not(.t-color) .ch-panel { top: 17.4vw; padding-top: 2.2vw; }

/* ── كروت التلوين: ٥ في الصف ── */
.ch-grid { display: flex; flex-wrap: wrap; justify-content: flex-start; }
.ch-card { position: relative; flex: none; width: 17.2vw; margin: 0 0 2.2vw 1.55vw; padding: .7vw .7vw .8vw; border-radius: 1.6vw; background: #fff; cursor: pointer;
  box-shadow: 0 .45vw 0 rgba(34, 25, 90, .14); transform: rotate(-1.2deg); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
  animation: ch-pop .55s cubic-bezier(.34, 1.56, .64, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.ch-card:nth-child(5n) { margin-left: 0; }
.ch-card:nth-child(3n+2) { transform: rotate(1deg); }
.ch-card:nth-child(3n) { transform: rotate(-.5deg); }
/* اللزق فوق الكارت: وردي لـ«بحرية» وفيروزي لـ«بالأرقام» */
.ch-card:before { content: ""; position: absolute; z-index: 2; left: 50%; top: -.9vw; width: 6.4vw; height: 1.7vw; margin-left: -3.2vw; border-radius: .25vw; transform: rotate(-4deg);
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0, rgba(255, 255, 255, .5) .3vw, rgba(255, 255, 255, 0) .3vw, rgba(255, 255, 255, 0) .6vw), #FFB3C7; }
.ch-card.m-num:before { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0, rgba(255, 255, 255, .5) .3vw, rgba(255, 255, 255, 0) .3vw, rgba(255, 255, 255, 0) .6vw), #8FD9E0; transform: rotate(5deg); }
.ch-pic { position: relative; display: block; height: 10vw; border-radius: 1vw; overflow: hidden; background: #FFFDF6; box-shadow: inset 0 0 0 .12vw #EADFCF; }
.ch-pic svg { display: block; width: 100%; height: 100%; }
.ch-meta { display: block; padding: .55vw .3vw 0; }
.ch-type { display: flex; align-items: center; font-size: 1.25vw; font-weight: 800; color: #C2364F; line-height: 1.3; }
.ch-type .ch-ico { width: 1.7vw; height: 1.7vw; margin-left: .4vw; }
.ch-card.m-num .ch-type { color: #0F7280; }
.ch-meta b { display: block; margin-top: .15vw; font-size: 1.65vw; font-weight: 900; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-pr { display: inline-block; vertical-align: middle; width: 7vw; height: .7vw; margin: .2vw 0 0 .6vw; border-radius: .4vw; background: #EEE7F7; overflow: hidden; }
.ch-pr i { display: block; height: 100%; border-radius: .4vw; background: #FFB43A; }
.ch-meta em { font-style: normal; font-size: 1.25vw; font-weight: 800; color: #4E4585; vertical-align: middle; }
.ch-ok { display: inline-block; margin-top: .2vw; padding: .1vw .8vw .25vw; border-radius: 1vw; background: #FFF1C4; color: #8A5A00; font-size: 1.25vw; font-weight: 900; }
/* البادج: معلومة حقيقية بس (بيكمّلها / خلّصها) */
.ch-bdg { position: absolute; z-index: 3; top: -1vw; left: -.8vw; padding: .2vw .9vw .35vw; border-radius: 1.2vw 1.2vw 1.2vw .35vw; background: #E5486C; color: #fff;
  font-size: 1.3vw; font-weight: 900; box-shadow: 0 0 0 .22vw #fff; transform: rotate(-7deg); }
.ch-bdg.gold { background: #FFC83D; color: #22195A; font-size: 1.5vw; padding: .1vw .7vw .25vw; }
.ch-card.s-done .ch-pic { box-shadow: inset 0 0 0 .25vw #FFC83D; }

/* ── معرضي: الرسومات متعلّقة بدبوس، ٤ في الصف ── */
.ch-wall { display: flex; flex-wrap: wrap; justify-content: flex-start; padding-top: .6vw; }
.ch-frame { position: relative; flex: none; width: 21.4vw; margin: 0 0 2.6vw 1.6vw; padding: 1vw 1vw .8vw; border-radius: .8vw; background: #fff; cursor: pointer;
  box-shadow: 0 .5vw 0 rgba(90, 50, 20, .2); transform: rotate(1.4deg); transform-origin: 50% 0;
  animation: ch-pop .55s cubic-bezier(.34, 1.56, .64, 1) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
.ch-frame:nth-child(4n) { margin-left: 0; }
.ch-frame:nth-child(2n) { transform: rotate(-1.6deg); }
.ch-frame:nth-child(3n) { transform: rotate(.6deg); }
.ch-pin { position: absolute; z-index: 2; left: 50%; top: -.9vw; width: 2vw; height: 2vw; margin-left: -1vw; border-radius: 50%; background: #E5486C; box-shadow: inset -.3vw -.3vw 0 rgba(0, 0, 0, .18), 0 .25vw 0 rgba(34, 25, 90, .2); }
.ch-frame:nth-child(2n) .ch-pin { background: #13899A; }
.ch-frame:nth-child(3n) .ch-pin { background: #FFC83D; }
.ch-frame .ch-pic { height: 12.6vw; border-radius: .3vw; box-shadow: inset 0 0 0 .12vw #EADFCF; }
.ch-frame .ch-meta { padding: .6vw .2vw 0; text-align: center; }
.ch-frame .ch-meta b { font-size: 1.6vw; }
.ch-frame .ch-meta small { display: block; font-size: 1.25vw; font-weight: 700; color: #4E4585; }
/* الرسمة اللي لسه متعلّقة: بتقع وتتمرجح على الدبوس */
.ch-frame.fresh { animation: ch-hang 1.1s cubic-bezier(.34, 1.56, .64, 1) .25s backwards; }
.ch-frame.fresh:after { content: "جديدة"; position: absolute; z-index: 3; top: -1vw; left: -.8vw; padding: .2vw .9vw .35vw; border-radius: 1.2vw 1.2vw 1.2vw .35vw; background: #E5486C; color: #fff;
  font-size: 1.3vw; font-weight: 900; box-shadow: 0 0 0 .22vw #fff; transform: rotate(-7deg); }

/* ── فاضي (المعرض أول مرة، وحكاياتي لحد ما الخدمة توصل) ── */
.ch-empty { width: 52vw; margin: 1.6vw auto 0; padding: 2vw 2.6vw 2.2vw; border-radius: 2vw; background: #fff; text-align: center; box-shadow: 0 .45vw 0 rgba(34, 25, 90, .12); transform: rotate(-.8deg);
  animation: ch-pop .6s cubic-bezier(.34, 1.56, .64, 1) backwards; }
.ch-empty img { display: block; width: 7vw; margin: 0 auto .6vw; animation: hb-bob 2.6s ease-in-out infinite alternate; }
.ch-empty b { display: block; font-size: 2.2vw; font-weight: 900; }
.ch-empty p { margin: .6vw 0 0; font-size: 1.55vw; line-height: 1.6; color: #4E4585; }
.ch-book { display: block; width: 7.4vw; height: 7.4vw; margin: 0 auto .6vw; padding: 1vw; border-radius: 50%; background: #FFF3DD; transform: rotate(-6deg); }
.ch-book .ch-ico { display: block; width: 100%; height: 100%; }

/* ── التحديد: حلقة حبر + دهبي، ورفعة بسيطة (الكارت بيعدل) ── */
#stage .ch .ch-tab.on, #stage .ch .ch-card.on, #stage .ch .ch-frame.on, #stage .ch .ch-chip.on { box-shadow: var(--focus-ring-on-light); animation: none; z-index: 4; }
#stage .ch .ch-tab.on { transform: translateY(-.4vw) scale(1.03); }
#stage .ch .ch-card.on, #stage .ch .ch-frame.on { transform: translateY(-.5vw) scale(1.04); }
#stage .ch .ch-chip.on { transform: translateY(-.3vw); }
#stage .ch .ch-chip.is-sel.on { background: #6A48D6; color: #fff; }
@media (hover: hover) {
  .ch .ch-card:hover, .ch .ch-frame:hover { transform: rotate(0) translateY(-.4vw); }
}
#screen.still .ch-card, #screen.still .ch-frame, #screen.still .ch-empty, #screen.still .ch-bub { animation: none; }

@keyframes ch-pop { from { opacity: 0; transform: translateY(2vw) rotate(4deg) scale(.86); } }
@keyframes ch-hang { 0% { opacity: 0; transform: translateY(-8vw) rotate(-14deg); } 55% { opacity: 1; transform: translateY(.4vw) rotate(6deg); } 78% { transform: rotate(-3deg); } 100% { transform: rotate(1.4deg); } }

/* =====================================================================
 * «لوّن بالأرقام» جوه شاشة التلوين (coloring.js، data.mode = "num")
 * ===================================================================== */
.dn-color .cl-nums { pointer-events: none; }
.dn-color .cta.cl-done.gone { display: none; }
.dn-color .cl-nums .cl-n { transition: opacity .3s; }
.dn-color .cl-nums .cl-n.has { opacity: 0; }
.dn-color .cl-nums text { font-family: inherit; }
.dn-color .cl-mode { font-style: normal; display: inline-block; margin-right: .5vw; padding: 0 .7vw .1vw; border-radius: 1vw; background: #13899A; color: #fff; font-size: 1.3vw; vertical-align: middle; }
.dn-color.num .cl-title { max-width: 30vw; }
.dn-color .cl-want { display: inline-block; min-width: 3vw; margin-right: .5vw; padding: 0 .6vw; border-radius: 1.5vw; background: #22195A; color: #FFC83D; text-align: center; font-weight: 900; }
.dn-color .cl-sw b { position: absolute; left: 0; right: 0; top: 50%; margin-top: -1.6vw; height: 3.2vw; line-height: 3.2vw; text-align: center; font-size: 2.6vw; font-weight: 900; color: #fff;
  text-shadow: .1vw 0 0 #22195A, -.1vw 0 0 #22195A, 0 .1vw 0 #22195A, 0 -.1vw 0 #22195A, 0 .2vw 0 #22195A; }
.dn-color .cl-sw b.dk { color: #22195A; text-shadow: none; }
/* اللون الصح بيلمع بعد أول غلطة: حلقة بيضا ودهبي بتنبض (من غير ضل مغبّش) */
.dn-color .cl-sw.hint { overflow: visible; animation: cl-hint 1s ease-in-out infinite; box-shadow: 0 0 0 .3vw #fff, 0 0 0 .7vw #FFC83D; }
.dn-color .cl-sw.hint.foc { box-shadow: var(--focus-ring); }
@keyframes cl-hint { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }

/* =====================================================================
 * مراجعة UX (design/ux-review/REPORT.md قسم د، 2026-11-18) لشاشة التلوين نفسها:
 *  - «رجوع» فوق يمين زي باقي الأنشطة (كان تحت شمال)، والعنوان اتزحزح جنبه.
 *  - العداد: شريط دهبي بيتملي + «٣ من ١٠» + فانوس بينوّر في الآخر (بدل ١٠ معينات بنفسجي).
 *  - علبة الألوان ظاهرة تحت الورقة من الأول، و«خلصت» راحت تحت يمين.
 * ===================================================================== */
#bnbar.s-coloring, #bnbar.s-colorart { left: auto; right: 1.2vw; top: 1.2vw; bottom: auto; }
.dn-color .cl-title { right: 10vw; max-width: 18vw; }
.dn-color.num .cl-title { max-width: 18vw; }
.dn-color .cl-guide { width: 32vw; margin-left: -16vw; }
.dn-color .cl-guide .bt { font-size: 1.9vw; }
.dn-color .cl-count { min-width: 15vw; padding: 0 1.2vw 0 1vw; font-size: 1.6vw; }
.dn-color .cl-count .cl-lan { width: 1.7vw; height: 2.3vw; margin: 0 0 0 .6vw; color: #D9CBB4; }
.dn-color .cl-count .cl-lan.on { color: #FFC83D; }
.dn-color .cl-cbar { display: inline-block; width: 6.4vw; height: .9vw; margin-left: .7vw; border-radius: .5vw; background: #EFE6D6; overflow: hidden; vertical-align: middle; }
.dn-color .cl-cbar i { display: block; height: 100%; border-radius: .5vw; background: #FFB43A; transition: width .5s cubic-bezier(.34, 1.56, .64, 1); }
.dn-color .cl-count span { white-space: nowrap; }
.dn-color .cl-count.lit { animation: cl-countPop .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes cl-countPop { 50% { transform: scale(1.12); } }

/* علبة الألوان: صف «علب ألوان» تحت الورقة (للعرض بالريموت، وللاختيار باللمس) */
.dn-color .cl-tray { position: absolute; left: 22vw; right: 22vw; bottom: 1.6vw; height: 6vw; z-index: 6; display: flex; justify-content: center; align-items: center; }
.dn-color .cl-pot { position: relative; flex: none; width: 4.2vw; height: 4.2vw; margin: 0 .45vw; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 .25vw #fff, 0 .45vw 0 .25vw rgba(90, 50, 20, .22);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.dn-color.big:not(.num) .cl-pot { width: 3.3vw; height: 3.3vw; margin: 0 .3vw; }
.dn-color .cl-pot.sel { transform: translateY(-.8vw) scale(1.12); box-shadow: 0 0 0 .3vw #22195A, 0 0 0 .75vw #FFC83D; }
.dn-color .cl-pot.hint { animation: cl-hint 1s ease-in-out infinite; box-shadow: 0 0 0 .3vw #fff, 0 0 0 .7vw #FFC83D; }
.dn-color .cl-pot.nudge { animation: dn-shake .4s var(--e-out); }
.dn-color .cl-pot b { position: absolute; left: 0; right: 0; top: 50%; margin-top: -1.3vw; line-height: 2.6vw; text-align: center; font-size: 2vw; font-weight: 900; font-style: normal; color: #fff;
  text-shadow: .1vw 0 0 #22195A, -.1vw 0 0 #22195A, 0 .1vw 0 #22195A, 0 -.1vw 0 #22195A; }
.dn-color .cl-pot b.dk { color: #22195A; text-shadow: none; }
.dn-color .ctarow { left: auto; right: var(--safe-x); justify-content: flex-end; }
.dn-color.palon .cl-tray, .dn-color.fin .cl-tray, .dn-color.view .cl-tray { opacity: 0; pointer-events: none; transition: opacity .2s; }

/* =====================================================================
 * تلوين صور الخطوط («حكاياتي»، colorart.js): الورقة على مقاس الصورة، والـcanvas جواها، واللمعة الدهبي طبقة فوق
 * ===================================================================== */
.dn-art .ca-paper { overflow: hidden; }
.dn-art .ca-stage { position: absolute; left: 0; top: 0; right: 0; bottom: 0; border-radius: 1.2vw; overflow: hidden; cursor: pointer; }
.dn-art .ca-cv, .dn-art .ca-hi { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.dn-art .ca-hi { pointer-events: none; animation: cl-pulse 1.1s ease-in-out infinite alternate; }
.dn-art.palon .ca-hi { animation: none; opacity: .35; }
.dn-art .ca-wait { position: absolute; left: 50%; top: 50%; margin: -1vw 0 0 -3.6vw; width: 7.2vw; height: 2vw; display: flex; justify-content: space-between; }
.dn-art .ca-wait i { width: 1.8vw; height: 1.8vw; border-radius: 50%; background: #FFC83D; animation: ca-dot .9s ease-in-out infinite alternate; }
.dn-art .ca-wait i:nth-child(2) { animation-delay: .15s; } .dn-art .ca-wait i:nth-child(3) { animation-delay: .3s; }
.dn-art.ready .ca-wait, .dn-art.failed .ca-wait { display: none; }
.dn-art:not(.ready) .cl-tray, .dn-art:not(.ready) .ctarow, .dn-art:not(.ready) .cl-undo, .dn-art:not(.ready) .cl-count { visibility: hidden; }
.dn-art .cl-title svg { width: 2.2vw; height: 2.2vw; }
@keyframes ca-dot { from { transform: translateY(.4vw); opacity: .5; } to { transform: translateY(-.4vw); opacity: 1; } }
.ch-pic.ch-ai { background: #fff; }
.ch-pic.ch-ai img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ch-card.m-ai:before { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0, rgba(255, 255, 255, .5) .3vw, rgba(255, 255, 255, 0) .3vw, rgba(255, 255, 255, 0) .6vw), #FFD66B; }
.ch-card.m-ai .ch-type { color: #8A5A00; }
.ch-ai-grid .ch-card .ch-pic { height: 12vw; }
