/* MůjFlix — Objevovat (banner, řady, filtry, mřížka) */
#universeOverlay {
  --dv-bg: #141414;
  --dv-surface: #1f1f1f;
  --dv-surface-2: #2a2a2a;
  --dv-line: rgba(255, 255, 255, 0.09);
  --dv-text: #f4f4f7;
  --dv-dim: rgba(244, 244, 247, 0.62);
  --dv-accent: var(--accent, #0a84ff);
  --dv-pad: clamp(14px, 3vw, 44px);
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  flex-direction: column;
  background: var(--dv-bg);
  color: var(--dv-text);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-family: inherit;
}
#universeOverlay.open { display: flex; }
#universeOverlay.visible { opacity: 1; }
#universeOverlay *, #universeOverlay *::before, #universeOverlay *::after { box-sizing: border-box; }
#universeOverlay button { font-family: inherit; }

/* horní lišta */
#universeOverlay .dv-top {
  flex: none;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--dv-pad) 10px;
  background: var(--dv-bg);
  border-bottom: 1px solid var(--dv-line);
  z-index: 3;
}
#universeOverlay .dv-filter-btn { display: none; position: relative; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 0; border-radius: 4px; background: var(--dv-surface-2); color: #fff; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; flex: none; }
#universeOverlay .dv-filter-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--dv-accent); }
#universeOverlay .dv-bar { display: flex; align-items: center; gap: 14px; }
#universeOverlay .dv-brand { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; flex: none; }
#universeOverlay .dv-brand span { color: var(--dv-accent); }
#universeOverlay .dv-search {
  flex: 1; min-width: 0; max-width: 640px; display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 12px 0 14px; border-radius: 12px; cursor: text;
  background: var(--dv-surface); border: 1px solid var(--dv-line); color: var(--dv-dim);
  transition: border-color 0.15s, background 0.15s;
}
#universeOverlay .dv-search:focus-within { border-color: var(--dv-accent); background: var(--dv-surface-2); color: var(--dv-text); }
#universeOverlay .dv-search input {
  flex: 1; min-width: 0; height: 100%; color: var(--dv-text); font-size: 1rem; font-family: inherit;
  -webkit-appearance: none; appearance: none;
}
#universeOverlay .dv-search input::-webkit-search-cancel-button { display: none; }
#universeOverlay .dv-search input::placeholder { color: var(--dv-dim); }
#universeOverlay .dv-clear, #universeOverlay .dv-close {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.1); color: var(--dv-text); font-size: 0.9rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: background 0.15s; padding: 0;
}
#universeOverlay .dv-clear[hidden] { display: none; }
#universeOverlay .dv-clear:hover, #universeOverlay .dv-close:hover { background: rgba(255, 255, 255, 0.2); }
#universeOverlay .dv-close { width: 44px; height: 44px; margin-left: auto; font-size: 1.05rem; }

/* filtry */
#universeOverlay .dv-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
#universeOverlay .dv-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--dv-surface); border: 1px solid var(--dv-line); border-radius: 12px; }
#universeOverlay .dv-seg-btn {
  padding: 8px 18px; border: 0; border-radius: 9px; background: transparent; color: var(--dv-dim);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s;
}
#universeOverlay .dv-seg-btn:hover { color: var(--dv-text); }
#universeOverlay .dv-seg-btn.active { background: var(--dv-accent); color: #fff; }
#universeOverlay .dv-selects { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#universeOverlay .dv-select {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border-radius: 10px;
  background: var(--dv-surface); border: 1px solid var(--dv-line); font-size: 0.8rem; color: var(--dv-dim);
}
#universeOverlay .dv-select select {
  color: var(--dv-text); font-size: 0.9rem; font-family: inherit; cursor: pointer; max-width: 160px; 
}
#universeOverlay .dv-select select option { background: #1f1f1f; color: #fff; }
#universeOverlay .dv-reset {
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255, 69, 58, 0.5);
  background: rgba(255, 69, 58, 0.12); color: #ff6961; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
#universeOverlay .dv-reset[hidden] { display: none; }
#universeOverlay .dv-reset:hover { background: rgba(255, 69, 58, 0.22); }
#universeOverlay .dv-chips {
  display: flex; gap: 8px; margin-top: 12px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
#universeOverlay .dv-chips::-webkit-scrollbar { display: none; }
#universeOverlay .dv-chip {
  flex: none; padding: 8px 16px; border-radius: 999px; scroll-snap-align: start; white-space: nowrap;
  background: var(--dv-surface); border: 1px solid var(--dv-line); color: var(--dv-text);
  font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: background 0.15s, transform 0.1s;
}
#universeOverlay .dv-chip:hover:not(:disabled) { background: var(--dv-surface-2); }
#universeOverlay .dv-chip:active:not(:disabled) { transform: scale(0.97); }
#universeOverlay .dv-chip.active { background: #fff; color: #0b0b10; border-color: #fff; }
#universeOverlay .dv-chip:disabled { opacity: 0.3; cursor: not-allowed; }

/* tělo */
#universeOverlay .dv-body {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 40px); overscroll-behavior: contain;
}

/* hero banner */
#universeOverlay .dv-hero {
  position: relative; height: clamp(300px, 54vh, 560px); overflow: hidden; background: var(--dv-surface);
  display: flex; align-items: flex-end;
}
#universeOverlay .dv-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
#universeOverlay .dv-hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, var(--dv-bg) 2%, rgba(11, 11, 16, 0.55) 40%, rgba(11, 11, 16, 0) 75%),
    linear-gradient(90deg, rgba(11, 11, 16, 0.85) 0%, rgba(11, 11, 16, 0.35) 45%, rgba(11, 11, 16, 0) 75%);
}
#universeOverlay .dv-hero-body { position: relative; padding: 0 var(--dv-pad) 28px; max-width: 760px; }
#universeOverlay .dv-hero-badge {
  display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase; background: var(--dv-accent); color: #fff; margin-bottom: 10px;
}
#universeOverlay .dv-hero-title { margin: 0 0 8px; font-size: clamp(1.7rem, 4.6vw, 3.2rem); font-weight: 800; line-height: 1.05; letter-spacing: -1px; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6); }
#universeOverlay .dv-hero-meta { font-size: 0.9rem; color: var(--dv-dim); margin-bottom: 10px; white-space: pre-wrap; }
#universeOverlay .dv-hero-desc {
  margin: 0 0 18px; font-size: 0.98rem; line-height: 1.5; color: rgba(255, 255, 255, 0.85);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#universeOverlay .dv-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#universeOverlay .dv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px;
  border-radius: 10px; border: 0; cursor: pointer; font-size: 0.98rem; font-weight: 700; transition: transform 0.1s, background 0.15s;
}
#universeOverlay .dv-btn:active { transform: scale(0.97); }
#universeOverlay .dv-btn-primary { background: #fff; color: #0b0b10; }
#universeOverlay .dv-btn-primary:hover { background: rgba(255, 255, 255, 0.85); }
#universeOverlay .dv-btn-ghost { background: rgba(109, 109, 118, 0.55); color: #fff; }
#universeOverlay .dv-btn-ghost:hover { background: rgba(109, 109, 118, 0.8); }
#universeOverlay .dv-btn-ghost.on svg { fill: #ff453a; stroke: #ff453a; }

/* řady */
#universeOverlay .dv-row { margin: 22px 0 8px; }
#universeOverlay .dv-row-head { display: flex; align-items: baseline; gap: 12px; padding: 0 var(--dv-pad); margin-bottom: 10px; flex-wrap: wrap; }
#universeOverlay .dv-row-title { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.3px; }
#universeOverlay .dv-row-sub { margin: 0; font-size: 0.82rem; color: var(--dv-dim); }
#universeOverlay .dv-row-more { margin-left: auto; background: transparent; border: 0; color: var(--dv-accent); font-size: 0.85rem; font-weight: 600; cursor: pointer; padding: 4px 0; }
#universeOverlay .dv-row-more:hover { text-decoration: underline; }
#universeOverlay .dv-scroller { position: relative; }
#universeOverlay .dv-track {
  display: flex; gap: 12px; overflow-x: auto; padding: 8px var(--dv-pad) 14px; scroll-snap-type: x proximity;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding-left: var(--dv-pad);
}
#universeOverlay .dv-track::-webkit-scrollbar { display: none; }
#universeOverlay .dv-track .dv-card { flex: none; width: clamp(120px, 14vw, 178px); scroll-snap-align: start; }
#universeOverlay .dv-arrow {
  position: absolute; top: 8px; bottom: 14px; width: 48px; border: 0; cursor: pointer; z-index: 2; color: #fff;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s; padding: 0;
}
#universeOverlay .dv-arrow-l { left: 0; background: linear-gradient(90deg, rgba(11, 11, 16, 0.92), transparent); }
#universeOverlay .dv-arrow-r { right: 0; background: linear-gradient(270deg, rgba(11, 11, 16, 0.92), transparent); }
#universeOverlay .dv-scroller:hover .dv-arrow { opacity: 1; }
@media (hover: none) { #universeOverlay .dv-arrow { display: none; } }

/* karta */
#universeOverlay .dv-card { position: relative; min-width: 0; cursor: pointer; outline: none; }
#universeOverlay .dv-poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--dv-surface);
  border: 1px solid var(--dv-line); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
#universeOverlay .dv-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#universeOverlay .dv-poster-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; opacity: 0.4; }
#universeOverlay .dv-card:hover .dv-poster,
#universeOverlay .dv-card:focus-visible .dv-poster { transform: scale(1.04); border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6); }
#universeOverlay .dv-card:focus-visible .dv-poster { outline: 2px solid var(--dv-accent); outline-offset: 2px; }
#universeOverlay .dv-rate, #universeOverlay .dv-type {
  position: absolute; z-index: 2; padding: 3px 7px; border-radius: 6px; font-size: 0.7rem; font-weight: 700;
  background: rgba(0, 0, 0, 0.68); color: #fff;
}
#universeOverlay .dv-rate { left: 6px; bottom: 6px; color: #ffd60a; }
#universeOverlay .dv-type { left: 6px; top: 6px; }
#universeOverlay .dv-fav {
  position: absolute; z-index: 3; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; padding: 0;
  background: rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.15s, transform 0.1s, background 0.15s;
}
#universeOverlay .dv-fav.on { opacity: 1; }
#universeOverlay .dv-fav.on svg { fill: #ff453a; stroke: #ff453a; }
#universeOverlay .dv-card:hover .dv-fav, #universeOverlay .dv-card:focus-within .dv-fav { opacity: 1; }
#universeOverlay .dv-fav:hover { background: rgba(0, 0, 0, 0.85); transform: scale(1.1); }
@media (hover: none) { #universeOverlay .dv-fav { opacity: 1; } }
#universeOverlay .dv-card-title {
  margin-top: 8px; font-size: 0.88rem; font-weight: 600; line-height: 1.25; color: var(--dv-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#universeOverlay .dv-card-meta { margin-top: 2px; font-size: 0.76rem; color: var(--dv-dim); }

/* mřížka */
#universeOverlay .dv-grid-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 22px var(--dv-pad) 4px; }
#universeOverlay .dv-grid-title { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }
#universeOverlay .dv-grid-count { font-size: 0.85rem; color: var(--dv-dim); }
#universeOverlay .dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 14px; padding: 14px var(--dv-pad) 8px; }
#universeOverlay .dv-sentinel { height: 1px; }
#universeOverlay .dv-status { text-align: center; color: var(--dv-dim); font-size: 0.88rem; padding: 14px var(--dv-pad); }
#universeOverlay .dv-status .dv-btn { margin-top: 10px; }

/* historie hledání */
#universeOverlay .dv-history { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px var(--dv-pad) 0; }
#universeOverlay .dv-history-label { font-size: 0.8rem; color: var(--dv-dim); margin-right: 4px; }
#universeOverlay .dv-hchip { padding: 6px 12px; border-radius: 999px; background: var(--dv-surface); border: 1px solid var(--dv-line); color: var(--dv-text); font-size: 0.85rem; cursor: pointer; }
#universeOverlay .dv-hchip:hover { background: var(--dv-surface-2); }
#universeOverlay .dv-hclear { background: transparent; border: 0; color: var(--dv-dim); font-size: 0.8rem; cursor: pointer; text-decoration: underline; }

/* prázdný stav */
#universeOverlay .dv-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 20px 18px; }
#universeOverlay .dv-empty-icon { font-size: 3rem; }
#universeOverlay .dv-empty-title { font-size: 1.15rem; font-weight: 700; }
#universeOverlay .dv-empty-sub { font-size: 0.9rem; color: var(--dv-dim); max-width: 380px; }

/* načítání */
#universeOverlay .dv-skel { background: var(--dv-surface-2); }
#universeOverlay .dv-skel-line { height: 12px; width: 70%; margin-top: 10px; border-radius: 6px; background: var(--dv-surface); }
@media (prefers-reduced-motion: reduce) {
  #universeOverlay, #universeOverlay * { animation: none !important; transition: none !important; }
}

/* přebití globálních stylů formulářových prvků */
#universeOverlay .dv-search input,
#universeOverlay .dv-select select {
  background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  margin: 0 !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; outline: 0 !important;
}
#universeOverlay .dv-search input { padding: 0 !important; }
#universeOverlay .dv-select select { padding: 4px 4px 4px 0 !important; }

/* telefon */
@media (max-width: 720px) {
  #universeOverlay .dv-brand { display: none; }
  #universeOverlay .dv-search { height: 44px; max-width: none; }
  #universeOverlay .dv-close { width: 40px; height: 40px; margin-left: 0; }
  #universeOverlay .dv-filters { gap: 8px; }
  #universeOverlay .dv-seg { width: 100%; }
  #universeOverlay .dv-seg-btn { flex: 1; padding: 8px 6px; }
  #universeOverlay .dv-selects { width: 100%; }
  #universeOverlay .dv-select { flex: 1; min-width: 0; padding: 0 8px 0 10px; }
  #universeOverlay .dv-select span { display: none; }
  #universeOverlay .dv-select select { flex: 1; min-width: 0; max-width: none; }
  #universeOverlay .dv-reset { flex: 1 1 100%; }
  #universeOverlay .dv-hero { height: 58vh; min-height: 340px; }
  #universeOverlay .dv-hero-desc { -webkit-line-clamp: 2; font-size: 0.9rem; }
  #universeOverlay .dv-hero-body { padding-bottom: 20px; }
  #universeOverlay .dv-track { gap: 10px; }
  #universeOverlay .dv-track .dv-card { width: 112px; }
  #universeOverlay .dv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; }
  #universeOverlay .dv-card-title { font-size: 0.8rem; }
  #universeOverlay .dv-row-title { font-size: 1.05rem; }
  #universeOverlay .dv-filter-btn { display: inline-flex; }
  #universeOverlay .dv-top .dv-filters, #universeOverlay .dv-top .dv-chips { display: none; }
  #universeOverlay.dv-filters-open .dv-top .dv-filters { display: flex; }
  #universeOverlay.dv-filters-open .dv-top .dv-chips { display: flex; }
}
@media (max-width: 380px) {
  #universeOverlay .dv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
