/* ════════════════════════════════════════════════════════════════
   WIKIVIDEOS — Design System
   Aesthetic: Cinematic editorial. Dark header, warm parchment body.
   Typefaces: IM Fell English (headings) · Source Sans 3 (body)
   Palette: #0d0f14 header · #f5f0e8 page · #2a4a8a accent
════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;1,400&display=swap');

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  /* Palette */
  --wv-ink:        #1a1814;   /* main text */
  --wv-page:       #f5f0e8;   /* parchment background */
  --wv-page-mid:   #ede8dc;   /* slightly darker panels */
  --wv-rule:       #c8bfa8;   /* borders, rules */
  --wv-muted:      #6b6355;   /* secondary text */
  --wv-accent:     #2a4a8a;   /* links, highlight */
  --wv-accent-h:   #1e3670;   /* link hover */
  --wv-header-bg:  #0d0f14;   /* nav bar */
  --wv-header-txt: #e8e4dc;   /* nav text */

  /* Player (same as before) */
  --pl-bg:          #0d0d0d;
  --pl-bar:         rgba(8,16,26,0.88);
  --pl-accent:      #2a4a8a;
  --pl-accent-glow: rgba(42,74,138,0.35);
  --pl-panel:       #111318;
  --pl-panel-hover: #1c2030;
  --pl-panel-active:#1a2540;
  --pl-text:        #e8eaf0;
  --pl-muted:       #7a8099;
  --pl-thumb-w:     96px;

  /* Type scale */
  --ff-body:    'Source Sans 3', Georgia, serif;
  --ff-heading: 'IM Fell English', Georgia, serif;
}

/* ── Base ──────────────────────────────────────────────────────── */
body {
  font-family: var(--ff-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--wv-ink);
  background: var(--wv-page);
  min-height: 100vh;
}

a { color: var(--wv-accent); text-decoration: none; }
a:hover { color: var(--wv-accent-h); text-decoration: underline; }

p { margin: 0 0 0.85em; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.6em; margin: 0 0 0.85em; }
li { margin-bottom: 0.25em; }

b, strong { font-weight: 600; }
i, em { font-style: italic; }

sup { font-size: 0.72em; vertical-align: super; line-height: 0; }

pre, code, tt, kbd, samp {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.875em;
}
code {
  background: var(--wv-page-mid);
  border: 1px solid var(--wv-rule);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}
pre {
  background: var(--wv-page-mid);
  border: 1px solid var(--wv-rule);
  padding: 1em 1.2em;
  overflow-x: auto;
  line-height: 1.5;
}

hr {
  border: none;
  border-top: 1px solid var(--wv-rule);
  margin: 1.5em 0;
}

/* ── Typography ────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-heading);
  font-weight: normal;
  line-height: 1.2;
  color: var(--wv-ink);
}

h1 { font-size: 2em;    margin: 0 0 0.15em; }
h2 { font-size: 1.45em; margin: 1.4em 0 0.4em; border-bottom: 1px solid var(--wv-rule); padding-bottom: 0.2em; }
h3 { font-size: 1.15em; margin: 1.2em 0 0.3em; }
h4 { font-size: 1em;    margin: 1em 0 0.25em; font-style: italic; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT SHELL
══════════════════════════════════════════════════════════════ */

/* ── Header / nav ──────────────────────────────────────────────── */
#wv-header {
  background: var(--wv-header-bg);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.wv-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Logo */
.wv-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 28px;
}
.wv-logo img {
  width: 28px;
  height: 28px;
}
.wv-logo-text {
  font-family: var(--ff-heading);
  font-size: 1.2em;
  color: var(--wv-header-txt);
  letter-spacing: 0.01em;
  line-height: 1;
}

/* Nav links */
.wv-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.wv-nav a {
  color: rgba(232,228,220,0.7);
  font-size: 0.85em;
  padding: 0 10px;
  height: 52px;
  display: flex;
  align-items: center;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.wv-nav a:hover {
  color: var(--wv-header-txt);
  border-bottom-color: rgba(232,228,220,0.3);
}
.wv-nav a.active {
  color: var(--wv-header-txt);
  border-bottom-color: var(--pl-accent);
}

/* Search */
.wv-header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.wv-search-form {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  overflow: hidden;
}
.wv-search-form input {
  background: none;
  border: none;
  outline: none;
  color: var(--wv-header-txt);
  font-family: var(--ff-body);
  font-size: 0.85em;
  padding: 6px 10px;
  width: 200px;
}
.wv-search-form input::placeholder { color: rgba(232,228,220,0.4); }
.wv-search-form button {
  background: none;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.1);
  color: rgba(232,228,220,0.5);
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.wv-search-form button:hover { color: var(--wv-header-txt); }
.wv-search-form button svg { width: 14px; height: 14px; fill: currentColor; }

/* ── Page layout ───────────────────────────────────────────────── */
#wv-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 40px;
  align-items: start;
}

/* Full-width override for index */
#wv-page.full-width {
  grid-template-columns: 1fr;
  max-width: 960px;
}

#wv-main { min-width: 0; }

/* ── Sidebar ───────────────────────────────────────────────────── */
#wv-sidebar {
  font-size: 0.85em;
  position: sticky;
  top: 72px;
}

.wv-sidebar-box {
  border: 1px solid var(--wv-rule);
  background: var(--wv-page-mid);
  margin-bottom: 18px;
}
.wv-sidebar-box h3 {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wv-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--wv-rule);
  margin: 0;
  font-family: var(--ff-body);
  font-weight: 600;
}
.wv-sidebar-box ul {
  list-style: none;
  padding: 6px 0;
  margin: 0;
}
.wv-sidebar-box ul li a {
  display: block;
  padding: 4px 12px;
  color: var(--wv-accent);
  font-size: 0.92em;
  line-height: 1.4;
}
.wv-sidebar-box ul li a:hover {
  background: rgba(0,0,0,0.04);
  text-decoration: none;
}

/* ── Page header ───────────────────────────────────────────────── */
.wv-page-header {
  border-bottom: 1px solid var(--wv-rule);
  margin-bottom: 20px;
  padding-bottom: 8px;
}
.wv-page-header h1 {
  font-size: 2em;
  margin: 0;
  line-height: 1.15;
}
.wv-from-line {
  font-size: 0.8em;
  color: var(--wv-muted);
  margin-top: 2px;
}

/* ── Tab bar (Read / Edit / History) ───────────────────────────── */
.wv-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--wv-rule);
}
.wv-tabs a {
  font-size: 0.82em;
  padding: 6px 14px;
  color: var(--wv-muted);
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  border-radius: 2px 2px 0 0;
  text-decoration: none;
  transition: color 0.12s, background 0.12s;
}
.wv-tabs a:hover { color: var(--wv-ink); }
.wv-tabs a.active {
  color: var(--wv-ink);
  background: var(--wv-page);
  border-color: var(--wv-rule);
}

/* ── Footer ────────────────────────────────────────────────────── */
#wv-footer {
  background: var(--wv-header-bg);
  border-top: 1px solid rgba(255,255,255,0.07);
  color: rgba(232,228,220,0.5);
  font-size: 0.8em;
  padding: 24px;
  margin-top: 60px;
}
.wv-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  align-items: flex-start;
}
.wv-footer-col { flex: 1; min-width: 180px; }
.wv-footer-col h4 {
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(232,228,220,0.6);
  margin: 0 0 8px;
}
.wv-footer-col ul { list-style: none; padding: 0; margin: 0; }
.wv-footer-col ul li { margin-bottom: 4px; }
.wv-footer-col ul li a { color: rgba(232,228,220,0.45); }
.wv-footer-col ul li a:hover { color: rgba(232,228,220,0.8); text-decoration: none; }
.wv-footer-inner::after {
  content: 'Scientia potentia est';
  flex: 1;
  min-width: 180px;
  font-family: var(--ff-heading);
  font-style: italic;
  font-size: 1.25em;
  color: rgba(232,228,220,0.35);
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-align: right;
  align-self: flex-start;
}
.wv-footer-copy {
  width: 100%;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  color: rgba(232,228,220,0.3);
  font-size: 0.9em;
}
.wv-footer-copy a { color: rgba(232,228,220,0.4); }

/* ══════════════════════════════════════════════════════════════
   ARTICLE CONTENT
══════════════════════════════════════════════════════════════ */

.wv-article h2 {
  font-size: 1.35em;
  margin: 1.6em 0 0.5em;
  border-bottom: 1px solid var(--wv-rule);
  padding-bottom: 0.2em;
}
.wv-article h3 {
  font-size: 1.1em;
  margin: 1.2em 0 0.3em;
  border: none;
}

/* Wikipedia-style infobox */
.wv-infobox {
  float: right;
  clear: right;
  margin: 0 0 16px 24px;
  border: 1px solid var(--wv-rule);
  background: var(--wv-page-mid);
  font-size: 0.85em;
  max-width: 260px;
  width: 100%;
}
.wv-infobox-title {
  background: var(--wv-ink);
  color: #fff;
  padding: 6px 10px;
  font-family: var(--ff-heading);
  font-size: 1em;
  text-align: center;
}
.wv-infobox table {
  width: 100%;
  border-collapse: collapse;
  padding: 8px;
}
.wv-infobox td {
  padding: 4px 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--wv-rule);
  line-height: 1.4;
}
.wv-infobox td:first-child {
  font-weight: 600;
  white-space: nowrap;
  color: var(--wv-muted);
  width: 42%;
}

/* References */
ol.references {
  font-size: 0.875em;
  color: var(--wv-muted);
  padding-left: 2em;
}
ol.references li { margin-bottom: 4px; }
.mw-cite-backlink { font-size: 0.85em; margin-right: 4px; }
sup.reference a {
  font-size: 0.82em;
  font-style: normal;
}

/* Chapter list */
ol.wikivideo-chapters {
  list-style: none;
  padding: 0;
  margin: 12px 0 16px;
  border: 1px solid var(--wv-rule);
  background: var(--wv-page-mid);
}
.wikivideo-chapter {
  display: flex;
  gap: 12px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--wv-rule);
  font-size: 0.875em;
  line-height: 1.5;
}
.wikivideo-chapter:last-child { border-bottom: none; }
.wikivideo-chapter-time {
  font-variant-numeric: tabular-nums;
  color: var(--wv-accent);
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.9em;
  flex-shrink: 0;
  min-width: 48px;
  cursor: pointer;
}
.wikivideo-chapter-text { color: var(--wv-ink); }
.wikivideo-chapter-text a { color: var(--wv-accent); }

/* Source line */
.wv-src-line {
  font-size: 0.8em;
  color: var(--wv-muted);
  margin: 4px 0 14px;
}
.wv-src-line a { color: var(--wv-accent); }

/* External links */
a.extiw { color: var(--wv-accent); }
a.external::after {
  content: ' ↗';
  font-size: 0.75em;
  opacity: 0.6;
}

/* ══════════════════════════════════════════════════════════════
   HOMEPAGE COMPONENTS
══════════════════════════════════════════════════════════════ */

/* Hero */
.wv-hero {
  background: var(--wv-ink);
  color: var(--wv-header-txt);
  padding: 28px 32px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-radius: 2px;
}
.wv-hero img { width: 52px; height: 52px; flex-shrink: 0; opacity: 0.9; }
.wv-hero h2 {
  font-family: var(--ff-heading);
  font-size: 1.6em;
  font-weight: normal;
  margin: 0 0 6px;
  color: #fff;
  border: none;
}
.wv-hero p {
  margin: 0;
  font-size: 0.9em;
  color: rgba(232,228,220,0.7);
  line-height: 1.55;
}
.wv-hero-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wv-hero-links a {
  color: rgba(232,228,220,0.9);
  font-size: 0.82em;
  padding: 3px 10px;
  border: 1px solid rgba(232,228,220,0.2);
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.15s, border-color 0.15s;
}
.wv-hero-links a:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(232,228,220,0.4);
  text-decoration: none;
}

/* Category filter bar */
.wv-catbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--wv-rule);
}
.wv-catbar a {
  display: inline-block;
  padding: 3px 12px;
  background: var(--wv-page-mid);
  border: 1px solid var(--wv-rule);
  font-size: 0.8em;
  color: var(--wv-accent);
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.12s, border-color 0.12s;
}
.wv-catbar a:hover {
  background: #e4ddd0;
  border-color: var(--wv-accent);
}

/* Section heading row */
.wv-sh {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--wv-rule);
  margin: 0 0 14px;
  padding-bottom: 5px;
}
.wv-sh h2 {
  margin: 0;
  border: none;
  font-size: 1.1em;
  padding: 0;
}
.wv-sh a { font-size: 0.8em; color: var(--wv-accent); }

/* Featured */
.wv-featured {
  display: grid;
  grid-template-columns: 55% 1fr;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--wv-rule);
}
.wv-feat-info h3 {
  font-size: 1.3em;
  margin: 0 0 8px;
  border: none;
  padding: 0;
}
.wv-feat-tags {
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.wv-feat-tags span {
  display: inline-block;
  background: var(--wv-page-mid);
  border: 1px solid var(--wv-rule);
  padding: 1px 8px;
  font-size: 0.75em;
  color: var(--wv-muted);
  border-radius: 2px;
}
.wv-feat-info p { font-size: 0.9em; line-height: 1.6; margin-bottom: 10px; }
.wv-feat-info a.wv-more { font-size: 0.88em; color: var(--wv-accent); }

/* Card grid */
.wv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.wv-card {
  border: 1px solid var(--wv-rule);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wv-card:hover {
  border-color: var(--wv-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.wv-card a { text-decoration: none; color: inherit; }
.wv-card-thumb {
  aspect-ratio: 16/9;
  background: var(--wv-ink);
  overflow: hidden;
  position: relative;
  display: block;
}
.wv-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.88;
  transition: opacity 0.18s;
}
.wv-card:hover .wv-card-thumb img { opacity: 1; }
.wv-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.15);
  transition: background 0.15s;
}
.wv-card:hover .wv-play-btn { background: rgba(0,0,0,0.28); }
.wv-play-btn::after {
  content: '';
  width: 0; height: 0;
  border-left: 16px solid rgba(255,255,255,0.88);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 4px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}
.wv-card-body { padding: 8px 10px 10px; }
.wv-card-body h4 {
  font-family: var(--ff-heading);
  font-size: 0.9em;
  font-weight: normal;
  margin: 0 0 3px;
  line-height: 1.3;
}
.wv-card-body h4 a { color: var(--wv-accent); }
.wv-card-meta { font-size: 0.74em; color: var(--wv-muted); margin-bottom: 4px; }
.wv-tag {
  display: inline-block;
  font-size: 0.68em;
  background: var(--wv-page-mid);
  border: 1px solid var(--wv-rule);
  padding: 0 5px;
  color: var(--wv-muted);
  margin-right: 3px;
  border-radius: 1px;
}
.wv-tag-ia   { background: #fef3e2; border-color: #d97706; color: #92400e; }
.wv-tag-commons { background: #ecfdf5; border-color: #16a34a; color: #14532d; }

/* Two-column info boxes */
.wv-twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.wv-box {
  border: 1px solid var(--wv-rule);
  background: var(--wv-page-mid);
  padding: 14px 16px;
  font-size: 0.875em;
  line-height: 1.6;
}
.wv-box h3 {
  font-size: 0.95em;
  border-bottom: 1px solid var(--wv-rule);
  padding-bottom: 6px;
  margin: 0 0 10px;
}
.wv-box ul { margin: 0; padding-left: 1.4em; }
.wv-box ul li { margin-bottom: 5px; }
.wv-box a { color: var(--wv-accent); }

/* About banner */
.wv-about-banner {
  border: 1px solid var(--wv-rule);
  background: var(--wv-page-mid);
  padding: 12px 16px;
  font-size: 0.875em;
  line-height: 1.65;
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════════════════
   PLAYER (inline from wv-player.html — identical)
══════════════════════════════════════════════════════════════ */

.wv-player-outer {
  max-width: 700px;
  font-family: var(--ff-body);
  font-size: 14px;
  color: var(--wv-ink);
  line-height: 1.4;
}
.wv-player {
  background: var(--pl-bg);
  position: relative;
  user-select: none;
}
.wv-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}
.wv-video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.wv-video-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
.wv-big-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.wv-big-play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.75);
  background: rgba(8,16,26,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
  box-shadow: 0 0 0 0 var(--pl-accent-glow);
}
.wv-big-play-btn svg { width: 24px; height: 24px; fill: #fff; margin-left: 3px; }
.wv-video-wrap:hover .wv-big-play-btn {
  background: rgba(8,16,26,0.80);
  box-shadow: 0 0 0 8px var(--pl-accent-glow);
  transform: scale(1.07);
}
.wv-player.playing .wv-big-play { opacity: 0; pointer-events: none; }
.wv-now-playing {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 10px 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, transparent 100%);
  font-family: var(--ff-heading);
  font-size: 0.95em;
  color: rgba(255,255,255,0.9);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.wv-player.playing .wv-now-playing { opacity: 1; }
.wv-player.series .wv-now-playing { opacity: 1; }
.wv-controls {
  display: flex;
  align-items: center;
  background: var(--pl-bar);
  height: 44px;
  padding: 0 10px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.wv-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 8px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pl-text);
  opacity: 0.78;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.wv-btn:hover { opacity: 1; }
.wv-btn svg { width: 18px; height: 18px; fill: currentColor; }
.wv-progress-wrap {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  cursor: pointer;
}
.wv-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  position: relative;
  transition: height 0.12s;
}
.wv-progress-wrap:hover .wv-progress-track { height: 5px; }
.wv-progress-fill {
  height: 100%;
  background: var(--pl-accent);
  border-radius: 2px;
  width: 0%;
  position: relative;
  pointer-events: none;
}
.wv-progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--pl-accent);
  transition: transform 0.12s;
}
.wv-progress-wrap:hover .wv-progress-fill::after { transform: translateY(-50%) scale(1); }
.wv-buffered {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
}
.wv-time {
  font-size: 0.78em;
  color: var(--pl-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 0 6px;
}
.wv-volume-wrap { display: flex; align-items: center; }
.wv-volume-slider {
  width: 60px;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.wv-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--pl-accent);
}
.wv-speed-btn {
  font-size: 0.75em;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--pl-muted);
  padding: 0 6px;
  border: none;
  background: none;
  cursor: pointer;
  height: 44px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.wv-speed-btn:hover { color: var(--pl-text); }

/* Episode panel */
.wv-episode-panel {
  background: var(--pl-panel);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: none;
}
.wv-player.series .wv-episode-panel { display: block; }
.wv-ep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wv-ep-label {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--pl-muted);
  font-weight: 600;
}
.wv-ep-count { font-size: 0.72em; color: var(--pl-muted); }
.wv-ep-list {
  max-height: 210px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.wv-ep-list::-webkit-scrollbar { width: 4px; }
.wv-ep-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.wv-ep {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.12s;
  position: relative;
}
.wv-ep:hover { background: var(--pl-panel-hover); }
.wv-ep.active { background: var(--pl-panel-active); }
.wv-ep.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--pl-accent);
}
.wv-ep-thumb {
  width: var(--pl-thumb-w);
  aspect-ratio: 4/3;
  flex-shrink: 0;
  border-radius: 2px;
  overflow: hidden;
  background: #1a1a2a;
  position: relative;
}
.wv-ep-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.wv-ep:hover .wv-ep-thumb img,
.wv-ep.active .wv-ep-thumb img { opacity: 1; }
.wv-ep-playing-icon {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8,16,26,0.45);
}
.wv-ep.active .wv-ep-playing-icon { display: flex; }
.wv-ep-playing-icon svg { width: 20px; height: 20px; fill: #fff; }
.wv-ep-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wv-ep-thumb-placeholder svg { width: 24px; height: 24px; fill: rgba(255,255,255,0.15); }
.wv-ep-info { flex: 1; min-width: 0; }
.wv-ep-num {
  font-size: 0.7em;
  color: var(--pl-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.wv-ep.active .wv-ep-num { color: var(--pl-accent); }
.wv-ep-title {
  font-size: 0.88em;
  color: var(--pl-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.wv-ep.active .wv-ep-title { color: #fff; }
.wv-ep-dur {
  font-size: 0.72em;
  color: var(--pl-muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #wv-page { grid-template-columns: 1fr; }
  #wv-sidebar { position: static; }
  .wv-featured, .wv-twocol { grid-template-columns: 1fr; }
  .wv-grid { grid-template-columns: repeat(2, 1fr); }
  .wv-nav a:nth-child(n+5) { display: none; }
}
@media (max-width: 500px) {
  .wv-grid { grid-template-columns: 1fr; }
  .wv-header-inner { padding: 0 14px; }
  #wv-page { padding: 20px 14px 40px; }
  .wv-search-form input { width: 130px; }
}

/* ══════════════════════════════════════════════════════════════
   EXTENSION PAGE — docs grid, example block
══════════════════════════════════════════════════════════════ */

.wv-docs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
.wv-docs-box {
  border: 1px solid var(--wv-rule);
  background: var(--wv-page-mid);
  padding: 14px 16px;
  font-size: 0.875em;
  line-height: 1.6;
}
.wv-docs-box h3 {
  font-size: 0.95em;
  border-bottom: 1px solid var(--wv-rule);
  padding-bottom: 6px;
  margin: 0 0 10px;
}
.wv-docs-box ul { margin: 0; padding-left: 1.4em; }
.wv-docs-box ul li { margin-bottom: 5px; }
.wv-docs-box a { color: var(--wv-accent); }
.wv-docs-box code {
  background: #fff;
  border: 1px solid var(--wv-rule);
  padding: 0 3px;
  font-size: 0.92em;
}

.wv-example-wrap {
  border: 1px solid var(--wv-rule);
  background: var(--wv-page-mid);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 0.875em;
}
.wv-example-wrap h3 {
  font-size: 0.95em;
  border-bottom: 1px solid var(--wv-rule);
  padding-bottom: 6px;
  margin: 0 0 12px;
}
.wv-example-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.wv-example-wrap pre {
  background: #fff;
  border: 1px solid var(--wv-rule);
  padding: 10px 12px;
  font-size: 0.9em;
  margin: 8px 0 0;
  line-height: 1.5;
  overflow-x: auto;
}
.wv-example-wrap .wikivideo-wrapper { margin: 0; }
.wv-example-wrap .wikivideo { max-width: 100%; }

/* TOC */
#toc {
  background: var(--wv-page-mid);
  border: 1px solid var(--wv-rule);
  padding: 12px 16px;
  display: inline-block;
  margin: 0 0 20px;
  min-width: 200px;
  font-size: 0.875em;
}
#toc h2 { font-size: 1em; margin: 0 0 8px; border: none; padding: 0; }
#toc ul { margin: 0; padding-left: 1.2em; }
#toc li { margin-bottom: 3px; }
#toc a { color: var(--wv-accent); }
.toctogglecheckbox, .toctogglelabel, .toctogglespan { display: none; }

@media (max-width: 700px) {
  .wv-docs-grid, .wv-example-cols { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   FULLSCREEN — based on fullscreen.css (class-toggle approach)
   Works on all browsers AND mobile (iOS/Android) where the
   native fullscreen API is unreliable. The .is-fullscreen
   class is toggled by the player JS on the .wv-player element.
══════════════════════════════════════════════════════════════ */

/* Player container: fixed overlay covering the entire viewport */
.wv-player.is-fullscreen {
  position: fixed !important;
  top:    0 !important;
  left:   0 !important;
  width:  100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  max-width:  none !important;
  margin:  0 !important;
  padding: 0 !important;
  background: #000 !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 99999 !important;
}

/* Video wrap: grows to fill all space above the controls bar.
   flex: 1 1 auto + height: 0 is the reliable flex-grow trick.
   min-height: 0 prevents overflow on small screens. */
.wv-player.is-fullscreen .wv-video-wrap {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: unset !important;
}

/* Video: letterboxes to fit any screen size without cropping */
.wv-player.is-fullscreen .wv-video-wrap video {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  border: none !important;
  object-fit: contain !important;
}

/* Controls bar: pinned to bottom, never shrinks, always on top */
.wv-player.is-fullscreen .wv-controls {
  flex: 0 0 auto !important;
  width: 100% !important;
  height: 52px !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
  background: rgba(10, 12, 18, 0.95) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,0.08) !important;
  z-index: 100000 !important;
}

/* Slightly larger touch targets in fullscreen */
.wv-player.is-fullscreen .wv-btn {
  height: 52px !important;
}

.wv-player.is-fullscreen .wv-time {
  font-size: 0.85em;
}

/* Hide episode panel in fullscreen — no room for it */
.wv-player.is-fullscreen .wv-episode-panel {
  display: none !important;
}

/* Outer wrapper must not constrain width when player is fullscreen */
.wv-player-outer:has(.wv-player.is-fullscreen) {
  max-width: none !important;
}