/* ════════════════════════════════════════
   REELIO  –  Player  (player.css)
════════════════════════════════════════ */

:root {
  --p:            #8B5CF6;
  --p-dk:         #6D28D9;
  --p-lt:         #A78BFA;
  --p-glow:       rgba(139,92,246,0.30);
  --dark:         #07070F;
  --muted:        #7878A0;
  --border:       rgba(139,92,246,0.16);
  --border2:      rgba(255,255,255,0.06);
  --sidebar-w:    240px;
  --sidebar-rail: 64px;
  --panel-w:      400px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: #0d0b18;
  color: #fff;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a      { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer;
         color: inherit; font-family: inherit; padding: 0; }

/* ════════════════════════════════════════
   SHELL
════════════════════════════════════════ */
.player-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 60%, rgb(161 161 161 / 18%) 0%, transparent 65%), radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 55%), #040304;
}

/* ════════════════════════════════════════
   DESKTOP SIDEBAR
════════════════════════════════════════ */
.player-sidebar { display: none; }

@media (min-width: 768px) {

  .player-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-rail);
    background: rgba(7,7,15,0.97);
    border-right: 1px solid var(--border);
    z-index: 100;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
    backdrop-filter: blur(20px);
  }

  .player-sidebar:hover { width: var(--sidebar-w); }
  .player-shell         { padding-left: var(--sidebar-rail); }
}

/* ── Sidebar logo ── */
.psb-logo {
  display: flex;
  align-items: center;
  padding: 16px 14px 16px 20px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
}

.logo-animated {
  display: flex;
  align-items: center;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.8px;
  overflow: hidden;
}

.logo-r {
  color: rgba(139,92,246,0.55);
  transition: color 0.25s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
}

.logo-eelio {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #fff;
  transition: max-width 0.25s cubic-bezier(0.4,0,0.2,1), opacity 0.18s;
}

.player-sidebar:hover .logo-r     { color: #fff; font-size: 1rem; }
.player-sidebar:hover .logo-eelio { max-width: 80px; opacity: 1; }

/* ── Sidebar nav ── */
.psb-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.psb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.psb-item i {
  font-size: 1.15rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: #fff;
}
.psb-item:hover  { background: rgba(255,255,255,0.07); color: #fff; }
.psb-item.active { background: rgba(255,255,255,0.1);  color: #fff; }
.player-sidebar:hover .psb-item { font-size: 0.875rem; }

/* ── Sidebar bottom ── */
.psb-bottom {
  padding: 16px;
  border-top: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  pointer-events: none;
}
.player-sidebar:hover .psb-bottom {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.psb-sub-card {
  background: linear-gradient(135deg, rgba(109,40,217,0.25), rgba(34,211,238,0.08));
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 12px;
  padding: 14px;
}
.psb-sub-title {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.psb-sub-desc {
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.psb-sub-btn {
  width: 100%;
  padding: 7px;
  background: linear-gradient(135deg, var(--p), var(--p-dk));
  color: #fff;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ════════════════════════════════════════
   PLAYER MAIN  (holds video, centred on desktop)
════════════════════════════════════════ */
.player-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.panel-toggle { display: none; } /* shown only on desktop */
.nav-arrows   { display: none; } /* shown only on desktop */

/* ════════════════════════════════════════
   VIDEO WRAP  (fills player-main on mobile)
════════════════════════════════════════ */
.video-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.player-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Permanent scrim */
.video-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.65) 0%,   transparent 20%),
    linear-gradient(to top,    rgba(0,0,0,0.80) 0%,   transparent 40%);
  pointer-events: none;
  z-index: 5;
}

/* ════════════════════════════════════════
   CONTROLS OVERLAY
════════════════════════════════════════ */
.ctrl-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 58px;
  z-index: 10;
  transition: opacity 0.3s ease;
}
.ctrl-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Top bar ── */
.ctrl-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(20px + env(safe-area-inset-top)) 16px 0;
}

.ctrl-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.ctrl-icon-btn:hover  { background: rgba(255,255,255,0.1); color: #fff; }
.ctrl-icon-btn.sm     { width: 32px; height: 32px; font-size: 0.82rem; border-radius: 8px; }

.back-btn {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
}

.ctrl-title-group { flex: 1; min-width: 0; }
.ctrl-series-name {
  font-size: 0.83rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctrl-ep-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

/* ── Centre controls ── */
.ctrl-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.ctrl-play-btn {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: rgba(139,92,246,0.28);
  border: 1.5px solid rgba(139,92,246,0.55);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  box-shadow: 0 0 30px rgba(139,92,246,0.35);
  transition: transform 0.12s, background 0.15s;
}
.ctrl-play-btn:hover  { background: rgba(139,92,246,0.42); }
.ctrl-play-btn:active { transform: scale(0.9); }

.ctrl-skip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 1.25rem;
  color: rgba(255,255,255,0.75);
}
.ctrl-skip span {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.ctrl-skip:hover { color: #fff; }

/* ── Bottom controls ── */
.ctrl-bottom { padding: 0 16px calc(18px + env(safe-area-inset-bottom)); }

.prog-wrap { padding: 10px 0; cursor: pointer; }

.prog-track {
  position: relative;
  height: 3px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
}
.prog-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--p-lt), var(--p));
  border-radius: 2px;
  transition: width 0.1s linear;
}
.prog-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 13px; height: 13px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px var(--p-glow);
  transition: left 0.1s linear;
}

.ctrl-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.ctrl-time {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.ctrl-right-btns { display: flex; gap: 2px; }

/* ════════════════════════════════════════
   EPISODE PILL TAB  (mobile)
════════════════════════════════════════ */
.ep-pill {
  position: absolute;
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 20px;
  background: rgba(7,7,15,0.72);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.ep-pill:hover,
.ep-pill.is-open {
  background: rgba(139,92,246,0.22);
  border-color: rgba(139,92,246,0.4);
}
.ep-pill-chevron {
  font-size: 0.6rem;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ════════════════════════════════════════
   PLAYER PANEL  (mobile = bottom sheet)
════════════════════════════════════════ */
.player-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-height: 78vh;
  background: rgba(8,8,17,0.98);
  border-top: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  backdrop-filter: blur(28px);
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(0.4,0,0.2,1);
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.player-panel.is-open { transform: translateY(0); }

.panel-drag-bar {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 40px;
  -webkit-overflow-scrolling: touch;
}
.panel-body::-webkit-scrollbar { width: 3px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--p); border-radius: 2px; }

/* Series info — hidden on mobile */
.panel-series-info { display: none; }

/* ── Episode section ── */
.panel-ep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.panel-ep-heading {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.ep-ranges {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  flex-shrink: 1;
}
.ep-ranges::-webkit-scrollbar { display: none; }

.ep-range {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  transition: all 0.15s;
}
.ep-range.active {
  background: rgba(139,92,246,0.18);
  border-color: rgba(139,92,246,0.45);
  color: var(--p-lt);
}

/* ════════════════════════════════════════
   EPISODE GRID
════════════════════════════════════════ */
.ep-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.ep-btn {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.15s;
}
.ep-btn:hover:not(.is-locked) {
  border-color: rgba(139,92,246,0.45);
  color: #fff;
  background: rgba(139,92,246,0.08);
}
.ep-btn.is-current {
  background: var(--p);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 14px rgba(139,92,246,0.5);
}
.ep-btn.is-watched {
  background: rgba(139,92,246,0.07);
  border-color: rgba(139,92,246,0.15);
  color: rgba(255,255,255,0.3);
}
.ep-btn.is-free {
  border-color: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.8);
}

/* Locked — lock above number */
.ep-btn.is-locked {
  flex-direction: column;
  gap: 3px;
  cursor: default;
  padding: 6px 4px;
}
.ep-lock-ico {
  font-size: 0.68rem;
  color: var(--p-lt);
  opacity: 0.8;
}
.ep-btn.is-locked span {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.28);
  line-height: 1;
}

/* ════════════════════════════════════════
   DESKTOP  ≥ 768px
════════════════════════════════════════ */
@media (min-width: 768px) {

  /* Player main: flex container that centres the video */
  .player-main {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden;
  }

  /* Video wrap: centred vertical aspect ratio */
  .video-wrap {
    position: relative;
    height: 100%;
    aspect-ratio: 9 / 16;
    max-height: 100%;
    flex-shrink: 0;
    overflow: hidden;
    /* not absolute anymore — centred by flex parent */
    inset: auto;
    width: auto;
  }

  .ctrl-overlay { padding-bottom: 0; }
  .ep-pill      { display: none; }

  /* Panel toggle button */
  .panel-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    z-index: 20;
    backdrop-filter: blur(8px);
    transition: background 0.15s, color 0.15s;
  }
  .panel-toggle:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
  }

  /* Prev / Next arrows */
  .nav-arrows {
    position: absolute;
    right: 14px;
    bottom: 72px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20;
  }

  .nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    transition: background 0.15s, color 0.15s;
  }
  .nav-arrow:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
  }

  /* Panel: right sidebar with width transition */
  .player-panel {
    position: relative;
    flex: 0 0 var(--panel-w);
    width: var(--panel-w);
    max-height: none;
    border-radius: 0;
    border-top: none;
    border-left: 1px solid var(--border);
    transform: none !important;
    background: rgba(7,7,15,0.99);
    overflow-x: hidden;
    overflow-y: hidden;
    /* Animate open/close */
    transition: flex-basis 0.32s cubic-bezier(0.4,0,0.2,1),
                width      0.32s cubic-bezier(0.4,0,0.2,1),
                border-color 0.2s;
  }

  .player-panel.is-desktop-closed {
    flex: 0 0 0;
    width: 0;
    border-left-color: transparent;
  }

  .panel-drag-bar { display: none; }

  .panel-body {
    width: var(--panel-w); /* stays at full width inside the collapsing wrapper */
    padding: 28px 24px 48px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .panel-body::-webkit-scrollbar       { width: 3px; }
  .panel-body::-webkit-scrollbar-thumb { background: var(--p); border-radius: 2px; }

  /* Show series info */
  .panel-series-info { display: block; }

  .panel-series-title {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    line-height: 1.15;
  }
  .panel-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    margin-bottom: 14px;
  }
  .panel-genre {
    background: rgba(139,92,246,0.14);
    border: 1px solid rgba(139,92,246,0.3);
    color: var(--p-lt);
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 0.66rem;
    font-weight: 700;
  }
  .panel-meta-dot { color: rgba(255,255,255,0.2); }
  .panel-star     { color: #FBBF24; }
  .panel-star i   { font-size: 0.62rem; }

  .panel-desc {
    font-size: 0.77rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.45);
    margin-bottom: 20px;
  }

  .panel-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
  }
  .panel-action {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.15s;
  }
  .panel-action span { font-size: 0.58rem; font-weight: 600; }
  .panel-action:hover {
    color: #fff;
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.1);
  }
  .panel-action.liked {
    color: #f43f5e;
    background: rgba(244,63,94,0.06);
    border-color: rgba(244,63,94,0.2);
  }

  .panel-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 20px 0;
  }

  /* Bigger, more readable episode buttons on desktop */
  .ep-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
  }
  .ep-btn {
    font-size: 0.9rem;
    min-height: 44px;
  }
  .ep-btn.is-locked     { padding: 6px 4px; }
  .ep-lock-ico          { font-size: 0.75rem; }
  .ep-btn.is-locked span{ font-size: 0.68rem; }
}

@media (min-width: 1200px) {
  .ep-grid { grid-template-columns: repeat(7, 1fr); gap: 8px; }
  .panel-series-title { font-size: 1.55rem; }
  .panel-desc { font-size: 0.8rem; }
}

/* ════════════════════════════════════════
   VIDEO STACK  (swipeable multi-episode)
════════════════════════════════════════ */
.vid-stack {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.vid-slide {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* ════════════════════════════════════════
   NOW PLAYING BARS  (episode grid)
════════════════════════════════════════ */
.ep-btn.is-current,
.ep-btn.is-watched {
  flex-direction: column;
  gap: 2px;
  padding: 4px 2px;
}

.now-playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.now-playing-bars span {
  display: block;
  width: 3px;
  height: 10px;
  background: #fff;
  border-radius: 1.5px;
  transform-origin: bottom;
  animation: bar-pulse 0.9s ease-in-out infinite;
}
.now-playing-bars span:nth-child(1) { animation-delay: 0s; }
.now-playing-bars span:nth-child(2) { animation-delay: 0.3s; }
.now-playing-bars span:nth-child(3) { animation-delay: 0.15s; }

@keyframes bar-pulse {
  0%, 100% { transform: scaleY(0.2); }
  50%       { transform: scaleY(1); }
}

.ep-watched-ico {
  font-size: 0.62rem;
  color: var(--p-lt);
  opacity: 0.8;
}

/* ════════════════════════════════════════
   PAYWALL MODAL
════════════════════════════════════════ */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.paywall-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.paywall-modal {
  width: 100%;
  max-width: 480px;
  background: #0e0e1c;
  border: 1px solid rgba(139,92,246,0.2);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 32px 24px 52px;
  position: relative;
  transform: translateY(40px);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.paywall-overlay.is-open .paywall-modal {
  transform: translateY(0);
}

.paywall-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  transition: background 0.15s, color 0.15s;
}
.paywall-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

.paywall-top {
  text-align: center;
  margin-bottom: 28px;
}
.paywall-crown {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(109,40,217,0.35), rgba(34,211,238,0.1));
  border: 1px solid rgba(139,92,246,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem;
  color: #FBBF24;
  margin: 0 auto 16px;
  box-shadow: 0 0 32px rgba(139,92,246,0.28);
}
.paywall-title {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}
.paywall-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.42);
  line-height: 1.6;
  max-width: 290px;
  margin: 0 auto;
}

/* ── Plan cards ── */
.paywall-plans {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.plan-card {
  flex: 1;
  position: relative;
  padding: 14px 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
}
.plan-card.has-badge { padding-top: 22px; }
.plan-card:hover      { border-color: rgba(139,92,246,0.4); }
.plan-card.is-selected {
  background: rgba(139,92,246,0.13);
  border-color: var(--p);
  box-shadow: 0 0 22px rgba(139,92,246,0.2);
}

.plan-badge {
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--p), var(--p-dk));
  color: #fff;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 0 0 8px 8px;
  white-space: nowrap;
}
.plan-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}
.plan-price {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 5px;
}
.plan-per {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
}
.plan-note {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.3);
  line-height: 1.4;
}

/* ── CTA button ── */
.paywall-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--p), var(--p-dk));
  color: #fff;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 4px 24px rgba(139,92,246,0.38);
  transition: transform 0.12s, box-shadow 0.15s;
  margin-bottom: 12px;
}
.paywall-btn:hover  { box-shadow: 0 6px 32px rgba(139,92,246,0.55); }
.paywall-btn:active { transform: scale(0.98); }

.paywall-fine {
  text-align: center;
  font-size: 0.63rem;
  color: rgba(255,255,255,0.22);
}

/* ── Success toast ── */
.sub-toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(8,8,17,0.96);
  border: 1px solid rgba(139,92,246,0.4);
  border-radius: 50px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  backdrop-filter: blur(16px);
}
.sub-toast i { color: var(--p-lt); font-size: 1rem; }
.sub-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
  .paywall-overlay { align-items: center; }
  .paywall-modal {
    border-bottom: 1px solid rgba(139,92,246,0.2);
    border-radius: 24px;
    padding: 40px 36px 44px;
  }
}

/* ════════════════════════════════════════
   QUIZ OVERLAY
════════════════════════════════════════ */
.quiz-overlay {
  position: fixed;
  inset: 0;
  background: #07070F;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.quiz-overlay.is-open {
  display: flex;
}

.quiz-modal {
  width: 100%;
  max-width: 440px;
  background: #0e0e22;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 24px;
  padding: 28px 24px 32px;
  box-shadow: 0 0 70px rgba(251, 191, 36, 0.08), 0 20px 60px rgba(0,0,0,0.6);
  transition: transform 0.2s ease;
}
.quiz-modal.pulse {
  animation: quiz-pulse 0.35s ease;
}
@keyframes quiz-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.025); }
}

/* ── Header ── */
.quiz-header {
  text-align: center;
  margin-bottom: 22px;
}
.quiz-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #FBBF24;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}
.quiz-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 14px;
  color: #fff;
}
.quiz-progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.quiz-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: all 0.2s;
}
.quiz-dot.answered {
  background: var(--p);
  border-color: var(--p);
}
.quiz-dot.current {
  background: #FBBF24;
  border-color: #FBBF24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.55);
}

/* ── Question ── */
.quiz-question {
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 16px;
  min-height: 56px;
}

/* ── Choices ── */
.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.quiz-choice {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.80);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
}
.quiz-choice:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.10);
  border-color: rgba(139, 92, 246, 0.40);
  color: #fff;
}
.quiz-choice.correct {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.50);
  color: #4ade80;
}
.quiz-choice.wrong {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.40);
  color: #f87171;
}
.quiz-choice:disabled { cursor: default; }

/* ── Result ── */
.quiz-result-area {
  display: none;
  text-align: center;
  padding: 8px 0 4px;
}
.quiz-score-ring {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  border: 3px solid #FBBF24;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 0 36px rgba(251, 191, 36, 0.22);
  background: rgba(251, 191, 36, 0.05);
}
.quiz-score-num {
  font-size: 1.65rem;
  font-weight: 900;
  color: #FBBF24;
  line-height: 1;
}
.quiz-score-lbl {
  font-size: 0.60rem;
  color: rgba(255, 255, 255, 0.40);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.quiz-score-msg {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 22px;
}
.quiz-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 34px;
  background: linear-gradient(135deg, var(--p), var(--p-dk));
  color: #fff;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 4px 22px rgba(139, 92, 246, 0.38);
  transition: transform 0.12s, box-shadow 0.15s;
}
.quiz-continue-btn:hover  { box-shadow: 0 6px 30px rgba(139, 92, 246, 0.55); }
.quiz-continue-btn:active { transform: scale(0.97); }

/* ════════════════════════════════════════
   QUIZ SCORE WIDGET  (panel)
════════════════════════════════════════ */
.score-widget {
  text-align: center;
  padding: 20px 16px 24px;
}
.score-widget-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin-bottom: 20px;
}
.score-widget-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}
.score-widget-label i { color: #FBBF24; }

.score-ring-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.score-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid #FBBF24;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(251,191,36,0.05);
  box-shadow: 0 0 28px rgba(251,191,36,0.18);
  transition: border-color 0.4s, box-shadow 0.4s;
}
.score-ring.good {
  border-color: #4ade80;
  background: rgba(74,222,128,0.05);
  box-shadow: 0 0 28px rgba(74,222,128,0.18);
}
.score-ring.poor {
  border-color: #f87171;
  background: rgba(248,113,113,0.05);
  box-shadow: 0 0 28px rgba(248,113,113,0.18);
}
.score-ring-pct {
  font-size: 1.55rem;
  font-weight: 900;
  color: #FBBF24;
  line-height: 1;
  letter-spacing: -1px;
  transition: color 0.4s;
}
.score-ring.good .score-ring-pct { color: #4ade80; }
.score-ring.poor .score-ring-pct { color: #f87171; }
.score-ring-lbl {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 3px;
}

.score-fraction {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.38);
  margin-bottom: 14px;
}
.score-bar-track {
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
  max-width: 160px;
  margin: 0 auto;
}
.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: #FBBF24;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1), background 0.4s;
  width: 0%;
}

/* ── Episode grid: quiz episode buttons ── */
.ep-btn.is-quiz {
  background: rgba(251, 191, 36, 0.07);
  border-color: rgba(251, 191, 36, 0.38);
  color: #FBBF24;
  flex-direction: column;
  gap: 2px;
  padding: 4px 2px;
}
.ep-btn.is-quiz-done {
  background: rgba(34, 197, 94, 0.07);
  border-color: rgba(34, 197, 94, 0.32);
  color: #4ade80;
  flex-direction: column;
  gap: 2px;
  padding: 4px 2px;
}
.ep-quiz-ico {
  font-size: 0.82rem;
}
.ep-btn.is-quiz span,
.ep-btn.is-quiz-done span {
  font-size: 0.50rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.38);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
