:root {
  --bg: #14161a; --panel: #1e2128; --panel2: #262a33;
  --text: #e8eaf0; --muted: #9aa0ae; --accent: #4f8cff;
  --danger: #e05555; --ok: #4caf7d; --border: #333845;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.topnav {
  display: flex; gap: 1.2rem; align-items: center;
  background: var(--panel); border-bottom: 1px solid var(--border);
  padding: 0.7rem 1.2rem; position: sticky; top: 0; z-index: 10;
}
.topnav .brand { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.topnav a { color: var(--text); }
.topnav .spacer { flex: 1; }

h1 { font-size: 1.5rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.6rem; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.2rem; margin-bottom: 1rem;
}
.error { color: var(--danger); margin: 0.5rem 0; }
.message { color: var(--ok); margin: 0.5rem 0; }
.muted { color: var(--muted); }

input[type=text], input[type=password], input[type=search] {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.55rem 0.75rem; font-size: 1rem; width: 100%;
}
button, .btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 0.55rem 1.1rem; font-size: 0.95rem; cursor: pointer;
}
button.danger { background: var(--danger); }
button.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--border); }
form.inline { display: inline; }

.login-box { max-width: 380px; margin: 8vh auto; }
.login-box label { display: block; margin: 0.8rem 0 0.25rem; color: var(--muted); }
.login-box button { width: 100%; margin-top: 1.2rem; }

.result-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.result-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; display: flex; flex-direction: column;
}
.result-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--panel2); }
.result-card .noposter {
  width: 100%; aspect-ratio: 2/3; display: flex; align-items: center;
  justify-content: center; font-size: 2.5rem; background: var(--panel2);
}
.result-card .meta { padding: 0.6rem 0.7rem; }
.result-card .title { font-weight: 600; font-size: 0.92rem; }
.result-card .sub { color: var(--muted); font-size: 0.8rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
tr:hover td { background: var(--panel2); }

.pill {
  display: inline-block; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.1rem 0.65rem; font-size: 0.8rem; margin: 0 0.25rem 0.3rem 0;
}
.fav-star { color: #f4c542; }

.checkgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.25rem 1rem; margin: 0.6rem 0 1rem;
}
.checkgrid label { display: flex; gap: 0.45rem; align-items: center; font-size: 0.92rem; }

.tilerow { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.tile {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.8rem 1rem; min-width: 140px;
}
.invite-link {
  background: var(--panel2); border: 1px dashed var(--accent); border-radius: 8px;
  padding: 0.7rem 1rem; margin: 0.8rem 0; word-break: break-all;
  font-family: ui-monospace, monospace; font-size: 0.85rem;
}
/* Dashboard: Hero-Carousel */
.hero {
  position: relative; height: 320px; border-radius: 12px; overflow: hidden;
  margin-bottom: 1.5rem; background: var(--panel);
}
.hero-slide {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  opacity: 0; transition: opacity 0.8s ease; pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-slide img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 20%; filter: brightness(0.55);
}
.hero-caption { position: relative; padding: 1.2rem 1.5rem; }
.hero-title { font-size: 1.6rem; font-weight: 700; color: #fff; text-shadow: 0 2px 8px #000; }

/* Dashboard: Poster-Grids je Kategorie — mehrzeilig umbrechend statt
   horizontaler Scrollbars (6 + 4 statt 10 in einer Scroll-Zeile). */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.9rem 0.8rem;
  padding: 7px; /* Platz für Favoriten-Farbringe */
}
.strip-card {
  color: var(--text); min-width: 0;
}
.strip-card img, .strip-card .noposter {
  width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px;
  background: var(--panel2); display: block;
}
.strip-card .noposter { display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.strip-card:hover img { outline: 2px solid var(--accent); }
.strip-title {
  font-size: 0.82rem; font-weight: 600; margin-top: 0.3rem;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.strip-caption { font-size: 0.75rem; color: var(--muted); }

/* Profil-Untermenü */
.subnav {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 1.2rem;
}
.subnav a {
  padding: 0.5rem 1rem; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent;
}
.subnav a.active { color: var(--text); border-bottom-color: var(--accent); }
.subnav a:hover { text-decoration: none; color: var(--text); }

/* Stern-Toggle in Tabellen */
button.star { padding: 0.2rem 0.55rem; font-size: 1.05rem; line-height: 1; }
button.star.on { color: #f4c542; border-color: #f4c542; }

/* Show-Detail: Kopf mit Backdrop-Hero */
.showhead { display: flex; gap: 1.5rem; align-items: flex-start; }
.showhead.with-backdrop {
  background-size: cover; background-position: center 25%;
  border-radius: 12px; padding: 1.5rem; margin: 0 0 1rem;
}
.showhead img.poster {
  border-radius: 10px; width: 220px; aspect-ratio: 2/3;
  object-fit: cover; flex: 0 0 auto; align-self: flex-start;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
}
@media (max-width: 640px) {
  .showhead { flex-direction: column; }
  .showhead img.poster { width: 160px; }
}

/* FSK-Kennzeichen in den offiziellen Farben */
.fsk {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; border-radius: 6px;
  transform: rotate(45deg); font-size: 0.85rem; font-weight: 800;
  color: #000; vertical-align: middle; margin-left: 0.6rem;
  border: 2px solid rgba(255,255,255,0.85);
}
.fsk > * , .fsk { line-height: 1; }
.fsk { text-shadow: none; }
.fsk-0  { background: #fff; }
.fsk-6  { background: #ffd400; }
.fsk-12 { background: #33a532; color: #fff; }
.fsk-16 { background: #1c9fd8; color: #fff; }
.fsk-18 { background: #e2001a; color: #fff; }
.fsk::before { content: ""; }
.fsk span { transform: rotate(-45deg); }

/* Tabs (CSS-only, radio-basiert) */
.tabs { margin-top: 1.2rem; }
.tabs > input[type=radio] { display: none; }
.tabs > label {
  display: inline-block; padding: 0.5rem 1rem; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent;
  font-weight: 600;
}
.tabs > input:checked + label { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding-top: 1rem; border-top: 1px solid var(--border); }
#tab-info:checked ~ #panel-info,
#tab-cast:checked ~ #panel-cast,
#tab-crew:checked ~ #panel-crew,
#tab-seasons:checked ~ #panel-seasons { display: block; }

/* Watch-State-Button auf Cards (☆ Watch List ★ / Gesehen ✔) */
.result-card, .strip-card { position: relative; }
.ws-btn {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%;
  background: rgba(14, 16, 20, 0.72); color: var(--muted);
  font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.ws-btn:hover { background: rgba(14, 16, 20, 0.9); color: var(--text); }
.ws-btn.ws-watchlist { color: #f4c542; }
.ws-btn.ws-watched { color: var(--ok); }

/* Pagination-Leiste (<< < 1 2 … > >>) */
.pagination {
  display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center;
  justify-content: center; margin-top: 1.2rem;
}
.pagination .btn { min-width: 2.4rem; text-align: center; padding: 0.45rem 0.6rem; }
.pagination .btn.disabled { opacity: 0.4; pointer-events: none; }
.pagination .btn:hover { text-decoration: none; }

/* Foto-Galerie auf der Personen-Seite */
.photo-strip { display: flex; gap: 0.6rem; overflow-x: auto; padding-bottom: 0.6rem; }
.photo-strip img {
  height: 180px; width: auto; border-radius: 8px; display: block;
  background: var(--panel2);
}
.photo-strip a:hover img { outline: 2px solid var(--accent); }

/* Personen-Karten (Besetzung) */
.person-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}
.person-card {
  display: flex; gap: 0.7rem; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem;
}
.person-card img, .person-card .noface {
  width: 56px; height: 84px; object-fit: cover; border-radius: 6px;
  background: var(--panel2); flex: 0 0 auto;
}
.person-card .noface { display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.person-name { font-weight: 600; font-size: 0.92rem; }
