/* ============ THEME ============ */
:root {
  --bg: #0b0d12; --panel: #151922; --panel2: #1c2230;
  --text: #eef2f7; --muted: #8b94a7;
  --accent: #e50914; --accent2: #ff6b6b;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box;
    -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
img, canvas { -webkit-user-drag: none; }
body { background: var(--bg); color: var(--text);
       font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.center { text-align: center; margin: 24px 0; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; grid-column: 1/-1; }
.empty i { color: var(--accent2); margin-right: 8px; }

/* ============ TOPBAR ============ */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center;
          gap: 16px; padding: 12px 20px; background: rgba(11,13,18,.92); backdrop-filter: blur(10px);
          border-bottom: 1px solid #1f2639; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.brand i { color: var(--accent); margin-right: 6px; }
.brand span { color: var(--accent); }
.now-playing { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing i { color: var(--accent); margin-right: 6px; }
.searchbox { flex: 1; max-width: 480px; margin-left: auto; display: flex; align-items: center;
             gap: 10px; background: var(--panel); border: 1px solid #232c42; border-radius: 999px; padding: 9px 16px; }
.searchbox i { color: var(--muted); }
.searchbox input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }

/* ============ CHIPS ============ */
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 14px 20px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
        background: var(--panel); color: var(--text); border: 1px solid #232c42;
        border-radius: 999px; padding: 9px 16px; font-size: 13px; cursor: pointer; transition: .2s; }
.chip i { color: var(--muted); }
.chip.active { background: var(--accent); border-color: var(--accent); }
.chip.active i { color: #fff; }
.chip.static { cursor: default; }
.server-row { justify-content: center; }

/* ============ GRID / CARDS ============ */
.section-title { padding: 8px 20px 0; font-size: 17px; }
.section-title i { color: var(--accent); margin-right: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 16px 20px; }
.card { background: var(--panel); border-radius: var(--radius); overflow: hidden; transition: transform .2s; }
.card:hover { transform: translateY(-4px); }
.thumb { position: relative; aspect-ratio: 2/3; background: var(--panel2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.flag { position: absolute; font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 6px; }
.flag.cat { top: 8px; left: 8px; background: rgba(0,0,0,.7); }
.flag.ongoing { top: 8px; right: 8px; background: var(--accent); }
.play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
                background: rgba(0,0,0,.45); opacity: 0; transition: .2s; font-size: 40px; color: var(--accent2); }
.card:hover .play-overlay { opacity: 1; }
.meta { padding: 10px 12px 14px; }
.meta h3 { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { display: flex; gap: 12px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.sub i { margin-right: 4px; }

/* skeleton shimmer */
.skeleton .thumb, .skeleton h3 { position: relative; overflow: hidden; }
.skeleton .thumb::after, .skeleton h3::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  animation: shimmer 1.2s infinite; }
.skeleton h3 { height: 14px; border-radius: 4px; }
@keyframes shimmer { from { transform: translateX(-100%);} to { transform: translateX(100%);} }

/* ============ BUTTONS ============ */
.btn { display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 10px;
       padding: 12px 22px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn.ghost { background: var(--panel); color: var(--text); border: 1px solid #232c42; }
.btn.small { padding: 8px 14px; font-size: 13px; margin: 16px 20px 0; }

/* ============ DETAIL PAGE ============ */
.detail { max-width: 1100px; margin: 0 auto; padding-bottom: 40px; }
.hero { display: flex; gap: 24px; padding: 20px; }
.poster { width: 220px; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.info h1 { font-size: 24px; margin-bottom: 12px; }
.meta-chips { padding: 0; margin-bottom: 12px; }
.genres { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.genres i { color: var(--accent2); margin-right: 6px; }
.storyline { font-size: 14px; line-height: 1.7; color: #c6cdd9; }
.panel { margin: 10px 20px; background: var(--panel); border-radius: var(--radius); padding: 18px; }
.panel h3 { font-size: 15px; margin-bottom: 14px; }
.panel h3 i { color: var(--accent); margin-right: 8px; }

/* episodes */
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ep-btn { display: flex; align-items: center; gap: 10px; background: var(--panel2);
          border: 1px solid #232c42; border-radius: 10px; padding: 12px 14px; font-size: 13px; transition: .2s; }
.ep-btn:hover { border-color: var(--accent); }
.ep-btn i { color: var(--accent2); font-size: 18px; }
.ep-btn span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-btn em { font-style: normal; font-size: 10px; color: var(--muted); border: 1px solid #2c3550; border-radius: 5px; padding: 2px 6px; }

/* ============ PLAYER ============ */
#playerWrap { padding: 0 16px 40px; }
#playerWrap movi-player { display: block; width: 100%; max-width: 1200px; margin: 0 auto;
                          aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden;
                          box-shadow: 0 10px 50px rgba(0,0,0,.7); }
.notice { max-width: 1200px; margin: 0 auto 14px; padding: 12px 18px; text-align: center;
          background: #2a1518; border: 1px solid #55262c; color: var(--accent2);
          border-radius: 10px; font-size: 13px; }
.notice i { margin-right: 8px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .hero { flex-direction: column; }
  .poster { width: 160px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
}