/* پلیر نماشو */
.nplayer {
  --np-amber: #f0b03f;
  --np-ivory: #ecdfc4;
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden;
  color: var(--np-ivory); font-family: 'Vazirmatn', system-ui, sans-serif; user-select: none;
  -webkit-tap-highlight-color: transparent; outline: none;
}
.nplayer [hidden] { display: none !important; }
.nplayer:focus-visible { box-shadow: inset 0 0 0 2px var(--np-amber); }
.nplayer.np-fs { aspect-ratio: auto; height: 100%; }
.nplayer > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.nplayer svg { width: 22px; height: 22px; fill: currentColor; }
.nplayer svg .s { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* دکمهٔ بزرگ پخش */
.np-big {
  position: absolute; z-index: 5; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%;
  border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(240, 176, 63, .94); color: #241411;
  box-shadow: 0 0 0 10px rgba(240, 176, 63, .18), 0 20px 50px rgba(0, 0, 0, .5);
  transition: transform .2s, opacity .25s;
}
.np-big svg { width: 34px; height: 34px; margin-left: 5px; }
.np-big:hover { transform: scale(1.06); }
.nplayer.np-started .np-big { opacity: 0; pointer-events: none; }
.nplayer.np-started.np-paused:not(.np-in-ad) .np-big { opacity: .92; pointer-events: auto; }

/* انتظار */
.np-spinner {
  position: absolute; z-index: 4; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%;
  border: 3px solid rgba(236, 223, 196, .2); border-top-color: var(--np-amber);
  animation: np-spin .9s linear infinite; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.nplayer.np-wait.np-started .np-spinner { opacity: 1; }
@keyframes np-spin { to { transform: rotate(360deg); } }

/* بازخورد */
.np-flash {
  position: absolute; z-index: 6; inset: 0; margin: auto; width: max-content; height: max-content;
  display: flex; align-items: center; gap: 8px; background: rgba(20, 10, 8, .6); padding: 14px; border-radius: 999px;
  opacity: 0; pointer-events: none;
}
.np-flash span { font-size: .9rem; padding-inline-end: 6px; }
.np-flash.on { animation: np-flash .6s ease-out; }
@keyframes np-flash { 0% { opacity: 1; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.15); } }
.np-notice {
  position: absolute; z-index: 9; top: 16px; inset-inline: 0; margin: auto; width: max-content; max-width: 90%;
  background: rgba(20, 10, 8, .85); padding: 6px 14px; border-radius: 999px; font-size: .9rem; opacity: 0; transition: opacity .3s;
}
.np-notice.on { opacity: 1; }
.np-resume {
  position: absolute; z-index: 9; top: 16px; right: 16px; border: 0; cursor: pointer;
  background: rgba(20, 10, 8, .85); color: var(--np-ivory); font: inherit; font-size: .88rem; padding: 7px 14px; border-radius: 999px;
}
.np-resume b { color: var(--np-amber); font-weight: 600; }
.np-embed-title {
  position: absolute; z-index: 7; top: 0; inset-inline: 0; padding: 14px 18px 30px; color: var(--np-ivory);
  background: linear-gradient(rgba(0, 0, 0, .7), transparent); font-weight: 600; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .3s;
}

/* کنترل‌ها */
.np-controls {
  position: absolute; z-index: 8; inset-inline: 0; bottom: 0; padding: 30px 14px 8px;
  background: linear-gradient(transparent, rgba(10, 5, 4, .88));
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.nplayer.np-started.np-active .np-controls,
.nplayer.np-started.np-paused .np-controls,
.nplayer.np-drag .np-controls { opacity: 1; pointer-events: auto; }
.nplayer.np-started:not(.np-active):not(.np-paused) { cursor: none; }
.nplayer.np-started:not(.np-active):not(.np-paused) .np-embed-title { opacity: 0; }
.nplayer.np-in-ad .np-controls { display: none; }

.np-progress { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.np-track { position: relative; width: 100%; height: 4px; background: rgba(236, 223, 196, .22); border-radius: 2px; transition: height .15s; }
.np-progress:hover .np-track, .nplayer.np-drag .np-track { height: 7px; }
.np-buf, .np-played { position: absolute; inset-block: 0; left: 0; border-radius: 2px; }
.np-buf { background: rgba(236, 223, 196, .35); }
.np-played { background: var(--np-amber); box-shadow: 0 0 10px rgba(240, 176, 63, .5); }
.np-chaps i { position: absolute; top: 0; bottom: 0; width: 3px; background: rgba(10, 5, 4, .9); transform: translateX(-1px); }
.np-handle {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--np-amber); transform: scale(0); transition: transform .15s;
}
.np-progress:hover .np-handle, .nplayer.np-drag .np-handle, .np-progress:focus-visible .np-handle { transform: scale(1); }
.np-preview {
  position: absolute; bottom: 26px; transform: translateX(-50%); display: none; text-align: center; pointer-events: none;
}
.np-progress.np-hover .np-preview { display: block; }
.np-thumb { border-radius: 4px; border: 2px solid var(--np-ivory); background-color: #000; background-repeat: no-repeat; margin: 0 auto 4px; }
.np-ptime { display: inline-block; background: rgba(10, 5, 4, .9); padding: 1px 8px; border-radius: 4px; font-size: .85rem; }
.np-pchap { font-size: .8rem; text-shadow: 0 1px 3px #000; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.np-row { display: flex; align-items: center; gap: 2px; height: 44px; }
.np-btn {
  background: none; border: 0; color: var(--np-ivory); width: 40px; height: 40px; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.np-btn:hover { background: rgba(236, 223, 196, .1); }
.np-btn.is-on { color: var(--np-amber); }
.np-vol { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: var(--np-amber); cursor: pointer; }
.np-row:hover .np-vol, .np-vol:focus { width: 80px; opacity: 1; margin-inline-end: 6px; }
.np-time { font-size: .9rem; padding-inline: 8px; white-space: nowrap; font-feature-settings: "tnum"; direction: ltr; }
.np-chap { font-size: .85rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; direction: rtl; }
.np-spacer { flex: 1; }

.np-menu {
  position: absolute; z-index: 10; bottom: 60px; right: 12px; min-width: 190px; max-height: 70%; overflow-y: auto;
  background: rgba(30, 17, 14, .97); border: 1px solid rgba(236, 223, 196, .14); border-radius: 10px; padding: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.np-mgroup + .np-mgroup { border-top: 1px solid rgba(236, 223, 196, .12); margin-top: 4px; padding-top: 4px; }
.np-mtitle { font-size: .78rem; opacity: .6; padding: 4px 10px; }
.np-mitem {
  display: block; width: 100%; text-align: start; background: none; border: 0; color: var(--np-ivory); font: inherit; font-size: .92rem;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
}
.np-mitem:hover { background: rgba(236, 223, 196, .08); }
.np-mitem.is-on { color: var(--np-amber); }
.np-mitem.is-on::before { content: "●"; font-size: .6rem; margin-inline-end: 8px; vertical-align: middle; }

/* تبلیغ */
.np-ad { position: absolute; inset: 0; z-index: 20; background: #000; }
.np-ad video { width: 100%; height: 100%; object-fit: contain; }
.np-ad-top { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; align-items: center; }
.np-ad-badge { background: var(--np-amber); color: #241411; font-weight: 700; font-size: .8rem; padding: 2px 10px; border-radius: 4px; }
.np-ad-by { font-size: .85rem; text-shadow: 0 1px 4px #000; }
.np-ad-link {
  position: absolute; bottom: 22px; right: 14px; background: rgba(236, 223, 196, .95); color: #241411; font-weight: 600;
  padding: 7px 16px; border-radius: 999px; text-decoration: none; font-size: .9rem;
}
.np-ad-skip {
  position: absolute; bottom: 22px; left: 0; background: rgba(10, 5, 4, .82); color: var(--np-ivory); border: 1px solid rgba(236, 223, 196, .4);
  border-left: 0; font: inherit; font-size: .92rem; padding: 9px 18px; border-radius: 0 6px 6px 0; cursor: pointer;
}
.np-ad-skip:disabled { cursor: default; opacity: .8; font-size: .82rem; }
.np-ad-skip:not(:disabled):hover { background: var(--np-ivory); color: #241411; }
.np-ad-bar { position: absolute; bottom: 0; inset-inline: 0; height: 4px; background: rgba(236, 223, 196, .2); }
.np-ad-bar i { display: block; height: 100%; width: 0; background: var(--np-amber); margin-left: 0; }

.np-banner {
  position: absolute; z-index: 7; bottom: 70px; left: 50%; transform: translateX(-50%); max-width: min(560px, 90%);
  display: flex; align-items: center; gap: 10px; background: rgba(236, 223, 196, .96); color: #241411;
  border-radius: 8px; padding: 6px 6px 6px 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); direction: rtl;
}
.np-banner-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; font-size: .9rem; }
.np-banner-link img { max-height: 54px; width: auto; border-radius: 4px; }
.np-banner-tag { font-size: .7rem; background: #241411; color: var(--np-amber); padding: 1px 6px; border-radius: 3px; }
.np-banner-x { border: 0; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: #241411; padding: 2px 6px; }

/* زیرنویس */
.nplayer video::cue { background: rgba(10, 5, 4, .75); color: #fff; font-family: 'Vazirmatn', sans-serif; font-size: 1.05em; }

@media (max-width: 640px) {
  .np-big { width: 68px; height: 68px; }
  .np-big svg { width: 28px; height: 28px; }
  .np-chap, .np-vol { display: none; }
  .np-controls { padding-inline: 6px; }
  .np-btn { width: 36px; }
  .np-time { font-size: .8rem; padding-inline: 4px; }
  .np-banner { bottom: 60px; }
}
@media (prefers-reduced-motion: reduce) { .np-flash.on { animation: none; } }
