:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --surface2: #2a2a4a;
  --accent: #c084fc;
  --accent2: #8b5cf6;
  --text: #eee;
  --muted: #888;
  --radius: 10px;
}

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

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

#navbar {
  position:sticky; top:0; z-index:100;
  background:rgba(15,15,26,0.9); backdrop-filter:blur(8px);
  border-bottom:1px solid #2a2a4a;
}
.nav-inner {
  max-width:1400px; margin:0 auto; padding:14px 20px;
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
}
.logo { color:var(--accent2); font-size:1.5rem; font-weight:800; text-decoration:none; }
.nav-right { display:flex; align-items:center; gap:10px; }
.search-box { display:flex; gap:0; }
.search-box input {
  background:var(--surface); color:var(--text); border:1px solid var(--surface2);
  border-right:none; padding:10px 14px; border-radius:8px 0 0 8px; width:260px; outline:none;
}
.search-box button {
  background:var(--accent2); color:#fff; border:none; border-radius:0 8px 8px 0;
  padding:0 18px; cursor:pointer; font-weight:600;
}
.search-box button:hover { filter:brightness(1.1); }

main { max-width:1400px; margin:0 auto; padding:20px; }

.content-wrap { display:flex; gap:24px; align-items:flex-start; }
#home-view, #search-view { flex:1; min-width:0; }

#sidebar {
  width:210px; flex-shrink:0; position:sticky; top:80px;
  background:var(--surface); border:1px solid var(--surface2);
  border-radius:var(--radius); padding:18px; display:flex; flex-direction:column; gap:12px;
}
#sidebar h3 { font-size:1rem; margin-bottom:4px; color:var(--accent2); }
.filter-label { font-size:0.75rem; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; margin-top:4px; }
#sidebar select {
  width:100%; background:var(--bg); color:var(--text); border:1px solid var(--surface2);
  border-radius:8px; padding:10px 12px; font-size:0.9rem; cursor:pointer; outline:none;
}
#sidebar select:focus { border-color:var(--accent2); }
.filter-reset {
  margin-top:6px; background:var(--accent2); color:#fff; border:none; border-radius:8px;
  padding:10px; cursor:pointer; font-weight:600;
}
.filter-reset:hover { filter:brightness(1.1); }

@media (max-width:760px) {
  .content-wrap { flex-direction:column; }
  #sidebar { width:100%; position:static; flex-direction:row; flex-wrap:wrap; }
  #sidebar select { width:calc(50% - 6px); }
}

#category-bar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:24px; }
.category-btn {
  background:var(--surface); color:var(--text); border:1px solid var(--surface2);
  border-radius:20px; padding:8px 18px; cursor:pointer; font-size:0.9rem;
}
.category-btn:hover { background:var(--surface2); }
.category-btn.active { background:var(--accent2); border-color:var(--accent2); color:#fff; }

h2 { margin:10px 0 20px; font-size:1.4rem; }

.anime-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(150px,1fr));
  gap:16px;
}
.anime-card {
  background:var(--surface); border-radius:var(--radius); overflow:hidden;
  cursor:pointer; transition:transform .15s, box-shadow .15s;
}
.anime-card:hover { transform:translateY(-4px); box-shadow:0 8px 24px rgba(0,0,0,.4); }
.anime-card img { width:100%; aspect-ratio:3/4; object-fit:cover; display:block; }
.card-media { position:relative; }
.format-badge {
  position:absolute; top:8px; left:8px; z-index:2;
  background:rgba(0,0,0,.75); color:#fff;
  font-size:0.65rem; font-weight:700; padding:3px 8px; border-radius:6px;
  text-transform:uppercase; letter-spacing:0.4px;
}
.format-badge.movie { background:#8b5cf6; color:#fff; }
.format-badge.series { background:rgba(0,0,0,.75); border:1px solid #8b5cf6; }
.card-body { padding:10px 12px; }
.card-title { font-size:0.9rem; font-weight:600; line-height:1.3; }
.card-meta { display:flex; gap:8px; margin-top:6px; font-size:0.75rem; color:var(--muted); }
.card-meta .score { color:var(--accent); font-weight:700; }

#loadMoreWrap, #searchLoadMore { text-align:center; margin:30px 0; }
#loadMoreWrap button, #searchLoadMore button {
  background:var(--surface2); color:var(--text); border:none; border-radius:6px;
  padding:12px 30px; cursor:pointer; font-size:1rem;
}
#loadMoreWrap button:hover, #searchLoadMore button:hover { background:#3a3a5a; }

.back-btn {
  background:var(--surface2); color:var(--text); border:none; border-radius:6px;
  padding:10px 20px; cursor:pointer; margin-bottom:20px; font-size:0.95rem;
}
.back-btn:hover { background:#3a3a5a; }

.detail-wrap { display:flex; gap:30px; flex-wrap:wrap; }
.detail-poster img { width:260px; max-width:100%; border-radius:var(--radius); display:block; }
.detail-info { flex:1; min-width:280px; }
.detail-info h1 { font-size:1.7rem; margin-bottom:6px; }
.detail-meta { display:flex; gap:12px; flex-wrap:wrap; margin:12px 0; color:var(--muted); font-size:0.9rem; }
.detail-meta .score { color:var(--accent); font-weight:700; }
.genres { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.genres span { background:var(--surface2); border-radius:14px; padding:4px 12px; font-size:0.75rem; }
.overview { color:#bbb; line-height:1.6; margin-bottom:20px; max-width:800px; }
.watch-btn {
  display:inline-block; background:var(--accent2); color:#fff; border:none;
  border-radius:8px; padding:14px 40px; font-size:1.1rem; font-weight:700; cursor:pointer;
}
.watch-btn:hover { filter:brightness(1.1); }

.ep-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(90px,1fr)); gap:10px; }
.ep-btn {
  background:var(--surface); border:1px solid var(--surface2); color:var(--text);
  border-radius:8px; padding:12px; cursor:pointer; text-align:center; font-size:0.9rem;
}
.ep-btn:hover { background:var(--surface2); }

.ep-dropdown { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.ep-dropdown select {
  background:var(--surface); color:var(--text); border:1px solid var(--surface2);
  border-radius:8px; padding:12px 14px; font-size:1rem; cursor:pointer; max-width:220px;
}
.ep-dropdown .watch-btn { padding:12px 30px; }

.player-shell { position:relative; max-width:1000px; margin:0 auto; }
.player-shell iframe {
  width:100%; height:calc(100vw * 9/20); max-height:80vh;
  border:none; border-radius:var(--radius); display:block;
}
.player-shield {
  position:absolute; inset:0; z-index:10;
  background:rgba(15,15,26,0.85); border-radius:var(--radius);
  display:flex; flex-direction:column; gap:12px; align-items:center; justify-content:center; cursor:pointer;
}
.player-shield:hover { background:rgba(15,15,26,0.7); }
.shield-play {
  width:80px; height:80px; border-radius:50%; background:var(--accent2); color:#fff;
  font-size:2rem; display:flex; align-items:center; justify-content:center; padding-left:6px;
}
.shield-text { color:#ccc; font-size:1rem; }

.mode-selector, .source-selector {
  display:flex; gap:8px; flex-wrap:wrap; margin:16px 0; justify-content:center;
}
.mode-btn, .source-btn {
  background:var(--surface); color:var(--text); border:1px solid var(--surface2);
  border-radius:6px; padding:8px 16px; cursor:pointer; font-size:0.85rem;
}
.mode-btn.active, .source-btn.active { background:var(--accent2); border-color:var(--accent2); color:#fff; }
.mode-btn:hover, .source-btn:hover { background:var(--surface2); }

.ep-label { text-align:center; margin-bottom:14px; color:var(--muted); font-size:0.9rem; }
.ep-label .player-title { display:block; color:var(--text); font-size:1.15rem; font-weight:700; margin-bottom:4px; }

.direct-shell video {
  width:100%; height:calc(100vw * 9/20); max-height:80vh;
  background:#000; border-radius:var(--radius); display:block; outline:none;
}

.vlc-row { text-align:center; margin-top:16px; }
.vlc-btn {
  background:var(--surface2); color:#fff; border:1px solid var(--surface2);
  border-radius:8px; padding:12px 28px; cursor:pointer; font-size:0.95rem; font-weight:600;
}
.vlc-btn:hover { background:#3a3a5a; }

.loading { text-align:center; color:var(--muted); padding:60px 0; }

@media (max-width:600px) {
  .search-box input { width:150px; }
  .detail-poster img { width:180px; }
}
