/* Private video catalogue (/videos): Netflix-style browse, details and player. Uses tokens from styles.css. */

.vids { --vbg: #0b0a0e; --vcard: #17141d; background: var(--vbg); }
.vids [hidden] { display: none !important; }
.vids svg { fill: currentColor; }

/* ---------- Shared bits ---------- */
.vlogo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 1.05rem; color: var(--text); }
.vlogo img { width: 30px; height: 30px; border-radius: 50%; }
.vlogo b { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .78em; margin-left: 2px; }
.vlink { background: none; border: 0; color: var(--muted); font: 500 .9rem var(--sans); cursor: pointer; padding: 6px 8px; }
.vlink:hover { color: var(--text); }

.vbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 20px; border: 0; border-radius: 6px; cursor: pointer;
  font: 700 .95rem/1 var(--sans); transition: background .15s, transform .15s, opacity .15s;
}
.vbtn svg { width: 20px; height: 20px; }
.vbtn:active { transform: scale(.97); }
.vbtn-lg { padding: 13px 26px; font-size: 1.05rem; }
.vbtn-lg svg { width: 24px; height: 24px; }
.vbtn-white { background: #fff; color: #000; }
.vbtn-white:hover { background: rgba(255, 255, 255, .78); }
.vbtn-grey { background: rgba(109, 109, 110, .7); color: #fff; }
.vbtn-grey:hover { background: rgba(109, 109, 110, .45); }
.vbtn-primary { background: var(--btn); color: #fff; width: 100%; }
.vbtn-primary:hover { background: var(--btn-hover); }
.vbtn:disabled { opacity: .6; cursor: default; }

/* ---------- Code screen (same look as the /admin login, see admin.css) ---------- */
.gate { min-height: 100svh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.gate-card {
  width: 100%; max-width: 360px; padding: 32px 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
}
.gate-card img { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; }
.gate-card h1 { font-size: 1.5rem; margin-bottom: 20px; }
.gate-field { display: grid; gap: 6px; margin-bottom: 16px; text-align: left; }
.gate-field > span { font-size: .85rem; font-weight: 500; color: var(--muted); }
.gate-input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
  font: inherit; font-size: .95rem; line-height: 1.5; text-transform: uppercase;
  transition: border-color .2s, box-shadow .2s;
}
.gate-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gate-card .btn { width: 100%; justify-content: center; margin-bottom: 10px; }
.gate-card .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.gate-error { min-height: 1.4em; margin: 0; color: #e5484d; font-size: .9rem; }
.gate-privacy { margin: 6px 0 0; color: var(--subtle); font-size: .75rem; line-height: 1.5; }
.gate-card.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Header ---------- */
.vheader {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: 68px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 4%;
  background: linear-gradient(180deg, rgba(0, 0, 0, .75), transparent);
  transition: background .4s;
}
.vheader.solid { background: rgba(11, 10, 14, .96); }
.vheader-right { display: flex; align-items: center; gap: 14px; }

/* Search: an icon that opens into a box */
.vsearch {
  display: flex; align-items: center; height: 38px; border: 1px solid transparent; border-radius: 4px;
  transition: background .25s, border-color .25s;
}
.vsearch.open { background: rgba(0, 0, 0, .75); border-color: rgba(255, 255, 255, .85); }
.vsearch-toggle, .vsearch-clear {
  display: grid; place-items: center; width: 38px; height: 36px; padding: 0; border: 0; background: none;
  color: #fff; cursor: pointer;
}
.vsearch-toggle svg { width: 22px; height: 22px; }
.vsearch-clear svg { width: 16px; height: 16px; }
.vsearch-input {
  width: 0; padding: 0; border: 0; background: none; color: #fff; outline: none;
  font: 500 .92rem var(--sans); transition: width .3s cubic-bezier(.2,.7,.2,1);
}
.vsearch.open .vsearch-input { width: 240px; }
.vsearch-input::placeholder { color: rgba(255, 255, 255, .5); }
.vsearch-input::-webkit-search-cancel-button { display: none; }

/* Search results */
.results { min-height: 100svh; padding: 110px 4% 60px; }
.results-title { margin-bottom: 26px; font-size: clamp(1.1rem, 1.8vw, 1.5rem); font-weight: 600; color: rgba(255, 255, 255, .7); }
.results-title b { color: #fff; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(200px, 22vw, 300px), 1fr)); gap: 34px 8px; }
.results-empty { margin: 8vh 0 0; text-align: center; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

/* ---------- Rows ---------- */
.rows { position: relative; z-index: 2; padding: 100px 0 40px; }

/* "Hey Lydia," above the rows */
.greeting { padding: 100px 4% 0; }
.greeting h1 { margin: 0; font-size: clamp(1.7rem, 3.2vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.greeting p { margin: 4px 0 0; color: rgba(255, 255, 255, .6); font-size: clamp(.95rem, 1.3vw, 1.1rem); }
.browse:has(.greeting:not([hidden])) .rows { padding-top: 28px; }

/* History link in the header, and the History page */
.vhistory-link { display: inline-flex; align-items: center; gap: 6px; }
.vhistory-link svg { width: 18px; height: 18px; }
.vhistory-link.on { color: #fff; }
.history { min-height: 100svh; padding: 110px 4% 60px; max-width: 900px; }
.history-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.history-head h2 { margin: 0; font-size: clamp(1.4rem, 2.2vw, 1.9rem); font-weight: 800; }
.history-total { margin: 6px 0 0; color: var(--accent); font-weight: 600; }
.history-day { margin-bottom: 26px; }
.history-day h3 { display: flex; justify-content: space-between; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 1rem; }
.history-day h3 span { color: rgba(255,255,255,.55); font-weight: 500; font-size: .9rem; }
.history-item {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .2s;
}
.history-item:hover, .history-item:focus-visible { background: #24202b; outline: none; }
.history-thumb { flex: none; width: 120px; aspect-ratio: 16 / 9; border-radius: 6px; background: #241f2e center / cover no-repeat; }
.history-text { min-width: 0; display: grid; gap: 3px; }
.history-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-text span { color: rgba(255,255,255,.6); font-size: .9rem; }
.history-empty { color: var(--muted); line-height: 1.6; }
.row { margin-bottom: 3vw; }
.row-title { margin: 0 4% 10px; font-size: clamp(1.05rem, 1.6vw, 1.4rem); font-weight: 700; letter-spacing: -0.01em; }
.row-wrap { position: relative; }
.row-track {
  display: flex; gap: 8px; padding: 24px 4%; margin: -24px 0;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 4%;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.row-track::-webkit-scrollbar { display: none; }
.row-arrow {
  position: absolute; top: 0; bottom: 0; z-index: 4; width: 4%; min-width: 36px;
  display: grid; place-items: center; border: 0; cursor: pointer; color: #fff;
  background: rgba(11, 10, 14, .6); opacity: 0; transition: opacity .2s, background .2s;
}
.row-arrow svg { width: 28px; height: 28px; transition: transform .2s; }
.row-arrow:hover svg { transform: scale(1.25); }
.row-arrow.prev { left: 0; } .row-arrow.prev svg { transform: rotate(180deg); }
.row-arrow.prev:hover svg { transform: rotate(180deg) scale(1.25); }
.row-arrow.next { right: 0; }
.row-wrap:hover .row-arrow:not([disabled]) { opacity: 1; }
.row-arrow[disabled] { display: none; }
/* Category rows wrap onto more lines instead of scrolling (only Continue watching scrolls) */
.row.wraps .row-track {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(200px, 22.5vw, 340px), 1fr));
  gap: 30px 8px; padding: 0 4%; margin: 0; overflow: visible; scroll-snap-type: none;
}

/* Cards: on hover they lift with a shadow and show their title and buttons, but don't grow */
.vcard {
  position: relative; flex: 0 0 clamp(200px, 22.5vw, 340px); scroll-snap-align: start;
  border-radius: 6px; background: var(--vcard); cursor: pointer; outline: none; z-index: 1;
  transition: box-shadow .35s ease;
}
.vcard:hover, .vcard:focus-visible { z-index: 3; box-shadow: 0 14px 40px rgba(0,0,0,.75); transition-delay: .12s; }
.vcard-img { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #241f2e center / cover no-repeat; }

/* Placeholders: a soft shimmer while the page loads and until each thumbnail arrives */
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.vcard.loading, .placeholder-title {
  background: linear-gradient(100deg, #1d1a23 30%, #2b2733 50%, #1d1a23 70%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.vcard.loading .vcard-img { background-color: transparent; }
.row.placeholder .vcard { pointer-events: none; }
.row.placeholder .vcard-img::before { content: none; }
.placeholder-title { width: 170px; height: 22px; border-radius: 5px; margin: 0 4% 12px; }
@media (prefers-reduced-motion: reduce) { .vcard.loading, .placeholder-title { animation: none; } }
/* Shade behind the text: a light one, plus a darker one that fades in on hover (gradients can't animate) */
.vcard-img::before, .vcard-img::after { content: ""; position: absolute; inset: 0; }
.vcard-img::before { background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.75)); }
.vcard-img::after { background: linear-gradient(180deg, transparent 15%, rgba(0,0,0,.92)); opacity: 0; transition: opacity .35s ease; }
.vcard:hover .vcard-img::after, .vcard:focus-visible .vcard-img::after { opacity: 1; transition-delay: .12s; }
.vcard-name {
  position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 1; margin: 0;
  font-weight: 700; font-size: .95rem; line-height: 1.2; text-shadow: 0 1px 6px rgba(0,0,0,.8);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity .25s ease .1s;
}
.vcard:hover .vcard-name, .vcard:focus-visible .vcard-name { opacity: 0; transition: opacity .2s ease .12s; }
/* Continue watching: time left, in the top corner (the ✕ has the other one) */
.vcard-left {
  position: absolute; left: 8px; top: 8px; z-index: 1; max-width: calc(100% - 52px); padding: 3px 8px; border-radius: 4px;
  background: rgba(11, 10, 14, .78); color: #fff; font: 600 .74rem var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vcard-more-title {
  margin: 0 0 8px; font-weight: 700; font-size: .95rem; line-height: 1.2; text-shadow: 0 1px 6px rgba(0,0,0,.8);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vcard-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 3px; background: rgba(255,255,255,.25); }
.vcard-progress span { display: block; height: 100%; background: var(--btn); }
/* Buttons and details appear over the bottom of the picture on hover (a panel below would be clipped by the row) */
.vcard-more {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 10px 9px;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .3s ease;
}
.vcard:hover .vcard-more, .vcard:focus-visible .vcard-more {
  opacity: 1; transform: none; pointer-events: auto;
  transition: opacity .3s ease .22s, transform .4s cubic-bezier(.25,.8,.25,1) .22s;
}
.vcard-buttons { display: flex; gap: 8px; margin-bottom: 8px; }
.round-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid rgba(255,255,255,.5); background: rgba(42,42,42,.6); color: #fff; transition: border-color .15s;
}
.round-btn:hover { border-color: #fff; }
.round-btn svg { width: 16px; height: 16px; }
.round-btn.play { background: #fff; color: #000; border-color: #fff; }
.round-btn.play svg { margin-left: 2px; }
/* Continue watching: remove from the row (on hover; always on touch screens) */
.vcard-remove {
  position: absolute; top: 7px; right: 7px; z-index: 3; display: grid; place-items: center; width: 28px; height: 28px;
  padding: 0; border: 1.5px solid rgba(255,255,255,.55); border-radius: 50%; background: rgba(20,18,25,.75); color: #fff;
  cursor: pointer; opacity: 0; transition: opacity .2s ease, border-color .15s, background .15s;
}
.vcard-remove svg { width: 14px; height: 14px; }
.vcard:hover .vcard-remove, .vcard:focus-within .vcard-remove { opacity: 1; transition-delay: .15s, 0s, 0s; }
.vcard-remove:hover, .vcard-remove:focus-visible { border-color: #fff; background: rgba(20,18,25,.95); outline: none; }
@media (hover: none), (max-width: 700px) { .vcard-remove { opacity: 1; } }
.vcard-meta { margin: 0; font-size: .78rem; color: rgba(255,255,255,.7); display: flex; gap: 8px; flex-wrap: wrap; }
.vcard-meta .tag { color: var(--accent); font-weight: 600; }

.browse-empty { padding: 30vh 4% 0; text-align: center; color: var(--muted); }
.vfooter { padding: 30px 4% 50px; color: var(--subtle); font-size: .85rem; }
.vfooter a:hover { color: var(--text); }

/* ---------- Details modal ---------- */
.details {
  width: min(850px, 94vw); max-height: 92vh; margin: 4vh auto auto; padding: 0; border: 0; border-radius: 10px;
  background: #18151d; color: var(--text); overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.8);
}
.details::backdrop { background: rgba(0, 0, 0, .72); }
/* Opens with a soft zoom and fade, and closes the same way in reverse; the backdrop fades with it */
.details[open] { animation: pop .32s cubic-bezier(.25,.8,.25,1); }
.details[open]::backdrop { animation: fade .32s ease; }
.details.closing { animation: pop-out .2s ease-in forwards; }
.details.closing::backdrop { animation: fade-out .2s ease-in forwards; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes pop-out { to { opacity: 0; transform: scale(.97); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.details:focus { outline: none; }
.details-hero { position: relative; aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; }
.details-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(24, 21, 29, .75) 70%, #18151d 100%);
}
.details-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: #18151d; color: #fff; cursor: pointer;
}
.details-close svg { width: 18px; height: 18px; }
/* Computers: pulled up over the faded bottom of the picture */
.details-actions { position: relative; z-index: 1; margin-top: -150px; padding: 0 44px 26px; }
.details-left { margin: 12px 0 0; color: rgba(255,255,255,.75); font-size: .95rem; font-weight: 500; }
.details-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 18px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .7);
}
.details-body { padding: 4px 44px 40px; }
.details-meta { margin: 0 0 14px; color: rgba(255,255,255,.7); font-weight: 500; }
.details-meta .tag { color: var(--accent); }
.details-desc { margin: 0; line-height: 1.6; white-space: pre-line; color: rgba(255,255,255,.88); }
/* Parts (e.g. Act 1 and Act 2), like a list of episodes */
.details-parts { margin-top: 30px; }
.details-parts h3 { font-size: 1.3rem; margin-bottom: 12px; }
.details-partlist { display: grid; gap: 4px; }
.part {
  display: flex; align-items: center; gap: 18px; width: 100%; padding: 12px; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .2s;
}
.part:hover, .part:focus-visible { background: #24202b; outline: none; }
.part-img {
  position: relative; flex: none; width: 150px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden;
  display: grid; place-items: center; background: #241f2e center / cover no-repeat;
}
.part-img svg { width: 30px; height: 30px; color: #fff; opacity: 0; transition: opacity .2s; filter: drop-shadow(0 1px 6px rgba(0,0,0,.8)); }
.part:hover .part-img svg, .part:focus-visible .part-img svg { opacity: 1; }
.part-body { min-width: 0; flex: 1; }
.part-head { display: flex; align-items: baseline; gap: 12px; }
.part-no { font-size: 1.4rem; font-weight: 700; color: rgba(255,255,255,.55); min-width: 1ch; }
.part-head strong { font-size: 1rem; }
.part-len { margin-left: auto; color: rgba(255,255,255,.6); font-size: .9rem; white-space: nowrap; }
.part-body p { margin: 6px 0 0; color: rgba(255,255,255,.65); font-size: .88rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.details-more { margin-top: 34px; }
.details-more h3 { font-size: 1.3rem; margin-bottom: 14px; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.mini { border-radius: 6px; overflow: hidden; background: #24202b; cursor: pointer; transition: background .2s; }
.mini:hover { background: #2e2936; }
.mini-img { aspect-ratio: 16 / 9; background: #241f2e center / cover no-repeat; position: relative; }
.mini-img span { position: absolute; right: 8px; top: 8px; padding: 2px 7px; border-radius: 4px; background: rgba(0,0,0,.7); font: 500 .75rem var(--mono); }
.mini-body { padding: 10px 12px 14px; }
.mini-body strong { display: block; margin-bottom: 4px; }
.mini-body p { margin: 0; color: rgba(255,255,255,.65); font-size: .82rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Player ---------- */
.player-screen { position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden; }
.pv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-screen.idle, .player-screen.idle .pv { cursor: none; }

.pv-ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; transition: opacity .35s; }
.player-screen.idle .pv-ui { opacity: 0; }
.pv-top { padding: 22px 26px; background: linear-gradient(180deg, rgba(0,0,0,.7), transparent); pointer-events: auto; }
.pv-bottom { padding: 40px 26px 18px; background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); pointer-events: auto; }

.pv-btn {
  display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; background: none; color: #fff; cursor: pointer;
  transition: transform .15s;
}
.pv-btn:hover { transform: scale(1.18); }
.pv-btn svg { width: 30px; height: 30px; }
.pv-big svg { width: 36px; height: 36px; }
.pv-speed { width: auto; padding: 0 8px; font: 700 1rem var(--sans); white-space: nowrap; }

/* Angles: a button with a small menu above it */
.pv-angle-wrap { position: relative; }
.js-pv-angle, .js-pv-part { display: flex; align-items: center; gap: 7px; max-width: 220px; }
.js-pv-angle svg, .js-pv-part svg { flex: none; width: 24px; height: 24px; }
.js-pv-angle span, .js-pv-part span { overflow: hidden; text-overflow: ellipsis; }
.pv-angles, .pv-parts {
  position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 7; min-width: 190px; max-width: 280px; padding: 6px;
  border-radius: 8px; background: rgba(20, 18, 25, .96); box-shadow: 0 12px 34px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.08);
  animation: angles-in .18s cubic-bezier(.25,.8,.25,1);
}
@keyframes angles-in { from { opacity: 0; transform: translateY(6px); } }
.pv-angle, .pv-part {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 5px;
  background: none; color: rgba(255,255,255,.85); font: 600 .95rem var(--sans); text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-angle::before, .pv-part::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); }
.pv-angle:hover, .pv-angle:focus-visible, .pv-part:hover, .pv-part:focus-visible { background: rgba(255,255,255,.1); color: #fff; outline: none; }
.pv-angle.on, .pv-part.on { color: #fff; }
.pv-parts { min-width: 230px; }
.pv-part-len { margin-left: auto; padding-left: 14px; color: rgba(255,255,255,.55); font-weight: 500; font-size: .85rem; }
.pv-angle.on::before, .pv-part.on::before { background: var(--accent); border-color: var(--accent); }
.pv-note {
  position: absolute; top: 24px; right: 26px; z-index: 6; margin: 0; padding: 8px 14px; border-radius: 999px;
  background: rgba(20, 18, 24, .88); border: 1px solid rgba(255,255,255,.12); color: #fff; font-size: .88rem; font-weight: 600;
  pointer-events: none; animation: pop .25s cubic-bezier(.2,.7,.2,1);
}

.pv-timeline { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.pv-track { position: relative; flex: 1; height: 26px; cursor: pointer; outline: none; }
.pv-track::before, .pv-buffered, .pv-played {
  content: ""; position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; transition: height .15s, margin .15s;
}
.pv-track::before { right: 0; background: rgba(255,255,255,.25); }
.pv-buffered { background: rgba(255,255,255,.4); width: 0; }
.pv-played { background: var(--btn); width: 0; box-shadow: 0 0 12px rgba(124, 58, 237, .6); }
.pv-track:hover::before, .pv-track:hover .pv-buffered, .pv-track:hover .pv-played, .pv-track.dragging .pv-played { height: 7px; margin-top: -3.5px; }
.pv-thumb {
  position: absolute; top: 50%; left: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(167, 139, 250, .25); transform: scale(0); transition: transform .15s;
}
.pv-track:hover .pv-thumb, .pv-track.dragging .pv-thumb, .pv-track:focus-visible .pv-thumb { transform: scale(1); }
.pv-hovertime {
  position: absolute; bottom: 30px; transform: translateX(-50%); padding: 4px 8px; border-radius: 4px;
  background: rgba(20,20,20,.92); font: 600 .85rem var(--mono); white-space: nowrap; pointer-events: none;
}
.pv-remaining { min-width: 64px; text-align: right; font: 500 .95rem var(--mono); color: rgba(255,255,255,.9); }

.pv-controls { display: flex; align-items: center; gap: 10px; }
.pv-volume { display: flex; align-items: center; }
.pv-volslider { width: 0; opacity: 0; accent-color: var(--accent); transition: width .2s, opacity .2s; cursor: pointer; }
.pv-volume:hover .pv-volslider, .pv-volslider:focus { width: 90px; opacity: 1; margin-left: 4px; }
.pv-title {
  flex: 1; margin: 0 12px; text-align: center; font-weight: 700; font-size: 1.05rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pv-spinner {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: spin .8s linear infinite;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.player-screen.buffering .pv-spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.pv-flash {
  position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px;
  display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff;
  opacity: 0; pointer-events: none;
}
.pv-flash svg { width: 44px; height: 44px; }
.pv-flash.show { animation: flash .6s ease-out; }
@keyframes flash { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.4); } }

/* Casting to a TV: say so where the picture would be, and light up the cast button */
.player-screen.casting::before {
  content: "Playing on your TV"; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 2;
  padding: 14px 22px; border-radius: 10px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.85);
  font: 600 1.15rem var(--sans); pointer-events: none;
}
.js-pv-cast.on { color: var(--accent); }

/* Double-tap skip on touch screens: a bubble on that side saying how far */
.pv-skip {
  position: absolute; top: 50%; z-index: 4; display: grid; justify-items: center; gap: 4px; padding: 16px 20px; margin-top: -50px;
  border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; font: 700 .95rem var(--sans); pointer-events: none; opacity: 0;
}
.pv-skip.left { left: 12%; }
.pv-skip.right { right: 12%; }
.pv-skip svg { width: 34px; height: 34px; }
.pv-skip.show { animation: skip-pop .7s ease-out; }
@keyframes skip-pop { 0% { opacity: 0; transform: scale(.85); } 15% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; } }

/* Up next */
.upnext {
  position: absolute; right: 30px; bottom: 120px; z-index: 5; display: flex; gap: 16px; align-items: center;
  width: min(520px, calc(100vw - 40px)); padding: 14px; border-radius: 10px;
  background: rgba(20, 18, 24, .92); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 20px 50px rgba(0,0,0,.6);
  animation: pop .3s cubic-bezier(.2,.7,.2,1);
}
.upnext-thumb { flex: 0 0 180px; aspect-ratio: 16 / 9; border-radius: 6px; background: #241f2e center / cover; }
.upnext-label { margin: 0 0 4px; color: rgba(255,255,255,.7); font-size: .85rem; }
.upnext-count { font-family: var(--mono); color: var(--accent); }
.upnext-title { margin: 0 0 12px; font-weight: 700; font-size: 1.1rem; }
.upnext-actions { display: flex; gap: 8px; }
.upnext-actions .vbtn { padding: 8px 14px; font-size: .88rem; }
.upnext-actions .vbtn svg { width: 16px; height: 16px; }

/* ---------- Phones ---------- */
/* Footer at the bottom of the screen even when there are only a few videos */
.browse { min-height: 100svh; display: flex; flex-direction: column; }
.browse > .rows, .browse > .results { flex: 1 0 auto; }
.vfooter { margin-top: auto; }
.vsearch-cancel { display: none; }
@keyframes vsearch-in { from { opacity: 0; transform: translateX(14px); } }

@media (max-width: 700px) {
  /* Header: solid, so rows never sit under see-through text */
  .vheader { height: 58px; padding: 0 16px; background: rgba(11, 10, 14, .97); border-bottom: 1px solid rgba(255,255,255,.06); }
  .vheader-right { gap: 6px; }

  /* Search takes over the whole bar, with a Cancel button */
  .vheader:has(.vsearch.open) .vlogo, .vsearch.open ~ .js-signout, .vsearch.open ~ .js-history { display: none; }
  .vheader:has(.vsearch.open) .vheader-right { flex: 1; }
  .vsearch.open { flex: 1; }
  .vsearch.open .vsearch-input { width: 100%; flex: 1; font-size: 16px; }
  .vsearch.open ~ .vsearch-cancel { display: block; }
  /* Opening slides out smoothly; Cancel snaps straight back (shrinking while the bar rearranges looked messy) */
  .vsearch, .vsearch-input { transition: none; }
  .vsearch.open { transition: background .25s ease, border-color .25s ease; }
  .vsearch.open .vsearch-input { animation: vsearch-in .35s cubic-bezier(.25,.8,.25,1); }

  .rows { padding-top: 78px; }
  .row { margin-bottom: 26px; }
  .row-title { margin-bottom: 8px; padding: 0 16px; margin-left: 0; margin-right: 0; }
  .placeholder-title { margin: 0 16px 10px; width: 130px; height: 18px; }
  .row-track { padding: 4px 16px; margin: -4px 0; scroll-padding: 0 16px; }
  .row-arrow { display: none; }
  .vcard { flex-basis: 44vw; }
  .row.wraps .row-track { grid-template-columns: 1fr 1fr; gap: 16px 8px; padding: 0 16px; }
  /* No hover effect on phones (a tap would leave it stuck); a small press-in instead */
  .vcard:hover, .vcard:focus-visible { box-shadow: none; }
  .vcard:active { transform: scale(.97); transition: transform .12s ease; }
  .vcard-more { display: none; }
  .vcard:hover .vcard-name, .vcard:focus-visible .vcard-name { opacity: 1; }
  .vcard:hover .vcard-img::after, .vcard:focus-visible .vcard-img::after { opacity: 0; }
  .vcard-name { font-size: .85rem; }

  .results { padding: 78px 16px 40px; }
  .greeting { padding: 78px 16px 0; }
  .history { padding: 78px 16px 40px; }
  .history-thumb { width: 96px; }
  .vhistory-link span { display: none; } /* just the clock icon on phones */
  .results-grid { grid-template-columns: 1fr 1fr; gap: 16px 8px; }
  .browse-empty { padding: 30vh 24px 0; }
  .vfooter { padding: 24px 16px 32px; }

  /* Details: a full-screen page, picture on top and the title + Play underneath */
  .details { margin: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .details[open] { animation: slideup .42s cubic-bezier(.22,1,.36,1); }
  .details.closing { animation: slidedown .24s cubic-bezier(.4,0,1,1) forwards; }
  .details-hero::after { background: linear-gradient(180deg, transparent 70%, #18151d 100%); }
  .details-actions { margin-top: 0; padding: 14px 20px 6px; }
  .details-title { font-size: 1.6rem; margin-bottom: 14px; text-shadow: none; }
  .details-actions .vbtn { width: 100%; }
  .details-body { padding: 10px 20px 40px; }
  .details-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .part { gap: 12px; padding: 8px 0; }
  .part-img { width: 120px; }
  .part-img svg { opacity: 1; }
  .details-close { top: 10px; right: 10px; width: 36px; height: 36px; background: rgba(0, 0, 0, .65); }

  /* Player: sized to what's actually visible, so Safari's bars can't cover the controls */
  .player-screen { bottom: auto; height: 100dvh; }
  .pv-top { padding: 12px; }
  .pv-bottom { padding: 30px 12px 12px; }
  .pv-btn { width: 40px; height: 40px; }
  .pv-btn svg { width: 26px; height: 26px; }
  .js-pv-angle span, .js-pv-part span { display: none; } /* just the icon: the menu shows which angle is on */
  .js-pv-angle, .js-pv-part { padding: 0 6px; }
  .pv-volume, .js-pv-back10, .js-pv-fwd10 { display: none; }
  .pv-title { font-size: .9rem; }
  .pv-note { top: 14px; right: 12px; }
  .upnext { right: 10px; left: 10px; width: auto; bottom: 110px; }
  .upnext-thumb { flex-basis: 110px; }
}
@keyframes slideup { from { transform: translateY(28px); opacity: 0; } }
@keyframes slidedown { to { transform: translateY(28px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .vcard, .vcard *, .vcard-img::after, .details, .details::backdrop { transition: none !important; animation: none !important; }
}
