:root {
  --bg: #0b0e14;
  --bg2: #11151f;
  --card: #161b27;
  --card-hover: #1d2434;
  --border: #262d3f;
  --text: #eef1f7;
  --muted: #9aa3b8;
  --accent: #ff4d6d;
  --drakor: #ffb703;
  --dracin: #4cc9f0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,14,20,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.accent { color: var(--accent); }
.main-nav { display: flex; gap: 8px; }
.nav-link { color: var(--muted); text-decoration: none; font-size: .93rem; padding: 8px 14px; border-radius: 8px; transition: all .15s; }
.nav-link:hover { color: var(--text); background: var(--card); }
.nav-link.active { color: #fff; font-weight: 700; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 70px 0 56px; overflow: hidden; background: radial-gradient(ellipse at 20% 30%, rgba(255,77,109,.18), transparent 60%), linear-gradient(180deg, #131a2a, var(--bg)); }
.hero .container { position: relative; z-index: 2; }
.hero-badge { display: inline-block; background: rgba(255,77,109,.15); color: var(--accent); font-size: .78rem; font-weight: 800; padding: 5px 14px; border-radius: 999px; margin-bottom: 14px; letter-spacing: .3px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; letter-spacing: -1px; line-height: 1.1; max-width: 700px; }
.hero-meta { margin-top: 12px; color: #cfd6e4; font-size: .95rem; }
.hero-desc { margin-top: 14px; color: var(--muted); max-width: 620px; font-size: 1rem; }
.hero-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, transparent, var(--bg)); }

/* ---------- buttons ---------- */
.btn { display: inline-block; padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: .95rem; text-decoration: none; transition: all .15s; cursor: pointer; border: 0; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 20px rgba(255,77,109,.4); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,.14); }

/* ---------- rows ---------- */
.row { margin-top: 32px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.row-head .row-title { margin-bottom: 0; }
.row-title { font-size: 1.3rem; font-weight: 800; }

.carousel-controls { display: flex; gap: 8px; flex-shrink: 0; }
.ctrl-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 50%;
  cursor: pointer; font-size: 1.1rem; font-weight: 700;
  transition: all .15s; line-height: 1;
}
.ctrl-btn:hover { border-color: var(--accent); background: var(--card-hover); }
.ctrl-btn:disabled { opacity: .35; cursor: default; }

.carousel {
  display: flex; gap: 14px;
  overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}
.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.carousel .card { flex: 0 0 auto; width: 200px; scroll-snap-align: start; }
.carousel .card-poster { height: auto; aspect-ratio: 2 / 3; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.tab-group { display: flex; gap: 6px; background: var(--card); padding: 4px; border-radius: 999px; border: 1px solid var(--border); }
.tab { border: 0; background: transparent; color: var(--muted); padding: 8px 18px; border-radius: 999px; cursor: pointer; font-size: .9rem; font-weight: 600; transition: all .15s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #fff; }
.search-wrap { flex: 1; min-width: 180px; }
#search { width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: .95rem; outline: none; transition: border-color .15s; }
#search:focus { border-color: var(--accent); }
.filter-wrap select { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: .95rem; outline: none; cursor: pointer; }
.result-info { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none; color: var(--text);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  animation: fadeIn .3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card-poster {
  position: relative; height: 190px;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px; text-align: center; overflow: hidden;
}
.poster-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
}
.card-poster-fallback {
  position: relative; z-index: 1;
  font-size: 1rem; font-weight: 800; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  display: none;
}
.card-poster-title { font-size: 1rem; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.card-poster .badge { position: absolute; top: 10px; left: 10px; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.25; }
.card-meta { padding: 0 14px 14px; }
.card-featured { min-width: 220px; scroll-snap-align: start; }

.badge { font-size: .7rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }
.badge-drakor { background: rgba(255,183,3,.16); color: var(--drakor); }
.badge-dracin { background: rgba(76,201,240,.16); color: var(--dracin); }
.card-year { color: var(--muted); font-size: .85rem; }

.genre-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.genre-tag { font-size: .72rem; background: var(--card-hover); color: var(--text); padding: 3px 10px; border-radius: 999px; }

.platform-links { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-link { text-decoration: none; font-size: .82rem; font-weight: 700; color: #fff; padding: 8px 14px; border-radius: 8px; background: #3a4152; transition: filter .15s, transform .1s; }
.platform-link:hover { filter: brightness(1.15); transform: scale(1.02); }
.platform-link.netflix { background: #e50914; }
.platform-link.viu { background: #b5121b; }
.platform-link.iqiyi { background: #00be06; }
.platform-link.wetv { background: #fa5425; }
.prov-link { display: inline-flex; align-items: center; gap: 8px; background: #222a3a; }
.prov-logo { width: 24px; height: 24px; border-radius: 5px; object-fit: cover; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.muted { color: var(--muted); font-size: .88rem; }

/* ---------- detail page ---------- */
.detail-page { padding-top: 32px; }
.detail-hero { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-poster { position: relative; flex: 0 0 220px; height: 300px; border-radius: var(--radius); display: flex; align-items: flex-end; justify-content: center; padding: 16px; text-align: center; }
.detail-poster-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; border-radius: var(--radius); }
.detail-info { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 14px; }
.detail-info h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 900; letter-spacing: -.5px; }
.detail-meta { color: #cfd6e4; font-size: .95rem; }
.detail-sinopsis { color: #c6cdda; font-size: 1rem; }

.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16 / 9; }
.player { width: 100%; height: 100%; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 36px; margin-top: 40px; text-align: center; }
.site-footer p { margin-bottom: 4px; }

@media (max-width: 640px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .detail-hero { flex-direction: column; }
  .detail-poster { flex-basis: auto; width: 100%; height: 220px; }
}
