@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;400;600;700&display=swap');

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

:root {
  --bg: #0e0c0b;
  --surface: #1a1714;
  --surface-2: #211e1b;
  --border: #38322c;
  --text: #e8e0d0;
  --text-muted: #8a7f72;
  --accent: #c8923a;
  --accent-hover: #d9a84e;
  --radius: 8px;
  --retro-font: 'Josefin Sans', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
}

/* Film grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.052;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  mix-blend-mode: overlay;
}

a { color: inherit; text-decoration: none; }

/* ── Header ── */
.header {
  background: rgba(14, 12, 11, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  font-family: var(--retro-font);
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  white-space: nowrap;
}

.header-logo a { color: var(--accent); }

.search-form {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  max-width: 380px;
}

.search-form input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-form input:focus { border-color: var(--accent); }
.search-form input::placeholder { color: var(--text-muted); }

/* ── Buttons ── */
.btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  padding: 0.4rem 0.9rem;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn:hover { background: #2e2e2e; border-color: #444; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}

.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-secondary:hover { background: #2e2b27; border-color: #555; color: var(--text); }

.btn-tall {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-height: 2.6rem;
  justify-content: center;
}
.btn-subtitle {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.75;
  letter-spacing: 0.01em;
}

.btn-progress-wrap {
  display: inline-flex;
  flex-direction: column;
}
.btn-progress-wrap .btn {
  border-radius: var(--radius) var(--radius) 0 0;
}
.btn-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.btn-progress-fill {
  height: 100%;
  background: #fff;
  opacity: 0.9;
}

/* ── Page wrapper ── */
.main {
  padding: 1.5rem 2rem;
  max-width: 1440px;
  margin: 0 auto;
}

/* ── Library sections — shelved layout ── */
.library-section {
  position: relative;
  margin-bottom: 3.5rem;
  padding-top: 2rem;
  padding-bottom: 2rem; /* room for shelf: top surface (10px) + front face (18px) */
}

.library-section:first-of-type {
  padding-top: 0;
}

/* Shelf front face — the thick plank edge facing the viewer */
.library-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18px;
  background: linear-gradient(to bottom, #241a0c 0%, #110c06 55%, #0c0805 100%);
  border-top: 1px solid rgba(200,146,58,0.28);
  border-radius: 0 0 3px 3px;
  box-shadow:
    0 8px 24px rgba(0,0,0,0.72),
    0 2px 6px rgba(0,0,0,0.4);
}

/* Shelf top surface — the face cards rest on, same oblique angle as card depth */
.library-section::before {
  content: '';
  position: absolute;
  bottom: 18px; /* sits flush on top of the front face */
  left: -10px;
  width: calc(100% + 10px);
  height: 10px;
  background: linear-gradient(135deg, rgba(200,146,58,0.12) 0%, #2c1e0d 35%, #1e1409 100%);
  /* Same oblique projection as the card faces: D=10px upper-left */
  clip-path: polygon(10px 100%, 100% 100%, calc(100% - 10px) 0%, 0% 0%);
}

.section-title {
  font-family: var(--retro-font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Season selector ── */
.season-selector {
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.season-select-btn {
  background: none;
  border: none;
  font-family: var(--retro-font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  transition: color 0.15s;
}

.season-select-btn:hover { color: var(--accent); }

.season-select-arrow {
  color: var(--accent);
  font-size: 0.8rem;
  line-height: 1;
  margin-top: 1px;
}

.season-label-static {
  font-family: var(--retro-font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.season-picker {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.season-picker.open { display: block; }

.season-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0.65rem 0.9rem;
  font-family: var(--retro-font);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.12s, color 0.12s;
  text-align: left;
}

.season-option:hover { background: var(--surface-2); color: var(--accent); }

.season-option--active { color: var(--accent); }

.season-option-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.5rem;
}

/* ── Still Watching zone (full-bleed surface band above the library) ── */
.strip-zone {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem 2rem;
}

.strip-zone-inner {
  max-width: 1440px;
  margin: 0 auto;
}

.section-title--live {
  color: var(--accent);
}

/* ── Home Continue Watching strip ── */

.home-strip {
  display: flex;
  gap: 1.75rem;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: 16px;
  margin-top: -16px;
  padding-bottom: 0.75rem;
  padding-left: 10px;
}

.home-strip::-webkit-scrollbar { display: none; }

.home-strip .card {
  flex-shrink: 0;
  width: 156px;
}

.strip-card-wrap {
  position: relative;
  flex-shrink: 0;
  width: 156px;
}
.strip-card-wrap .card {
  width: 100%;
}

.strip-dismiss {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
  font-size: 0.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  z-index: 2;
}
.strip-card-wrap:hover .strip-dismiss { opacity: 1; }
.strip-dismiss:hover { color: var(--text); }

/* Still Watching zone: 16:9 landscape cards */
.strip-zone .card .card-poster {
  padding-top: 0 !important;
  aspect-ratio: 16 / 9;
}

/* Portrait library strips: standard 2:3 poster cards */
.home-strip--portrait .card {
  width: 118px;
}

/* First card in any strip: pin pill to left edge so it doesn't get clipped */
.home-strip .card:first-child .card-info,
.home-strip--portrait .card:first-child .card-info {
  left: 0;
  transform: none;
}

/* Still Watching strip: no lift, amber ring on hover */
.strip-zone .card:hover {
  transform: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* Still Watching cards: revert to original look — clipped poster, text always visible */
.strip-zone .card {
  overflow: hidden;
}

.strip-zone .card .card-info {
  position: static;
  opacity: 1;
  transform: none;
  background: none;
  border-radius: 0;
  padding: 0.45rem 0.55rem 0.55rem;
  pointer-events: auto;
  z-index: auto;
  transition: none;
  width: auto;
}

.strip-zone .card:hover .card-info {
  opacity: 1;
  transition: none;
}

.strip-zone .card .card-title {
  font-size: 0.77rem;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: unset;
}

.strip-zone .card .card-year {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.75;
}

/* Strip section header */
.strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.strip-header-title {
  font-family: var(--retro-font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

/* Mood strips — Playfair Display, italic, amber */
.strip-header--mood .strip-header-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
  font-size: 1.4rem;
  color: var(--accent);
}

/* Invisible spacer to hold empty slots so the more-btn stays at slot 8 */
.card-spacer {
  width: 118px;
  flex-shrink: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 8th-slot "show more" card */
.strip-more-btn {
  width: 118px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  gap: 0.35rem;
  transition: border-color 0.15s, color 0.15s;
}

.strip-more-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.strip-more-count {
  font-family: var(--retro-font);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.strip-more-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.strip-progress-bar {
  height: 2px;
  background: var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.strip-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Card grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
  padding-top: 16px;
  margin-top: -16px;
  overflow: visible;
}
.grid--6 { grid-template-columns: repeat(6, 1fr); }

.card {
  display: block;
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: visible;
  border: 1px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  border-color: #5a4f42;
  z-index: 2;
}


.card-poster {
  position: relative;
  padding-top: 150%;   /* 2:3 default (movies) */
  background: var(--surface-2);
  overflow: hidden;
  border-radius: var(--radius);
}

.card--dim { opacity: 0.4; pointer-events: none; }

.card--wide .card-poster {
  padding-top: 56.25%; /* 16:9 for episodes */
}

.card-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.card:hover .card-poster img { transform: scale(1.03); }

.card-poster .no-poster {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #444;
}

.card-info {
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  background: rgba(10, 8, 6, 0.88);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  opacity: 0;
  transition: opacity 0.15s ease 0s;
  pointer-events: none;
  z-index: 10;
}

.card:hover .card-info {
  opacity: 1;
  transition: opacity 0.15s ease 1s;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

.card-year {
  display: none;
}

/* Paired-episode second title line on show-page cards */
.card--wide .card-year--paired {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Paired-episode title on detail page */
.detail-title--paired .paired-title-b {
  color: var(--text-muted);
  font-size: 0.85em;
}
.detail-title--paired .paired-title-sep {
  color: var(--text-muted);
  font-size: 0.85em;
}

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}

.empty p { margin-bottom: 0.5rem; font-size: 0.95rem; }
.empty code {
  background: var(--surface-2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* ── Show page banner + header section ── */
.show-detail-section {
  position: relative;
  margin: -1.5rem -2rem 0;
  padding: 2rem 2rem 5rem;
  overflow: hidden;
}

.show-banner {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.show-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: blur(5px) brightness(0.38) saturate(0.7);
  transform: scale(1.12);
}

.show-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 75%, var(--bg) 100%);
}

.show-detail-section .back-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  margin-bottom: 1.5rem;
}

/* ── Show page header ── */
.show-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

.show-info-box {
  flex: 1;
  background: rgba(14,12,11,0.62);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
}

.show-poster {
  width: 160px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-2);
  display: block;
}

.show-poster--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #444;
}

.show-header-info { padding-top: 0.25rem; }

.show-play-btns {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.show-begin-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.12s;
}
.show-begin-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Detail page ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
  transition: color 0.15s;
}

.back-link:hover { color: var(--text); }

.detail-layout {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
  align-items: flex-start;
}

.detail-left {
  flex-shrink: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-poster { width: 100%; }

.detail-left--wide { width: 320px; }

.detail-poster--wide .detail-poster-img {
  aspect-ratio: 16 / 9;
  object-position: center;
}


.crew-collapsible { align-self: flex-start; display: flex; flex-direction: column; gap: 0; }
.crew-box-hidden { display: none !important; }

.show-crew-box--pinned {
  background: none;
  border: none;
  padding: 0 0 0.5rem 0;
  width: auto;
  gap: 0.75rem 1.5rem;
}

.crew-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: color 0.15s, border-color 0.15s;
}
.crew-toggle:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }
.crew-toggle-arrow { font-size: 0.65rem; margin-left: 0.3rem; }

.show-crew-box {
  flex-shrink: 0;
  width: 460px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  align-self: flex-start;
}
.show-crew-box--col { grid-template-columns: 1fr; width: auto; min-width: 180px; max-width: 260px; flex-shrink: 0; }

.crew-section { display: flex; flex-direction: row; flex-wrap: wrap; gap: 0.15rem 0.6rem; }

.crew-role {
  flex: 0 0 100%;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.crew-name {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
  transition: color 0.12s;
}

.crew-name:hover { color: var(--accent); }

.detail-poster-img,
.detail-poster-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  display: block;
}

.detail-poster-img { object-fit: cover; background: var(--surface-2); border: 3px solid var(--bg); }

.detail-poster-placeholder {
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #444;
}

.detail-info { flex: 1; min-width: 200px; padding-top: 0.25rem; }

.detail-show-name {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.detail-title {
  font-family: var(--retro-font);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin-bottom: 0.6rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  align-items: center;
}

.fav-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.1rem 0.35rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.12s, border-color 0.12s;
}
.fav-btn:hover { color: #f5c518; border-color: #f5c518; }
.fav-btn--on { color: #f5c518; border-color: #f5c518; }
.fav-guest-err { color: #e06c6c; font-size: 0.78rem; margin-left: 0.3rem; vertical-align: middle; }

.player-fav-star {
  font-size: 0.85rem;
  color: #f5c518;
  margin-left: 0.4rem;
  flex-shrink: 0;
}

.badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.detail-description {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #bbb;
  margin-bottom: 1.75rem;
  max-width: 580px;
  white-space: pre-line;
}

.show-genres {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.resume-notice {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Video player ── */
.player-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.player-wrap video {
  width: 100%;
  display: block;
  min-height: 120px;
  max-height: 72vh;
  background: #000;
}

/* ── Edit page ── */
.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.75rem;
}

.edit-container { max-width: 680px; }

.form-group { margin-bottom: 1.2rem; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: #555; }

textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* TMDB fetch box */
.tmdb-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.75rem;
}

.tmdb-box-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.tmdb-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tmdb-row input { flex: 1; min-width: 140px; }
.tmdb-row select { width: auto; flex-shrink: 0; }

.tmdb-result {
  display: none;
  gap: 0.85rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  align-items: flex-start;
}

.tmdb-result.visible { display: flex; }

.tmdb-result img { width: 56px; border-radius: 4px; flex-shrink: 0; }

.tmdb-result-info { font-size: 0.85rem; }
.tmdb-result-info strong { display: block; margin-bottom: 0.15rem; }
.tmdb-result-info span { color: var(--text-muted); font-size: 0.8rem; }

.poster-preview { margin-top: 0.75rem; }
.poster-preview img { width: 110px; border-radius: var(--radius); display: block; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

/* ── Episode navigation arrows ── */
.ep-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  width: 44px;
  height: 72px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.ep-nav:hover {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

.ep-nav--prev { left: 0.5rem; }
.ep-nav--next { right: 0.5rem; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.1rem;
  font-size: 0.875rem;
  z-index: 300;
  animation: fadeup 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

@keyframes fadeup {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .header { padding: 0 1rem; gap: 0.75rem; }
  .main { padding: 1rem; }
  .strip-zone { padding: 1rem 1rem 1.25rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 0.65rem; }
  .detail-layout { flex-direction: column; gap: 1.5rem; }
  .detail-left { width: 140px; }
  .detail-left--wide { width: 100%; }
  .show-crew-box { width: 100%; grid-template-columns: 1fr 1fr; }
  .detail-title { font-size: 1.35rem; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── Hamburger button ── */
.hamburger {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border-radius: var(--radius);
  transition: background 0.15s;
  flex-shrink: 0;
}

.hamburger:hover { background: var(--surface-2); }

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

/* ── Sidebar backdrop ── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Sidebar panel ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 260px;
  background: #131110;
  border-right: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar.open { transform: translateX(0); }

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  height: 60px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 0.75rem;
}

.sidebar-logo {
  font-family: var(--retro-font);
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  flex: 1;
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.35rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.sidebar-close:hover { color: var(--text); background: var(--surface-2); }

.sidebar-nav {
  padding: 0.5rem 0;
  flex: 1;
}

.sidebar-primary-links {
  margin: 0.5rem 0.75rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.sidebar-link--primary {
  padding: 0.6rem 1rem;
}

.sidebar-link--primary:hover {
  background: rgba(255,255,255,0.06);
}

.sidebar-primary-links .sidebar-link--primary + .sidebar-link--primary {
  border-top: 1px solid var(--border);
}

.sidebar-section-label {
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 1rem 1.25rem 0.3rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  color: #aaa;
  transition: background 0.12s, color 0.12s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.sidebar-icon {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.65;
  font-size: 0.85rem;
}

.sidebar-footer {
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
}

/* ── Card badge (e.g. VHS) ── */
.card-badge {
  position: absolute;
  bottom: 0.4rem;
  left: 0.4rem;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.8);
  padding: 0.1rem 0.35rem;
}

/* ── Page section title (continue watching, recently added) ── */
.page-section-title {
  font-family: var(--retro-font);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

/* ── Continue Watching edit mode ── */
.cw-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.cw-edit-toggle {
  font-size: 0.78rem;
}

.cw-card-wrap {
  position: relative;
}

.cw-dismiss {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  border: none;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  line-height: 1;
  transition: background 0.12s, transform 0.12s;
}

.cw-dismiss:hover {
  background: #fff;
  transform: scale(1.1);
}

body.cw-editing .cw-dismiss {
  display: flex;
}

body.cw-editing .cw-card-wrap .card {
  pointer-events: none;
  opacity: 0.75;
}

/* ── Search page ── */
.search-hero {
  margin-bottom: 2.5rem;
}

.search-hero-form {
  width: 100%;
}

.search-hero-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-hero-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-hero-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.85rem 1rem 0.85rem 2.9rem;
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.search-hero-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,146,58,0.12);
}

.search-hero-input::placeholder { color: var(--text-muted); }

.search-count-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  padding: 0.1rem 0.45rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: inherit;
  text-transform: none;
  opacity: 0.75;
}

.search-expanded-note {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0.85rem;
  background: rgba(200,146,58,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.search-no-results {
  padding-top: 2.5rem;
  text-align: center;
}

.search-no-results-msg {
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.similar-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.5rem;
  margin-top: 2rem;
}

.similar-reason-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.3rem;
  margin-bottom: 1.2rem;
}

/* ── Card title inline badge (VHS etc.) ── */
.card-title-badge {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.05rem 0.3rem;
  vertical-align: middle;
  margin-left: 0.2rem;
  position: relative;
  top: -1px;
}

/* ── Detail title row (title + badge inline) ── */
.detail-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.detail-title-row .detail-title { margin-bottom: 0; }

/* ── Category browse tiles ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.category-tile {
  display: block;
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
}

.category-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border-color: var(--border);
}

.category-tile-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.category-tile:hover .category-tile-bg { opacity: 0.65; }

.category-tile-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 0.85rem 0.7rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.category-tile-no-img {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 2rem;
}

/* ── Player page ── */
/* ── Player page — video always fills the screen, controls float above ── */
body.player-page {
  background: #000;
  overflow: hidden;
  height: 100vh;
  margin: 0;
  padding: 0;
}

.player-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  display: block;
  z-index: 1;
}

/* Dim overlay — sits above video, below controls; fades in with UI */
.player-dim {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.35s ease;
}
.player-dim.visible {
  background: rgba(0, 0, 0, 0.3);
}

/* Top overlay — title + close + fav star */
.player-top {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.player-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.player-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(14, 12, 11, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.player-close:hover {
  background: rgba(200, 146, 58, 0.25);
  border-color: rgba(200, 146, 58, 0.5);
  color: var(--accent);
}

.player-display-title {
  font-family: var(--retro-font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}

/* Toolbar wrapper — hidden by default, slides up when .visible */
.player-toolbar-wrap {
  position: fixed;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  padding: 0 2rem;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.player-toolbar-wrap.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Toolbar panel */
.player-toolbar {
  max-width: 900px;
  margin: 0 auto;
  background: rgba(10, 9, 8, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(200, 146, 58, 0.2);
  border-radius: 14px;
  padding: 0.75rem 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Seek row */
.player-seek-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

/* Custom amber-fill seek bar */
.player-seek-bar {
  flex: 1;
  height: 3px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--seek-fill, 0%),
    rgba(255, 255, 255, 0.15) var(--seek-fill, 0%),
    rgba(255, 255, 255, 0.15) 100%
  );
  border-radius: 2px;
  outline: none;
  border: none;
}
.player-seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(200, 146, 58, 0.6);
}
.player-seek-bar::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.player-time {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  min-width: 2.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Controls row */
.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-controls-left,
.player-controls-right {
  display: flex;
  align-items: center;
  gap: 0.05rem;
}

.player-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
  line-height: 1;
}
.player-btn:hover {
  background: rgba(200, 146, 58, 0.12);
  color: var(--accent);
}
.player-btn--play {
  padding: 0.45rem 0.7rem;
  color: rgba(255, 255, 255, 0.9);
}
.player-btn--play:hover {
  background: rgba(200, 146, 58, 0.15);
  color: var(--accent);
}

/* Volume slider */
.player-vol-slider {
  width: 68px;
  height: 3px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(255, 255, 255, 0.7) var(--vol-fill, 100%),
    rgba(255, 255, 255, 0.15) var(--vol-fill, 100%),
    rgba(255, 255, 255, 0.15) 100%
  );
  border-radius: 2px;
  outline: none;
  border: none;
  margin-right: 0.1rem;
}
.player-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}
.player-vol-slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  cursor: pointer;
}

/* ── Creator search result ── */
.creator-result {
  margin-bottom: 2.5rem;
}

.creator-result-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  width: fit-content;
}

.creator-result-photo {
  width: 64px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
  display: block;
}

.creator-result-photo--placeholder {
  background: var(--surface-2);
}

.creator-result-hero:hover .creator-result-name { color: var(--accent); }

.creator-result-hero-info { display: flex; flex-direction: column; gap: 0.2rem; }

.creator-result-name {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  transition: color 0.12s;
}

.creator-result-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.creator-result-show {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

/* ── Favorites page ── */
.fav-grid {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

/* ── Favorites page typography ── */
.fav-page-title {
  font-family: var(--retro-font);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.fav-section-title {
  font-family: var(--retro-font);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── Guest wall (favorites + elsewhere) ── */
.guest-wall { max-width: 36rem; margin: 2rem 0; }
.guest-wall-text { font-size: 1.4rem; font-weight: 600; color: var(--text); margin: 0 0 0.5rem; }
.guest-wall-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* ── Favorites page episode groups ── */
.fav-ep-group {
  margin-bottom: 1.75rem;
  padding-left: 1.5rem;
}

.fav-ep-show-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.creator-result-show-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.creator-result-ep-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

/* ── Settings page ── */
.settings-page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.settings-gear-icon {
  width: 38px;
  height: 38px;
  color: var(--text);
  flex-shrink: 0;
}

.settings-page-title {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.settings-section {
  max-width: 720px;
  margin-bottom: 2.75rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-of-type { border-bottom: none; }

.settings-section--dim { opacity: 0.55; }

.settings-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.settings-coming-soon {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

.settings-placeholder-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 540px;
}

.settings-section-title--lg {
  font-size: 1.25rem;
}

/* ── Profiles ── */
.profile-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.4rem;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 88px;
  text-align: center;
}

.profile-avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
}

/* Crown badge — floats above-right of any avatar circle */
.profile-avatar-wrap {
  position: relative;
  display: inline-flex;
}
.profile-crown-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  line-height: 1;
  pointer-events: none;
  font-size: 0.85rem;
  filter: sepia(1) saturate(4) hue-rotate(5deg) brightness(1.1) drop-shadow(0 0 1px #000);
}
.profile-crown-badge--sm {
  top: -6px;
  font-size: 0.65rem;
}

.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  border: 3px solid #2a2826;
  transition: transform 0.15s, width 0.15s, height 0.15s;
}

.profile-card:not(.profile-card--active) .profile-avatar-btn:hover .profile-avatar {
  transform: scale(1.06);
}

.profile-avatar--add {
  background: var(--surface-2) !important;
  color: var(--text-muted);
  border: 2px dashed var(--border);
  font-weight: 400;
}

.profile-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-active-tag {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.profile-active-tag--ghost { color: transparent; }

.profile-edit-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
}
.profile-edit-link:hover { color: var(--accent); }

/* Selected profile — bigger and highlighted */
.profile-card--active { width: 108px; }

.profile-card--active .profile-avatar {
  width: 84px;
  height: 84px;
  font-size: 2.1rem;
}

.profile-card--active .profile-name {
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}

.profile-editor {
  margin-top: 1.6rem;
  padding: 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 420px;
}

.profile-editor-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.profile-editor-fields {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.profile-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
}
.profile-input:focus { border-color: var(--accent); outline: none; }

.profile-color-input {
  width: 44px;
  height: 40px;
  padding: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
}

.profile-editor-actions {
  display: flex;
  gap: 0.6rem;
}

.profile-delete-btn {
  color: #e06666;
  border-color: #5a2a2a;
}
.profile-delete-btn:hover { background: #3a1f1f; }

/* ── Profile edit page ── */
.profile-edit-page {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-top: 0.5rem;
}

.pep-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pep-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--border);
}

.pep-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.pep-avatar-upload-btn {
  font-size: 0.82rem;
  color: var(--accent);
  cursor: pointer;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: background 0.12s;
}
.pep-avatar-upload-btn:hover { background: var(--surface); }

.pep-upload-status {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pep-fields {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.pep-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pep-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pep-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}
.pep-input:focus { border-color: var(--accent); outline: none; }

.pep-color-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.pep-color-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pep-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.pep-swatch {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 3px solid transparent;
  outline: none;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.pep-swatch:hover,
.pep-swatch:focus-visible {
  transform: scale(1.15);
  border-color: var(--text);
}

.pep-swatch--sel {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.tv-mode .pep-swatch {
  width: 3.2rem;
  height: 3.2rem;
}

.tv-mode .pep-swatch:focus-visible {
  outline: 4px solid var(--accent);
  outline-offset: 3px;
  transform: scale(1.15);
}

.tv-mode .pep-swatch--sel {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.pep-pic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.4rem;
  max-width: 32rem;
}

.pep-pic-btn {
  padding: 0;
  border: 3px solid transparent;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  background: none;
  transition: border-color 0.15s, transform 0.15s;
  aspect-ratio: 1;
}

.pep-pic-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pep-pic-btn:hover,
.pep-pic-btn:focus-visible {
  border-color: var(--text);
  transform: scale(1.04);
  outline: none;
}

.pep-pic-btn--sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.pep-pic-color-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pep-color-icon {
  font-size: 2rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  pointer-events: none;
  line-height: 1;
}

.pep-swatches--inline {
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.5rem;
  max-width: 32rem;
}

.pep-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-avatar-upload {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profile-avatar-upload-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-avatar-status {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0;
}

.settings-row--top { align-items: flex-start; }

.settings-row-info { flex: 1; min-width: 0; }

.settings-row-label {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.settings-row-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.settings-stat-line {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.6rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: background 0.18s;
}

.toggle-track::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.18s, background 0.18s;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(18px);
  background: #fff;
}

/* Segmented control */
.segmented-control {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  flex-shrink: 0;
}

.seg-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: inherit;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.seg-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}

/* Number input */
.settings-number-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.settings-number-input {
  width: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.settings-number-input:focus { border-color: var(--accent); }

.settings-number-unit {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Resume threshold table */
.settings-threshold-table {
  border-collapse: collapse;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.settings-threshold-table th {
  text-align: center;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0 0.75rem 0.5rem;
  white-space: nowrap;
}

.settings-threshold-table th:first-child { text-align: left; }

.settings-threshold-table td {
  padding: 0.35rem 0.75rem;
  text-align: center;
  vertical-align: middle;
}

.settings-threshold-table td:first-child { text-align: left; }

.settings-threshold-label {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  padding-right: 1rem !important;
}

/* Show list */
.settings-show-list {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-show-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.settings-show-row:last-child { border-bottom: none; }

.settings-show-name {
  font-size: 0.85rem;
}

/* ── Autoplay overlay ── */
.autoplay-overlay {
  position: fixed;
  bottom: 7.5rem;
  right: 2.5rem;
  z-index: 20;
  display: none;
  animation: fadein 0.2s ease;
}

.autoplay-card {
  background: rgba(16, 16, 16, 0.93);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 0.05rem 1.2rem 0.1rem;
  min-width: 220px;
  max-width: 280px;
}

.autoplay-label {
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.3rem;
}

.autoplay-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.autoplay-bar-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 1px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.autoplay-bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.25s linear;
}

.autoplay-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

.autoplay-play-btn { color: #fff; }

@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Artist page ── */
.artist-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.artist-left {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.artist-photo {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.artist-photo--placeholder {
  background: var(--surface-2);
}

.artist-name {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.75rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.artist-right {
  flex: 1;
  min-width: 0;
  padding-top: 0.25rem;
}

.artist-bio {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #bbb;
  margin-bottom: 2rem;
  max-width: 580px;
}

.artist-more { }

.artist-more-header {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
}

.artist-more-section {
  margin-bottom: 2rem;
}

.artist-more-subheader {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.artist-shows-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.artist-show-item {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .artist-layout { flex-direction: column; gap: 1.5rem; }
  .artist-left { width: 140px; align-items: flex-start; text-align: left; }
}

/* ── MKV custom seek controls ── */
.mkv-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.1rem 0;
}

.mkv-seek-bar {
  flex: 1;
  cursor: pointer;
  accent-color: var(--accent);
  height: 4px;
}

.mkv-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 3rem;
  font-variant-numeric: tabular-nums;
}

/* ── Detail hero (banner + content section) ── */
.detail-hero {
  position: relative;
  margin: -1.5rem -2rem 2rem;
  padding: 1.5rem 2rem 5rem;
  overflow: hidden;
  min-height: calc(100vh - 60px);
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.detail-backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: blur(5px) brightness(0.38) saturate(0.7);
  transform: scale(1.1);
}

.detail-backdrop-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 75%, var(--bg) 100%);
}

.detail-hero .back-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  margin-bottom: 1.25rem;
}

.detail-hero .detail-layout {
  position: relative;
  z-index: 1;
}

.detail-hero .detail-info {
  background: rgba(14,12,11,0.62);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
}

@media (max-width: 768px) {
  .detail-hero { margin: -1rem -1rem 1.5rem; padding: 1rem 1rem 2rem; }
  .show-detail-section { margin: -1rem -1rem 0; padding: 1.25rem 1rem 2rem; }
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.5s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.spinner--lg {
  width: 44px;
  height: 44px;
  border-width: 4px;
  margin-right: 0;
}

.spinner--card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-width: 3px;
  margin-right: 0;
}

.player-spinner-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Devices (Settings) ── */
.device-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
}
.device-card-head {
  font-family: var(--retro-font, inherit);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}
.device-card-head--bare { margin: 1.5rem 0 0.6rem; }

.device-mono { font-family: monospace; }
.device-dim { color: var(--text-muted); }

/* This device — key/value rows */
.device-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}
.device-k { color: var(--text-muted); }
.device-v { color: var(--text); }

/* Connect table */
.device-conn { width: 100%; border-collapse: collapse; }
.device-conn td { padding: 0.35rem 0; font-size: 0.88rem; vertical-align: middle; }
.device-conn-label { color: var(--text); white-space: nowrap; padding-right: 1.2rem !important; }

/* Pills */
.device-pill {
  display: inline-block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  padding: 0.08rem 0.4rem;
  vertical-align: middle;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.device-pill--ok   { color: #5fa85f; border-color: #3c633c; }
.device-pill--off  { color: var(--text-muted); }
.device-pill--this { color: var(--accent); border-color: var(--accent); }

/* LAN toggle row */
.device-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; transition: 0.2s;
}
.switch-slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: var(--text-muted); border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .switch-slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); background: #fff; }

/* Connected devices table */
.device-table { width: 100%; border-collapse: collapse; }
.device-table th {
  text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); font-weight: 500; padding: 0 0.6rem 0.5rem; border-bottom: 1px solid var(--border);
}
.device-table td {
  padding: 0.6rem; font-size: 0.88rem; color: var(--text);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.device-table tr:last-child td { border-bottom: none; }
.device-action { text-align: right; width: 1%; white-space: nowrap; }
.device-revoke {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.8rem; padding: 0.2rem 0.3rem;
  transition: color 0.12s;
}
.device-revoke:hover { color: #d66; text-decoration: underline; }
.device-key-btn {
  background: none; border: 1px solid var(--accent); cursor: pointer;
  color: var(--accent); font-size: 0.78rem; padding: 0.15rem 0.5rem;
  border-radius: 4px; margin-right: 0.4rem; transition: background 0.12s, color 0.12s;
}
.device-key-btn:hover { background: var(--accent); color: #1a1715; }
.device-key-err { display: block; color: #e06c6c; font-size: 0.75rem; margin-top: 0.25rem; }

/* ── Permission error (edit pages) ── */
.perm-error {
  color: #e06c6c;
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  background: rgba(224, 108, 108, 0.08);
  border: 1px solid rgba(224, 108, 108, 0.25);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

/* ── Mood checkboxes (edit page) ── */
.mood-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.mood-check-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.65rem;
  transition: border-color 0.12s, color 0.12s;
  user-select: none;
}

.mood-check-label:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
}

.mood-check-label input { display: none; }

/* =========================================================
   Video frame scrubber (edit pages)
   ========================================================= */

.scrubber-section {
  margin-top: 2.5rem;
  border-top: 1px solid var(--surface-2);
  padding-top: 1.5rem;
}

.scrubber-section-title {
  font-family: var(--retro-font);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.scrubber-ep-pick {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  max-width: 420px;
}

.scrubber-wrap {
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.scrubber-video-wrap {
  position: relative;
  background: #000;
  cursor: default;
  line-height: 0;
}

.scrubber-video-wrap video {
  width: 100%;
  height: auto;
  display: block;
}

.crop-handle {
  position: absolute;
  width: 11px;
  height: 11px;
  background: var(--accent);
  border-radius: 2px;
  z-index: 2;
}
.crop-handle--nw { top: -6px;    left: -6px;    cursor: nw-resize; }
.crop-handle--ne { top: -6px;    right: -6px;   cursor: ne-resize; }
.crop-handle--sw { bottom: -6px; left: -6px;    cursor: sw-resize; }
.crop-handle--se { bottom: -6px; right: -6px;   cursor: se-resize; }

.scrubber-crop-box {
  position: absolute;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
  z-index: 5;
  pointer-events: auto;
}

.scrubber-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--surface-2);
}

.scrubber-time {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.scrubber-spacer { flex: 1; }

.scrubber-jump-inline {
  width: 68px;
  background: var(--surface-2);
  border: 1px solid var(--surface-3, #3a3532);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 0.2rem 0.4rem;
  outline: none;
  margin-left: 1rem;
}
.scrubber-jump-inline:focus {
  border-color: var(--accent);
  color: var(--text);
}
.scrubber-jump-inline::placeholder { color: var(--text-muted); opacity: 0.5; }

.scrubber-seekbar-wrap {
  padding: 0.5rem 1rem 0.4rem;
  background: var(--surface);
}

.scrubber-seekbar {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  outline: none;
  cursor: pointer;
  display: block;
}

.scrubber-seekbar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}

.scrubber-seekbar::-webkit-slider-thumb:hover { transform: scale(1.3); }

.scrubber-seekbar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.scrubber-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 1rem 0.85rem;
  background: var(--surface);
  border-top: 1px solid var(--surface-2);
}

/* =========================================================
   Before/after frame confirm modal
   ========================================================= */

.frame-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.frame-modal {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.frame-modal-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1rem 0;
}

.frame-modal-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.frame-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TV Mode — cursor hidden, hover suppressed, focus-visible takes over
   Activated by body.tv-mode (set via UA detection or crown \ toggle)
   ═══════════════════════════════════════════════════════════════════════════ */

.tv-mode,
.tv-mode * { cursor: none !important; }

/* Suppress card hover effects — keyboard focus replaces them */
.tv-mode .card:hover .card-poster img { transform: none; }
.tv-mode .card:hover { opacity: 1; }
.tv-mode .card:hover .card-poster::after { opacity: 0; }

/* Base focus ring for all interactive elements */
.tv-mode a:focus-visible,
.tv-mode button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Card focus — amber glow + lift */
.tv-mode .card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 0;
  border-radius: 6px;
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 0 24px rgba(200, 146, 58, 0.45);
  transition: transform 0.12s, box-shadow 0.12s;
}

/* Wide card (episodes) */
.tv-mode .card--wide:focus-visible {
  transform: scale(1.02) translateY(-2px);
}

/* Strip dismiss button — still reachable via Tab */
.tv-mode .strip-dismiss:focus-visible {
  outline: 2px solid var(--accent);
  border-radius: 50%;
}

/* Player buttons */
.tv-mode .player-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 50%;
}

/* Seek / volume sliders */
.tv-mode input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Season picker options */
.tv-mode .season-option:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}

/* Header action buttons */
.tv-mode .header-action-btn:focus-visible { background: var(--surface-2); }

/* Toggle switch labels (made focusable via tabindex in TV mode) */
.tv-mode label.toggle-switch:focus,
.tv-mode label.switch:focus {
  outline: 4px solid var(--accent);
  outline-offset: 3px;
  border-radius: 24px;
}

/* Sidebar links + close button */
.tv-mode .sidebar-link:focus-visible,
.tv-mode .sidebar-close:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}

/* Episode nav arrows: always visible in TV mode */
.tv-mode .ep-nav { display: flex !important; }

/* ── 10-foot layout: scale UP for TV viewing distance ── */

/* Grid: fewer, larger columns (≈5 on 1920px, ≈4 on 1280px) */
.tv-mode .grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Still Watching strip: wider landscape cards */
.tv-mode .home-strip { gap: 2.5rem; }
.tv-mode .home-strip .card { width: 240px; }
.tv-mode .strip-card-wrap { width: 240px; }
.tv-mode .strip-card-wrap .card { width: 100%; }

/* Portrait library strips: bigger poster cards */
.tv-mode .home-strip--portrait .card { width: 180px; }

/* Section labels */
.tv-mode .section-title {
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
}

/* Grid card label: show after 3s of sustained focus */
.tv-mode .card:focus-visible .card-info {
  opacity: 1;
  transition: opacity 0.25s ease 3s;
}

/* Card label text */
.tv-mode .card-title { font-size: 1rem; }

/* Strip card label text */
.tv-mode .strip-zone .card .card-title { font-size: 0.9rem; }
.tv-mode .strip-zone .card .card-year { font-size: 0.72rem; }

/* Chunkier focus rings at 10-foot scale */
.tv-mode .card:focus-visible {
  outline: 4px solid var(--accent);
  box-shadow: 0 0 36px rgba(200, 146, 58, 0.65);
}
.tv-mode a:focus-visible,
.tv-mode button:focus-visible { outline-width: 4px; }
.tv-mode .season-option:focus-visible { outline-width: 4px; }
.tv-mode .player-btn:focus-visible { outline-width: 4px; }
