/* Randomizer filter visibility UI — shared by Settings and Randomizer. */
.settings-v2 .settings-randomizer-visibility-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-v2 .settings-randomizer-visibility-row {
  position: relative;
  min-height: 96px;
  padding: 17px 18px 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 11px;
  background: #0b0e17;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.settings-v2 .settings-randomizer-visibility-row:hover {
  border-color: rgba(155,92,255,.28);
  background: #0d101a;
}

.settings-v2 .settings-randomizer-visibility-row > span {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.settings-v2 .settings-randomizer-visibility-row strong {
  color: #f0edf5;
  font-size: .8rem;
  line-height: 1.25;
}

.settings-v2 .settings-randomizer-visibility-row small {
  max-width: 38rem;
  color: #777b8d;
  font-size: .72rem;
  line-height: 1.5;
}

.settings-v2 .settings-randomizer-visibility-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-v2 .settings-randomizer-visibility-row i {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #3d3944;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  transition: .18s ease;
}

.settings-v2 .settings-randomizer-visibility-row i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #b7b3bc;
  transition: .18s ease;
}

.settings-v2 .settings-randomizer-visibility-row input:checked + i {
  background: linear-gradient(90deg, #9b5cff, #7d3ce7);
  box-shadow: 0 0 0 1px rgba(155,92,255,.18), 0 0 22px rgba(126,69,203,.12);
}

.settings-v2 .settings-randomizer-visibility-row input:checked + i::after {
  left: 23px;
  background: #fff;
}

.settings-v2 .settings-randomizer-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.settings-v2 .settings-randomizer-actions .secondary-button {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 8px;
  font-size: .73rem;
}

.settings-v2 .settings-randomizer-note {
  margin: 13px 0 0;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  background: rgba(8,10,16,.44);
  color: #777b8d;
  font-size: .69rem;
  line-height: 1.5;
}

.settings-v2 [data-settings-panel="randomizer"] .settings-v2-card:last-child .settings-v2-row {
  min-height: 82px;
  padding: 15px 16px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  background: #0b0e17;
}

.comrade-filter-hidden-by-preference {
  display: none !important;
}

/* Passive browser-snapshot prompts are obsolete in the cloud-catalogue Core flow. */
.global-library-sync[data-state="ready"] {
  display: none !important;
}

html[data-comrade-theme="light"] .settings-v2 .settings-randomizer-visibility-row {
  border-color: rgba(24,28,39,.11);
  background: #f7f8fb;
}

html[data-comrade-theme="light"] .settings-v2 .settings-randomizer-visibility-row:hover {
  border-color: rgba(119,65,204,.28);
  background: #f3f0f9;
}

html[data-comrade-theme="light"] .settings-v2 .settings-randomizer-visibility-row strong {
  color: #242733;
}

html[data-comrade-theme="light"] .settings-v2 .settings-randomizer-visibility-row small,
html[data-comrade-theme="light"] .settings-v2 .settings-randomizer-note {
  color: #6c7280;
}

html[data-comrade-theme="light"] .settings-v2 .settings-randomizer-note,
html[data-comrade-theme="light"] .settings-v2 [data-settings-panel="randomizer"] .settings-v2-card:last-child .settings-v2-row {
  border-color: rgba(24,28,39,.09);
  background: #f7f8fb;
}

/* Randomizer result set — 2x2 vertical cards for real Plex poster artwork. */
.cinema-randomizer-page .cinema-result-list {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch;
}

.cinema-randomizer-result-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 11px;
  background: #10131f;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.cinema-randomizer-result-card:hover {
  border-color: rgba(155,92,255,.42);
  box-shadow: 0 14px 36px rgba(0,0,0,.18);
}

.cinema-randomizer-page .cinema-randomizer-result-open.poster-card {
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto !important;
  align-items: stretch !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: left !important;
}

.cinema-randomizer-page .cinema-randomizer-result-open.poster-card:hover {
  border: 0 !important;
  transform: none !important;
  box-shadow: none !important;
}

.cinema-randomizer-page .cinema-randomizer-result-open .poster-frame {
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: 2 / 3 !important;
  display: block !important;
  border-radius: 0 !important;
  background: #090c14 !important;
  overflow: hidden;
}

.cinema-randomizer-page .cinema-randomizer-result-open .poster-frame img {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
}

.cinema-randomizer-page .cinema-randomizer-result-open > :not(.poster-frame) {
  min-width: 0;
  padding: 12px 14px 13px !important;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
}

.cinema-randomizer-page .cinema-randomizer-result-open .poster-title {
  width: 100%;
  margin-top: 7px;
  overflow: hidden;
  color: #f2eff6 !important;
  font-size: .94rem !important;
  font-weight: 800;
  line-height: 1.22;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cinema-randomizer-page .cinema-randomizer-result-open .poster-meta {
  margin-top: 5px;
  color: #8c90a1 !important;
  font-size: .7rem !important;
  line-height: 1.35;
}

.cinema-randomizer-page .cinema-result-fit-label.poster-badge {
  position: static !important;
  inset: auto !important;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  margin: 0 !important;
  padding: 0 8px !important;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(93,229,140,.22) !important;
  border-radius: 999px !important;
  background: rgba(38,128,75,.12) !important;
  color: #72eca0 !important;
  font-size: .64rem !important;
  font-weight: 850 !important;
  line-height: 1 !important;
}

.cinema-randomizer-page .cinema-result-source.poster-source-pill {
  position: static !important;
  inset: auto !important;
  max-width: 100%;
  margin: 8px 0 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #777b8d !important;
  box-shadow: none !important;
  font-size: .64rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cinema-randomizer-page .cinema-result-source .poster-source-provider-icon {
  width: 14px !important;
  height: 14px !important;
}

.cinema-randomizer-page .cinema-randomizer-result-open .poster-reasons,
.cinema-randomizer-page .cinema-randomizer-result-open .movie-pick-reasons {
  margin-top: 9px !important;
}

.cinema-randomizer-page .cinema-randomizer-result-open .poster-reason-chip {
  min-height: 22px;
  padding: 0 7px !important;
  font-size: .61rem !important;
}

.cinema-result-actions {
  min-height: 49px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: #0b0e17;
}

.cinema-result-action {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font: inherit;
  font-size: .66rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.cinema-result-action-secondary,
.cinema-result-action-save {
  border: 1px solid rgba(255,255,255,.1);
  background: transparent;
  color: #b1b4c0;
}

.cinema-result-action-secondary:hover,
.cinema-result-action-save:hover:not(:disabled) {
  border-color: rgba(155,92,255,.35);
  background: rgba(155,92,255,.1);
  color: #e5d8fa;
}

.cinema-result-action-primary {
  border: 1px solid rgba(155,92,255,.34);
  background: rgba(112,58,180,.28);
  color: #d5b8ff;
}

.cinema-result-action-primary:hover {
  background: rgba(125,67,198,.38);
  color: #f0e6ff;
}

.cinema-result-action-save { margin-left: auto; }
.cinema-result-action-save:disabled {
  border-color: rgba(93,229,140,.18);
  background: rgba(38,128,75,.08);
  color: #69d990;
  cursor: default;
  opacity: 1;
}

html[data-comrade-theme="light"] .cinema-randomizer-result-card {
  border-color: rgba(24,28,39,.11);
  background: #fff;
}

html[data-comrade-theme="light"] .cinema-randomizer-page .cinema-randomizer-result-open .poster-title {
  color: #242733 !important;
}

html[data-comrade-theme="light"] .cinema-randomizer-page .cinema-randomizer-result-open .poster-meta,
html[data-comrade-theme="light"] .cinema-randomizer-page .cinema-result-source.poster-source-pill {
  color: #6c7280 !important;
}

html[data-comrade-theme="light"] .cinema-result-actions {
  border-color: rgba(24,28,39,.08);
  background: #f7f8fb;
}

html[data-comrade-theme="light"] .cinema-result-action-secondary,
html[data-comrade-theme="light"] .cinema-result-action-save {
  border-color: rgba(24,28,39,.12);
  color: #5f6573;
}

@media (max-width: 1180px) {
  .cinema-randomizer-page .cinema-result-list {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  .settings-v2 .settings-randomizer-visibility-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .settings-v2 .settings-randomizer-visibility-row {
    min-height: 104px;
    padding: 17px 17px 17px 19px;
    gap: 14px;
  }

  .settings-v2 .settings-randomizer-visibility-row strong {
    font-size: .81rem;
  }

  .settings-v2 .settings-randomizer-visibility-row small {
    font-size: .72rem;
  }

  .settings-v2 .settings-randomizer-actions {
    align-items: stretch;
  }

  .settings-v2 .settings-randomizer-actions .secondary-button {
    flex: 1 1 150px;
  }

  .cinema-randomizer-page .cinema-randomizer-result-open .poster-frame {
    height: auto !important;
    aspect-ratio: 2 / 3 !important;
  }

  .cinema-result-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .cinema-result-action {
    flex: 1 1 auto;
  }

  .cinema-result-action-save { margin-left: 0; }
}

/* Minimal Randomizer cards: poster, title and year only. All other details remain in the movie modal. */
body.cinema-v2.cinema-randomizer-page .cinema-randomizer-result-card {
  grid-template-rows: auto !important;
}

body.cinema-v2.cinema-randomizer-page .cinema-result-actions,
body.cinema-v2.cinema-randomizer-page .cinema-result-fit-label,
body.cinema-v2.cinema-randomizer-page .cinema-result-source,
body.cinema-v2.cinema-randomizer-page .cinema-randomizer-result-open .poster-submeta,
body.cinema-v2.cinema-randomizer-page .cinema-randomizer-result-open .poster-reason-list,
body.cinema-v2.cinema-randomizer-page .cinema-randomizer-result-open .poster-reasons,
body.cinema-v2.cinema-randomizer-page .cinema-randomizer-result-open .movie-pick-reasons {
  display: none !important;
}

body.cinema-v2.cinema-randomizer-page .cinema-randomizer-result-open > :not(.poster-frame) {
  padding: 12px 14px 14px !important;
  display: block !important;
}

body.cinema-v2.cinema-randomizer-page .cinema-randomizer-result-open .poster-title {
  margin-top: 0 !important;
}

body.cinema-v2.cinema-randomizer-page .cinema-randomizer-result-open .poster-meta {
  width: 4.2ch !important;
  max-width: 4.2ch !important;
  margin-top: 4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}
