:root {
  --bg: #0b0e14;
  --surface: #12151d;
  --surface2: #1d212c;
  --text: #f0f2f5;
  --dim: #9aa0ad;
  --accent: #e50914;
  --cyan: #00d2ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.logo {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1px;
  padding: 8px 12px 20px;
  color: var(--text);
}
.logo span { color: var(--accent); }
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--dim);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 4px;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(229, 9, 20, .16); color: #fff; font-weight: 700; }
.main { flex: 1; padding: 24px 28px; min-width: 0; }

/* ---------- Setup ---------- */
.setup {
  max-width: 440px;
  margin: 10vh auto;
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
}
.setup h1 { font-size: 20px; margin-bottom: 6px; }
.setup p { color: var(--dim); font-size: 13px; margin-bottom: 20px; }
.setup input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid #2a2f3d;
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.setup input:focus { border-color: var(--cyan); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1;
  background: var(--surface2);
  border: none;
  color: var(--dim);
  padding: 9px;
  border-radius: 8px;
  font-size: 13px;
}
.tabs button.active { background: var(--accent); color: #fff; font-weight: 700; }
.btn {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  width: 100%;
}
.btn:disabled { opacity: .5; cursor: default; }
.error-msg { color: #ff6b6b; font-size: 13px; margin-top: 10px; }

/* ---------- Content ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; }
.search-box input {
  background: var(--surface2);
  border: 1px solid #2a2f3d;
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  width: 280px;
  outline: none;
}
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cat-chip {
  background: var(--surface2);
  border: none;
  color: var(--dim);
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12.5px;
}
.cat-chip.active { background: rgba(0, 210, 255, .22); color: #fff; font-weight: 700; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.grid.channels { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card {
  background: var(--surface);
  border: none;
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
  transition: transform .12s ease;
  padding: 0;
}
.card:hover { transform: scale(1.03); }
.card .thumb {
  aspect-ratio: 2/3;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 30px;
}
.grid.channels .card .thumb { aspect-ratio: 16/9; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid.channels .card .thumb img { object-fit: contain; padding: 14px; }
.card .name { padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.55); border: none; border-radius: 50%;
  width: 32px; height: 32px; color: #fff; font-size: 15px;
}
.card { position: relative; }
.loading, .empty { color: var(--dim); text-align: center; padding: 60px 0; font-size: 15px; }

/* ---------- Series detail ---------- */
.detail-head { display: flex; gap: 24px; margin-bottom: 24px; }
.detail-head .poster { width: 180px; border-radius: 12px; background: var(--surface2); flex-shrink: 0; }
.detail-head .poster img { width: 100%; border-radius: 12px; display: block; }
.detail-head h2 { font-size: 24px; margin-bottom: 10px; }
.detail-head .plot { color: var(--dim); font-size: 14px; line-height: 1.55; max-width: 720px; }
.episodes { margin-top: 8px; }
.ep-row {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: none; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px; width: 100%;
  text-align: left; color: var(--text); font-size: 14px;
}
.ep-row:hover { background: var(--surface2); }
.ep-row .still { width: 120px; height: 68px; border-radius: 8px; background: var(--surface2); flex-shrink: 0; object-fit: cover; }
.ep-row .t { font-weight: 600; }
.ep-row .d { color: var(--dim); font-size: 12.5px; margin-top: 3px; }
.season-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.back-link { background: none; border: none; color: var(--cyan); font-size: 14px; margin-bottom: 16px; padding: 0; }

/* ---------- Player ---------- */
.player-overlay {
  position: fixed; inset: 0; background: #000;
  z-index: 50; display: flex; flex-direction: column;
}
.player-overlay video { flex: 1; width: 100%; background: #000; }
.player-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 16px 20px;
  background: linear-gradient(rgba(0,0,0,.75), transparent);
  display: flex; align-items: center; gap: 16px;
}
.player-top .close {
  background: none; border: none; color: #fff; font-size: 22px; padding: 4px 10px;
}
.player-top .title { font-size: 16px; font-weight: 700; }
.player-err {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  color: #ff6b6b; font-size: 15px; background: rgba(0,0,0,.7); padding: 14px 20px; border-radius: 10px;
}
.channel-strip {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.92) 30%);
  padding: 40px 20px 16px;
  display: none;
}
.channel-strip.open { display: block; }
.channel-strip .row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.ch-card {
  flex-shrink: 0; width: 170px; background: var(--surface2);
  border: 2px solid transparent; border-radius: 10px; padding: 10px;
  color: var(--text); text-align: center;
}
.ch-card.current { border-color: var(--accent); }
.ch-card img { width: 100%; height: 60px; object-fit: contain; margin-bottom: 8px; }
.ch-card .n { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-toggle {
  position: absolute; bottom: 14px; right: 20px;
  background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.25);
  color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px; z-index: 5;
}
.strip-toggle:hover { background: rgba(0,0,0,.85); }

/* ---------- Branding & language ---------- */
.setup-logo { display: block; width: 96px; margin: 0 auto 14px; border-radius: 20px; }
.logo img { width: 26px; height: 26px; border-radius: 6px; vertical-align: -7px; margin-right: 8px; }
.nav-group { color: var(--dim); font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; padding: 16px 14px 6px; }
.lang-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.lang-chip {
  background: var(--surface2); border: 1px solid #2a2f3d; color: var(--dim);
  padding: 8px 14px; border-radius: 20px; font-size: 12.5px;
}
.lang-chip.active { background: rgba(229,9,20,.22); border-color: var(--accent); color: #fff; font-weight: 700; }

/* ---------- Detail ---------- */
.backdrop {
  position: absolute; inset: 0 0 auto; height: 340px;
  background-size: cover; background-position: center 20%;
  opacity: .22; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000, transparent);
  mask-image: linear-gradient(#000, transparent);
}
.detail-body { position: relative; }
.detail-head { position: relative; }
.meta-line, .genre-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.meta-chip {
  background: var(--surface2); color: var(--text); font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 8px;
}
.meta-chip.rating { color: #ffd34d; }
.meta-chip.genre { background: rgba(0,210,255,.14); color: var(--cyan); }
.detail-actions { display: flex; gap: 12px; margin-bottom: 18px; position: relative; }
.btn.ghost { background: var(--surface2); color: var(--text); }

/* ---------- Cast / person ---------- */
.cast-header { color: var(--dim); font-size: 12px; font-weight: 800; letter-spacing: 1.5px; margin: 20px 0 10px; }
.cast-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.cast-card { flex-shrink: 0; width: 104px; background: none; border: none; color: var(--text); text-align: center; padding: 0; }
.cast-card .face { width: 88px; height: 88px; margin: 0 auto 8px; border-radius: 50%; background: var(--surface2); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--dim); }
.cast-card .face img { width: 100%; height: 100%; object-fit: cover; }
.cast-card .cn { font-size: 12px; font-weight: 700; }
.cast-card .cr { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { padding: 0 12px 10px; font-size: 11px; color: var(--dim); }
.card.not-in-cat { opacity: .55; }
.card.in-cat .thumb { position: relative; }
.cat-badge {
  position: absolute; right: 8px; bottom: 8px; background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 8px;
}

/* ---------- History ---------- */
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-row {
  display: flex; gap: 14px; align-items: center; width: 100%;
  background: var(--surface); border: none; border-radius: 10px;
  padding: 10px 14px; text-align: left; color: var(--text);
}
.hist-row:hover { background: var(--surface2); }
.hist-thumb { width: 110px; height: 62px; border-radius: 8px; background: var(--surface2); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 24px; }
.hist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hist-body { flex: 1; min-width: 0; }
.hist-body .t { font-weight: 600; font-size: 14px; }
.hist-body .d { color: var(--dim); font-size: 12px; margin: 3px 0 7px; }
.hist-prog { height: 3px; background: #333; border-radius: 2px; overflow: hidden; }
.hist-prog > div { height: 100%; background: var(--accent); }
.ep-prog { height: 3px; background: #333; border-radius: 2px; overflow: hidden; margin-top: 6px; max-width: 220px; }
.ep-prog > div { height: 100%; background: var(--accent); }
.watched-badge { color: #4ade80; font-size: 11px; font-weight: 700; }
.still.ph { display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--dim); }

/* ---------- Settings ---------- */
.set-card { background: var(--surface); border-radius: 14px; padding: 20px 22px; margin-bottom: 14px; max-width: 640px; }
.set-head { font-weight: 800; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; }
.set-sub { color: var(--text); font-size: 13.5px; margin-bottom: 14px; word-break: break-all; }

/* ---------- Player extras ---------- */
.live-badge {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 6px; letter-spacing: 1px;
}
.player-bar {
  position: absolute; bottom: 14px; left: 20px; right: 20px;
  display: flex; align-items: center; gap: 10px; z-index: 6; pointer-events: none;
}
.pv-right { margin-left: auto; display: flex; gap: 10px; }
.pv-btn {
  pointer-events: auto;
  background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.25);
  color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px;
}
.pv-btn:hover { background: rgba(0,0,0,.85); }
.boost-pill.on { border-color: var(--accent); color: #fff; background: rgba(229,9,20,.45); font-weight: 700; }
.track-menu {
  position: absolute; bottom: 62px; right: 20px; z-index: 7;
  background: rgba(18,21,29,.97); border: 1px solid #2a2f3d; border-radius: 12px;
  min-width: 220px; max-height: 320px; overflow-y: auto; padding: 8px;
}
.track-head { color: var(--dim); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; padding: 8px 10px; }
.track-row {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--text); padding: 9px 10px; border-radius: 8px; font-size: 13px;
}
.track-row:hover { background: var(--surface2); }
.track-row.current { color: var(--cyan); font-weight: 700; }
.ch-card .now { color: var(--accent); font-size: 10px; font-weight: 800; margin-top: 4px; letter-spacing: .5px; }

/* ---------- Landing ---------- */
.landing { min-height: 100vh; }
.land-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px; position: sticky; top: 0; z-index: 10;
  background: rgba(11,14,20,.85); backdrop-filter: blur(8px);
}
.land-logo { font-weight: 800; font-size: 16px; letter-spacing: 1px; }
.land-logo span { color: var(--accent); }
.land-logo img { width: 30px; height: 30px; border-radius: 8px; vertical-align: -9px; margin-right: 8px; }
.land-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero { text-align: center; padding: 60px 24px 50px; }
.hero-logo { width: 120px; border-radius: 28px; margin-bottom: 18px; }
.hero h1 { font-size: 34px; letter-spacing: 2px; }
.hero h1 span { color: var(--accent); }
.hero .tag { color: var(--dim); font-size: 15px; margin: 10px 0 26px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-sign { margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--dim); font-size: 13px; }
.feat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; max-width: 980px; margin: 0 auto; padding: 10px 24px 34px;
}
.feat-card { background: var(--surface); border-radius: 14px; padding: 20px 16px; text-align: center; }
.feat-card .fi { font-size: 26px; margin-bottom: 10px; }
.feat-card .ft { font-weight: 700; font-size: 14px; }
.feat-card .fs { color: var(--dim); font-size: 12px; margin-top: 4px; }
.promo-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; padding: 0 24px 34px; }
.promo-card {
  background: var(--surface); border-radius: 16px; padding: 22px 24px;
  max-width: 340px; flex: 1 1 260px; border: 1px solid #1f2430;
}
.promo-card.accent { border-color: var(--accent); background: linear-gradient(135deg, rgba(229,9,20,.14), var(--surface)); }
.promo-card .pt { font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.promo-card .px { color: var(--dim); font-size: 13.5px; line-height: 1.5; margin-bottom: 16px; }
.dl-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; padding: 0 24px 50px; }
.dl-card {
  background: var(--surface); border-radius: 16px; padding: 24px 28px; text-align: center;
  min-width: 190px; flex: 0 1 210px;
}
.dl-card .di { font-size: 30px; margin-bottom: 10px; }
.dl-card .dt { font-weight: 800; font-size: 15px; }
.dl-card .ds { color: var(--dim); font-size: 12.5px; margin: 5px 0 16px; }
.land-foot { text-align: center; color: var(--dim); font-size: 12px; padding: 26px 20px; letter-spacing: 2px; border-top: 1px solid #1a1f2b; }

/* ---------- Landing v2: apps showcase ---------- */
.hero { position: relative; overflow: hidden; }
.hero-glow {
  position: absolute; top: -140px; left: 50%; transform: translateX(-50%);
  width: 640px; height: 420px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(229,9,20,.22), transparent);
  pointer-events: none;
}
.land-h2 {
  text-align: center; font-size: 13px; font-weight: 800; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--dim); margin-bottom: 22px;
}
.apps-section { padding: 16px 24px 40px; }
.apps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; max-width: 1080px; margin: 0 auto;
}
.app-card {
  background: var(--surface); border: 1px solid #1f2430; border-radius: 18px;
  padding: 26px 22px; display: flex; flex-direction: column; transition: transform .15s ease, border-color .15s ease;
}
.app-card:hover { transform: translateY(-4px); border-color: #39415a; }
.app-card.web { border-color: var(--accent); background: linear-gradient(160deg, rgba(229,9,20,.12), var(--surface) 55%); }
.app-icon { font-size: 34px; margin-bottom: 14px; }
.app-name { font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.app-desc { color: var(--dim); font-size: 13px; line-height: 1.55; flex: 1; }
.app-foot { margin-top: 18px; }
.app-badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 8px;
  background: var(--surface2); color: var(--dim);
}
.app-badge.member { background: rgba(0,210,255,.15); color: var(--cyan); }
.how-section { padding: 8px 24px 36px; }
.how-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.how-card {
  background: var(--surface); border-radius: 14px; padding: 18px 22px;
  display: flex; align-items: center; gap: 14px; flex: 1 1 250px; max-width: 340px;
}
.how-n {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.how-t { font-size: 13.5px; line-height: 1.45; color: var(--text); }
.promo-section { padding: 10px 24px 44px; }

/* ---------- Home: source banner + hero + rows ---------- */
.src-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(90deg, rgba(229,9,20,.14), var(--surface) 60%);
  border: 1px solid #262c3d; border-radius: 14px; padding: 12px 16px; margin-bottom: 18px;
}
.sb-l { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; }
.sb-l b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-dot { width: 9px; height: 9px; border-radius: 50%; background: #2bd576; flex-shrink: 0; box-shadow: 0 0 8px #2bd576; }

#home-hero { position: relative; height: clamp(260px, 38vw, 460px); border-radius: 18px; overflow: hidden; margin-bottom: 8px; }
#home-hero:empty { display: none; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.hero-slide.on { opacity: 1; }
.hero-bd { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(10,12,18,.92) 92%), linear-gradient(90deg, rgba(10,12,18,.55), transparent 60%); }
.hero-meta { position: absolute; left: 30px; bottom: 30px; right: 30px; max-width: 620px; }
.hero-tag { font-size: 11px; font-weight: 800; letter-spacing: 2.5px; color: var(--accent); text-transform: uppercase; margin-bottom: 8px; }
.hero-title { font-size: clamp(22px, 3.4vw, 38px); font-weight: 800; text-shadow: 0 2px 14px rgba(0,0,0,.7); margin-bottom: 10px; }
.hero-sub { display: flex; gap: 14px; color: #cfd4e0; font-size: 13.5px; margin-bottom: 16px; font-weight: 600; }
.hero-dots { position: absolute; right: 22px; bottom: 20px; display: flex; gap: 7px; z-index: 3; }
.hd { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,.35); cursor: pointer; padding: 0; transition: all .2s; }
.hd.on { background: #fff; transform: scale(1.3); }

.hrow { margin: 26px 0 6px; }
.hrow-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.hrow-head h3 { margin: 0; font-size: 15.5px; font-weight: 750; }
.see-all { background: none; border: none; color: var(--cyan); font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 2px 6px; }
.see-all:hover { text-decoration: underline; }
.hscroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.hscroll::-webkit-scrollbar { height: 6px; }
.hscroll::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 3px; }

.rcard { flex: 0 0 128px; background: none; border: none; padding: 0; cursor: pointer; text-align: left; color: var(--text); scroll-snap-align: start; }
.rcard .rthumb { position: relative; width: 128px; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 30px; transition: transform .15s ease, box-shadow .15s ease; }
.rcard .rthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard:hover .rthumb { transform: scale(1.05); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.rcard.wide { flex-basis: 220px; }
.rcard .rthumb.wide { width: 220px; aspect-ratio: 16/9; }
.rname { margin-top: 8px; font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rrank {
  position: absolute; left: 6px; bottom: 4px; font-size: 44px; font-weight: 900; line-height: .8;
  color: #fff; text-shadow: -2px -2px 0 var(--accent), 2px -2px 0 var(--accent), -2px 2px 0 var(--accent), 2px 2px 0 var(--accent), 0 4px 14px rgba(0,0,0,.8);
}
.ccard { flex: 0 0 150px; background: var(--surface); border: 1px solid #202636; border-radius: 14px; padding: 16px 10px; cursor: pointer; text-align: center; color: var(--text); transition: transform .15s ease, border-color .15s; scroll-snap-align: start; }
.ccard:hover { transform: translateY(-3px); border-color: #3a4358; }
.clogo { height: 56px; display: flex; align-items: center; justify-content: center; font-size: 30px; margin-bottom: 8px; }
.clogo img { max-height: 56px; max-width: 120px; object-fit: contain; }
.rph { font-size: 30px; opacity: .6; }

/* ---------- Settings widgets ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #1b2130; font-size: 13.5px; }
.set-row:last-child { border-bottom: none; }
.toggle { position: relative; width: 44px; height: 24px; border-radius: 12px; border: none; background: #2b3243; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #98a0b5; transition: all .15s; }
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 23px; background: #fff; }
.sel { background: var(--surface2); color: var(--text); border: 1px solid #2c3346; border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; }

/* ---------- PIN overlay ---------- */
.pin-overlay { position: fixed; inset: 0; background: rgba(6,8,13,.8); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 400; }
.pin-box { background: var(--surface); border: 1px solid #2a3145; border-radius: 18px; padding: 30px; width: 300px; text-align: center; }
.pin-t { font-weight: 700; margin-bottom: 18px; }
.pin-in { width: 140px; text-align: center; font-size: 26px; letter-spacing: 10px; padding: 10px; margin: 0 auto 14px; display: block; background: var(--surface2); border: 1px solid #2c3346; border-radius: 10px; color: var(--text); }
.pin-err { color: var(--accent); font-size: 12.5px; margin-bottom: 10px; }
.cat-chip.locked { opacity: .65; }

/* ---------- Rating / episode-count badges ---------- */
.rate-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  background: rgba(8,10,16,.82); border: 1px solid rgba(255,215,0,.35); color: #ffd75e;
  font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 7px;
}
.eps-badge {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  background: rgba(8,10,16,.82); color: var(--cyan); border: 1px solid rgba(0,210,255,.3);
  font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 7px;
}
.thumb { position: relative; }

/* ---------- Sources & account ---------- */
.src-list { max-width: 720px; }
.src-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid #1f2430; border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px;
}
.src-card.active { border-color: var(--accent); }
.src-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.src-info b { font-size: 14px; }
.src-info span { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.sm { padding: 8px 14px; font-size: 12.5px; }
.src-list input, .set-card input {
  width: 100%; background: var(--surface2); border: 1px solid #2a2f3d; border-radius: 10px;
  color: var(--text); padding: 12px 14px; font-size: 14px; margin-bottom: 12px; outline: none;
}
.src-list input:focus, .set-card input:focus { border-color: var(--cyan); }
.acc-row { display: flex; align-items: center; gap: 14px; }
.acc-ava { width: 46px; height: 46px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.acc-ava.ph { color: var(--dim); }
.acc-info { flex: 1; display: flex; flex-direction: column; }
.acc-info span { color: var(--dim); font-size: 12.5px; }

/* ---------- RTL ---------- */
[dir="rtl"] .nav-item, [dir="rtl"] .card .name, [dir="rtl"] .hist-row,
[dir="rtl"] .track-row, [dir="rtl"] .ep-row, [dir="rtl"] .card { text-align: right; }
[dir="rtl"] .pv-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .logo img { margin-right: 0; margin-left: 8px; }
