:root {
  --accent: #ff3d6e;
  --accent-2: #8b5cf6;
  --bg: #0b0b10;
  --bg-elev: #14141c;
  --bg-elev-2: #1c1c27;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f3f7;
  --muted: #9a9ab0;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --header-h: 68px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f6fa;
  --bg-elev: #ffffff;
  --bg-elev-2: #eeeef4;
  --line: rgba(0, 0, 0, 0.08);
  --text: #15151c;
  --muted: #64647a;
  --shadow: 0 10px 30px rgba(20, 20, 40, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.container { width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.header .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent);
}

.logo-mark svg { width: 16px; height: 16px; fill: #fff; margin-left: 2px; }

.search {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.search input {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 0 52px 0 20px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.search input:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.search button {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  display: grid;
  place-items: center;
}

.search button svg { width: 16px; height: 16px; stroke: #fff; }

.nav { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.nav a, .icon-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.nav a:hover, .icon-btn:hover, .nav a.active { background: var(--bg-elev-2); color: var(--text); }
.icon-btn { padding: 0; width: 40px; justify-content: center; }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Chips & Toolbar ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0 8px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  mask-image: linear-gradient(90deg, #000 92%, transparent);
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, border-color .2s, transform .15s;
}

.chip:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.chip.active { background: var(--text); color: var(--bg); border-color: transparent; }
.chip small { color: var(--muted); font-weight: 500; }
.chip.active small { color: inherit; opacity: .6; }

.segmented {
  display: flex;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  flex-shrink: 0;
}

.segmented button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.segmented button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.page-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 18px 0 4px;
}

.page-title h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0; }
.page-title span { color: var(--muted); font-size: 14px; }

/* ---------- Video-Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px 20px;
  padding: 16px 0 40px;
}

.card { display: block; min-width: 0; }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev-2);
  isolation: isolate;
}

.thumb img, .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}

.thumb .preview { position: absolute; inset: 0; opacity: 0; }
.card:hover .thumb .preview.ready { opacity: 1; }
.card:hover .thumb img, .card:hover .thumb > video:not(.preview) { transform: scale(1.06); }

.thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .55));
  pointer-events: none;
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 25% 20%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 55%),
    radial-gradient(circle at 80% 90%, color-mix(in srgb, var(--accent-2) 50%, transparent), transparent 55%),
    var(--bg-elev-2);
}

.thumb-placeholder svg { width: 44px; height: 44px; fill: rgba(255, 255, 255, .85); }

.badge {
  position: absolute;
  z-index: 2;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(6px);
}

.badge.left { right: auto; left: 10px; display: flex; align-items: center; gap: 4px; }
.badge.left svg { width: 12px; height: 12px; fill: #4ade80; }

.play-hover {
  position: absolute;
  z-index: 2;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .25s, transform .25s;
}

.play-hover svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
.card:hover .play-hover { opacity: 1; transform: scale(1); }
.card:hover .thumb .preview.ready ~ .play-hover { opacity: 0; }

.card-body { padding: 12px 2px 0; }

.card-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card:hover .card-title { color: var(--accent); }

.meta { color: var(--muted); font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

/* ---------- Pagination ---------- */

.pagination { display: flex; justify-content: center; gap: 6px; padding: 0 0 60px; flex-wrap: wrap; }

.pagination button {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  cursor: pointer;
  font-weight: 600;
}

.pagination button:hover:not(:disabled) { border-color: var(--accent); }
.pagination button.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.pagination button:disabled { opacity: .35; cursor: default; }

/* ---------- Videoseite ---------- */

.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  padding: 24px 0 60px;
}

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.watch h1 { font-size: 22px; letter-spacing: -0.01em; margin: 18px 0 10px; line-height: 1.3; }

.watch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .1s;
}

.btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn.on { background: color-mix(in srgb, var(--accent) 22%, var(--bg-elev-2)); border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  color: #fff;
}

.btn-primary:hover { filter: brightness(1.1); }

.rating-bar {
  width: 120px;
  height: 4px;
  border-radius: 4px;
  background: var(--bg-elev-2);
  overflow: hidden;
  margin-top: 6px;
}

.rating-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.desc {
  margin-top: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  white-space: pre-wrap;
  color: color-mix(in srgb, var(--text) 85%, var(--muted));
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag-row .chip { height: 30px; font-size: 13px; padding: 0 12px; }

.sidebar h3 { font-size: 16px; margin: 0 0 14px; }

.mini {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.mini .thumb { border-radius: 10px; }
.mini .card-title { font-size: 14px; }
.mini .badge { bottom: 6px; right: 6px; font-size: 11px; padding: 2px 6px; }

/* ---------- Kategorien ---------- */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding: 16px 0 60px;
}

.cat-card { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; }
.cat-card .thumb { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.cat-card .thumb::after { background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.8)); }

.cat-card .label {
  position: absolute;
  z-index: 3;
  left: 16px;
  bottom: 14px;
  right: 16px;
  color: #fff;
}

.cat-card .label strong { display: block; font-size: 18px; }
.cat-card .label small { opacity: .75; }
.cat-card:hover .thumb img { transform: scale(1.08); }

/* ---------- Leerzustand & Laden ---------- */

.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty svg { width: 56px; height: 56px; opacity: .4; margin-bottom: 10px; }

.skeleton .thumb, .skeleton .line {
  background: linear-gradient(90deg, var(--bg-elev-2) 0%, var(--bg-elev) 50%, var(--bg-elev-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton .line { height: 12px; border-radius: 6px; margin-top: 12px; }
.skeleton .line.short { width: 55%; margin-top: 8px; }

@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Altersabfrage ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 5, 10, .7);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.gate-box {
  max-width: 440px;
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.gate-box .logo { justify-content: center; margin-bottom: 18px; }
.gate-box h2 { margin: 0 0 8px; font-size: 22px; }
.gate-box p { color: var(--muted); margin: 0 0 24px; }
.gate-box .actions { justify-content: center; }
.gate-box .btn { height: 46px; padding: 0 24px; }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding: 28px 0;
}

.footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

[hidden] { display: none !important; }

/* ---------- Abschnitte ---------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 0;
}

.section-head h2 { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.section-head h2 svg { width: 20px; height: 20px; color: var(--accent); }
.section-head a { color: var(--muted); font-size: 14px; font-weight: 600; }
.section-head a:hover { color: var(--accent); }

/* ---------- Galerie-Karten ---------- */

.mosaic { display: grid; grid-template-columns: 2fr 1fr; gap: 3px; }
.mosaic.single { grid-template-columns: 1fr; }
.mosaic-main, .mosaic-side > div { overflow: hidden; background: var(--bg-elev); min-height: 0; }
.mosaic-side { display: grid; grid-template-rows: 1fr 1fr; gap: 3px; min-height: 0; }
.mosaic-side:has(> div:only-child) { grid-template-rows: 1fr; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.album:hover .mosaic img { transform: scale(1.06); }
.album .badge { display: flex; align-items: center; gap: 5px; }
.album .badge svg { width: 13px; height: 13px; }

/* ---------- Album ---------- */

.album-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  padding: 26px 0 8px;
}

.album-head h1 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 6px; }
.album-desc { color: var(--muted); max-width: 720px; margin: 10px 0 0; white-space: pre-wrap; }
.album-head .tag-row { margin-top: 12px; }

.masonry {
  columns: 4 260px;
  column-gap: 12px;
  padding: 18px 0 30px;
}

.tile {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  margin: 0 0 12px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elev-2);
  cursor: zoom-in;
  break-inside: avoid;
  position: relative;
}

.tile img { width: 100%; height: auto; min-height: 120px; transition: transform .5s cubic-bezier(.2, .8, .2, 1), filter .3s; }
.tile:hover img { transform: scale(1.04); filter: brightness(1.08); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

#related-g .grid { padding-top: 16px; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(5, 5, 9, .96);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: #fff;
  animation: fade .2s ease;
}

@keyframes fade { from { opacity: 0; } }

.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; }
.lb-count { font-weight: 600; font-size: 14px; opacity: .8; font-variant-numeric: tabular-nums; }
.lb-tools { display: flex; gap: 6px; }

.lb-btn, .lb-nav {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s;
}

.lb-btn:hover, .lb-nav:hover { background: rgba(255, 255, 255, .2); }
.lb-btn svg { width: 18px; height: 18px; fill: none; }
.lb-btn[data-act="play"] svg { fill: #fff; }
.lightbox.playing .lb-btn[data-act="play"] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.lb-stage { display: grid; place-items: center; min-height: 0; padding: 0 70px; }
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0;
  transform: scale(.98);
  transition: opacity .25s, transform .25s;
  user-select: none;
}
.lb-stage img.in { opacity: 1; transform: none; }

.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; }
.lb-nav svg { width: 22px; height: 22px; }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }

.lb-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 18px 16px;
  scrollbar-width: none;
  justify-content: safe center;
}

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

.lb-strip button {
  flex-shrink: 0;
  width: 64px;
  height: 46px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  opacity: .45;
  transition: opacity .2s, border-color .2s;
}

.lb-strip button:hover { opacity: .8; }
.lb-strip button.active { opacity: 1; border-color: var(--accent); }
.lb-strip img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .watch { grid-template-columns: 1fr; }
  .mini { grid-template-columns: 200px 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: auto; }
  .container { padding: 0 16px; }
  .header .container { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .nav { margin-left: auto; }
  .nav a span { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .chips { mask-image: none; }
  .segmented { overflow-x: auto; scrollbar-width: none; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented button { white-space: nowrap; flex: 1; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 14px; }
  .mini { grid-template-columns: 140px 1fr; }
  .player { border-radius: 12px; margin: 0 -16px; border-radius: 0; }
  .masonry { columns: 2; column-gap: 8px; }
  .tile { margin-bottom: 8px; border-radius: 8px; }
  .album-head h1 { font-size: 22px; }
  .lb-stage { padding: 0; }
  .lb-nav { display: none; }
}
