/* ==========================================================================
   ثيم «Anime» (كان اسمه Titan Love) — نفس عالم الأسوار، بس كيوت وحب:
   - لوحات أصلية مرسومة بـ ComfyUI بستايل chibi باستيل: عملاق مدوّر لطيف يحضن قلب
     ورا سور مليان ورد، وجنديين صغار يتقاسمون قلب فوگ السور
   - ألوان باستيل (وردي، خوخي، كريمي، أزرق سماوي)، زوايا مدوّرة، وخط عربي مدوّر (Baloo Bhaijaan 2)
   - الحركة نفس قواعد design-taste-frontend: دخول لوحة الترحيب مرة وحدة + التأشير والضغط بس
   - الشخصيات المتدندلة: ثلاث شخصيات chibi أصلية بحبال
   ========================================================================== */
:root[data-theme="titan-cute"] {
  color-scheme: light;
  --bg: #FFF4F2; --surface: #FFFFFF; --surface-2: #FFECEA;
  --border: rgba(200, 70, 106, .14); --border-strong: rgba(200, 70, 106, .3);
  --text: #4A2B34; --muted: #8C6670;
  --primary: #C8466A; --primary-hover: #B23A5C; --primary-soft: rgba(200, 70, 106, .1); --on-primary: #FFFFFF;
  --peach: #F4A68C; --sky: #9CC6E8; --cream: #FFF8EE;
  --accent: var(--peach);
  --grad-a: #D9577C; --grad-b: #EE8FA4; --orb: #F4A6B8;
  --grad: linear-gradient(120deg, #C8466A, #E0708C);
  --grad-dark: linear-gradient(120deg, #C8466A, #E0708C);
  --blob-1: rgba(244, 166, 184, .2); --blob-2: rgba(156, 198, 232, .2);
  --danger: #C0392B; --danger-soft: rgba(192, 57, 43, .1);
  --ok: #3E8A5A; --ok-soft: rgba(62, 138, 90, .12);
  --warn: #A36614; --warn-soft: rgba(244, 166, 140, .2);
  --star: #E8A13A;
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  --display: "Baloo Bhaijaan 2", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(160, 60, 90, .06), 0 10px 26px rgba(160, 60, 90, .08);
  --shadow-lift: 0 2px 6px rgba(160, 60, 90, .08), 0 16px 34px rgba(160, 60, 90, .12);
  --icon-c: #C8466A;
  --tl-ease: cubic-bezier(.2, .8, .2, 1); --tl-enter: cubic-bezier(.22, 1, .36, 1);
  --tl-in: 150ms; --tl-out: 120ms; --tl-press: 90ms;
}
:root[data-theme="titan-cute"] body { background: var(--bg); }
:root[data-theme="titan-cute"] ::selection { background: rgba(244, 166, 184, .5); color: #4A2B34; }

/* ---------- الخلفية: اللوحة الكيوت، وفوگها غشاوة خفيفة حتى الكلام يبقى واضح ---------- */
:root[data-theme="titan-cute"] body::before {
  inset: 0; animation: none;
  background:
    linear-gradient(180deg, rgba(255, 244, 242, .35) 0%, rgba(255, 244, 242, .15) 40%, rgba(255, 244, 242, .55) 100%),
    url("/static/titan-art/cute-bg-wide.webp") center 40% / cover no-repeat,
    #FFF4F2;
}
:root[data-theme="titan-cute"] body::after { content: none; }
@media (max-width: 744px) {
  :root[data-theme="titan-cute"] body::before {
    background:
      linear-gradient(180deg, rgba(255, 244, 242, .3) 0%, rgba(255, 244, 242, .1) 35%, rgba(255, 244, 242, .6) 100%),
      url("/static/titan-art/cute-bg-tall.webp") center top / cover no-repeat,
      #FFF4F2;
  }
}

/* ---------- الخط: عناوين مدوّرة كيوت ---------- */
:root[data-theme="titan-cute"] :is(body, button, input, select, textarea) { font-family: var(--font); }
:root[data-theme="titan-cute"] :is(h1, h2, .brand, .auth-art-title) { font-family: var(--display); font-weight: 700; letter-spacing: 0; }
:root[data-theme="titan-cute"] body { line-height: 1.7; }

/* ---------- الأسطح: غيوم بيضة مدوّرة فوگ اللوحة ---------- */
:root[data-theme="titan-cute"] :is(.card, .tile, .mini-item, .modal, .palette, .account-menu, .stat, .profile-card, .row-card, .news, .subject) {
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
}
:root[data-theme="titan-cute"] :is(.tile, .subject, .stat, .profile-card, .row-card, .news, .mini-item, .card:not(.modal, .hero)) {
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
:root[data-theme="titan-cute"] :is(.sidebar, .topbar-in) {
  background: rgba(255, 250, 248, .88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--border); border-radius: 22px;
}
:root[data-theme="titan-cute"] .bottomnav { background: #FFF8F6; box-shadow: var(--shadow), inset 0 0 0 1px var(--border); border-radius: 24px; }
:root[data-theme="titan-cute"] .page-head:not(.subject-banner) h1 { color: var(--text); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
/* علامة عنوان القسم: قلب صغير */
:root[data-theme="titan-cute"] .section-title h2::before {
  width: 16px; height: 14px; border-radius: 0; transform: none; box-shadow: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 21'%3E%3Cpath d='M12 21C5 15.5 0 11.6 0 6.6 0 2.9 2.9 0 6.5 0 8.7 0 10.8 1.1 12 2.9 13.2 1.1 15.3 0 17.5 0 21.1 0 24 2.9 24 6.6 24 11.6 19 15.5 12 21Z' fill='%23E0708C'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- التنقل والأزرار: حبوب مدوّرة ---------- */
:root[data-theme="titan-cute"] :is(.side-link, .menu-item, .user-card, .filter, .seg button, .input, .chip, .rate-btn) { border-radius: 14px; }
:root[data-theme="titan-cute"] :is(.btn, .seg) { border-radius: 999px; }
:root[data-theme="titan-cute"] .btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -10px rgba(200, 70, 106, .8); }
:root[data-theme="titan-cute"] .btn-ghost, :root[data-theme="titan-cute"] .btn-ghost:hover { background: #fff; box-shadow: inset 0 0 0 1px var(--border-strong); }
:root[data-theme="titan-cute"] .side-link.active, :root[data-theme="titan-cute"] .bottomnav a.active {
  background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px rgba(200, 70, 106, .22);
}
:root[data-theme="titan-cute"] .side-link:hover:not(.active) { background: rgba(244, 166, 184, .14); color: var(--text); }
:root[data-theme="titan-cute"] :is(.fab, .bn-search-circle) { background: var(--grad); color: #fff; border-radius: 999px; box-shadow: 0 10px 24px -8px rgba(200, 70, 106, .6); }
:root[data-theme="titan-cute"] .bn-search-circle { box-shadow: 0 0 0 5px #FFF8F6, 0 10px 22px -6px rgba(200, 70, 106, .55); }
:root[data-theme="titan-cute"] .brand-mark { background: #fff; color: var(--primary); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--border-strong); }
:root[data-theme="titan-cute"] :is(.tile-meta, .tile-chips .chip) { background: var(--surface-2); color: var(--muted); }

/* ---------- الأيقونات: باستيل، وتمتلي وردي عند التأشير ---------- */
:root[data-theme="titan-cute"] .subject[data-icon="cpu"]      { --icon-c: #C8466A; }
:root[data-theme="titan-cute"] .subject[data-icon="tree"]     { --icon-c: #3E8A5A; }
:root[data-theme="titan-cute"] .subject[data-icon="math"]     { --icon-c: #3F78B0; }
:root[data-theme="titan-cute"] .subject[data-icon="terminal"] { --icon-c: #B8506E; }
:root[data-theme="titan-cute"] .subject[data-icon="circuit"]  { --icon-c: #C0663E; }
:root[data-theme="titan-cute"] .subject[data-icon="history"]  { --icon-c: #8A5A9E; }
:root[data-theme="titan-cute"] .subject[data-icon="book"]     { --icon-c: #C8466A; }
:root[data-theme="titan-cute"] [class^="c-"], :root[data-theme="titan-cute"] [class*=" c-"] { --tint: rgba(244, 166, 184, .18); --tint-fg: #B23A5C; }
:root[data-theme="titan-cute"][data-mode] :is(.tile-icon, .mini-icon) {
  border-radius: 16px; background: color-mix(in srgb, var(--icon-c) 12%, #fff); color: var(--icon-c);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--icon-c) 25%, transparent);
  transition: background var(--tl-in) var(--tl-ease), color var(--tl-in) var(--tl-ease);
}
:root[data-theme="titan-cute"][data-mode] :is(.tile, .subject, .row-card, .mini-item, .stat):hover :is(.tile-icon, .mini-icon) { background: var(--icon-c); color: #fff; }

/* ---------- لوحة الترحيب: الجنديين الصغار بالقلب، والكلام على جهة السما ---------- */
:root[data-theme="titan-cute"] .hero {
  background: #FFF8F4; color: var(--text); border: 1px solid rgba(200, 70, 106, .22); border-radius: 24px;
  box-shadow: 0 20px 40px -26px rgba(200, 70, 106, .5), var(--shadow);
  min-height: clamp(300px, 42vh, 420px); align-content: end; padding-top: 34px;
}
:root[data-theme="titan-cute"] .hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: url("/static/titan-art/cute-hero.webp") left 20% / cover no-repeat; transform-origin: 30% 50%;
}
:root[data-theme="titan-cute"] .hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(270deg, rgba(255, 248, 244, .95) 0%, rgba(255, 248, 244, .82) 36%, rgba(255, 248, 244, .1) 70%, rgba(255, 248, 244, 0) 100%);
}
:root[data-theme="titan-cute"] .hero-orb { display: none !important; }
:root[data-theme="titan-cute"] .hero h1 { color: var(--text); font-size: clamp(1.7rem, 1.1rem + 2vw, 2.6rem); line-height: 1.3; }
:root[data-theme="titan-cute"] .hero-name { color: var(--primary); }
:root[data-theme="titan-cute"] .hero :is(.hero-tip, .hero-date) { color: var(--muted); }
:root[data-theme="titan-cute"] .hero-tip b { color: #B23A5C; }
:root[data-theme="titan-cute"] .hero .avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #F4A6B8, 0 8px 18px -6px rgba(200, 70, 106, .45); }
:root[data-theme="titan-cute"] .hero-stat { background: rgba(255, 255, 255, .9); color: var(--text); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border-strong); }
:root[data-theme="titan-cute"] .hero-stat b { color: var(--primary); }
:root[data-theme="titan-cute"] .hero-stat .icon { color: var(--peach); }
:root[data-theme="titan-cute"] .hero-search { background: #fff; color: var(--muted); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border-strong); }
:root[data-theme="titan-cute"] .hero-search .icon { color: var(--primary); }
:root[data-theme="titan-cute"] .hero-date::before {
  content: ""; width: 12px; height: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 21'%3E%3Cpath d='M12 21C5 15.5 0 11.6 0 6.6 0 2.9 2.9 0 6.5 0 8.7 0 10.8 1.1 12 2.9 13.2 1.1 15.3 0 17.5 0 21.1 0 24 2.9 24 6.6 24 11.6 19 15.5 12 21Z' fill='%23F4A6B8'/%3E%3C/svg%3E") center / contain no-repeat;
}
:root[data-theme="titan-cute"] .hero-date { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; }
@media (max-width: 744px) {
  :root[data-theme="titan-cute"] .hero { min-height: 0; padding-top: 160px; }
  :root[data-theme="titan-cute"] .hero::before { background-position: 25% top; background-size: auto 200px; background-color: #FFF8F4; }
  :root[data-theme="titan-cute"] .hero::after { background: linear-gradient(0deg, rgba(255, 248, 244, .97) 0%, rgba(255, 248, 244, .92) calc(100% - 200px), rgba(255, 248, 244, .1) calc(100% - 130px), rgba(255, 248, 244, 0) 100%); }
}

/* ---------- دخول لوحة الترحيب مرة وحدة بالزيارة (نفس قواعد الأداة) ---------- */
:root[data-theme="titan-cute"]:not(.tl-entered) .hero::before { animation: tl-settle 1.1s var(--tl-enter) both; }
:root[data-theme="titan-cute"]:not(.tl-entered) .hero h1 { animation: tl-rise .7s var(--tl-enter) both; }
:root[data-theme="titan-cute"]:not(.tl-entered) .hero :is(.hero-date, .hero-tip, .hero-stats, .hero-search) { animation: tl-up .52s var(--tl-enter) both; }
:root[data-theme="titan-cute"]:not(.tl-entered) .hero .hero-tip { animation-delay: 380ms; }
:root[data-theme="titan-cute"]:not(.tl-entered) .hero .hero-stats { animation-delay: 440ms; }
:root[data-theme="titan-cute"]:not(.tl-entered) .hero .hero-search { animation-delay: 500ms; }

/* ---------- التأشير والضغط (أرقام motion.md) ---------- */
@media (hover: hover) and (pointer: fine) {
  :root[data-theme="titan-cute"] :is(.tile, .subject, .row-card, .mini-item, .publisher-card, .news) {
    transition: transform var(--tl-out) var(--tl-ease), border-color var(--tl-out) var(--tl-ease), box-shadow var(--tl-out) var(--tl-ease);
  }
  :root[data-theme="titan-cute"] :is(.tile, .subject, .row-card, .mini-item, .publisher-card, .news):hover {
    transform: translateY(-2px); border-color: rgba(200, 70, 106, .35); box-shadow: var(--shadow-lift); transition-duration: 180ms;
  }
  :root[data-theme="titan-cute"] .btn { transition: transform var(--tl-out) var(--tl-ease), box-shadow var(--tl-out) var(--tl-ease); }
  :root[data-theme="titan-cute"] .btn:hover { transform: translateY(-1px); transition-duration: var(--tl-in); }
}
:root[data-theme="titan-cute"] .btn:active { transform: translateY(1px) scale(.985); transition-duration: var(--tl-press); }
:root[data-theme="titan-cute"] :is(a, button, [tabindex], input, select, textarea):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- الشخصيات المتدندلة: chibi أصلية بحبال ---------- */
/* الأساس (كان بثيم Titan المحذوف): العناصر يخلقها titan-scouts.js، ومخفية إلا بهذا الثيم */
.tw-scouts { display: none; }
.tw-scout { position: absolute; top: 0; transform-origin: 50% 0; animation: tw-swing 2.8s ease-in-out infinite alternate; }
.tw-scout i { display: block; height: var(--len); margin: 0 auto; }
.tw-scout b { display: block; transform-origin: 50% 0; animation: tw-sway 2.8s ease-in-out infinite alternate; animation-duration: inherit; animation-delay: inherit; }
.tw-scout.s1 { left: 27%; --len: 30px; animation-duration: 3.2s; }
.tw-scout.s2 { left: 39%; --len: 74px; animation-duration: 2.5s; animation-delay: -1.2s; }
.tw-scout.s3 { left: 16%; --len: 120px; animation-duration: 3.9s; animation-delay: -2.3s; }
@keyframes tw-swing { from { transform: rotate(-15deg); } to { transform: rotate(15deg); } }
/* الجسم يتأخر شوية عن الحبل، حتى الحركة تبين طبيعية */
@keyframes tw-sway { from { transform: rotate(7deg); } to { transform: rotate(-7deg); } }
@media (max-width: 744px) {
  .tw-scout.s2, .tw-scout.s3 { display: none; }
  .tw-scout.s1 { left: auto; right: 8%; --len: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  .tw-scout, .tw-scout b { animation: none; }
}
:root[data-theme="titan-cute"] .tw-scouts { display: block; position: absolute; top: 0; left: 0; right: 0; height: 0; z-index: 30; pointer-events: none; direction: ltr; }
:root[data-theme="titan-cute"] .tw-scout { width: var(--w); transform-origin: var(--rx) 0; }
:root[data-theme="titan-cute"] .tw-scout i { position: relative; left: calc(var(--rx) - 1px); margin: 0; width: 2px; background: linear-gradient(#E8B4BF, #C98A98); }
:root[data-theme="titan-cute"] .tw-scout b { width: 100%; height: var(--h); margin-top: 0; transform-origin: var(--rx) 0; background: center top / contain no-repeat; filter: drop-shadow(0 6px 8px rgba(160, 60, 90, .25)); }
:root[data-theme="titan-cute"] .tw-scout.s1 { --h: 130px; --w: 80px; --rx: 36.1%; }
:root[data-theme="titan-cute"] .tw-scout.s2 { --h: 130px; --w: 61px; --rx: 23.8%; }
:root[data-theme="titan-cute"] .tw-scout.s3 { --h: 120px; --w: 48px; --rx: 25.3%; }
:root[data-theme="titan-cute"] .tw-scout.s1 b { background-image: url("/static/titan-art/cute-1.webp"); }
:root[data-theme="titan-cute"] .tw-scout.s2 b { background-image: url("/static/titan-art/cute-2.webp"); }
:root[data-theme="titan-cute"] .tw-scout.s3 b { background-image: url("/static/titan-art/cute-3.webp"); }
@media (max-width: 744px) {
  :root[data-theme="titan-cute"] .tw-scout.s1 { --h: 110px; --w: 68px; width: var(--w); }
  :root[data-theme="titan-cute"] .tw-scout.s1 b { width: 100%; height: var(--h); }
}

/* ---------- شعار العين: وردي ناعم ---------- */
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo { filter: drop-shadow(0 2px 6px rgba(200, 70, 106, .25)); }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-hex { stroke: #F4A6B8; stroke-width: 3; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-hex-fill { fill: #FFF4F2; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-white { fill: #FFFFFF; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-lid { stroke: #8C4A5E; stroke-width: 2.4; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-iris-c { fill: #E0708C; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-ring { stroke: #FFD3DD; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-pupil { fill: #4A2B34; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-glint { fill: #FFFFFF; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-scan { fill: #F4A6B8; }

/* عين قطة أنمي: قزحية ذهبية ووردية، بؤبؤ طولي رفيع، لمعتين، وخط جفن بزوايا مدبّبة.
   البؤبؤ يتبع الماوس ويرمش مثل العين العادية، ومن تأشر على الشعار يتوسع شوية مثل القطط */
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo :is(.el-iris-c, .el-ring, .el-pupil, .el-glint, .el-scan) { display: none; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-cat-iris { display: inline; stroke: #7A2E44; stroke-width: 1.1; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-slit {
  display: inline; fill: #2A1420; transform-box: fill-box; transform-origin: center;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo :is(.el-cat-glint, .el-cat-glint2) { display: inline; fill: #FFFFFF; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-cat-line { display: inline; fill: none; stroke: #3A1A26; stroke-width: 3.4; stroke-linecap: round; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-cat-wing { display: inline; fill: #3A1A26; }
:root[data-theme="titan-cute"]:not(.eye-rage) .eye-logo .el-lid { stroke: #8C4A5E; stroke-width: 1.6; }
:root[data-theme="titan-cute"]:not(.eye-rage) :is(.brand:hover, .brand-mark:hover) .eye-logo .el-slit { transform: scaleX(2.3); }
@media (prefers-reduced-motion: reduce) {
  :root[data-theme="titan-cute"] .eye-logo .el-slit { transition: none; }
}

/* ---------- معاينة الثيم بنافذة الاختيار ---------- */
.theme-option[data-value="titan-cute"] { --sw-main: #E0708C; --sw-soft: #9CC6E8; --sw-bg: #FFF4F2; }

@media (prefers-reduced-motion: reduce) {
  :root[data-theme="titan-cute"] .hero::before, :root[data-theme="titan-cute"] .hero h1,
  :root[data-theme="titan-cute"] .hero :is(.hero-date, .hero-tip, .hero-stats, .hero-search) { animation: none !important; }
  :root[data-theme="titan-cute"] :is(.tile, .subject, .row-card, .mini-item, .news, .btn) { transition: none !important; transform: none !important; }
  :root[data-theme="titan-cute"] .tw-scout, :root[data-theme="titan-cute"] .tw-scout b { animation: none; }
}
