/* ==========================================================================
   AniVexo — Premium UI Redesign Layer
   Kiranime Pro theme — visual layer only.
   Loaded AFTER assets/style.css, so these rules override the theme defaults.
   No PHP logic, database queries, AJAX, or JS behaviour is touched by this
   file — it only restyles the markup that is already rendered by the theme.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. DESIGN TOKENS
   Colors are read from the theme's own CSS variables (set in the Customizer
   via Kira_Utility::get_color_variables()) so the site's existing red brand
   color is always respected — nothing here hardcodes a replacement color.
   -------------------------------------------------------------------------- */
:root {
  --av-primary: rgb(var(--accent-3-color));      /* brand accent (site's red) */
  --av-primary-soft: rgba(var(--accent-3-color), 0.16);
  --av-primary-glow: rgba(var(--accent-3-color), 0.55);
  --av-surface: rgb(var(--overlay-color));
  --av-surface-2: rgb(var(--primary-darker-color));
  --av-surface-3: rgb(var(--primary-darkest-color));
  --av-text: rgb(var(--text-color));
  --av-text-dim: rgba(var(--text-color), 0.68);
  --av-radius-sm: 8px;
  --av-radius: 14px;
  --av-radius-lg: 20px;
  --av-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --av-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  --av-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Fixed badge palette — intentionally independent of the brand red,
     as requested: HD/ENG/HINDI/SUB/PG/Status each get their own identity. */
  --av-badge-hd: #3b82f6;
  --av-badge-hd-bg: rgba(59, 130, 246, 0.16);
  --av-badge-eng: #22c55e;
  --av-badge-eng-bg: rgba(34, 197, 94, 0.16);
  --av-badge-hindi: #f97316;
  --av-badge-hindi-bg: rgba(249, 115, 22, 0.16);
  --av-badge-sub: #06b6d4;
  --av-badge-sub-bg: rgba(6, 182, 212, 0.16);
  --av-badge-jap: #a78bfa;
  --av-badge-jap-bg: rgba(167, 139, 250, 0.16);
  --av-badge-pg: #eab308;
  --av-badge-pg-bg: rgba(234, 179, 8, 0.16);
  --av-badge-status: #22c55e;
  --av-badge-status-bg: rgba(34, 197, 94, 0.16);
}

body {
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.005em;
}

/* generic focus ring, kept accessible */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--av-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   SECTION 1 — ANIME DETAILS PAGE  (template-parts/packs/file-anime.php)
   ========================================================================== */

.av-details-hero {
  padding-bottom: 2.5rem;
}

.av-details-poster img {
  border-radius: var(--av-radius);
  box-shadow: var(--av-shadow-lg);
  transition: transform 0.4s var(--av-ease);
}

.av-details-poster img:hover {
  transform: translateY(-4px);
}

.av-details-title {
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, var(--av-text) 0%, var(--av-text-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* info badge row (rating / attributes / type / episode / duration) */
.av-badge-row {
  gap: 0.5rem !important;
}

.av-badge-row li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* rating badge, e.g. PG-13 */
.av-badge-rate {
  background: var(--av-badge-pg-bg) !important;
  color: var(--av-badge-pg) !important;
  border: 1px solid rgba(234, 179, 8, 0.35) !important;
  border-radius: 999px !important;
  padding: 0.28rem 0.7rem !important;
  font-weight: 700 !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.02em;
}

/* attribute badges (DUB / HD / SUB) — colored by data-badge set via a small
   presentational script (anivexo-enhance.js); falls back to a neutral chip
   if JS is disabled. */
.av-badge-attr {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--av-text) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 999px !important;
  padding: 0.28rem 0.7rem !important;
  font-weight: 600 !important;
  font-size: 0.7rem !important;
}

.av-badge-attr[data-badge="hd"] {
  background: var(--av-badge-hd-bg) !important;
  color: var(--av-badge-hd) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}
.av-badge-attr[data-badge="sub"] {
  background: var(--av-badge-sub-bg) !important;
  color: var(--av-badge-sub) !important;
  border-color: rgba(6, 182, 212, 0.35) !important;
}
.av-badge-attr[data-badge="dub"],
.av-badge-attr[data-badge="eng"] {
  background: var(--av-badge-eng-bg) !important;
  color: var(--av-badge-eng) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
}
.av-badge-attr[data-badge="hindi"] {
  background: var(--av-badge-hindi-bg) !important;
  color: var(--av-badge-hindi) !important;
  border-color: rgba(249, 115, 22, 0.35) !important;
}
.av-badge-attr[data-badge="jap"] {
  background: var(--av-badge-jap-bg) !important;
  color: var(--av-badge-jap) !important;
  border-color: rgba(167, 139, 250, 0.35) !important;
}

/* Watch Now / Add to List buttons */
.av-btn-watch {
  background: var(--av-primary) !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 24px var(--av-primary-glow);
  transition: transform 0.2s var(--av-ease), box-shadow 0.2s var(--av-ease), filter 0.2s var(--av-ease);
}

.av-btn-watch:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 30px var(--av-primary-glow);
}

.av-btn-list {
  border-radius: 999px !important;
  font-weight: 700 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  transition: transform 0.2s var(--av-ease), background 0.2s var(--av-ease);
}

.av-btn-list:hover {
  transform: translateY(-2px);
  background: #fff !important;
}

/* synopsis + info panel card */
.av-info-panel {
  border-radius: var(--av-radius) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(6px);
  box-shadow: var(--av-shadow);
}

.av-info-panel a {
  transition: color 0.15s ease;
}

.av-info-panel ul li {
  padding: 0.15rem 0;
}

/* genre chips already exist as <a> tags in file-anime.php; refine them */
.av-info-panel a[href*="/genre/"],
section a.av-genre-chip {
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease !important;
}

section a.av-genre-chip:hover {
  background: var(--av-primary-soft) !important;
}

/* --------------------------------------------------------------------------
   SECTION 2 — WATCH PAGE
   The player, server/language selectors and episode list are rendered by
   the theme's Vue app into #episode-head-data at runtime. That component's
   logic is never touched; everything below is scoped strictly under
   #episode-head-data so it only restyles markup, using the same Tailwind
   utility classes the component already outputs.
   -------------------------------------------------------------------------- */

.av-watch-hero {
  padding-bottom: 1.5rem;
}

.av-watching-box {
  background: linear-gradient(135deg, var(--av-primary), rgba(var(--accent-3-color), 0.78)) !important;
  color: #fff !important;
  border-radius: var(--av-radius-sm) !important;
  box-shadow: 0 6px 18px var(--av-primary-glow);
}

.av-watching-box span {
  color: #fff !important;
}

.av-watching-box span:first-child {
  opacity: 0.85;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.av-watching-box span:nth-child(2) {
  font-size: 1.05rem;
  font-weight: 800;
  display: block;
}

.av-watching-box span:last-child {
  opacity: 0.9;
  font-weight: 500;
}

/* Episode row now includes a real thumbnail (card layout) */
#episode-head-data .av-ep-row {
  align-items: center !important;
  padding: 0.6rem !important;
  gap: 0.85rem !important;
  border-radius: var(--av-radius-sm);
  margin-bottom: 0.4rem;
}

#episode-head-data .av-ep-thumb {
  flex-shrink: 0;
  width: 118px;
  aspect-ratio: 16 / 9;
  border-radius: var(--av-radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: var(--av-shadow);
}

#episode-head-data .av-ep-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#episode-head-data .av-ep-date {
  color: var(--av-text-dim);
}

/* Episode range selector (e.g. 1-50, 51-100) */
#episode-head-data .av-ep-range-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.03);
}

#episode-head-data .av-ep-range-chip {
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--av-text-dim);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

#episode-head-data .av-ep-range-chip-active {
  background: var(--av-primary) !important;
  color: #fff !important;
}

#episode-head-data {
  --av-watch-radius: var(--av-radius);
}

/* Player container + surrounding chrome */
#episode-head-data [data-episode-player-container] {
  border-radius: var(--av-watch-radius);
  overflow: hidden;
}

#episode-head-data .aspect-w-16.aspect-h-9 {
  border-radius: var(--av-watch-radius) var(--av-watch-radius) 0 0;
  overflow: hidden;
}

/* server / language selector card ("bg-primary", "bg-darker" blocks) */
#episode-head-data .bg-darker,
#episode-head-data .bg-primary {
  border-radius: 0 0 var(--av-watch-radius) var(--av-watch-radius);
}

#episode-head-data [class*="border-dashed"] {
  border-color: rgba(255, 255, 255, 0.08) !important;
  border-style: solid !important;
}

/* server / language pill buttons rendered inside the selector rows */
#episode-head-data .bg-secondary,
#episode-head-data button.bg-accent-3,
#episode-head-data span.bg-accent-3 {
  border-radius: 999px !important;
  transition: transform 0.15s ease, filter 0.15s ease;
}

#episode-head-data .bg-secondary:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

/* "Episode Lists" heading + search box */
#episode-head-data [data-episode-list-container] {
  border-radius: var(--av-radius);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem 0;
}

#episode-head-data input[name="episode_number"] {
  border-radius: var(--av-radius-sm) !important;
}

/* Episode list — card based rows instead of plain rows */
#episode-head-data [data-episode-list-index] {
  margin: 0.3rem 0.6rem;
  border-radius: var(--av-radius-sm) !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

#episode-head-data [data-episode-list-index]:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  transform: translateX(2px);
}

/* Current episode — glowing accent border, per the brief */
#episode-head-data [data-episode-list-index].before\:w-2px {
  background: var(--av-primary-soft) !important;
  border: 1px solid var(--av-primary);
  box-shadow: 0 0 0 1px var(--av-primary-glow), 0 0 18px var(--av-primary-glow);
}

/* Auto Play / Auto Skip / Auto Next toggles */
#episode-head-data [class*="rounded-lg"][class*="bg-primary"] {
  border-radius: var(--av-radius) !important;
}

/* --------------------------------------------------------------------------
   SECTION 3 — HOME PAGE ANIME CARDS
   (template-parts/sections/listing/use-grid.php,
    template-parts/sections/listing/use-episode-grid.php)
   -------------------------------------------------------------------------- */

.av-card {
  border-radius: var(--av-radius) !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: transform 0.3s var(--av-ease);
}

.av-card:hover {
  transform: translateY(-4px);
}

.av-card .kira-anime {
  border-radius: var(--av-radius) !important;
  box-shadow: var(--av-shadow);
  transition: box-shadow 0.3s var(--av-ease);
}

.av-card:hover .kira-anime {
  box-shadow: var(--av-shadow-lg), 0 0 0 1px var(--av-primary-soft);
}

.av-card .kira-anime img {
  border-radius: var(--av-radius) !important;
  transition: transform 0.5s var(--av-ease);
}

.av-card:hover .kira-anime img {
  transform: scale(1.06);
}

/* quality / language / PG badge chips on the card */
.av-card .status_show,
.av-card [class*="bg-accent-2/80"],
.av-card span.bg-accent-3 {
  border-radius: 999px !important;
  font-weight: 700 !important;
  backdrop-filter: blur(3px);
}

.av-card span.bg-accent-3 {
  background: rgba(0, 0, 0, 0.55) !important;
}

/* card footer (title / type / duration) */
.av-card > div:last-child {
  border-radius: 0 0 var(--av-radius) var(--av-radius) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

.av-card a.text-sm {
  transition: color 0.2s ease;
}

.av-card:hover a.text-sm {
  color: var(--av-primary);
}

/* Latest episode cards (home-episode-listing) */
.av-ep-card {
  border-radius: var(--av-radius) !important;
  box-shadow: var(--av-shadow);
  transition: transform 0.3s var(--av-ease), box-shadow 0.3s var(--av-ease);
}

.av-ep-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--av-shadow-lg), 0 0 0 1px var(--av-primary-soft);
}

.av-ep-card .bg-accent-2 {
  border-radius: 0 0 10px 0 !important;
  font-weight: 700 !important;
}

/* section headers on home page */
.grid-anime-auto ~ * h2,
section > div > h2.text-accent,
section > div > div > h2.text-accent {
  position: relative;
  padding-left: 0.85rem;
}

section > div > h2.text-accent::before,
section > div > div > h2.text-accent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8%;
  height: 84%;
  width: 4px;
  border-radius: 4px;
  background: var(--av-primary);
}

/* --------------------------------------------------------------------------
   SECTION 4 — POPULAR RANKING SECTION (core/widget/popular-list.php)
   Premium glass panel + gradient rank badges + EP count pill (replaces
   the old view-count row entirely — no more material-icons dependency).
   -------------------------------------------------------------------------- */

.av-rank-tabs {
  border-radius: var(--av-radius) var(--av-radius) 0 0 !important;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: none;
}

.av-rank-tabs [data-tab-id] {
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.25s var(--av-ease), color 0.25s var(--av-ease);
}

.av-rank-tabs [data-tab-id].bg-secondary {
  background: linear-gradient(135deg, var(--av-primary), rgba(var(--accent-3-color), 0.72)) !important;
  color: #fff !important;
  box-shadow: 0 4px 16px var(--av-primary-glow);
}

.av-rank-tabs [data-tab-id]:not(.bg-secondary) {
  background: transparent !important;
  color: var(--av-text-dim) !important;
}

.av-rank-panel[data-tab-content] {
  border-radius: 0 0 var(--av-radius-lg) var(--av-radius-lg) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.18)) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.av-rank-item {
  border-radius: var(--av-radius) !important;
  padding: 0.65rem 0.85rem !important;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  margin-bottom: 0 !important;
  transition: background 0.25s var(--av-ease), transform 0.25s var(--av-ease),
    border-color 0.25s var(--av-ease), box-shadow 0.25s var(--av-ease);
}

.av-rank-item:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: var(--av-primary-soft);
  transform: translateX(3px);
  box-shadow: var(--av-shadow);
}

.av-rank-num-wrap {
  transform: none !important;
}

.av-rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--av-primary);
  background: var(--av-primary-soft);
  border: 1px solid rgba(var(--accent-3-color), 0.35);
}

/* Gold/premium treatment for the top 3 ranks in each tab panel */
.av-rank-item:nth-child(-n+3) .av-rank-num {
  color: #fff;
  background: linear-gradient(135deg, var(--av-primary), rgba(var(--accent-3-color), 0.6));
  border-color: transparent;
  box-shadow: 0 3px 12px var(--av-primary-glow);
}

.av-rank-thumb-wrap {
  border-radius: var(--av-radius-sm);
  overflow: hidden;
  box-shadow: var(--av-shadow);
  line-height: 0;
}

.av-rank-thumb {
  width: 3.2rem;
  height: 4.35rem;
  display: block;
  border-radius: var(--av-radius-sm) !important;
  object-fit: cover;
  transition: transform 0.35s var(--av-ease);
}

.av-rank-item:hover .av-rank-thumb {
  transform: scale(1.07);
}

.av-rank-title {
  font-size: 0.9rem;
  line-height: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--av-text);
}

.av-rank-title a {
  transition: color 0.2s var(--av-ease);
}

.av-rank-title a:hover {
  color: var(--av-primary);
}

.av-rank-ep-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--av-primary);
  background: var(--av-primary-soft);
  border: 1px solid rgba(var(--accent-3-color), 0.3);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.av-ep-icon {
  width: 0.8rem;
  height: 0.8rem;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   RESPONSIVE SAFETY NET
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
  .av-details-title {
    font-size: 1.35rem !important;
  }

  #episode-head-data [data-episode-list-index] {
    margin: 0.25rem 0.4rem;
  }
}

img, video, iframe {
  max-width: 100%;
}

.av-card, .av-ep-card, .av-rank-item {
  min-width: 0;
}

/* ==========================================================================
   SECTION 5 — HOMEPAGE: CONTINUE WATCHING
   New section added in template-parts/packs/file-homepage.php, above
   Trending. Its content is the theme's own Watched.vue component (the same
   one used on the dedicated "Continue Watching" page) mounted into
   #continue-watching — no new PHP query, AJAX call, or data source; it
   already reads the "_cwl_current" localStorage key the theme writes.
   ========================================================================== */

.av-cw-section {
  scroll-margin-top: 5rem;
  margin-bottom: 1.25rem;
}

.av-cw-title {
  position: relative;
  padding-left: 1.6rem !important;
  margin-bottom: 0.5rem;
}

.av-cw-title::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 8%;
  height: 84%;
  width: 4px;
  border-radius: 4px;
  background: var(--av-primary);
  box-shadow: 0 0 10px var(--av-primary-glow);
}

.av-cw-icon {
  font-size: 1.2rem !important;
  color: var(--av-primary);
}

#continue-watching .grid-episode-auto-watched {
  gap: 1rem !important;
  padding: 0.35rem 0.5rem 0;
}

/* poster card */
#continue-watching .grid-episode-auto-watched a[href] {
  border-radius: var(--av-radius) !important;
  box-shadow: var(--av-shadow);
  transition: transform 0.35s var(--av-ease), box-shadow 0.35s var(--av-ease);
}

#continue-watching .grid-episode-auto-watched > div:hover a[href] {
  transform: translateY(-4px);
  box-shadow: var(--av-shadow-lg), 0 0 0 1px var(--av-primary-soft);
}

/* darken poster toward the bottom, Crunchyroll-style, so the title stays legible */
#continue-watching .grid-episode-auto-watched a[href]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.2) 48%, transparent 72%);
}

/* title bar */
#continue-watching .grid-episode-auto-watched a[href] > div:first-child {
  background: transparent !important;
  top: auto !important;
  bottom: 0;
  inset-inline: 0;
  padding: 0.65rem 0.75rem !important;
  z-index: 1;
}

#continue-watching .grid-episode-auto-watched a[href] > div:first-child span {
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* episode badge pill, top-left, brand color */
#continue-watching .grid-episode-auto-watched a[href] > span.bg-accent-3 {
  top: 0.6rem !important;
  left: 0.6rem !important;
  right: auto !important;
  bottom: auto !important;
  background: var(--av-primary) !important;
  border-radius: 999px !important;
  padding: 0.28rem 0.75rem !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px var(--av-primary-glow);
  z-index: 2;
}

/* play icon overlay, glass circle on hover */
#continue-watching .grid-episode-auto-watched a[href] > div:nth-child(2) {
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(3px);
}

#continue-watching .grid-episode-auto-watched a[href] .material-icons-round {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--av-primary);
  font-size: 1.6rem !important;
  box-shadow: 0 6px 18px var(--av-primary-glow);
}

/* remove-from-list button */
#continue-watching .grid-episode-auto-watched > div > span[class*="cursor-pointer"] {
  top: 0.5rem !important;
  left: auto !important;
  right: 0.5rem !important;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55) !important;
  z-index: 3;
}

#continue-watching .grid-episode-auto-watched > div > span[class*="cursor-pointer"] .material-icons-round {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  font-size: 1.1rem !important;
}

/* ==========================================================================
   SECTION 6 — HOMEPAGE: TRENDING SLIDER
   (template-parts/sections/home-trendings.php) — cinematic, ranked-poster
   carousel restyle. Only CSS — the Swiper instance/markup is untouched.
   ========================================================================== */

.swiper-trending .swiper-slide > a[href] {
  border-radius: var(--av-radius) !important;
  box-shadow: var(--av-shadow);
  transition: transform 0.4s var(--av-ease), box-shadow 0.4s var(--av-ease);
}

.swiper-trending .swiper-slide > a[href]:hover {
  transform: translateY(-6px);
  box-shadow: var(--av-shadow-lg), 0 0 0 1px var(--av-primary-soft);
}

.swiper-trending .swiper-slide img {
  transition: transform 0.6s var(--av-ease);
}

.swiper-trending .swiper-slide > a[href]:hover img {
  transform: scale(1.07);
}

/* cinematic bottom-darkening on every poster */
.swiper-trending .swiper-slide > a[href]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 55%);
}

/* desktop rank/title strip — glass panel instead of the flat gradient */
.swiper-trending .bg-gradient-to-t.from-primary.to-secondary {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.6)) !important;
  backdrop-filter: blur(4px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
  z-index: 2;
}

.swiper-trending .bg-gradient-to-t.from-primary.to-secondary .text-2xl {
  font-weight: 800 !important;
  text-shadow: 0 0 14px var(--av-primary-glow);
  color: var(--av-primary) !important;
}

/* mobile card — replace the corner triangle with a clean glowing pill */
.swiper-trending .swiper-slide > a[class*="sm:hidden"] > div > div[class*="rotate-45"] {
  display: none;
}

.swiper-trending .swiper-slide > a[class*="sm:hidden"] span[class*="z-20"] {
  top: 0.6rem !important;
  left: 0.6rem !important;
  z-index: 2 !important;
  background: var(--av-primary);
  color: #fff;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px var(--av-primary-glow);
}

/* navigation arrows — glass, circular */
.trending-nav-next,
.trending-nav-prev {
  width: 2.75rem !important;
  height: 2.75rem !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  transition: background 0.25s var(--av-ease), border-color 0.25s var(--av-ease), transform 0.2s var(--av-ease);
}

.trending-nav-next:hover,
.trending-nav-prev:hover {
  background: var(--av-primary) !important;
  border-color: var(--av-primary);
  transform: scale(1.08);
}

/* pagination dots (mobile) */
.swiper-trending .swiper-pagination-bullet {
  width: 6px !important;
  height: 6px !important;
  background: rgba(255, 255, 255, 0.35) !important;
  opacity: 1 !important;
  border-radius: 999px !important;
  transition: width 0.3s var(--av-ease), background 0.3s var(--av-ease);
}

.swiper-trending .swiper-pagination-bullet-active {
  width: 22px !important;
  background: var(--av-primary) !important;
}

/* ==========================================================================
   SECTION 7 — HOMEPAGE: TOP AIRING! / COMPLETED SERIES / MOST POPULAR /
   MOST FAVORITE PANELS  (template-parts/sections/home-featured.php)
   ========================================================================== */

.kira-grid-featured section.bg-secondary {
  border-radius: var(--av-radius-lg) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)), var(--av-surface-2) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--av-shadow);
  overflow: hidden;
  transition: box-shadow 0.3s var(--av-ease), border-color 0.3s var(--av-ease);
}

.kira-grid-featured section.bg-secondary:hover {
  box-shadow: var(--av-shadow-lg);
  border-color: rgba(255, 255, 255, 0.12);
}

.kira-grid-featured section.bg-secondary > h2 {
  position: relative;
  padding: 1rem 1.1rem 1rem 1.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kira-grid-featured section.bg-secondary > h2::before {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  height: 55%;
  width: 4px;
  border-radius: 4px;
  background: var(--av-primary);
  box-shadow: 0 0 10px var(--av-primary-glow);
}

.kira-grid-featured section.bg-secondary ul li {
  position: relative;
  transition: background 0.25s var(--av-ease), padding-left 0.25s var(--av-ease);
}

.kira-grid-featured section.bg-secondary ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--av-primary);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.25s var(--av-ease);
}

.kira-grid-featured section.bg-secondary ul li:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  padding-left: 1.35rem !important;
}

.kira-grid-featured section.bg-secondary ul li:hover::before {
  transform: scaleY(1);
}

.kira-grid-featured section.bg-secondary ul li > div:first-child {
  border-radius: var(--av-radius-sm) !important;
  box-shadow: var(--av-shadow);
  transition: transform 0.3s var(--av-ease);
}

.kira-grid-featured section.bg-secondary ul li:hover > div:first-child {
  transform: scale(1.06);
}

.kira-grid-featured section.bg-secondary ul li h3 a {
  transition: color 0.2s ease;
}

.kira-grid-featured section.bg-secondary ul li:hover h3 a {
  color: var(--av-primary);
}

.kira-grid-featured section.bg-secondary ul li .flex.items-center.text-xs.gap-2 {
  color: var(--av-text-dim);
}

/* footer "View More" pill */
.kira-grid-featured section.bg-secondary .w-full.absolute.bottom-0 a {
  background: rgba(255, 255, 255, 0.04) !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  transition: background 0.25s var(--av-ease), color 0.25s var(--av-ease);
}

.kira-grid-featured section.bg-secondary .w-full.absolute.bottom-0 a:hover {
  background: var(--av-primary) !important;
  color: #fff !important;
}

.kira-grid-featured section.bg-secondary .w-full.absolute.bottom-0 a svg {
  transition: transform 0.25s var(--av-ease);
}

.kira-grid-featured section.bg-secondary .w-full.absolute.bottom-0 a:hover svg {
  transform: translateX(4px);
}

@media (max-width: 480px) {
  #continue-watching .grid-episode-auto-watched a[href] > div:first-child span {
    font-size: 0.72rem !important;
  }
}

/* ==========================================================================
   SECTION 8 — ANIME DETAILS PAGE: "MORE SEASON" SLIDER
   (template-parts/sections/anime/section-season.php) — Swiper instance/
   markup untouched; the breakpoints in kiranime-frontend.js now show a
   partial next-card peek on mobile (instead of one full-width slide) so
   it visibly reads as swipeable. This is cosmetic-only restyling.
   ========================================================================== */

.swiper-season {
  padding: 0.15rem 0.15rem 0.4rem !important;
  -webkit-mask-image: linear-gradient(to right, #000 92%, transparent 100%);
  mask-image: linear-gradient(to right, #000 92%, transparent 100%);
}

.swiper-season .swiper-slide > a[href] {
  border-radius: var(--av-radius-sm) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)), var(--av-surface-2) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--av-shadow);
  transition: transform 0.3s var(--av-ease), border-color 0.3s var(--av-ease), box-shadow 0.3s var(--av-ease);
}

.swiper-season .swiper-slide > a[href]:hover,
.swiper-season .swiper-slide > a[href]:active {
  transform: translateY(-2px);
  border-color: var(--av-primary-soft);
  box-shadow: var(--av-shadow-lg);
}

.swiper-season .swiper-slide > a[href].border-accent-2 {
  border-color: var(--av-primary) !important;
  box-shadow: 0 0 0 1px var(--av-primary), var(--av-shadow-lg);
}

.swiper-season .swiper-slide > a[href] > div:first-child {
  color: #fff;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

@media (max-width: 767px) {
  .swiper-season .swiper-slide > a[href] {
    height: 3.25rem !important;
  }
}

/* ==========================================================================
   SECTION 9 — WATCH PAGE: SUB ROW HIDDEN / SERVER ROW (formerly "DUB")
   Player.vue markup and selectIndex()/provider logic are untouched — the
   SUB row is only hidden via CSS (data-av-sub-row hook added in the
   render call, no code removed), and the DUB row is restyled + relabeled
   "Server" with a server icon in the JS render.
   ========================================================================== */

#episode-head-data [data-av-sub-row] {
  display: none !important;
}

#episode-head-data [data-av-server-row] {
  border-radius: var(--av-radius-sm) !important;
  border-top: none !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)), var(--av-surface-2) !important;
  box-shadow: var(--av-shadow);
}

#episode-head-data [data-av-server-row] > span:first-child {
  color: var(--av-primary);
}

#episode-head-data [data-av-server-row] .cursor-pointer.bg-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  transition: background 0.2s var(--av-ease), transform 0.2s var(--av-ease);
}

#episode-head-data [data-av-server-row] .cursor-pointer.bg-secondary:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  transform: translateY(-1px);
}

#episode-head-data [data-av-server-row] .cursor-pointer.bg-accent-3 {
  box-shadow: 0 4px 12px var(--av-primary-glow);
}

/* ==========================================================================
   SECTION 10 — FOOTER BRAND CREDIT (footer.php)
   The old "Proudly presented by Tukutema" credit line was removed in the
   template. This just restyles the remaining "© AniVexo" line so the site
   name reads as a small-but-bold, red, on-brand signature.
   ========================================================================== */

.av-footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

@media (min-width: 768px) {
  .av-footer-brand {
    justify-content: flex-start;
  }
}

.av-footer-brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--av-primary);
  text-shadow: 0 0 14px var(--av-primary-glow);
}

/* --------------------------------------------------------------------------
   SECTION 11 — ESTIMATED SCHEDULE (home-scheduled.php / ScheduledAnime Vue component)
   -------------------------------------------------------------------------- */

/* Day selector strip */
.prev-schedule,
.next-schedule {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.prev-schedule:hover,
.next-schedule:hover {
  background: var(--av-primary) !important;
  transform: translateY(-50%) scale(1.05);
}

.prev-schedule svg,
.next-schedule svg {
  color: #fff !important;
  width: 1.1rem;
  height: 1.1rem;
}

.av-day-chip {
  padding: 0.6rem 0.3rem !important;
  border-radius: var(--av-radius) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  overflow: hidden;
}

/* Weekday label (e.g. "WEDNESDAY") — shrink responsively so long names
   never overflow the pill and get clipped on narrow screens. */
.av-day-chip span:first-child {
  font-size: clamp(0.6rem, 2.4vw, 0.85rem);
  white-space: nowrap;
}

.av-day-chip:hover {
  transform: translateY(-2px);
}

.av-day-chip-active {
  background: linear-gradient(160deg, rgba(147, 51, 234, 0.35), var(--av-primary-soft)) !important;
  border-color: rgba(147, 51, 234, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(147, 51, 234, 0.4), 0 0 24px rgba(147, 51, 234, 0.45);
}

/* Card grid */
.av-sched-list {
  padding: 0 1rem;
}

.av-sched-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.av-sched-card {
  position: relative;
  min-height: 190px;
  border-radius: var(--av-radius-lg);
  overflow: hidden;
  box-shadow: var(--av-shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.9rem 1.1rem 0;
  isolation: isolate;
  transition: transform 0.35s var(--av-ease), box-shadow 0.35s var(--av-ease);
  background: var(--av-surface-2);
}

.av-sched-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--av-shadow-lg), 0 0 0 1px var(--av-primary-soft);
}

.av-sched-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.av-sched-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}

.av-sched-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.35) 35%,
    rgba(0, 0, 0, 0.75) 100%
  );
  backdrop-filter: blur(0.5px);
}

.av-sched-top,
.av-sched-center,
.av-sched-bottom {
  position: relative;
  z-index: 2;
}

.av-sched-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.av-sched-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.av-sched-time,
.av-sched-audio-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  white-space: nowrap;
}

.av-sched-time {
  background: rgba(0, 0, 0, 0.5);
}

.av-sched-audio-badge {
  background: var(--av-primary-soft);
  border-color: rgba(var(--accent-3-color), 0.4);
  color: var(--av-primary);
}

.av-sched-bell {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem !important;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.av-sched-bell:hover {
  transform: scale(1.08);
}

.av-sched-bell-active {
  background: var(--av-primary) !important;
  color: #fff;
}

.av-sched-center {
  display: block;
  padding: 0.5rem 0 0.75rem;
  text-decoration: none;
}

.av-sched-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.av-sched-sub {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
}

.av-sched-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  flex-wrap: wrap;
}

.av-sched-airing-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
}

.av-sched-countdown {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

.av-sched-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ff4d4d;
}

.av-sched-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff4d4d;
  box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.6);
  animation: av-live-pulse 1.4s ease-out infinite;
}

@keyframes av-live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 77, 77, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0);
  }
}

.av-sched-watch-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: var(--av-primary);
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px var(--av-primary-glow);
  transition: transform 0.2s ease, filter 0.2s ease;
  text-decoration: none;
}

.av-sched-watch-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.av-sched-progress {
  position: relative;
  z-index: 2;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.av-sched-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(147, 51, 234, 0.9), var(--av-primary));
  transition: width 1s linear;
  position: relative;
}

.av-sched-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  animation: av-progress-shimmer 2.2s linear infinite;
}

@keyframes av-progress-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@media (min-width: 640px) {
  .av-sched-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .av-sched-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   SECTION 12 — HOMEPAGE: HERO SPOTLIGHT SLIDER (home-spotlights.php)
   Reference layout: a distinct poster card + a blurred, atmospheric
   backdrop, title, year/duration line, star rating, genre pills, a
   longer synopsis, and two CTAs (a dark "outline" button and a red
   "play" button). Swiper's own config (loop, autoplay, navigation,
   breakpoints) in kiranime-frontend.js is untouched — this only
   restyles markup and supplies the `.swiper-pagination` node the
   existing JS was already configured to use on mobile. The header's
   transparent-until-scroll behavior is unchanged (that's a global,
   site-wide script — see functions.php/kiranime-frontend.js) and
   naturally applies here since the hero is the first thing on the page.
   ========================================================================== */

.av-hero-wrap {
  isolation: isolate;
}

/* Taller than the previous minimal version since there's more content
   to fit (poster + title + subline + rating + genres + synopsis + CTAs). */
.swiper.swiper-spotlight.av-hero-swiper {
  height: 480px;
  max-height: none;
  padding: 0 !important;
  margin: 66px 0 22px;
  width: 100%;
  border-radius: 0;
}
@media (min-width: 640px) {
  .swiper.swiper-spotlight.av-hero-swiper {
    height: 460px;
    margin: 86px 0 26px;
  }
}
@media (min-width: 1024px) {
  .swiper.swiper-spotlight.av-hero-swiper {
    height: 560px;
    margin: 96px 0 32px;
  }
}
@media (min-width: 1440px) {
  .swiper.swiper-spotlight.av-hero-swiper {
    height: 620px;
    margin: 110px 0 36px;
  }
}

.swiper.swiper-spotlight.av-hero-swiper .swiper-wrapper .swiper-slide.av-hero-slide {
  max-height: none;
}

.av-hero-wrap + #av-continue-watching-section {
  margin-top: 22px !important;
}
.av-hero-wrap + #av-continue-watching-section .av-cw-title {
  padding-top: 0.5rem !important;
  margin-top: 0 !important;
}

/* ---- Crossfade layered on top of Swiper's native slide transform
   transition (no extra effect module needed). ---- */
.av-hero-slide {
  transition: opacity 0.8s var(--av-ease);
  opacity: 0;
}
.av-hero-slide.swiper-slide-active {
  opacity: 1;
}

/* ---- Backdrop: same art, pushed back with blur + a moody tint so the
   poster card in front reads as the crisp, focal element — this is the
   atmosphere layer, not the content itself. ---- */
.av-hero-bgwrap {
  overflow: hidden;
}

.av-hero-bg {
  opacity: 1 !important;
  filter: blur(7px) saturate(1.05) !important;
  transform: scale(1.08);
  transform-origin: center;
}

.av-hero-slide.swiper-slide-active .av-hero-bg {
  animation: av-hero-kenburns 12s ease-in-out forwards;
}

@keyframes av-hero-kenburns {
  from { transform: scale(1.08); }
  to   { transform: scale(1.16); }
}

@media (prefers-reduced-motion: reduce) {
  .av-hero-slide.swiper-slide-active .av-hero-bg {
    animation: none;
    transform: scale(1.08);
  }
}

.av-hero-wrap .image-after::before {
  background: linear-gradient(120deg,
    rgba(10, 8, 30, 0.85) 0%,
    rgba(10, 8, 30, 0.55) 30%,
    rgba(30, 20, 60, 0.35) 55%,
    rgba(40, 30, 80, 0.25) 100%);
}
.av-hero-wrap .image-after::after {
  background: linear-gradient(0deg,
    rgba(4, 4, 10, 0.9) 0%,
    rgba(4, 4, 10, 0.5) 20%,
    rgba(4, 4, 10, 0.15) 40%,
    rgba(4, 4, 10, 0) 60%);
}

/* ---- Layout: poster card + content, side by side ---- */
.av-hero-inner {
  gap: 0.9rem;
  padding: 0 1rem;
  align-items: center;
}
@media (min-width: 640px) {
  .av-hero-inner {
    gap: 1.75rem;
    padding: 0 2rem;
  }
}
@media (min-width: 1024px) {
  .av-hero-inner {
    gap: 2.5rem;
    padding: 0 3.5rem;
  }
}
@media (min-width: 1440px) {
  .av-hero-inner {
    padding: 0 5rem;
    max-width: 1600px;
    margin: 0 auto;
  }
}

/* ---- Poster card ---- */
.av-hero-poster {
  flex-shrink: 0;
  width: 96px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.av-hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (min-width: 640px) {
  .av-hero-poster {
    width: 160px;
    border-radius: 14px;
  }
}
@media (min-width: 1024px) {
  .av-hero-poster {
    width: 230px;
    border-radius: 18px;
  }
}
@media (min-width: 1440px) {
  .av-hero-poster {
    width: 270px;
    border-radius: 20px;
  }
}

/* ---- Text column ---- */
.av-hero-card {
  min-width: 0;
  flex: 1;
}

.av-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--av-primary);
  margin-bottom: 0.35rem;
}
.av-hero-badge-icon {
  font-size: 0.9rem !important;
}
@media (min-width: 1024px) {
  .av-hero-badge {
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
  }
}

.av-hero-title {
  font-size: 1.05rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 640px) {
  .av-hero-title { font-size: 1.55rem; margin-bottom: 0.4rem; }
}
@media (min-width: 1024px) {
  .av-hero-title { font-size: 2.4rem; margin-bottom: 0.55rem; }
}
@media (min-width: 1440px) {
  .av-hero-title { font-size: 2.85rem; }
}

.av-hero-subline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.3rem;
}
.av-hero-subline-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  display: inline-block;
}
@media (min-width: 1024px) {
  .av-hero-subline { font-size: 0.95rem; margin-bottom: 0.5rem; }
}

.av-hero-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #facc15;
  margin-bottom: 0.5rem;
}
.av-hero-rating .material-icons-round {
  font-size: 1rem !important;
}
.av-hero-rating-max {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  font-size: 0.7em;
}
@media (min-width: 1024px) {
  .av-hero-rating { font-size: 1.05rem; margin-bottom: 0.75rem; }
  .av-hero-rating .material-icons-round { font-size: 1.3rem !important; }
}

/* Genre pills */
.av-hero-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
@media (min-width: 1024px) {
  .av-hero-genres { gap: 0.6rem; margin-bottom: 1rem; }
}

.av-hero-genre-pill {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
@media (min-width: 640px) {
  .av-hero-genre-pill {
    font-size: 0.68rem;
    padding: 0.24rem 0.7rem;
  }
}
@media (min-width: 1024px) {
  .av-hero-genre-pill {
    font-size: 0.85rem;
    padding: 0.4rem 1.1rem;
  }
}

/* Description — present at every size (1 line on the smallest phones,
   growing to 3 lines on desktop) rather than hidden below a breakpoint. */
.av-hero-desc {
  display: -webkit-box;
  font-size: 0.72rem;
  line-height: 1.45;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  margin-bottom: 0.5rem;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 640px) {
  .av-hero-desc {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    margin-bottom: 0.8rem;
  }
}
@media (min-width: 1024px) {
  .av-hero-desc {
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 1.1rem;
    -webkit-line-clamp: 3;
    max-width: 640px;
  }
}

/* ---- Buttons ---- */
.av-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.av-hero-btn-watch,
.av-hero-btn-detail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.72rem;
  white-space: nowrap;
}
.av-hero-btn-watch .material-icons-round,
.av-hero-btn-detail .material-icons-round {
  font-size: 1rem;
}
@media (min-width: 1024px) {
  .av-hero-btn-watch,
  .av-hero-btn-detail {
    padding: 0.85rem 1.9rem;
    font-size: 1rem;
    gap: 0.45rem;
  }
  .av-hero-btn-watch .material-icons-round,
  .av-hero-btn-detail .material-icons-round {
    font-size: 1.3rem;
  }
}

.av-hero-btn-watch {
  background: linear-gradient(135deg, var(--av-primary), #b3121f);
  color: #fff;
  box-shadow: 0 8px 22px var(--av-primary-glow);
  transition: transform 0.2s var(--av-ease), box-shadow 0.2s var(--av-ease), filter 0.2s var(--av-ease);
}
.av-hero-btn-watch:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 26px var(--av-primary-glow);
}

.av-hero-btn-detail {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.2s var(--av-ease), background 0.2s var(--av-ease);
}
.av-hero-btn-detail:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.18);
}

/* ---- Pagination: elegant dots (Swiper's own pagination module — the JS
   already targets `.swiper-pagination` on mobile breakpoints; this only
   supplies the element and a quiet visual style). ---- */
.av-hero-dots.swiper-pagination {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
  width: auto;
}
@media (min-width: 998px) {
  .av-hero-dots.swiper-pagination {
    display: none;
  }
}

.av-hero-dots .swiper-pagination-bullet {
  width: 5px;
  height: 5px;
  margin: 0 !important;
  background: rgba(255, 255, 255, 0.45);
  opacity: 1;
  border-radius: 999px;
  transition: width 0.25s var(--av-ease), background 0.25s var(--av-ease);
}
.av-hero-dots .swiper-pagination-bullet-active {
  width: 16px;
  background: var(--av-primary);
}

/* --------------------------------------------------------------------------
   RATE-THIS-ANIME WIDGET — premium glass card
   Restyles the Episode.vue vote widget. Only class hooks added in the
   compiled component (av-rate-*) are targeted here — no Vue logic touched.
   -------------------------------------------------------------------------- */
.av-rate-card {
  position: relative;
  background: linear-gradient(165deg, var(--av-surface-2) 0%, var(--av-surface-3) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--av-radius-lg);
  box-shadow: var(--av-shadow-lg);
  overflow: hidden;
  padding: 1.1rem 1.1rem 1.25rem;
}

.av-rate-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 15% -10%, var(--av-primary-soft) 0%, transparent 60%);
  pointer-events: none;
}

.av-rate-top {
  position: relative;
  z-index: 1;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.av-rate-score {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.3rem 0.7rem 0.3rem 0.5rem;
}

.av-rate-star {
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.55));
}

.av-rate-score-num {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--av-text);
}

.av-rate-score-count {
  color: var(--av-text-dim);
  font-size: 0.72rem;
}

.av-rate-cta {
  color: var(--av-primary);
  font-weight: 700;
  letter-spacing: 0.02em;
  position: relative;
  padding-left: 1rem;
}

.av-rate-cta::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--av-primary);
  box-shadow: 0 0 8px var(--av-primary-glow);
  animation: av-rate-pulse 1.8s ease-in-out infinite;
}

@keyframes av-rate-pulse {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.45; transform: translateY(-50%) scale(0.7); }
}

.av-rate-title {
  position: relative;
  z-index: 1;
  color: var(--av-text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}

.av-rate-icons {
  position: relative;
  z-index: 1;
  gap: 0.4rem;
}

.av-rate-icon {
  position: relative;
  border-radius: var(--av-radius);
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.22s var(--av-ease), background 0.22s var(--av-ease),
    border-color 0.22s var(--av-ease), box-shadow 0.22s var(--av-ease);
}

.av-rate-icon-inner {
  display: inline-flex;
  transition: transform 0.22s var(--av-ease);
}

.av-rate-icon:hover {
  transform: translateY(-3px) scale(1.08);
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.16);
}

.av-rate-icon:hover .av-rate-icon-inner {
  transform: scale(1.12);
}

.av-rate-icon-active {
  background: var(--av-primary-soft) !important;
  border-color: var(--av-primary-glow) !important;
  box-shadow: 0 0 0 1px var(--av-primary-glow), 0 8px 18px var(--av-primary-soft);
}

.av-rate-icon-active .av-rate-icon-inner {
  transform: scale(1.18);
  filter: drop-shadow(0 0 6px var(--av-primary-glow));
}

.av-rate-icon[data-av-rate-value="1"] .material-icons-round,
.av-rate-icon[data-av-rate-value="2"] .material-icons-round { color: #f87171 !important; }
.av-rate-icon[data-av-rate-value="3"] .material-icons-round { color: #facc15 !important; }
.av-rate-icon[data-av-rate-value="4"] .material-icons-round,
.av-rate-icon[data-av-rate-value="5"] .material-icons-round { color: #4ade80 !important; }

@media (min-width: 1024px) {
  .av-rate-card { padding: 1.4rem; }
}

/* --------------------------------------------------------------------------
   COMMENTS — premium composer + comment list
   Wraps the existing WP comment_form()/wp_list_comments() output. Field
   ids/names (#comment, #commentform, #submit) are unchanged, so the
   existing validation script in comments.php keeps working untouched.
   -------------------------------------------------------------------------- */
.av-comments-card {
  position: relative;
}

.av-composer {
  position: relative;
  background: linear-gradient(165deg, var(--av-surface-2) 0%, var(--av-surface-3) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--av-radius-lg);
  box-shadow: var(--av-shadow);
  padding: 1.25rem;
  overflow: hidden;
}

.av-composer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 60% at 100% 0%, var(--av-primary-soft) 0%, transparent 60%);
  pointer-events: none;
}

.av-composer-title,
.comment-reply-title.av-composer-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--av-text);
  margin-bottom: 0.6rem;
}

.av-composer-title-icon {
  font-size: 1.15rem;
  color: var(--av-primary);
}

.av-composer .logged-in-as,
.av-composer-locked-text {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  color: var(--av-text-dim);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin-bottom: 0.75rem;
}

.av-composer .logged-in-as a,
.av-composer-login-link {
  color: var(--av-primary);
  font-weight: 600;
}

.av-composer-field {
  position: relative;
  z-index: 1;
}

.av-composer-textarea {
  min-height: 96px;
  resize: vertical;
  transition: box-shadow 0.2s var(--av-ease), border-color 0.2s var(--av-ease);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.av-composer-textarea:focus {
  box-shadow: 0 0 0 3px var(--av-primary-soft);
}

.av-composer .form-submit,
.av-composer-form .form-submit {
  position: relative;
  z-index: 1;
  margin-top: 0.5rem;
}

.av-composer-submit,
.av-composer .form-submit input#submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--av-primary), rgba(var(--accent-3-color), 0.75)) !important;
  box-shadow: 0 8px 20px var(--av-primary-soft);
  transition: transform 0.18s var(--av-ease), box-shadow 0.18s var(--av-ease), filter 0.18s var(--av-ease);
  border: none;
}

.av-composer .form-submit input#submit::after {
  content: "send";
  font-family: "Material Icons Round";
  font-size: 1rem;
  line-height: 1;
  margin-left: 0.4rem;
  vertical-align: -2px;
}

.av-composer-submit:hover,
.av-composer .form-submit input#submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 26px var(--av-primary-glow);
}

.av-composer-submit:active,
.av-composer .form-submit input#submit:active {
  transform: translateY(0);
}

.av-composer-textarea.required-field {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.45) !important;
}

.av-comments-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  margin: 1.75rem 0 1rem;
  background: linear-gradient(90deg, var(--av-primary-soft) 0%, transparent 100%);
  border-left: 3px solid var(--av-primary);
  border-radius: var(--av-radius-sm);
}

.av-comments-heading-icon {
  color: var(--av-primary);
  font-size: 1.2rem;
}

.av-comments-heading-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--av-text);
}

.av-comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  list-style: none;
  padding: 0;
}

.av-comment {
  align-items: flex-start;
}

.av-comment-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.av-comment-avatar {
  border-radius: 999px;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--av-surface-2), var(--av-surface-2)) padding-box,
    linear-gradient(135deg, var(--av-primary), rgba(255, 255, 255, 0.2)) border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.av-comment-bubble {
  position: relative;
  background: linear-gradient(165deg, var(--av-surface-2) 0%, var(--av-surface-3) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--av-radius);
  padding: 0.85rem 1rem !important;
  box-shadow: var(--av-shadow);
  transition: border-color 0.2s var(--av-ease), transform 0.2s var(--av-ease);
}

.av-comment-bubble:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.av-comment-arrow {
  position: absolute;
  top: 14px;
  left: -6px;
  width: 12px;
  height: 12px;
  background: var(--av-surface-2);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transform: rotate(45deg);
}

.av-comment-pending {
  display: inline-block;
  font-size: 0.72rem;
  color: #facc15;
  margin-bottom: 0.35rem;
}

.av-comment-head {
  margin-bottom: 0.35rem;
}

.av-comment-author {
  color: var(--av-text);
  font-weight: 700;
  font-size: 0.88rem;
}

.av-comment-reply a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--av-text-dim);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  transition: color 0.2s var(--av-ease), background 0.2s var(--av-ease);
}

.av-comment-reply a:hover {
  color: var(--av-primary);
  background: var(--av-primary-soft);
}

.av-comment-text {
  color: var(--av-text-dim);
  line-height: 1.55;
  margin: 0.2rem 0 0.6rem;
}

.av-comment-date {
  color: var(--av-text-dim);
  opacity: 0.7;
  font-size: 0.68rem;
}

.av-composer-locked {
  text-align: center;
  padding: 1.5rem 1.25rem;
}

.av-composer-locked .av-composer-title {
  justify-content: center;
}

@media (min-width: 1024px) {
  .av-composer { padding: 1.6rem; }
}

/* --------------------------------------------------------------------------
   COMMENTS — follow-up refinements
   Avatar is now shown on mobile too (markup no longer hides it below sm),
   sized down slightly on small screens; "Logged in as" chip simplified.
   -------------------------------------------------------------------------- */
.av-comment-avatar-wrap {
  width: 40px;
}

.av-comment-avatar {
  width: 40px !important;
  height: 40px !important;
}

@media (min-width: 640px) {
  .av-comment-avatar-wrap { width: 56px; }
  .av-comment-avatar { width: 56px !important; height: 56px !important; }
}

.av-composer-loggedin strong {
  color: var(--av-text);
  font-weight: 700;
}
