*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* AGE GATE */
#age-gate {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#age-gate.hidden { display: none; }

#age-gate-box {
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(233,69,96,0.15);
}

#age-gate-logo {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}
#age-gate-logo span { color: #e94560; }

#age-gate-warning {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e94560;
  margin-bottom: 16px;
}

#age-gate-text {
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 32px;
}
#age-gate-text strong { color: #fff; }

#age-gate-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

#age-yes {
  background: #e94560;
  border: none;
  color: #fff;
  padding: 14px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
#age-yes:hover { background: #c73652; }

#age-no {
  background: transparent;
  border: 1px solid #333;
  color: #666;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
#age-no:hover { border-color: #555; color: #999; }

#age-gate-legal {
  font-size: 0.75rem;
  color: #444;
  line-height: 1.5;
}

:root {
  --bg: #0d0d0d;
  --bg2: #1a1a1a;
  --bg3: #242424;
  --accent: #e94560;
  --accent2: #c73652;
  --text: #e0e0e0;
  --text-muted: #888;
  --border: #333;
  --tag-bg: #2a2a2a;
  --radius: 8px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}
.logo span { color: var(--accent); }

nav { display: flex; gap: 4px; }

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.nav-btn:hover { color: var(--text); background: var(--bg3); }
.nav-btn.active { color: var(--accent); background: rgba(233,69,96,0.12); }

/* MAIN */
main { flex: 1; padding: 32px 24px; max-width: 1200px; margin: 0 auto; width: 100%; }

.tab { display: none; }
.tab.active { display: block; }

h2 { font-size: 1.6rem; margin-bottom: 24px; color: #fff; }
h3 { font-size: 1rem; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

.tab-desc { color: var(--text-muted); margin-bottom: 24px; }

/* INPUTS */
input[type="text"], input[type="url"], select, textarea {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
input[type="text"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus { border-color: var(--accent); }

select { cursor: pointer; }

button {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
button:hover { border-color: var(--accent); color: var(--accent); }

.primary-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.primary-btn:hover { background: var(--accent2); border-color: var(--accent2); color: #fff; }

.big-btn { padding: 14px 36px; font-size: 1.1rem; }
.small-btn { padding: 6px 12px; font-size: 0.8rem; }

/* SEARCH TAB */
.search-box { display: flex; gap: 8px; margin-bottom: 20px; }
.search-box input { flex: 1; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  background: var(--bg2);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-muted); }
.filters select, .filters input { min-width: 160px; }

.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.placeholder-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.placeholder-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card-thumb {
  background: var(--bg3);
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--border);
}
.card-info { padding: 10px; }
.card-info strong { display: block; font-size: 0.9rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-info span { font-size: 0.78rem; color: var(--text-muted); }

/* TAGS TAB */
.tag-search-box { margin-bottom: 24px; }
.tag-search-box input { width: 100%; max-width: 400px; }

.tag-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin-bottom: 32px; }

.tag-group {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag.selected { background: rgba(233,69,96,0.2); border-color: var(--accent); color: var(--accent); }
.tag[data-count]::after { content: ' · ' attr(data-count); color: var(--text-muted); font-size: 0.75rem; }
.tag.lang { border-color: #3a5a8a; color: #7aaddf; background: rgba(58,90,138,0.15); }

.selected-tags-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.selected-tags-panel h3 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
#selected-tags-display { min-height: 36px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

/* RANDOM TAB */
.random-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; margin-bottom: 32px; }
.random-filter { display: flex; flex-wrap: wrap; gap: 12px; }
.random-filter label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-muted); }

.random-result {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  padding: 32px;
}
.random-placeholder { color: var(--text-muted); text-align: center; }
.random-card { text-align: center; }
.random-card .rtitle { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.random-card .rmeta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.random-card .rtags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

.random-history h3 { margin-bottom: 12px; }
#random-history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.history-item .htime { color: var(--text-muted); font-size: 0.8rem; }

/* DOWNLOADER TAB */
.downloader-box { display: flex; gap: 8px; margin-bottom: 20px; }
.downloader-box input { flex: 1; }

.dl-options {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.dl-options label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-muted); }

.dl-progress {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-bar-wrap {
  flex: 1;
  background: var(--bg3);
  border-radius: 99px;
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s;
  width: 0%;
}

.dl-log {
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: monospace;
  font-size: 0.82rem;
  color: #0f0;
  min-height: 80px;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 24px;
  white-space: pre-wrap;
}
.dl-log:empty::before { content: '> Bereit...'; color: var(--text-muted); }

.dl-batch h3 { margin-bottom: 12px; }
.dl-batch textarea {
  width: 100%;
  height: 100px;
  resize: vertical;
  margin-bottom: 10px;
  font-family: monospace;
  font-size: 0.85rem;
}

/* FAVORITES TAB */
.fav-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.fav-controls input { flex: 1; min-width: 200px; }

.fav-collections {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.fav-collections h3 { margin-bottom: 0; margin-right: 4px; }
.collection {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.collection.active, .collection:hover { border-color: var(--accent); color: var(--accent); }
.fav-count {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.75rem;
  margin-left: 4px;
}

.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.fav-empty { grid-column: 1/-1; text-align: center; color: var(--text-muted); padding: 48px; }

.fav-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.fav-card-thumb {
  background: var(--bg3);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--border);
}
.fav-card-info { padding: 10px; }
.fav-card-info strong { display: block; font-size: 0.88rem; margin-bottom: 4px; }
.fav-card-info span { font-size: 0.78rem; color: var(--text-muted); }
.fav-card-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.fav-card:hover .fav-card-remove { opacity: 1; }

.fav-add-manual {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.fav-add-manual h3 { width: 100%; margin-bottom: 0; }
.fav-add-manual input { flex: 1; min-width: 180px; }

/* FOOTER */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* RESPONSIVE */
@media (max-width: 600px) {
  header { flex-direction: column; height: auto; padding: 12px; gap: 8px; }
  nav { flex-wrap: wrap; justify-content: center; }
  main { padding: 16px; }
}
