/* ============================================================
   مشغل محمد المصري — أسود عميق وبنسجي متوهج
   ============================================================ */

:root{
  --bg:#0A0A0F;
  --surface:#14101F;
  --surface-2:#1A1428;
  --border:rgba(168,85,247,.28);
  --border-soft:rgba(168,85,247,.14);
  --primary:#7C3AED;
  --accent:#A855F7;
  --glow:#C084FC;
  --text:#F5F3FF;
  --muted:#A29AB8;
  --ok:#34D399;
  --err:#F87171;
  --r:16px;
  --ease:cubic-bezier(.2,.7,.3,1);
  --shadow-focus:0 0 0 2px var(--accent), 0 0 24px rgba(124,58,237,.55);
}

*,*::before,*::after{box-sizing:border-box}

html,body{height:100%}

body{
  margin:0;
  min-height:100vh;
  min-height:100dvh;
  background:
    radial-gradient(900px 460px at 50% -200px, rgba(124,58,237,.32), transparent 72%),
    radial-gradient(600px 300px at 100% 100%, rgba(168,85,247,.10), transparent 70%),
    var(--bg);
  background-color:var(--bg);
  color:var(--text);
  font-family:'Tajawal',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  font-size:15px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overscroll-behavior:none;
}

[hidden]{display:none !important}

.sprite{position:absolute;width:0;height:0;overflow:hidden}

.icon{
  width:20px;height:20px;flex:0 0 auto;
  fill:none;stroke:currentColor;stroke-width:1.5;
  stroke-linecap:round;stroke-linejoin:round;
}
.icon.fill{fill:currentColor;stroke:none}
.icon-wa{
  width:26px;height:26px;flex:0 0 auto;
  fill:currentColor;stroke:none;
}

h1,h2,h3{margin:0;font-weight:700;letter-spacing:0;line-height:1.3}
p{margin:0}
code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.86em;
  background:rgba(168,85,247,.14);
  border:1px solid var(--border-soft);
  border-radius:6px;
  padding:1px 5px;
  color:var(--glow);
}

.muted{color:var(--muted)}

:focus{outline:none}
[data-nav]:focus{
  outline:2px solid var(--accent);
  outline-offset:2px;
}

button{font-family:inherit;font-size:inherit;color:inherit;background:none;border:0;cursor:pointer;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
input,textarea{font-family:inherit;font-size:16px;color:var(--text)}

/* ---------- أزرار عامة ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:46px;padding:0 18px;border-radius:12px;
  font-weight:700;font-size:15px;
  border:1px solid transparent;
  transition:transform .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.btn.sm{min-height:42px;padding:0 14px;font-size:14px}
.btn.wide{width:100%}
.btn.primary{
  background:linear-gradient(180deg,var(--accent),var(--primary));
  color:#fff;
  box-shadow:0 6px 22px rgba(124,58,237,.38);
}
.btn.primary:hover{filter:brightness(1.08)}
.btn.primary:active{transform:scale(.98)}
.btn.ghost{
  background:rgba(168,85,247,.08);
  border-color:var(--border);
  color:var(--text);
}
.btn.ghost:hover{background:rgba(168,85,247,.16)}
.btn.danger{color:#FCA5A5;border-color:rgba(248,113,113,.32)}
.btn.danger:hover{background:rgba(248,113,113,.12)}
.btn:disabled{opacity:.5;cursor:not-allowed}

.icon-btn{
  display:inline-grid;place-items:center;
  width:44px;height:44px;border-radius:12px;
  color:var(--muted);
  border:1px solid transparent;
  transition:background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
  flex:0 0 auto;
}
.icon-btn:hover{background:rgba(168,85,247,.14);color:var(--text);border-color:var(--border)}

/* ---------- التطبيق ---------- */
.app{
  display:flex;flex-direction:column;
  height:100vh;height:100dvh;
  min-height:0;
}

.topbar{
  flex:0 0 auto;
  display:flex;align-items:center;gap:12px;
  padding:10px 16px;
  background:rgba(10,10,15,.78);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
  z-index:30;
}

.brand{
  display:flex;align-items:center;gap:10px;
  padding:4px 6px;border-radius:12px;flex:0 0 auto;
  transition:background .16s var(--ease);
}
.brand:hover{background:rgba(168,85,247,.10)}
.brand-mark{
  display:grid;place-items:center;
  width:40px;height:40px;border-radius:12px;
  background:linear-gradient(160deg,var(--glow),var(--primary));
  color:#fff;
  box-shadow:0 0 20px rgba(124,58,237,.55);
}
.brand-mark .icon{width:20px;height:20px}
.brand-text{display:flex;flex-direction:column;align-items:flex-start;line-height:1.25}
.brand-text strong{font-size:15px;font-weight:800;white-space:nowrap}
.brand-text small{font-size:11px;color:var(--muted);letter-spacing:.4px}

.search-wrap{
  position:relative;flex:1 1 auto;max-width:520px;
  display:flex;align-items:center;
  background:var(--surface);
  border:1px solid var(--border-soft);
  border-radius:12px;
  padding-inline-start:36px;
  padding-inline-end:8px;
  transition:border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.search-wrap:focus-within{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent), 0 0 20px rgba(124,58,237,.35)}
.search-ico{position:absolute;inset-inline-start:11px;top:50%;transform:translateY(-50%);color:var(--muted);width:18px;height:18px}
.search-wrap input{
  flex:1;min-width:0;border:0;background:transparent;
  height:44px;padding:0;color:var(--text);
}
.search-wrap input::placeholder{color:#6F6885}
.search-wrap input::-webkit-search-cancel-button{display:none}

.top-actions{display:flex;align-items:center;gap:4px;flex:0 0 auto}
.src-pill{
  font-size:12px;font-weight:500;color:var(--glow);
  background:rgba(124,58,237,.16);
  border:1px solid var(--border);
  border-radius:99px;
  padding:5px 12px;
  max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

.body{flex:1 1 auto;display:flex;min-height:0}

/* ---------- الشريط الجانبي ---------- */
.sidebar{
  flex:0 0 auto;width:236px;
  display:flex;flex-direction:column;gap:3px;
  padding:14px 10px;
  border-inline-end:1px solid var(--border-soft);
  overflow-y:auto;
  background:linear-gradient(180deg,rgba(124,58,237,.07),transparent 42%);
}
.nav-item{
  display:flex;align-items:center;gap:12px;
  width:100%;padding:11px 13px;border-radius:12px;
  font-size:15px;font-weight:500;color:var(--muted);
  text-align:start;
  transition:background .16s var(--ease), color .16s var(--ease);
}
.nav-item span{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-item .count{
  font-size:11px;font-weight:700;color:var(--muted);
  background:rgba(168,85,247,.14);
  border-radius:99px;padding:1px 7px;min-width:20px;text-align:center;
}
.nav-item .count:empty{display:none}
.nav-item:hover{background:rgba(168,85,247,.10);color:var(--text)}
.nav-item.active{
  background:rgba(124,58,237,.20);
  color:#fff;
  box-shadow:inset 0 0 0 1px var(--border);
}
.nav-item.active .icon{color:var(--glow)}
.nav-sep{height:1px;background:var(--border-soft);margin:8px 10px}

/* ---------- المحتوى ---------- */
.content{flex:1 1 auto;min-width:0;overflow-y:auto;padding:16px 18px 140px;scroll-behavior:smooth}
.content-head{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}
.content-head h1{font-size:22px;font-weight:800}
.content-head h1::after{
  content:"";display:block;width:44px;height:3px;border-radius:99px;
  margin-top:8px;
  background:linear-gradient(90deg,var(--glow),transparent);
  box-shadow:0 0 14px rgba(168,85,247,.8);
}

.chips{
  display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;
  scrollbar-width:none;-ms-overflow-style:none;
}
.chips::-webkit-scrollbar{display:none}
.chip{
  flex:0 0 auto;
  display:inline-flex;align-items:center;gap:6px;
  height:36px;padding:0 14px;border-radius:99px;
  font-size:13.5px;font-weight:500;color:var(--muted);
  background:var(--surface);
  border:1px solid var(--border-soft);
  white-space:nowrap;
  transition:background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.chip b{font-size:11px;opacity:.75;font-weight:700}
.chip:hover{color:var(--text);border-color:var(--border)}
.chip.active{
  background:linear-gradient(180deg,rgba(168,85,247,.30),rgba(124,58,237,.22));
  color:#fff;border-color:var(--border);
  box-shadow:0 0 16px rgba(124,58,237,.32);
}

/* ---------- الشبكة ---------- */
.grid{
  display:grid;gap:14px;
  grid-template-columns:repeat(auto-fill,minmax(148px,1fr));
  align-content:start;
}

.card{
  position:relative;display:block;width:100%;
  border-radius:var(--r);overflow:hidden;
  background:var(--surface);
  border:1px solid var(--border);
  text-align:start;padding:0;
  transition:transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.card:hover{transform:translateY(-3px);border-color:rgba(168,85,247,.55);box-shadow:0 10px 28px rgba(0,0,0,.5)}
.card:focus{box-shadow:var(--shadow-focus);border-color:transparent;transform:translateY(-3px)}

.poster{
  position:relative;aspect-ratio:2/3;
  background:linear-gradient(155deg,#241536 0%,#160f22 48%,#0C0912 100%);
  display:grid;place-items:center;overflow:hidden;
}
.poster::after{
  content:"";position:absolute;inset:0;
  background:radial-gradient(circle at 50% 28%,rgba(168,85,247,.30),transparent 62%);
  pointer-events:none;
}
.poster img{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;display:block;z-index:1;
}
.poster .initial{
  position:relative;z-index:0;
  font-size:42px;font-weight:800;
  color:rgba(192,132,252,.62);
  text-shadow:0 0 26px rgba(168,85,247,.65);
}

.card-body{padding:9px 11px 11px}
.card-title{
  font-size:13.5px;font-weight:700;line-height:1.4;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;min-height:2.7em;
}
.card-sub{
  font-size:11.5px;color:var(--muted);margin-top:3px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

.badge{
  position:absolute;top:8px;inset-inline-start:8px;z-index:2;
  font-size:10.5px;font-weight:700;letter-spacing:.2px;
  padding:3px 8px;border-radius:99px;
  background:rgba(10,10,15,.72);
  border:1px solid var(--border);
  color:var(--glow);
  backdrop-filter:blur(8px);
}
.badge.sport{color:#FCD34D;border-color:rgba(252,211,77,.35)}
.badge.audio{color:#34D399;border-color:rgba(52,211,153,.35)}

.fav-dot{
  position:absolute;top:8px;inset-inline-end:8px;z-index:2;
  display:grid;place-items:center;width:26px;height:26px;border-radius:50%;
  background:rgba(10,10,15,.72);border:1px solid var(--border);
  color:#F472B6;
  backdrop-filter:blur(8px);
}
.fav-dot .icon{width:14px;height:14px;fill:currentColor;stroke:none}

.prog-line{
  position:absolute;bottom:0;inset-inline:0;height:3px;z-index:2;
  background:rgba(255,255,255,.10);
}
.prog-line i{display:block;height:100%;background:linear-gradient(90deg,var(--glow),var(--primary));box-shadow:0 0 10px rgba(168,85,247,.9)}

.more-wrap{grid-column:1/-1;display:flex;justify-content:center;padding:16px 0}

/* ---------- الحالة الفارغة ---------- */
.empty{
  display:flex;flex-direction:column;align-items:center;gap:12px;
  padding:56px 20px;text-align:center;color:var(--muted);
}
.empty-ico{
  display:grid;place-items:center;width:64px;height:64px;border-radius:20px;
  background:rgba(124,58,237,.14);border:1px solid var(--border);color:var(--glow);
}
.empty-ico .icon{width:28px;height:28px}

/* ---------- Toast ---------- */
.toast{
  position:fixed;inset-inline:0;bottom:104px;z-index:200;
  display:flex;justify-content:center;pointer-events:none;
  padding:0 16px;
}
.toast span,
.toast{
  font-size:13.5px;
}
.toast-inner{
  background:rgba(20,16,31,.95);
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 16px;
  box-shadow:0 12px 32px rgba(0,0,0,.6);
  max-width:420px;
  animation:toastIn .2s var(--ease);
}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------- شاشة الإعداد ---------- */
.setup{
  position:fixed;inset:0;z-index:80;
  background:
    radial-gradient(700px 380px at 50% -120px, rgba(124,58,237,.35), transparent 70%),
    #0A0A0F;
  overflow-y:auto;
  padding:22px 16px 40px;
}
.setup-inner{max-width:640px;margin:0 auto;display:flex;flex-direction:column;gap:18px}
.setup-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.setup-head h2{font-size:21px;font-weight:800}
.setup-head .muted{font-size:13px;margin-top:4px}

.segmented{
  display:flex;gap:6px;padding:5px;
  background:var(--surface);
  border:1px solid var(--border-soft);
  border-radius:14px;
  overflow-x:auto;scrollbar-width:none;
}
.segmented::-webkit-scrollbar{display:none}
.seg{
  flex:1 0 auto;min-height:40px;padding:0 12px;border-radius:10px;
  font-size:13.5px;font-weight:700;color:var(--muted);white-space:nowrap;
  transition:background .16s var(--ease), color .16s var(--ease);
}
.seg:hover{color:var(--text)}
.seg.active{
  background:linear-gradient(180deg,var(--accent),var(--primary));
  color:#fff;box-shadow:0 4px 18px rgba(124,58,237,.45);
}

.pane{display:flex;flex-direction:column;gap:12px}

.field{display:flex;flex-direction:column;gap:7px;flex:1;min-width:0}
.field > span{font-size:13px;font-weight:500;color:var(--muted)}
.field input,.field textarea{
  width:100%;
  background:var(--surface);
  border:1px solid var(--border-soft);
  border-radius:12px;
  padding:11px 14px;
  color:var(--text);
  outline:none;
  transition:border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field textarea{resize:vertical;line-height:1.5;min-height:82px}
.field input::placeholder,.field textarea::placeholder{color:#6F6885}
.field input:focus,.field textarea:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 1px var(--accent), 0 0 18px rgba(124,58,237,.30);
}
.field-sm{flex:0 0 110px}

.field-row{display:flex;gap:10px}

.inline-field{display:flex;gap:8px;align-items:stretch}
.inline-field input{flex:1;min-width:0}

.drop{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:26px 16px;
  border:1.5px dashed rgba(168,85,247,.42);
  border-radius:var(--r);
  background:rgba(124,58,237,.06);
  text-align:center;color:var(--muted);
  transition:background .16s var(--ease), border-color .16s var(--ease);
  cursor:pointer;
}
.drop:hover,.drop.over{background:rgba(124,58,237,.14);border-color:var(--accent)}
.drop .icon{width:26px;height:26px;color:var(--glow)}
.drop strong{color:var(--text);font-size:14.5px}
.drop span{font-size:12.5px}

.hint{font-size:12.5px;color:var(--muted);line-height:1.7}

.status-box{
  border-radius:14px;padding:13px 15px;
  font-size:13.5px;line-height:1.7;
  border:1px solid var(--border);
  background:rgba(124,58,237,.10);
  color:var(--text);
  display:flex;align-items:flex-start;gap:9px;
}
.status-box.err{border-color:rgba(248,113,113,.42);background:rgba(248,113,113,.10);color:#FECACA}
.status-box.ok{border-color:rgba(52,211,153,.42);background:rgba(52,211,153,.10);color:#A7F3D0}
.status-box .icon{width:18px;height:18px;margin-top:3px;flex:0 0 auto}
.status-box .busy{
  width:16px;height:16px;border-radius:50%;flex:0 0 auto;margin-top:3px;
  border:2px solid rgba(192,132,252,.28);border-top-color:var(--glow);
  animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

.setup-foot{display:flex;gap:10px;flex-wrap:wrap}
.setup-foot .btn{flex:1 1 auto}

/* ---------- الطبقات المنبثقة ---------- */
.sheet{
  position:fixed;inset:0;z-index:90;
  display:flex;align-items:center;justify-content:center;
  padding:18px;
}
.sheet-backdrop{
  position:absolute;inset:0;
  background:rgba(5,4,9,.78);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  animation:fadeIn .18s var(--ease);
}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

.detail-panel{
  position:relative;z-index:1;
  width:min(760px,100%);max-height:calc(100dvh - 36px);
  overflow-y:auto;
  display:flex;gap:20px;flex-wrap:wrap;
  padding:22px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:0 24px 70px rgba(0,0,0,.7), 0 0 40px rgba(124,58,237,.20);
  animation:pop .2s var(--ease);
}
@keyframes pop{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}

.detail-close{position:absolute;top:12px;inset-inline-end:12px;z-index:2;background:rgba(10,10,15,.6)}

.detail-poster{
  flex:0 0 168px;width:168px;aspect-ratio:2/3;
  border-radius:var(--r);overflow:hidden;
  background:linear-gradient(155deg,#241536,#0C0912);
  display:grid;place-items:center;
  border:1px solid var(--border-soft);
  position:relative;
}
.detail-poster img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.detail-poster .initial{font-size:56px;font-weight:800;color:rgba(192,132,252,.62);text-shadow:0 0 30px rgba(168,85,247,.7)}

.detail-info{flex:1 1 260px;min-width:220px;display:flex;flex-direction:column;gap:10px;padding-top:36px}
.detail-info h2{font-size:22px;font-weight:800;line-height:1.35}
.type-pill{
  align-self:flex-start;
  font-size:11.5px;font-weight:700;color:var(--glow);
  background:rgba(124,58,237,.18);
  border:1px solid var(--border);
  border-radius:99px;padding:3px 11px;
}
.detail-plot{font-size:13.5px;color:#CFC6E4;line-height:1.75}
.detail-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.detail-actions .btn{flex:1 1 auto}

/* ---------- المشغل ---------- */
.player{
  position:fixed;inset:0;z-index:120;
  background:#000;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
}
.player video{width:100%;height:100%;object-fit:contain;background:#000;display:block}

.p-spin{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;z-index:3}
.ring{
  width:46px;height:46px;border-radius:50%;
  border:3px solid rgba(192,132,252,.22);
  border-top-color:var(--glow);
  animation:spin .9s linear infinite;
  box-shadow:0 0 28px rgba(124,58,237,.5);
}

.p-bigplay{
  position:absolute;z-index:5;
  display:grid;place-items:center;width:82px;height:82px;border-radius:50%;
  background:linear-gradient(180deg,var(--accent),var(--primary));
  color:#fff;box-shadow:0 0 40px rgba(124,58,237,.7);
  transition:transform .16s var(--ease);
}
.p-bigplay .icon{width:34px;height:34px}
.p-bigplay:active{transform:scale(.94)}

.p-top{
  position:absolute;top:0;inset-inline:0;z-index:6;
  display:flex;align-items:center;gap:12px;
  padding:12px 14px;
  background:linear-gradient(180deg,rgba(0,0,0,.82),transparent);
  transition:opacity .2s var(--ease), visibility .2s var(--ease);
}
.p-titles{display:flex;flex-direction:column;min-width:0;line-height:1.3}
.p-titles strong{font-size:15px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.p-titles small{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.p-controls{
  position:absolute;bottom:0;inset-inline:0;z-index:6;
  display:flex;flex-direction:column;gap:8px;
  padding:18px 16px 16px;
  background:linear-gradient(0deg,rgba(0,0,0,.9),rgba(0,0,0,.5) 60%,transparent);
  transition:opacity .2s var(--ease), visibility .2s var(--ease);
}
.player.hide-ui .p-top,
.player.hide-ui .p-controls{opacity:0;visibility:hidden;pointer-events:none}

.p-row{display:flex;align-items:center;gap:8px}
.p-grow{flex:1}
.p-btn{
  display:grid;place-items:center;
  width:58px;height:58px;border-radius:50%;
  background:rgba(124,58,237,.28);
  border:1px solid var(--border);
  color:#fff;
  transition:background .16s var(--ease), transform .16s var(--ease);
  flex:0 0 auto;
}
.p-btn:hover{background:rgba(168,85,247,.42)}
.p-btn:active{transform:scale(.94)}
.p-btn .icon{width:24px;height:24px}
.p-btn.sm{width:46px;height:46px;background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.10)}
.p-btn.sm .icon{width:20px;height:20px}
.p-btn.on{background:rgba(168,85,247,.5);border-color:var(--accent)}

.p-time{font-size:12.5px;color:#CFC6E4;font-variant-numeric:tabular-nums;white-space:nowrap;padding-inline:4px}

.p-tracks{
  display:flex;flex-wrap:wrap;gap:8px;
  padding:10px;border-radius:12px;
  background:rgba(20,16,31,.92);
  border:1px solid var(--border);
}
.track-item{
  font-size:13px;font-weight:500;color:var(--text);
  padding:8px 13px;border-radius:10px;
  background:rgba(255,255,255,.06);
  border:1px solid transparent;
  transition:background .16s var(--ease);
}
.track-item:hover{background:rgba(168,85,247,.24)}
.track-item.on{background:rgba(124,58,237,.45);border-color:var(--accent)}

.p-err{
  position:absolute;z-index:8;
  width:min(440px,calc(100% - 40px));
  display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;
  padding:24px 20px;border-radius:20px;
  background:rgba(20,16,31,.96);
  border:1px solid var(--border);
  box-shadow:0 20px 60px rgba(0,0,0,.7);
}
.p-err .icon{width:30px;height:30px;color:var(--err)}
.p-err p{font-size:13.5px;color:#E4DDF2;line-height:1.7}
.p-err-actions{display:flex;gap:10px;width:100%}
.p-err-actions .btn{flex:1}

/* ---------- شريط الصوت المصغّر ---------- */
.mini{
  position:fixed;inset-inline:10px;bottom:10px;z-index:70;
  display:flex;align-items:center;gap:10px;
  padding:8px 10px;
  border-radius:18px;
  background:rgba(20,16,31,.86);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  border:1px solid var(--border);
  box-shadow:0 14px 40px rgba(0,0,0,.6), 0 0 26px rgba(124,58,237,.28);
  animation:miniIn .22s var(--ease);
}
@keyframes miniIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

.mini-cover{
  flex:0 0 auto;width:46px;height:46px;border-radius:12px;
  display:grid;place-items:center;
  background:linear-gradient(150deg,var(--accent),#2B1145);
  color:#fff;font-size:20px;font-weight:800;
  box-shadow:0 0 18px rgba(124,58,237,.5);
  overflow:hidden;position:relative;
}
.mini-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}

.mini-meta{
  flex:1 1 auto;min-width:0;
  display:flex;flex-direction:column;align-items:flex-start;gap:3px;
  text-align:start;padding:0;
}
.mini-meta strong{font-size:13.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.mini-meta small{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.mini-progress{width:100%;height:3px;border-radius:99px;background:rgba(255,255,255,.12);overflow:hidden}
.mini-progress i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--glow),var(--primary));box-shadow:0 0 8px rgba(168,85,247,.9)}

.mini-btn{
  flex:0 0 auto;display:grid;place-items:center;
  width:44px;height:44px;border-radius:50%;
  background:rgba(168,85,247,.14);
  color:var(--text);
  transition:background .16s var(--ease);
}
.mini-btn:hover{background:rgba(168,85,247,.3)}
.mini-btn .icon{width:20px;height:20px}

body.has-mini .content{padding-bottom:180px}
body.has-mini .fab{bottom:82px}

/* ---------- لوحة الصوت ---------- */
.audio-panel{
  position:relative;z-index:1;
  width:min(440px,100%);max-height:calc(100dvh - 36px);
  overflow-y:auto;
  display:flex;flex-direction:column;align-items:center;gap:10px;
  padding:26px 20px 20px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:24px;
  box-shadow:0 24px 70px rgba(0,0,0,.7), 0 0 44px rgba(124,58,237,.25);
  animation:pop .2s var(--ease);
}
.ap-cover{
  width:min(210px,60%);aspect-ratio:1;
  border-radius:22px;
  display:grid;place-items:center;
  background:linear-gradient(150deg,var(--accent),#240F3B 75%);
  color:rgba(255,255,255,.85);font-size:64px;font-weight:800;
  box-shadow:0 18px 46px rgba(124,58,237,.45);
  overflow:hidden;position:relative;
}
.ap-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.audio-panel h2{font-size:18px;font-weight:800;text-align:center;line-height:1.35}
.audio-panel > .muted{font-size:12.5px;text-align:center}
.ap-times{display:flex;justify-content:space-between;width:100%;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;margin-top:-6px}
.ap-controls{display:flex;align-items:center;justify-content:center;gap:12px;margin:6px 0 4px;width:100%}
.ap-add{display:flex;gap:8px;width:100%;margin-top:8px}
.ap-add input{
  flex:1;min-width:0;
  background:var(--surface-2);border:1px solid var(--border-soft);
  border-radius:12px;padding:10px 13px;color:var(--text);outline:none;
}
.ap-add input:focus{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.ap-list{
  list-style:none;margin:6px 0 0;padding:0;width:100%;
  display:flex;flex-direction:column;gap:6px;
  max-height:230px;overflow-y:auto;
}
.ap-row{
  display:flex;align-items:center;gap:8px;
  padding:8px 10px;border-radius:12px;
  background:rgba(255,255,255,.03);
  border:1px solid transparent;
  transition:background .16s var(--ease);
}
.ap-row:hover{background:rgba(168,85,247,.12)}
.ap-row.playing{border-color:var(--border);background:rgba(124,58,237,.20)}
.ap-row .ap-play{
  flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;
  text-align:start;gap:2px;
}
.ap-row .ap-play strong{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.ap-row .ap-play small{font-size:11px;color:var(--muted)}
.ap-row .ap-del{
  flex:0 0 auto;display:grid;place-items:center;width:34px;height:34px;border-radius:9px;
  color:var(--muted);
}
.ap-row .ap-del:hover{background:rgba(248,113,113,.16);color:#FCA5A5}

/* ---------- حول ---------- */
.about-panel{
  position:relative;z-index:1;
  width:min(560px,100%);max-height:calc(100dvh - 36px);
  overflow-y:auto;
  display:flex;flex-direction:column;gap:14px;align-items:flex-start;
  padding:26px 22px 22px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:24px;
  box-shadow:0 24px 70px rgba(0,0,0,.7), 0 0 40px rgba(124,58,237,.22);
  animation:pop .2s var(--ease);
}
.about-logo{
  width:56px;height:56px;border-radius:16px;display:grid;place-items:center;
  background:linear-gradient(160deg,var(--glow),var(--primary));color:#fff;
  box-shadow:0 0 26px rgba(124,58,237,.6);
}
.about-logo .icon{width:26px;height:26px}
.about-panel h2{font-size:20px;font-weight:800}
.about-block{width:100%}
.about-block h3{font-size:14px;font-weight:700;color:var(--glow);margin-bottom:6px}
.about-block p,.about-block li{font-size:13px;color:#CFC6E4;line-height:1.85}
.about-block ul{margin:0;padding-inline-start:18px}

/* ---------- زر واتساب ---------- */
.fab{
  position:fixed;
  inset-inline-start:18px;bottom:18px;
  z-index:75;
  display:flex;align-items:center;justify-content:center;
  width:56px;height:56px;border-radius:50%;
  background:linear-gradient(160deg,#4ADE80,#16A34A);
  color:#062b12;
  box-shadow:0 10px 28px rgba(22,163,74,.45), 0 0 0 0 rgba(74,222,128,.55);
  animation:waPulse 2s ease-in-out infinite;
  transition:transform .16s var(--ease);
  text-decoration:none;
}
.fab:active{transform:scale(.92)}
.fab .icon-wa{width:28px;height:28px;fill:#062b12}
@keyframes waPulse{
  0%,100%{box-shadow:0 10px 28px rgba(22,163,74,.42), 0 0 0 0 rgba(74,222,128,.5)}
  50%{box-shadow:0 10px 28px rgba(22,163,74,.42), 0 0 0 14px rgba(74,222,128,0)}
}

/* ---------- شريط التمرير ---------- */
::-webkit-scrollbar{width:9px;height:9px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:rgba(168,85,247,.28);border-radius:99px}
::-webkit-scrollbar-thumb:hover{background:rgba(168,85,247,.5)}

/* ---------- range ---------- */
.range{
  -webkit-appearance:none;appearance:none;
  width:100%;height:24px;background:transparent;cursor:pointer;
}
.range::-webkit-slider-runnable-track{
  height:6px;border-radius:99px;
  background:linear-gradient(90deg,var(--accent) var(--pct,0%),rgba(255,255,255,.16) var(--pct,0%));
}
.range::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;
  width:16px;height:16px;border-radius:50%;background:#fff;
  margin-top:-5px;
  box-shadow:0 0 12px rgba(168,85,247,.95);
}
.range::-moz-range-track{height:6px;border-radius:99px;background:rgba(255,255,255,.16)}
.range::-moz-range-progress{height:6px;border-radius:99px;background:var(--accent)}
.range::-moz-range-thumb{width:16px;height:16px;border:0;border-radius:50%;background:#fff}

/* ============================================================
   الاستجابة
   ============================================================ */
@media (min-width:1500px){
  .grid{grid-template-columns:repeat(auto-fill,minmax(172px,1fr))}
  .content{padding-inline:28px}
}

@media (max-width:1000px){
  .sidebar{width:196px}
  .src-pill{display:none}
}

@media (max-width:860px){
  .body{flex-direction:column}
  .sidebar{
    width:100%;flex-direction:row;
    overflow-x:auto;overflow-y:hidden;
    border-inline-end:0;border-bottom:1px solid var(--border-soft);
    padding:8px 10px;gap:6px;
    background:linear-gradient(180deg,rgba(124,58,237,.09),transparent);
    scrollbar-width:none;
  }
  .sidebar::-webkit-scrollbar{display:none}
  .nav-item{width:auto;padding:9px 12px;font-size:13.5px;gap:8px;white-space:nowrap;flex:0 0 auto}
  .nav-item .icon{width:18px;height:18px}
  .nav-sep{display:none}
  .content{padding:14px 14px 150px}
  .content-head h1{font-size:19px}
  .detail-panel{padding:18px;gap:16px}
  .detail-poster{flex:0 0 118px;width:118px}
  .detail-info{padding-top:30px}
  .detail-info h2{font-size:18px}
}

@media (max-width:760px){
  .topbar{flex-wrap:wrap;padding:8px 12px;gap:8px}
  .brand-text small{display:none}
  .brand-text strong{font-size:14px}
  .search-wrap{order:3;flex-basis:100%;max-width:none}
  .search-wrap input{height:42px}
  .search-wrap .icon-btn,
  .search-wrap .clear-btn{height:38px;width:38px}
}

@media (max-width:430px){
  .grid{grid-template-columns:repeat(2,1fr);gap:11px}
  .card-title{font-size:12.5px}
  .card-body{padding:8px 9px 10px}
  .p-btn{width:52px;height:52px}
  .p-btn.sm{width:42px;height:42px}
  .p-controls{padding:14px 12px 12px}
  .p-time{font-size:11.5px}
  .field-row{flex-direction:column}
  .field-sm{flex:1 1 auto}
  .segmented{gap:4px}
  .seg{font-size:12.5px;padding:0 10px}
  .mini-meta small{display:none}
  .ap-cover{width:min(170px,54%)}
}

@media (prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
}