:root {
  --bg: #000000;
  --surface: #121214;
  --surface-2: #1c1c21;
  --surface-3: #26262d;
  --border: rgba(255, 255, 255, 0.1);
  --border-hi: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --text-2: #b3b3b8;
  --text-3: #7c7c85;
  --red: #e50914;
  --red-hi: #f6121d;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --top-h: 56px;
  --tab-h: 60px;
  --rail-w: 76px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
svg { display: block; }
body.lock-scroll { overflow: hidden; }

.app-shell { min-height: 100dvh; display: flex; background: var(--bg); }
.rail-nav {
  display: none; position: fixed; inset: 0 auto 0 0; width: var(--rail-w);
  background: #08080a; border-right: 1px solid var(--border); z-index: 40;
  flex-direction: column; align-items: center; padding: 16px 8px; gap: 18px;
}
.rail-logo { width: 42px; height: 42px; border-radius: 10px; background: var(--red); display: grid; place-items: center; font-weight: 900; font-size: 24px; color: #fff; }
.rail-links { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.rail-btn {
  width: 100%; padding: 10px 4px; border-radius: 12px; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn:hover { background: rgba(255,255,255,0.07); color: #fff; }
.rail-btn.is-active { color: #fff; background: rgba(229,9,20,0.16); }
.rail-btn.is-active svg { color: var(--red); }
.rail-settings { margin-top: auto; }

.app-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 35;
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 16px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0) 100%);
  transition: background 0.2s;
}
.top-bar.is-solid { background: rgba(10,10,12,0.92); backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); }
.brand-mark { display: flex; align-items: center; gap: 10px; }
.brand-k { font-size: 28px; font-weight: 900; color: var(--red); line-height: 1; letter-spacing: -0.05em; }
.top-title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.top-right { display: flex; align-items: center; gap: 8px; }
.icon-circle { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,0.08); }
.icon-circle:hover { background: rgba(255,255,255,0.18); }
.icon-circle svg { width: 20px; height: 20px; }

.screen-root { flex: 1; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 22px); outline: none; }
.container { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 14px; }

.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tab-h) + var(--safe-b)); padding: 6px 8px var(--safe-b);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(12,12,14,0.94); backdrop-filter: blur(20px); border-top: 1px solid var(--border);
}
.tab-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 10.5px; font-weight: 700; }
.tab-btn svg { width: 22px; height: 22px; }
.tab-btn.is-active { color: #fff; }
.my-avatar-mini { width: 22px; height: 22px; border-radius: 5px; background: var(--red); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; }

@media (min-width: 768px) {
  .rail-nav { display: flex; }
  .app-body { margin-left: var(--rail-w); }
  .top-bar { left: var(--rail-w); padding-inline: 26px; }
  .brand-k { display: none; }
  .tab-bar { display: none; }
  .screen-root { padding-bottom: 48px; }
  .container { padding: 0 26px; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px; border-radius: 6px; font-size: 14px; font-weight: 800;
  transition: transform 0.1s, opacity 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-white { background: #fff; color: #000; }
.btn-white:hover { background: #e5e7eb; }
.btn-dark { background: rgba(58,58,66,0.78); color: #fff; backdrop-filter: blur(8px); }
.btn-dark:hover { background: rgba(82,82,92,0.88); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-hi); }
.btn-ghost { background: transparent; border: 1px solid var(--border-hi); color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; }

.home-pills {
  display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: calc(var(--top-h) + var(--safe-t) + 6px) 14px 14px; position: relative; z-index: 6;
}
.home-pills::-webkit-scrollbar { display: none; }
.pill-filter {
  flex: 0 0 auto; height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.34); background: rgba(18,18,22,0.45);
  font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; backdrop-filter: blur(10px);
}
.pill-filter.is-active { background: #fff; color: #000; border-color: #fff; }
.pill-filter svg { width: 14px; height: 14px; }
@media (min-width: 768px) { .home-pills { padding: calc(var(--top-h) + 8px) 26px 16px; } }

.bb-wrap { position: relative; padding: 0 16px 24px; }
.bb-card {
  position: relative; width: 100%; max-width: 440px; margin: 0 auto;
  aspect-ratio: 2 / 3; max-height: 68dvh; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 20px 55px rgba(0,0,0,0.85); background: var(--surface);
}
.bb-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.bb-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.18) 45%, rgba(0,0,0,0.92) 82%, #000 100%); }
.bb-content { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 18px 16px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.bb-series-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 900; letter-spacing: 0.2em; color: #e2e8f0; margin-bottom: 4px; }
.bb-series-tag b { color: var(--red); font-size: 15px; letter-spacing: 0; }
.bb-title { margin: 0 0 6px; font-size: clamp(24px, 6.2vw, 42px); font-weight: 900; line-height: 1.05; text-shadow: 0 4px 18px rgba(0,0,0,0.9); }
.bb-tags { font-size: 12.5px; color: #e2e8f0; font-weight: 600; margin-bottom: 14px; }
.bb-desc { display: none; margin: 0 0 16px; max-width: 48ch; font-size: 14px; color: #d4d4d8; }
.bb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.bb-dots { display: flex; gap: 6px; margin-top: 12px; }
.bb-dot { width: 7px; height: 7px; border-radius: 99px; background: rgba(255,255,255,0.3); transition: width 0.2s, background 0.2s; }
.bb-dot.is-active { width: 22px; background: var(--red); }
.bb-side-poster { display: none; }

@media (min-width: 768px) {
  .bb-wrap { padding: 0 26px 28px; }
  .bb-card { max-width: 1308px; aspect-ratio: 21 / 9; min-height: 360px; max-height: 470px; border-radius: 18px; }
  .bb-card > img { filter: blur(18px) brightness(0.45) saturate(1.2); transform: scale(1.1); }
  .bb-card::after { background: linear-gradient(90deg, rgba(0,0,0,0.94) 0%, rgba(0,0,0,0.52) 52%, rgba(0,0,0,0.15) 100%), linear-gradient(180deg, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0.88) 92%, #000 100%); }
  .bb-content { inset: 0; text-align: left; flex-direction: row; align-items: flex-end; justify-content: space-between; padding: 28px 34px; gap: 28px; }
  .bb-left { max-width: 560px; display: flex; flex-direction: column; align-items: flex-start; }
  .bb-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .bb-actions { display: flex; width: auto; }
  .bb-actions .btn { padding: 0 22px; }
  .bb-side-poster { display: block; width: 192px; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; position: relative; flex: 0 0 auto; border: 1px solid rgba(255,255,255,0.22); box-shadow: 0 18px 44px rgba(0,0,0,0.85); }
  .bb-side-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
}

.row-sec { margin-bottom: 24px; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.row-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.row-more { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.row-rail { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.row-rail::-webkit-scrollbar { display: none; }

.poster-card { flex: 0 0 108px; width: 108px; max-width: 108px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 5px; align-items: stretch; text-align: left; transition: transform 0.16s ease; }
@media (min-width: 600px) { .poster-card { flex: 0 0 138px; width: 138px; max-width: 138px; } }
@media (min-width: 1024px) { .poster-card { flex: 0 0 158px; width: 158px; max-width: 158px; } .poster-card:hover { transform: scale(1.03); } }
.poster-box { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid rgba(255,255,255,0.06); }
.poster-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster-k { position: absolute; top: 5px; left: 6px; font-size: 13px; font-weight: 900; color: var(--red); text-shadow: 0 1px 4px rgba(0,0,0,0.9); }
.poster-name { font-size: 12px; font-weight: 600; color: #e4e4e7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top10-card { flex: 0 0 148px; width: 148px; max-width: 148px; scroll-snap-align: start; position: relative; padding-left: 34px; display: flex; align-items: flex-end; text-align: left; }
@media (min-width: 768px) { .top10-card { flex: 0 0 184px; width: 184px; max-width: 184px; padding-left: 46px; } }
.top10-num { position: absolute; left: 0; bottom: -4px; font-size: 84px; font-weight: 900; line-height: 0.8; color: #000; -webkit-text-stroke: 2.5px rgba(255,255,255,0.62); letter-spacing: -0.08em; z-index: 1; pointer-events: none; }
@media (min-width: 768px) { .top10-num { font-size: 106px; } }
.top10-card .poster-box { z-index: 2; box-shadow: -6px 0 18px rgba(0,0,0,0.7); }

.cw-card { flex: 0 0 146px; width: 146px; max-width: 146px; scroll-snap-align: start; border-radius: 8px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; }
@media (min-width: 768px) { .cw-card { flex: 0 0 176px; width: 176px; max-width: 176px; } }
.cw-art { position: relative; width: 100%; aspect-ratio: 2 / 3; background: #111; }
.cw-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cw-play-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,0.68); border: 2px solid #fff; color: #fff; display: grid; place-items: center; }
.cw-play-badge svg { width: 20px; height: 20px; margin-left: 2px; }
.cw-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.25); }
.cw-prog i { display: block; height: 100%; background: var(--red); }
.cw-foot { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; color: var(--text-2); font-size: 11.5px; font-weight: 700; }
.cw-foot button { width: 28px; height: 28px; display: grid; place-items: center; color: var(--text-2); border-radius: 50%; }
.cw-foot button:hover { background: rgba(255,255,255,0.1); color: #fff; }
.cw-foot svg { width: 17px; height: 17px; }

.hot-wrap { padding-top: calc(var(--top-h) + var(--safe-t) + 8px); }
.hot-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 14px; }
.hot-chips::-webkit-scrollbar { display: none; }
.hot-feed { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 768px) { .hot-feed { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1160px) { .hot-feed { grid-template-columns: repeat(3, 1fr); } }
.hot-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.hot-media { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #111; overflow: hidden; }
.hot-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.hot-tag { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 5px; background: rgba(229,9,20,0.92); font-size: 11px; font-weight: 800; }
.hot-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.hot-body h3 { margin: 0; font-size: 18px; font-weight: 800; }
.hot-meta { font-size: 12px; color: var(--text-2); font-weight: 600; }
.hot-desc { margin: 0; font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hot-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }

.my-wrap { padding-top: calc(var(--top-h) + var(--safe-t) + 12px); }
.my-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 12px 0 24px; }
.my-avatar { width: 72px; height: 72px; border-radius: 14px; background: linear-gradient(135deg, var(--red), #991b1b); display: grid; place-items: center; font-size: 32px; font-weight: 900; box-shadow: 0 12px 32px rgba(229,9,20,0.35); }
.my-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 440px; margin-top: 6px; }
.my-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 8px; }
.my-stat b { display: block; font-size: 18px; }
.my-stat span { font-size: 11px; color: var(--text-3); }

.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.78); backdrop-filter: blur(8px); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 768px) { .backdrop { align-items: center; padding: 24px; } }
.detail-sheet { width: 100%; max-width: 820px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0; border: 1px solid var(--border-hi); position: relative; box-shadow: 0 24px 70px rgba(0,0,0,0.9); }
@media (min-width: 768px) { .detail-sheet { border-radius: 18px; max-height: 88dvh; } }
.sheet-hero { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 320px; background: #000; overflow: hidden; }
.sheet-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.sheet-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(18,18,20,0.96) 100%); }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 5; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,0.72); border: 1px solid rgba(255,255,255,0.2); color: #fff; display: grid; place-items: center; }
.sheet-close svg { width: 18px; height: 18px; }
.sheet-body { padding: 0 18px 28px; margin-top: -42px; position: relative; z-index: 3; }
.sheet-title { margin: 0 0 8px; font-size: clamp(22px, 5vw, 30px); font-weight: 900; line-height: 1.1; }
.sheet-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.tag-hd { padding: 1px 6px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.35); font-size: 10.5px; font-weight: 800; color: #fff; }
.sheet-cta-main { width: 100%; min-height: 44px; font-size: 15px; margin-bottom: 12px; }
.sheet-icon-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.sheet-ico-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px; border-radius: 10px; font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.sheet-ico-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sheet-ico-btn svg { width: 22px; height: 22px; }
.sheet-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin: 18px 0 14px; }
.sheet-tab { padding: 10px 0; font-size: 14px; font-weight: 800; color: var(--text-3); border-bottom: 3px solid transparent; }
.sheet-tab.is-active { color: #fff; border-bottom-color: var(--red); }

.ep-list { display: flex; flex-direction: column; gap: 10px; }
.ep-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; text-align: left; }
.ep-row:hover { border-color: var(--border-hi); }
.ep-thumb { position: relative; flex: 0 0 116px; width: 116px; height: 66px; border-radius: 6px; overflow: hidden; background: #000; }
.ep-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-play-mini { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.72); border: 1.5px solid #fff; display: grid; place-items: center; }
.ep-play-mini svg { width: 12px; height: 12px; margin-left: 1px; }
.ep-info { min-width: 0; flex: 1; }
.ep-info b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-info small { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }

.search-overlay { position: fixed; inset: 0; z-index: 70; background: #000; overflow-y: auto; padding: calc(var(--safe-t) + 10px) 14px calc(var(--safe-b) + 24px); }
.search-top { display: flex; align-items: center; gap: 10px; max-width: 960px; margin: 0 auto 14px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--border-hi); }
.search-field input { flex: 1; background: none; border: 0; outline: none; font-size: 15px; }
.search-body { max-width: 960px; margin: 0 auto; }
.top-search-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px; border-radius: 10px; background: var(--surface); margin-bottom: 8px; text-align: left; }
.top-search-row:hover { background: var(--surface-2); }
.top-search-thumb { position: relative; flex: 0 0 112px; width: 112px; height: 64px; border-radius: 6px; overflow: hidden; background: #111; }
.top-search-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.poster-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
@media (min-width: 600px) { .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 12px; } }
@media (min-width: 960px) { .poster-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.poster-grid .poster-card { flex: initial; width: 100%; max-width: none; }

.cat-modal { position: fixed; inset: 0; z-index: 75; background: rgba(0,0,0,0.92); backdrop-filter: blur(16px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; }
.cat-item { font-size: 20px; font-weight: 700; color: var(--text-2); padding: 8px 20px; border-radius: 99px; }
.cat-item:hover, .cat-item.is-active { color: #fff; background: rgba(255,255,255,0.1); }
.drawer-sheet { width: 100%; max-width: 440px; height: 100dvh; margin-left: auto; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border-hi); padding: calc(var(--safe-t) + 18px) 18px 28px; }
.set-group { background: var(--surface-2); border-radius: 12px; padding: 6px 14px; margin-bottom: 14px; }
.set-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.set-item:first-child { border-top: 0; }
.set-item b { display: block; font-size: 14px; }
.set-item small { display: block; font-size: 12px; color: var(--text-3); }
.set-select { background: var(--surface-3); border: 1px solid var(--border-hi); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.toggle-sw { width: 46px; height: 26px; border-radius: 99px; background: rgba(255,255,255,0.2); position: relative; flex: 0 0 auto; transition: background 0.16s; }
.toggle-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.16s; }
.toggle-sw[aria-checked="true"] { background: var(--red); }
.toggle-sw[aria-checked="true"]::after { transform: translateX(20px); }

.center-load { min-height: 60dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-2); }
.spin { width: 32px; height: 32px; border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--red); border-radius: 50%; animation: sp 0.75s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.toast-pill { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 120; background: #222229; border: 1px solid var(--border-hi); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 700; transition: 0.2s; }
.toast-pill.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) { .toast-pill { bottom: 26px; } }
@media (min-width: 768px) { .top-right [data-open="settings"] { display: none !important; } }

/* === V6.3 TOP 10 CLEAN ALIGNMENT === */
.top10-card {
  flex: 0 0 156px !important; width: 156px !important; max-width: 156px !important;
  padding-left: 0 !important; display: flex !important; align-items: flex-end !important;
  gap: 0 !important; overflow: visible !important;
}
.top10-num {
  position: relative !important; left: auto !important; bottom: 0 !important;
  flex: 0 0 auto !important; margin-right: -14px !important;
  font-size: 74px !important; line-height: 0.78 !important; font-weight: 900 !important;
  color: #0a0a0c !important; -webkit-text-stroke: 2px rgba(255,255,255,0.72) !important;
  letter-spacing: -0.09em !important; z-index: 1 !important;
}
.top10-card .poster-box {
  flex: 1 1 auto !important; min-width: 0 !important; z-index: 2 !important;
  box-shadow: -8px 0 20px rgba(0,0,0,0.78) !important;
}
@media (min-width: 768px) {
  .top10-card { flex: 0 0 198px !important; width: 198px !important; max-width: 198px !important; }
  .top10-num { font-size: 96px !important; margin-right: -18px !important; }
}

/* === V6.5 TOP 10 FOREGROUND NUMBER === */
.top10-card {
  flex: 0 0 116px !important; width: 116px !important; max-width: 116px !important;
  padding-left: 0 !important; display: block !important; position: relative !important;
  overflow: hidden !important;
}
@media (min-width: 600px) { .top10-card { flex: 0 0 144px !important; width: 144px !important; max-width: 144px !important; } }
@media (min-width: 1024px) { .top10-card { flex: 0 0 164px !important; width: 164px !important; max-width: 164px !important; } }
.top10-card .poster-box { width: 100% !important; box-shadow: none !important; }
.top10-card .poster-box::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 48%; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.88) 100%);
}
.top10-num {
  position: absolute !important; left: 8px !important; bottom: 6px !important;
  margin: 0 !important; z-index: 4 !important;
  font-size: 42px !important; line-height: 0.9 !important; font-weight: 900 !important;
  color: #ffffff !important; -webkit-text-stroke: 1px rgba(0,0,0,0.65) !important;
  letter-spacing: -0.05em !important;
  text-shadow: 0 4px 14px rgba(0,0,0,0.95), 0 0 6px rgba(0,0,0,0.9) !important;
}
@media (min-width: 768px) {
  .top10-num { font-size: 52px !important; left: 10px !important; bottom: 8px !important; }
}

/* === V6.8 ANTI-FLICKER SCROLL & BILLBOARD CONTAINMENT === */
.bb-wrap { contain: layout style; }
.bb-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.top-bar, .tab-bar { transform: translateZ(0); will-change: background-color; }

/* === V6.10 FIXED BILLBOARD HEIGHT (NO MOBILE ADDRESS-BAR DVH RESIZE/FLICKER) === */
.bb-card { max-height: 490px !important; }
@media (min-width: 768px) { .bb-card { max-height: 440px !important; } }
.poster-card:hover { transform: none !important; }

/* === V6.11 SILKY 60FPS DETAIL SHEET ANIMATION === */
.backdrop {
  backdrop-filter: none !important;
  background: rgba(0, 0, 0, 0.82) !important;
  animation: kvFadeIn 0.18s ease-out both;
}
.detail-sheet {
  animation: kvSlideUp 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}
@keyframes kvFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes kvSlideUp { from { transform: translateY(36px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }

/* === V6.12 LOCKED DETAIL SHEET & HERO HEIGHT (ZERO JUMP/SHRINK) === */
.detail-sheet {
  height: 90svh !important; max-height: 90svh !important;
  display: flex !important; flex-direction: column !important; overflow: hidden !important;
}
.sheet-hero {
  height: 220px !important; min-height: 220px !important; max-height: 220px !important;
  aspect-ratio: auto !important; flex: 0 0 220px !important;
}
.sheet-body {
  flex: 1 1 auto !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch;
  margin-top: 0 !important; padding-top: 14px !important;
}
#sheetTrailer { opacity: 0; transition: opacity 0.35s ease; }
#sheetTrailer.is-ready { opacity: 1; }
@media (min-width: 768px) {
  .detail-sheet { height: 86svh !important; max-height: 86svh !important; }
  .sheet-hero { height: 300px !important; min-height: 300px !important; max-height: 300px !important; flex: 0 0 300px !important; }
}

/* Pembeda jelas badge FILM vs SERIAL (V6.15) */
.pcard-tag.is-series { background: rgba(229, 9, 20, .92); color: #fff; border: 1px solid rgba(255, 255, 255, .16); }
.pcard-tag.is-film { background: rgba(16, 20, 28, .82); color: #e6ebf2; border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(4px); }
.similar-card { position: relative; }
.sheet-badge.badge-series { background: rgba(229, 9, 20, .18); border-color: rgba(229, 9, 20, .65); color: #ff6b72; font-weight: 700; }
.sheet-badge.badge-film { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .32); color: #f0f0f0; font-weight: 700; }

/* Badge tipe FILM / SERIAL di pojok kanan atas poster (V6.17) */
.poster-type { position: absolute; top: 6px; right: 6px; z-index: 2; padding: 2px 5px; border-radius: 4px; font-size: 9px; font-weight: 700; letter-spacing: .06em; line-height: 1.2; pointer-events: none; }
.poster-type.is-series { background: rgba(229, 9, 20, .92); color: #fff; border: 1px solid rgba(255, 255, 255, .18); }
.poster-type.is-film { background: rgba(14, 18, 24, .82); color: #e8edf5; border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(4px); }

/* Badge FILM vs SERIAL pada Detail Sheet (V6.18) */
.tag-hd.tag-serial { background: rgba(229, 9, 20, .2); border-color: rgba(229, 9, 20, .7); color: #ff6b72; font-weight: 700; }
.tag-hd.tag-film { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .35); color: #f4f4f5; font-weight: 700; }

/* Badge kualitas resolusi asli pada Detail Sheet (V6.19) */
.tag-hd.tag-4k { background: rgba(251, 191, 36, .16); border-color: rgba(251, 191, 36, .75); color: #fcd34d; font-weight: 700; }
.tag-hd.tag-2k { background: rgba(56, 189, 248, .16); border-color: rgba(56, 189, 248, .75); color: #7dd3fc; font-weight: 700; }
.tag-hd.tag-fhd { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .52); color: #ffffff; font-weight: 700; }
.tag-hd.tag-sd { background: rgba(161, 161, 170, .1); border-color: rgba(161, 161, 170, .4); color: #a1a1aa; }

/* AI Vibe Pills pada Detail Sheet (V6.22) */
.sheet-vibes { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.vibe-pill { font-size: 11px; font-weight: 600; color: #e4e4e7; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .15); padding: 3px 9px; border-radius: 999px; letter-spacing: .01em; }
button.vibe-pill { cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
button.vibe-pill:hover, button.vibe-pill:active { background: rgba(229, 9, 20, .22); border-color: rgba(229, 9, 20, .65); color: #fff; }

/* Halaman Login Member Access & Input Gelap (V6.25) */
.login-screen {
  position: fixed !important; inset: 0 !important; z-index: 950 !important;
  min-height: 100dvh; display: flex !important; align-items: center; justify-content: center;
  padding: 20px !important; box-sizing: border-box;
  background: radial-gradient(ellipse 85% 50% at 50% 0%, rgba(229, 9, 20, .24), #050507 62%), #000 !important;
  overflow-y: auto;
}
.login-screen > div {
  width: 100% !important; max-width: 390px !important; box-sizing: border-box;
  background: rgba(18, 18, 22, .94) !important;
  border: 1px solid rgba(255, 255, 255, .11) !important;
  border-radius: 20px !important;
  padding: 28px 22px 24px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .88) !important;
  backdrop-filter: blur(16px);
}
.input-dark {
  width: 100%; height: 48px; padding: 0 14px; box-sizing: border-box;
  border-radius: 11px; border: 1px solid rgba(255, 255, 255, .15);
  background: #1a1a20; color: #fff; font-size: 15px; outline: none;
  appearance: none; -webkit-appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input-dark::placeholder { color: #686873; }
.input-dark:focus {
  border-color: #e50914; background: #21212a;
  box-shadow: 0 0 0 3px rgba(229, 9, 20, .24);
}
#kvPinRow {
  display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 8px !important; width: 100%; box-sizing: border-box;
}
#kvPinRow .input-dark {
  width: 100% !important; min-width: 0 !important; height: 50px !important;
  padding: 0 !important; text-align: center !important;
  font-size: 20px !important; font-weight: 800 !important;
  caret-color: #e50914; border-radius: 11px !important;
}
.btn-red {
  background: #e50914 !important; color: #fff !important;
  border: 0 !important; border-radius: 11px !important;
  height: 48px; font-weight: 700 !important;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: background .15s ease, transform .1s ease, opacity .15s ease;
}
.btn-red:hover { background: #f6121d !important; }
.btn-red:active { transform: scale(.985); }
.btn-red:disabled { opacity: .6; cursor: not-allowed; }
#kvLoginErr:empty { display: none; }
#kvLoginErr:not(:empty) {
  padding: 9px 12px; border-radius: 9px; margin: 10px 0 12px !important;
  background: rgba(229, 9, 20, .14); border: 1px solid rgba(229, 9, 20, .42);
  color: #fca5a5; font-size: 13px; line-height: 1.4;
}

/* === V6.28 SMOOTHNESS & 60/120FPS MOBILE PERFORMANCE === */
html, body { touch-action: manipulation; }

/* Hilangkan backdrop-filter berat yang bikin frame-drop saat scroll di HP/tablet */
.top-bar.is-solid { background: rgba(10, 10, 13, 0.95) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.tab-bar { background: rgba(11, 11, 14, 0.96) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.pill-filter { background: rgba(24, 24, 30, 0.88) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.btn-dark { background: rgba(48, 48, 56, 0.9) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.poster-type.is-film { background: rgba(14, 18, 24, 0.88) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* Lewati layout & paint untuk baris katalog di luar layar (jauh lebih ringan saat scroll panjang) */
.row-sec { content-visibility: auto; contain-intrinsic-size: auto 220px; }
.hot-card { content-visibility: auto; contain-intrinsic-size: auto 340px; }

/* Cegah scroll bocor & rubber-band di overlay */
.detail-sheet, .sheet-body, .search-overlay, .drawer-sheet { overscroll-behavior: contain; }

/* Feedback sentuhan halus GPU-only (transform) */
.poster-card, .top10-card, .cw-card, .ep-row, .top-search-row {
  transition: transform 0.14s cubic-bezier(0.2, 0, 0, 1);
}
.poster-card:active, .top10-card:active, .cw-card:active, .ep-row:active, .top-search-row:active {
  transform: scale(0.965);
}

/* Animasi halus untuk Settings Drawer, Search Overlay & Billboard */
.drawer-sheet { animation: kvSlideLeft 0.22s cubic-bezier(0.22, 1, 0.36, 1) both; }
.search-overlay { animation: kvFadeIn 0.16s ease-out both; }
.bb-card > img { animation: kvFadeIn 0.28s ease-out both; }
@keyframes kvSlideLeft { from { transform: translateX(36px); opacity: 0.7; } to { transform: translateX(0); opacity: 1; } }

/* Scrollbar horizontal lebih mulus */
.row-rail, .home-pills, .hot-chips { scroll-behavior: smooth; }

/* === V6.29 CINEMATIC FROSTED-GLASS BLUR & SILKY SPRING MOTION === */

/* 1. Frosted Glass GPU-promoted pada chrome utama & overlay (anti-flicker, tetap 60/120fps) */
.top-bar.is-solid {
  background: rgba(10, 10, 14, 0.76) !important;
  backdrop-filter: blur(18px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
.tab-bar {
  background: rgba(10, 10, 14, 0.80) !important;
  backdrop-filter: blur(20px) saturate(170%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(170%) !important;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
.pill-filter {
  background: rgba(24, 24, 30, 0.58) !important;
  backdrop-filter: blur(12px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}
.pill-filter:active { transform: scale(0.95); }
.btn-dark {
  background: rgba(54, 54, 64, 0.62) !important;
  backdrop-filter: blur(12px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
}
.backdrop {
  background: rgba(0, 0, 0, 0.68) !important;
  backdrop-filter: blur(14px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
  animation: kvGlassIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
.cat-modal {
  background: rgba(6, 6, 10, 0.78) !important;
  backdrop-filter: blur(22px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
  animation: kvGlassIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.drawer-sheet {
  background: rgba(16, 16, 20, 0.88) !important;
  backdrop-filter: blur(22px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
  animation: kvDrawerIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
.search-overlay {
  background: rgba(6, 6, 9, 0.90) !important;
  backdrop-filter: blur(22px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
  animation: kvSheetFadeUp 0.24s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
.detail-sheet {
  background: rgba(18, 18, 22, 0.96) !important;
  animation: kvSpringUp 0.30s cubic-bezier(0.22, 1, 0.36, 1) both !important;
  transform-origin: center bottom;
}
.toast-pill {
  background: rgba(24, 24, 32, 0.82) !important;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}

/* 2. Animasi keluar halus (is-closing) agar popup tidak hilang mendadak */
.layer-root.is-closing .backdrop,
.layer-root.is-closing .cat-modal {
  animation: kvGlassOut 0.18s ease-in forwards !important;
  pointer-events: none;
}
.layer-root.is-closing .detail-sheet {
  animation: kvSpringDown 0.18s cubic-bezier(0.4, 0, 1, 1) forwards !important;
  pointer-events: none;
}
.layer-root.is-closing .drawer-sheet {
  animation: kvDrawerOut 0.18s ease-in forwards !important;
  pointer-events: none;
}
.layer-root.is-closing .search-overlay {
  animation: kvSheetFadeOut 0.17s ease-in forwards !important;
  pointer-events: none;
}

/* 3. Transisi sinematik blur-ke-tajam untuk Billboard & perpindahan tab */
.bb-card > img {
  animation: kvBbCinema 0.45s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
.bb-content {
  animation: kvContentRise 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.screen-root.is-tab-enter {
  animation: kvTabEnter 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.nfx-player {
  animation: kvGlassIn 0.22s ease-out both;
}

/* 4. Keyframes GPU-only (transform + opacity + ringan blur) */
@keyframes kvGlassIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes kvGlassOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes kvSpringUp {
  from { opacity: 0; transform: translate3d(0, 34px, 0) scale(0.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes kvSpringDown {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 0; transform: translate3d(0, 28px, 0) scale(0.985); }
}
@keyframes kvDrawerIn {
  from { opacity: 0; transform: translate3d(44px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes kvDrawerOut {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(38px, 0, 0); }
}
@keyframes kvSheetFadeUp {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes kvSheetFadeOut {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(0, 10px, 0); }
}
@keyframes kvBbCinema {
  from { opacity: 0.45; transform: scale(1.035); filter: blur(6px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes kvContentRise {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes kvTabEnter {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* === V6.30 IPHONE 13 / IOS SAFARI & PWA STANDALONE POLISH === */
:root {
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

html { -webkit-text-size-adjust: 100%; }
@supports (-webkit-touch-callout: none) {
  html { overscroll-behavior-y: none; }
}

/* Safe-area kiri/kanan untuk iPhone landscape & bawah untuk Home Indicator */
.top-bar {
  padding-left: max(14px, var(--safe-l));
  padding-right: max(14px, var(--safe-r));
}
.tab-bar {
  padding-left: max(8px, var(--safe-l));
  padding-right: max(8px, var(--safe-r));
  padding-bottom: max(6px, var(--safe-b));
  height: calc(var(--tab-h) + var(--safe-b));
}
.screen-root {
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 28px);
}
.sheet-body {
  padding-bottom: calc(28px + var(--safe-b)) !important;
}
.drawer-sheet {
  padding-top: calc(var(--safe-t) + 18px) !important;
  padding-bottom: calc(28px + var(--safe-b)) !important;
  padding-right: max(18px, var(--safe-r)) !important;
}
.search-overlay {
  padding-top: calc(var(--safe-t) + 12px) !important;
  padding-left: max(14px, var(--safe-l)) !important;
  padding-right: max(14px, var(--safe-r)) !important;
  padding-bottom: calc(28px + var(--safe-b)) !important;
}
.backdrop {
  padding-top: var(--safe-t);
}

/* Cegah iOS Safari auto-zoom saat mengetuk kolom input / select */
.input-dark,
.search-field input,
.set-select,
input[type="text"],
input[type="search"],
input[type="password"] {
  font-size: 16px !important;
}

/* Presisi layar sempit iPhone 13 (390px) agar tombol & kartu tidak tabrakan */
@media (max-width: 430px) {
  .top-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
  .home-pills { padding-left: 12px; padding-right: 12px; gap: 6px; }
  .pill-filter { height: 31px; padding: 0 12px; font-size: 12.5px; white-space: nowrap; }
  .bb-wrap { padding: 0 12px 20px; }
  .bb-card { max-height: 465px !important; border-radius: 14px; }
  .bb-content { padding: 14px 12px 14px; }
  .bb-title { font-size: clamp(21px, 6vw, 28px); margin-bottom: 5px; }
  .bb-tags { font-size: 12px; margin-bottom: 12px; }
  .bb-actions { gap: 8px; }
  .bb-actions .btn { padding: 0 10px; font-size: 13.5px; white-space: nowrap; min-height: 38px; }
  .detail-sheet { height: 88svh !important; max-height: 88svh !important; }
  .sheet-hero { height: 205px !important; min-height: 205px !important; max-height: 205px !important; flex: 0 0 205px !important; }
  .sheet-body { padding-left: 14px; padding-right: 14px; }
  .sheet-meta { gap: 6px; font-size: 12.5px; }
  .hot-actions .btn { white-space: nowrap; padding: 0 10px; }
  .poster-grid { gap: 10px 7px; }
  .login-screen > div { padding: 24px 18px 22px !important; }
  #kvPinRow { gap: 6px !important; }
  #kvPinRow .input-dark { height: 46px !important; font-size: 19px !important; }
}

/* Mode PWA Standalone iOS (Add to Home Screen) */
@media all and (display-mode: standalone) {
  .top-bar { padding-top: max(var(--safe-t), 12px); }
  .tab-bar { padding-bottom: max(var(--safe-b), 12px); }
}
/* V6.31 Fix Android Chrome vertical scroll */
html { overflow-y: auto; overflow-x: clip; }
body { overflow-y: visible; overflow-x: clip; }
/* V6.33 Fix kontras pill kategori aktif */
.pill-filter.is-active { background: #ffffff !important; color: #000000 !important; border-color: #ffffff !important; }
