* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --accent: #a92535;
  --accent-soft: #f8e9eb;
  --text: #171719;
  --muted: #666367;
  --line: #dedde0;
  --panel: #fff;
  --card: #f2f2f3;
}
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 15px/1.5 Arial, Helvetica, sans-serif;
}
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 64px; }
.intro-panel, .movie-section, .cover-demo {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2rem); line-height: 1.2; }
.intro { margin: 10px 0 22px; color: var(--muted); }
.nav-label { margin-bottom: 8px; color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.jump-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.jump-nav a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; min-height: 38px; padding: 6px 9px;
  border-radius: 6px; color: var(--text); text-decoration: none;
  font-size: .88rem; border: 1px solid transparent;
}
.jump-nav a:hover, .jump-nav a:focus-visible { border-color: var(--line); background: #f7f7f8; }
.jump-nav a.active { background: var(--accent); color: #fff; }
.jump-nav a.preview { cursor: default; }
.movie-section { margin-top: 16px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 16px; padding-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 1.4rem; }
#movie-count, .section-heading > span { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.movie-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.movie-card { min-width: 0; display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 8px; background: var(--card); }
.movie-icon {
  flex: 0 0 39px; width: 39px; height: 39px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #f4b7bf; background: #29252b; font-size: 1.1rem;
}
.movie-icon svg { width: 19px; height: 19px; }
.movie-info { flex: 1; min-width: 0; }
.card-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.movie-card h3 { margin: 2px 0 0; font-size: .95rem; line-height: 1.35; overflow-wrap: anywhere; }
.rating { flex: 0 0 auto; padding: 6px 8px; border-radius: 6px; background: #fff; font-size: .8rem; white-space: nowrap; }
.movie-details { margin: 5px 0 3px; color: var(--muted); font-size: .8rem; }
.original-title { margin: 5px 0 5px; color: var(--muted); font-size: .76rem; }
.genre-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.genre-tag { padding: 1px 8px; border-radius: 20px; background: #e5e5e7; font-size: .72rem; line-height: 1.55; }
.movie-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.movie-links a { display: inline-flex; align-items: center; color: #d94e5d; font-size: .8rem; text-decoration: none; }
.movie-links .imdb-logo { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 19px; padding: 0 4px; border-radius: 3px; background: #f5c518; color: #171717; font-weight: 800; font-size: .72rem; letter-spacing: -.04em; }
.movie-links .werstreamtes-logo { color: #e65362; font-weight: 800; font-size: .82rem; letter-spacing: -.045em; }
.movie-links .director-link { color: var(--muted); }
.movie-links a:hover { text-decoration: underline; }
.note { margin-top: 18px; color: var(--muted); font-size: .8rem; }
.cover-demo { margin-top: 16px; }
.cover-demo-card { max-width: 680px; }
.poster-link { display: block; flex: 0 0 39px; width: 39px; height: 39px; border-radius: 6px; overflow: hidden; line-height: 0; }
.movie-poster { display: block; width: 39px; height: 39px; object-fit: cover; background: #e5e5e7; }
.cover-demo-info { flex: 1; min-width: 0; }
@media (max-width: 1000px) {
  .movie-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .movie-list { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  main { width: calc(100% - 20px); padding-top: 18px; }
  .intro-panel, .movie-section, .cover-demo { padding: 12px; }
  .jump-nav { gap: 2px; }
  .jump-nav a { min-width: 30px; min-height: 34px; padding: 5px 7px; }
  .movie-list { grid-template-columns: 1fr; }
}

/* Drei Karten auf großen Bildschirmen, zwei auf Tablets, eine auf Handys. Lange Filmtitel dürfen umbrechen. */
.movie-info { overflow: visible; }
.movie-card .card-topline { min-width: 0; }
.movie-card .card-topline h3 { min-width: 0; }

/* Statische Cover aus posterUrl in der JSON-Datei; keine Live-API. */
.top-attribution { margin: 0 0 10px; padding: 8px 12px; text-align: right; }
.poster-link { display: block; flex: 0 0 94px; width: 94px; }
.movie-poster { display: block; width: 94px; height: 141px; object-fit: cover; border-radius: 6px; background: var(--border); }

/* Integration in das bestehende YKZONE-Layout */
body { background:#000; color:#fff; font-family:Verdana,Arial,sans-serif; font-size:13px; }
.content-panel.movies-page { width:100%; margin:55px 0 auto; padding:28px max(20px, calc((100% - 1250px)/2)); background:#666; color:#fff; border:1px solid #fff; border-top:0; border-radius:0; }
.movies-page .intro-panel, .movies-page .movie-section { border:1px solid #888; border-radius:0; background:#555; color:#fff; padding:16px; }
.movies-page .eyebrow, .movies-page .intro, .movies-page .nav-label, .movies-page .movies-page .note, .movies-page #movie-count { color:#eee; }
.movies-page .jump-nav a { color:#fff; }
.movies-page .jump-nav a.preview { opacity:.55; }
.movies-page .movie-section { margin-top:16px; }
@media(max-width:700px){ .content-panel.movies-page { padding:18px 12px; margin-top:0; } }


/* Farbkorrektur: Filmkarten im vorhandenen YKZONE-Dunkelgrau */
.movies-page .movie-card {
  background: #333333;
  color: #ffffff;
}

.movies-page .movie-card h3 {
  color: #ffffff;
}

.movies-page .movie-details,
.movies-page .original-title,
.movies-page .movie-details a,
.movies-page .movie-links .director-link {
  color: #c8c8c8;
}

.movies-page .rating {
  background: #555555;
  color: #ffffff;
  border: 1px solid #666666;
}

.movies-page .genre-tag {
  background: #555555;
  color: #ffffff;
}

.movies-page .movie-icon {
  background: #29252b;
  color: #f4b7bf;
}

.movies-page .movie-poster {
  background: #555555;
}

/* Markenfarben beibehalten: IMDb-Gelb und werstreamt.es-Rot */
.movies-page .movie-links .imdb-logo {
  background: #f5c518;
  color: #171717;
}

.movies-page .movie-links .werstreamtes-logo {
  display: block;
  width: auto;
  max-width: 110px;
  height: 19px;
  object-fit: contain;
  object-position: left center;
}

/* Kartenaufbau: Filminformationen links, Bewertung und Logos rechts */
.movies-page .movie-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: start;
  gap: 10px;
  background: #333333;
  color: #ffffff;
}

.movies-page .movie-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.movies-page .movie-info {
  flex: 1;
  min-width: 0;
}

.movies-page .card-topline {
  display: block;
}

.movies-page .movie-card h3 {
  color: #ffffff;
}

.movies-page .movie-details,
.movies-page .original-title,
.movies-page .movie-details a,
.movies-page .movie-links .director-link {
  color: #c8c8c8;
}

/* Der gewünschte kleine zusätzliche Abstand zwischen Regie und Genres bleibt erhalten. */
.movies-page .genre-tags {
  margin-top: 7px;
}

.movies-page .movie-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.movies-page .rating {
  padding: 6px 5px;
  background: #555555;
  color: #ffffff;
  border: 1px solid #777777;
  border-radius: 6px;
  text-align: center;
}

.movies-page .movie-side-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 0;
}

.movies-page .movie-side-links a {
  display: flex;
  align-items: center;
  justify-content: center;
}

.movies-page .movie-side-links .imdb-logo {
  min-width: 40px;
  height: 19px;
}

.movies-page .movie-side-links .werstreamtes-logo {
  display: block;
  width: 22px;
  max-width: 22px;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.movies-page .genre-tag {
  background: #555555;
  color: #ffffff;
}

@media (max-width: 420px) {
  .movies-page .movie-card {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 7px;
    padding: 10px;
  }
  .movies-page .movie-main {
    gap: 8px;
  }
}

/* Einheitliche untere Ausrichtung von Genres und Logos */
.movies-page .movie-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: stretch;
}

.movies-page .movie-main {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.movies-page .movie-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.movies-page .genre-tags {
  margin-top: auto;
  padding-top: 8px;
}

.movies-page .movie-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
}

.movies-page .movie-side-links {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Genre-Filter: Buttons behalten das bisherige Tag-Design */
.movies-page .genre-filter-button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  border: 0;
  font: inherit;
  font-size: .72rem;
  line-height: 1.55;
  padding: 1px 8px;
  border-radius: 20px;
  background: #555555;
  color: #ffffff;
  cursor: pointer;
}

.movies-page .genre-filter-button:hover,
.movies-page .genre-filter-button:focus-visible {
  background: #707070;
  color: #ffffff;
}

.movies-page .genre-filter-button.is-active,
.movies-page .genre-filter-button[aria-pressed="true"] {
  background: #a92535;
  color: #ffffff;
  outline: 1px solid #d66a78;
  outline-offset: 1px;
}

.movies-page #reset-genre-filter {
  margin-left: 10px;
  padding: 4px 9px;
  border: 1px solid #888888;
  border-radius: 5px;
  background: #333333;
  color: #ffffff;
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
}

.movies-page #reset-genre-filter:hover,
.movies-page #reset-genre-filter:focus-visible {
  background: #a92535;
  border-color: #d66a78;
}

.movies-page #reset-genre-filter[hidden] {
  display: none;
}


/* Wichtig: Gefilterte Filmkarten zuverlässig ausblenden */
.movies-page .movie-card[hidden] {
  display: none !important;
}


/* Kompakter My-Rating-Filter, kombinierbar mit dem Genre-Filter */
.movies-page .rating-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 4px;
}
.movies-page .rating-filter-label {
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.movies-page .rating-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.movies-page .rating-filter-button {
  appearance: none;
  min-width: 25px;
  height: 25px;
  padding: 0 5px;
  border: 1px solid #888;
  border-radius: 4px;
  background: #333;
  color: #fff;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.movies-page .rating-filter-button:hover,
.movies-page .rating-filter-button:focus-visible {
  border-color: #d66a78;
  background: #555;
}
.movies-page .rating-filter-button.is-active,
.movies-page .rating-filter-button[aria-pressed="true"] {
  border-color: #d66a78;
  background: #a92535;
  color: #fff;
}
.movies-page .reset-rating-filter {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid #888;
  border-radius: 4px;
  background: #333;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.movies-page .reset-rating-filter:hover,
.movies-page .reset-rating-filter:focus-visible {
  background: #a92535;
  border-color: #d66a78;
}
.movies-page .rating-filter-legend {
  margin: 0 0 16px;
  color: #ddd;
  font-size: 11px;
}
.movies-page .rating-filter [hidden] {
  display: none !important;
}


/* Anklickbare Regienamen: Filterverhalten wie bei den Genre-Tags */
.movies-page .director-filter-button {
  appearance: none;
  -webkit-appearance: none;
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c8c8c8;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.movies-page .director-filter-button:hover,
.movies-page .director-filter-button:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

.movies-page .director-filter-button.is-active,
.movies-page .director-filter-button[aria-pressed="true"] {
  color: #ff9aa6;
  text-decoration: underline;
  font-weight: 700;
}

.movies-page .director-link {
  color: #c8c8c8;
  font-size: .75em;
  text-decoration: none;
}

.movies-page .director-link:hover,
.movies-page .director-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

/* Buchstaben-Navigation: Hover-Farbe deutlich von der normalen Schriftfarbe abheben */
.movies-page .jump-nav a:hover,
.movies-page .jump-nav a:focus-visible {
  color: #ff9aa6;
  border-color: #a92535;
  background: #444444;
}



/* Suchfeld für die Filmliste */
.movie-search {
  position: relative;
  width: 100%;
  margin: 2rem 0 1.5rem;
}

.movie-search input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 3.2rem 0.85rem 1.1rem;

  background: #383838;
  color: #fff;

  border: 1px solid #777;
  border-radius: 9px;

  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;

  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.movie-search input::placeholder {
  color: #c5c5c5;
  opacity: 1;
}

.movie-search input:hover {
  border-color: #aaa;
}

.movie-search input:focus {
  outline: none;
  border-color: #bd263e;
  background: #303030;
  box-shadow: 0 0 0 3px rgb(189 38 62 / 18%);
}

/* Lösch-Button im Suchfeld */
.clear-movie-search {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);

  display: grid;
  place-items: center;

  width: 34px;
  height: 34px;
  padding: 0;

  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #ddd;

  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.clear-movie-search:hover {
  background: #bd263e;
  color: #fff;
}

.clear-movie-search[hidden] {
  display: none;
}

/* Auf schmalen Bildschirmen kompakter */
@media (max-width: 600px) {
  .movie-search {
    margin-top: 1.5rem;
    margin-bottom: 1.25rem;
  }

  .movie-search input {
    min-height: 48px;
    font-size: 0.95rem;
  }
}

/* ==================================================
   AKTE X – EPISODENLISTE
   Gemeinsames YKZONE-Design, spezifische Episodenregeln
   ================================================== */

/* Seitenbereich */
.page {
  width: 100%;
  margin: 0 auto;
  padding: 28px max(20px, calc((100% - 1250px) / 2)) 64px;
  background: #666;
  color: #fff;
  border: 1px solid #fff;
  border-top: 0;
}

/* Einleitung und Episodenbereich */
.page .intro-panel,
.page .episode-section {
  border: 1px solid #888;
  border-radius: 0;
  padding: 16px;
  background: #555;
  color: #fff;
}

.page .intro {
  margin: 10px 0 22px;
  color: #eee;
}

/* Episodensuche */
#episode-search {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  margin: 2px 0 1.5rem;
  padding: .85rem 1.1rem;
  background: #383838;
  color: #fff;
  border: 1px solid #777;
  border-radius: 9px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

#episode-search::placeholder {
  color: #c5c5c5;
  opacity: 1;
}

#episode-search:hover {
  border-color: #aaa;
}

#episode-search:focus {
  outline: none;
  border-color: #bd263e;
  background: #303030;
  box-shadow: 0 0 0 3px rgb(189 38 62 / 18%);
}

/* Staffel-Navigation */
.page .jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.page .season-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}

.page .season-button:hover,
.page .season-button:focus-visible {
  color: #ff9aa6;
  border-color: #a92535;
  background: #444;
}

.page .season-button.active {
  background: #a92535;
  color: #fff;
  border-color: #a92535;
}

/* Überschrift und Episodenzähler */
.page .episode-section {
  margin-top: 16px;
}

.page .section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #888;
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.page .section-heading h2 {
  margin: 0;
  font-size: 1.4rem;
}

#episode-count {
  color: #eee;
  font-size: .72rem;
  text-transform: uppercase;
}

/* Episodenraster */
.page .episode-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.page .season-heading {
  grid-column: 1 / -1;
  margin: 14px 0 0;
  padding: 8px 0;
  border-bottom: 1px solid #888;
  font-size: 1.08rem;
}

/* Episodenkarte */
.page .episode-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #333;
  color: #fff;
}

.page .episode-main {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
}

/* Kennzeichnung: S8. / E01 */
.page .episode-number {
  flex: 0 0 39px;
  width: 39px;
  min-height: 39px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px;
  border-radius: 6px;
  background: #29252b;
  color: #f4b7bf;
  text-align: center;
  font-weight: 700;
  font-size: .68rem;
  overflow-wrap: anywhere;
}

/* Episodeninformationen */
.page .episode-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.page .episode-info h3 {
  margin: 2px 0 0;
  color: #fff;
  font-size: .95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.page .original-title {
  margin: 5px 0;
  color: #c8c8c8;
  font-size: .76rem;
  font-style: italic;
}

.page .episode-meta {
  margin: 5px 0 0;
  color: #c8c8c8;
  font-size: .76rem;
}

/* IMDb-Bereich */
.page .episode-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.page .episode-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.page .episode-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d94e5d;
  font-size: .8rem;
  text-decoration: none;
}

.page .episode-links a:hover {
  text-decoration: underline;
}

.page .imdb-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 19px;
  padding: 0 4px;
  border-radius: 3px;
  background: #f5c518;
  color: #171717;
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: -.04em;
}

/* Leere Suchergebnisse und Quellenhinweis */
.page .empty-state,
.page .source-note {
  color: #eee;
}

.page .source-note {
  margin: 20px 0 0;
  font-size: .78rem;
}

/* Responsive Darstellung */
@media (max-width: 1000px) {
  .page .episode-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .page {
    padding: 18px 12px 40px;
  }
}

@media (max-width: 650px) {
  .page .episode-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .page .intro-panel,
  .page .episode-section {
    padding: 12px;
  }

  .page .jump-nav {
    gap: 2px;
  }

  .page .season-button {
    min-width: 30px;
    min-height: 34px;
    padding: 5px 7px;
  }

  .page .episode-card {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 7px;
    padding: 10px;
  }

  .page .episode-main {
    gap: 8px;
  }
}

/* X-Files: Überschrift und Untertitel kompakt */
.xfiles-page .intro-panel h1 {
    margin-bottom: 8px;
}

.xfiles-page .intro-panel .intro {
    margin: 0 0 16px;
    padding: 0;
    text-align: left;
}

/* Abstand zwischen Suchfeld und Staffeln reduzieren */
.xfiles-page #episode-search {
    margin-bottom: 10px;
}

.xfiles-page #season-nav {
    margin-top: 0;
}

/* NEW-Markierung für Filme hinter dem JSON-Marker */
.movies-page .movie-new-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 39px;
  width: 39px;
  height: 39px;
  min-height: 39px;
  padding: 0 2px;
  border: 1px solid #ff5267;
  border-radius: 6px;
  background: #a92535;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -.04em;
  text-shadow: 0 1px 2px #500;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%);
}

.movies-page .new-nav-button {
  margin-left: auto;
  padding-left: 12px !important;
  padding-right: 12px !important;
  border: 1px solid #d66a78 !important;
  border-radius: 6px;
  background: #999999;
  color: #fff !important;
  font-weight: 700;
}

.movies-page .new-nav-button:hover,
.movies-page .new-nav-button:focus-visible,
.movies-page .new-nav-button.active {
  background: #333333 !important;
  color: #fff !important;
}
