* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #0f0f0f; color: #e5e5e5; font-family: system-ui, -apple-system, sans-serif; }
a { color: inherit; }
/* key gate */
.key-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.key-card { background: #171717; border: 1px solid #262626; border-radius: 14px; padding: 32px 28px; width: 100%; max-width: 380px; text-align: center; }
.key-card h1 { font-size: 2rem; letter-spacing: 2px; }
.key-sub { color: #f43f5e; font-size: 0.85rem; margin: 4px 0 12px; }
.key-card p { color: #a3a3a3; font-size: 0.95rem; margin-bottom: 12px; }
.key-err { background: #3f1d24; color: #fda4af; border-radius: 8px; padding: 10px; margin-bottom: 12px; font-size: 0.9rem; }
.key-card form { display: flex; flex-direction: column; gap: 10px; }
.key-card input { background: #0f0f0f; border: 1px solid #333; color: #fff; border-radius: 8px; padding: 12px; font-size: 1rem; }
.key-card button { background: #f43f5e; color: #fff; border: 0; border-radius: 8px; padding: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; }
/* topbar */
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #141414; border-bottom: 1px solid #262626; position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: 1px; white-space: nowrap; }
.brand span { color: #f43f5e; font-size: 0.8rem; font-weight: 600; }
.brand .back { text-decoration: none; margin-right: 6px; }
.meta { color: #a3a3a3; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { flex: 1; max-width: 420px; margin-left: auto; }
.search input { width: 100%; background: #0f0f0f; border: 1px solid #333; color: #fff; border-radius: 999px; padding: 8px 16px; }
.logout { color: #a3a3a3; text-decoration: none; font-size: 0.85rem; white-space: nowrap; }
/* tabs */
.tabs { display: flex; gap: 8px; padding: 12px 16px 0; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; }
.tab { padding: 8px 18px; border-radius: 999px; background: #1f1f1f; color: #d4d4d4; text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.tab.active { background: #f43f5e; color: #fff; }
/* grid */
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.row-title { margin: 8px 0 12px; font-size: 1.1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.card { text-decoration: none; background: #171717; border-radius: 10px; overflow: hidden; }
.poster { aspect-ratio: 3/4; background: #262626; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info { padding: 8px 10px; }
.title { font-size: 0.85rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.eps { font-size: 0.75rem; color: #a3a3a3; margin-top: 4px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 24px 0; }
.pager a { background: #1f1f1f; padding: 8px 18px; border-radius: 999px; text-decoration: none; font-size: 0.9rem; }
.pager span { color: #a3a3a3; font-size: 0.9rem; }
footer { text-align: center; padding: 20px; color: #525252; font-size: 0.8rem; }
footer a { color: #737373; }
/* detail */
.detail { max-width: 900px; }
.detail-head { display: flex; gap: 20px; margin-bottom: 24px; }
.detail-poster { flex: 0 0 180px; }
.detail-poster img { width: 100%; border-radius: 10px; }
.detail-info h1 { font-size: 1.5rem; margin-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { background: #262626; border-radius: 999px; padding: 4px 12px; font-size: 0.75rem; color: #d4d4d4; }
.meta-line { color: #a3a3a3; font-size: 0.9rem; margin-bottom: 12px; }
.synopsis { color: #d4d4d4; font-size: 0.95rem; line-height: 1.6; margin-bottom: 16px; }
.watch-btn { display: inline-block; background: #f43f5e; color: #fff; text-decoration: none; font-weight: 700; padding: 12px 28px; border-radius: 10px; }
.watch-btn.secondary { background: #262626; font-weight: 600; padding: 10px 20px; }
.row h2 { margin-bottom: 12px; font-size: 1.1rem; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.ep-btn { background: #1f1f1f; border-radius: 8px; padding: 10px 0; text-align: center; text-decoration: none; font-weight: 600; font-size: 0.9rem; }
/* watch */
.watch { max-width: 960px; }
.watch video { width: 100%; border-radius: 10px; background: #000; max-height: 70vh; }
.ep-nav { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .detail-head { flex-direction: column; }
  .detail-poster { flex: none; width: 140px; }
}
