/* ===========================================================
   Nana Modern Video Player
   =========================================================== */
.nplayer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
  outline: none;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  user-select: none;
  isolation: isolate;
  --np-accent: var(--accent, #7c5cfc);
  --np-accent2: var(--accent2, #a07cff);
}
.nplayer:fullscreen,
.nplayer:-webkit-full-screen { border-radius: 0; aspect-ratio: auto; height: 100%; width: 100%; }

.nplayer-video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

/* ── Poster overlay ── */
.nplayer-poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
  pointer-events: none;
  transition: opacity .3s;
}
.nplayer-poster.hidden { opacity: 0; }

/* ── Top bar ── */
.nplayer-top {
  position: absolute;
  inset: 0 0 auto 0;
  padding: 14px 18px 38px;
  background: linear-gradient(180deg, rgba(0,0,0,.7), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 4;
}
.nplayer-title {
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  letter-spacing: .2px;
}
.nplayer.is-active .nplayer-top { opacity: 1; }

/* ── Center ── */
.nplayer-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}
.nplayer-spinner {
  width: 56px; height: 56px;
  border: 3px solid rgba(255,255,255,.18);
  border-top-color: var(--np-accent2);
  border-radius: 50%;
  animation: np-spin .8s linear infinite;
  display: none;
}
.nplayer.is-loading .nplayer-spinner { display: block; }
@keyframes np-spin { to { transform: rotate(360deg); } }

.nplayer-bigplay {
  pointer-events: auto;
  width: 84px; height: 84px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 20, 32, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, opacity .2s;
  box-shadow: 0 4px 24px rgba(0,0,0,.45);
}
.nplayer-bigplay:hover { background: var(--np-accent); transform: scale(1.06); }
.nplayer-bigplay svg { transform: translateX(2px); }
.nplayer.is-paused:not(.is-loading) .nplayer-bigplay { display: flex; animation: np-fadein .25s ease; }
@keyframes np-fadein { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

/* ── Tap indicators ── */
.nplayer-tap {
  position: absolute;
  top: 0; bottom: 0;
  width: 38%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
}
.nplayer-tap-l { left: 0; }
.nplayer-tap-r { right: 0; }
.nplayer-tap span {
  background: rgba(20, 20, 32, .6);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 999px;
}
.nplayer-tap.show { animation: np-tap .55s ease; }
@keyframes np-tap { 0% {opacity:0; transform:scale(.85)} 30%{opacity:1} 100%{opacity:0; transform:scale(1.15)} }

/* ── Bottom controls ── */
.nplayer-bottom {
  position: absolute;
  inset: auto 0 0 0;
  padding: 30px 14px 10px;
  background: linear-gradient(0deg, rgba(0,0,0,.85), transparent);
  z-index: 5;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.nplayer.is-active .nplayer-bottom,
.nplayer.is-paused .nplayer-bottom,
.nplayer.is-menu-open .nplayer-bottom { opacity: 1; transform: none; }

/* progress bar */
.nplayer-progress {
  position: relative;
  height: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  margin: 0 4px 4px;
}
.nplayer-progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,.22);
  border-radius: 99px;
  overflow: visible;
  transition: height .15s ease;
}
.nplayer-progress:hover .nplayer-progress-track,
.nplayer-progress.dragging .nplayer-progress-track { height: 6px; }
.nplayer-progress-buffer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(255,255,255,.32);
  border-radius: inherit;
}
.nplayer-progress-played {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--np-accent), var(--np-accent2));
  border-radius: inherit;
}
.nplayer-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform .15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  pointer-events: none;
}
.nplayer-progress:hover .nplayer-progress-thumb,
.nplayer-progress.dragging .nplayer-progress-thumb { transform: translate(-50%, -50%) scale(1); }
.nplayer-progress-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: rgba(15, 15, 25, .92);
  color: #fff;
  font-size: .75rem;
  padding: 4px 6px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.nplayer-progress:hover .nplayer-progress-tip,
.nplayer-progress.dragging .nplayer-progress-tip { opacity: 1; }
.nplayer-tip-img {
  width: 160px;
  height: 90px;
  background-size: 1600px 900px; /* 10col × 160, 10row × 90 */
  background-repeat: no-repeat;
  border-radius: 3px;
  display: none;
  flex-shrink: 0;
}
.nplayer-tip-img.has-sprite { display: block; }

/* controls row */
.nplayer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 4px;
}
.nplayer-controls-left,
.nplayer-controls-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nplayer-btn {
  position: relative;
  background: transparent;
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .1s ease;
  text-decoration: none;
  flex-shrink: 0;
}
.nplayer-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.nplayer-btn:active { transform: scale(.92); }
.nplayer-btn svg { display: block; }
/* Skip ±10s buttons – number centered in circular arrow */
.nplayer-skip { position: relative; }
.nplayer-skip svg { transition: transform .35s cubic-bezier(.4, 1.6, .5, 1); }
.nplayer-skip:hover svg,
.nplayer-skip:focus-visible svg { transform: scale(1.08); }
.nplayer-back10.is-spin svg { animation: np-spin-back .5s ease; }
.nplayer-fwd10.is-spin  svg { animation: np-spin-fwd  .5s ease; }
@keyframes np-spin-back { from { transform: rotate(0); } to { transform: rotate(-360deg); } }
@keyframes np-spin-fwd  { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.nplayer-skiplbl {
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  pointer-events: none;
  color: #fff;
  line-height: 1;
  z-index: 2;
}

/* volume */
.nplayer-volume {
  display: flex;
  align-items: center;
  height: 38px;
}
.nplayer-volbar {
  position: relative;
  width: 0;
  height: 4px;
  background: rgba(255,255,255,.22);
  border-radius: 99px;
  margin-left: 0;
  cursor: pointer;
  overflow: visible;
  transition: width .25s ease, margin-left .25s ease;
}
.nplayer-volume:hover .nplayer-volbar,
.nplayer-volume.show .nplayer-volbar { width: 80px; margin-left: 4px; margin-right: 8px; }
.nplayer-volbar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: #fff;
  border-radius: inherit;
}
.nplayer-volbar-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.nplayer-volume:hover .nplayer-volbar-thumb { opacity: 1; }

/* time */
.nplayer-time {
  color: #fff;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
  white-space: nowrap;
}
.nplayer-sep { opacity: .5; margin: 0 4px; }
.nplayer-dur { opacity: .85; }

/* speed label */
.nplayer-speed-lbl {
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* popup menus */
.nplayer-menu { position: relative; }
.nplayer-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  background: rgba(20, 20, 30, .96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 10;
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
  max-height: 280px;
  overflow-y: auto;
}
.nplayer-popup.open { display: flex; animation: np-pop .15s ease; }
@keyframes np-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.nplayer-popup-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.55);
  padding: 6px 10px 4px;
  font-weight: 700;
}
.nplayer-popup button {
  background: transparent;
  border: none;
  color: #fff;
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .12s;
}
.nplayer-popup button:hover { background: rgba(255,255,255,.1); }
.nplayer-popup button.active {
  background: linear-gradient(135deg, var(--np-accent), var(--np-accent2));
  font-weight: 700;
}
.nplayer-popup button.active::before { content: "✓"; font-size: .8rem; margin-right: -2px; }

/* error overlay */
.nplayer-error {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
}
.nplayer-error[hidden] { display: none !important; }
.nplayer-error-inner { text-align: center; color: #fff; padding: 20px; }
.nplayer-error-icon { font-size: 2.4rem; margin-bottom: 8px; }
.nplayer-error-msg { font-size: .95rem; margin-bottom: 14px; opacity: .85; }

/* hide cursor on idle */
.nplayer.is-idle { cursor: none; }
.nplayer.is-idle .nplayer-bottom,
.nplayer.is-idle .nplayer-top { opacity: 0; pointer-events: none; }

/* mobile tweaks */
@media (max-width: 640px) {
  .nplayer-btn { width: 34px; height: 34px; }
  .nplayer-time { font-size: .75rem; }
  .nplayer-back10, .nplayer-fwd10 { display: none; }
  .nplayer-volbar { display: none !important; }
  .nplayer-bigplay { width: 68px; height: 68px; }
}
