*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:     #000000;
  --bg2:    #0e0e0e;
  --bg3:    #1a1a1a;
  --bg4:    #242424;
  --border: rgba(255,255,255,0.07);
  --bd2:    rgba(255,255,255,0.13);
  --text:   #f0f0f4;
  --text2:  #a0a0b0;
  --text3:  #606070;
  --accent: #00a800;
  --acc2:   #00cc00;
  --blue:   #5b8af5;
  --green:  #4cba7e;
  --red:    #f85149;
  --font:   'Outfit', sans-serif;
}
html { scroll-behavior: smooth; overflow-x: hidden; }
body { background: var(--bg); color: var(--text); font-family: var(--font); min-height: 100vh; overflow-x: hidden; }
.page { width: 100%; padding: 0 32px; }

/* ── header ── */
header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(0,0,0,0.94); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.hinner {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 0 32px; height: 58px;
}
.logo {
  font-size: 19px; font-weight: 700; letter-spacing: -.03em;
  color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 7px;
  white-space: nowrap; user-select: none; flex-shrink: 0;
}
.logo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* header search (shown on non-home views) */
.hbar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
  transform: scaleX(0.04);
  transform-origin: left center;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  min-width: 0;
}
.hbar-wrap.on {
  animation: hbarIn 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: auto;
}
@keyframes hbarIn {
  from { transform: scaleX(0.04); opacity: 0; }
  to   { transform: scaleX(1);    opacity: 1; }
}
.hbar {
  flex: 1; display: flex; align-items: center;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; overflow: visible; transition: border-color .2s, box-shadow .2s; position: relative;
}
.hbar:focus-within { border-color: rgba(0,168,0,.4); box-shadow: 0 0 0 3px rgba(0,168,0,.1); }
.hbar svg.si { flex-shrink:0; margin:0 10px; color:var(--text3); width:15px; height:15px; transition:color .15s; }
.hbar svg.si:hover { color:var(--accent); }
#sinput {
  flex:1; background:transparent; border:none; outline:none;
  color:var(--text); font-family:var(--font); font-size:14px; padding:9px 0 9px 12px;
}
#sinput::placeholder { color:var(--text3); }
#sclr {
  background:none; border:none; color:var(--text3); cursor:pointer;
  padding:0 10px; font-size:17px; display:none; transition:color .15s;
}
#sclr:hover { color:var(--text); }
#sclr.on { display:block; }

/* header right group */
.h-right { display:flex; align-items:center; gap:8px; flex-shrink:0; margin-left:auto; }
.hbtn {
  display:flex; align-items:center; gap:5px;
  background:var(--bg3); border:1px solid var(--border); border-radius:8px;
  color:var(--text2); font-family:var(--font); font-size:12px;
  padding:5px 11px; cursor:pointer; transition:all .15s; white-space:nowrap;
}
.hbtn:hover { border-color:var(--bd2); color:var(--text); }
.hbtn.on { border-color:var(--accent); color:var(--accent); background:rgba(0,168,0,.08); }
@media(max-width:480px){ .hbtn-label { display:none; } }

/* ── filter btn in search bar ── */
.filter-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text2); font-family: var(--font); font-size: 12px; font-weight:600;
  padding: 5px 12px; cursor: pointer; transition: all .15s; white-space: nowrap; flex-shrink:0;
}
.filter-btn:hover { border-color:var(--bd2); color:var(--text); }
.filter-btn.on { border-color:var(--accent); color:var(--accent); background:rgba(0,168,0,.08); }

/* ── filter panel ── */
.filter-panel {
  display: none; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin: 0 0 20px; animation: fadeUp .2s ease;
}
.filter-panel.on { display: block; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 120px; }
.filter-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; }
.filter-select {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-family: var(--font); font-size: 13px;
  padding: 6px 10px; cursor: pointer; outline: none; transition: border-color .15s;
}
.filter-select:focus { border-color: var(--accent); }
.genre-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.genre-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.genre-chip {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 20px;
  color: var(--text2); font-family: var(--font); font-size: 12px;
  padding: 4px 12px; cursor: pointer; transition: all .15s; user-select: none;
}
.genre-chip:hover { border-color: var(--bd2); color: var(--text); }
.genre-chip.on { background: rgba(0,168,0,.15); border-color: var(--accent); color: var(--accent); }
.filter-actions { display: flex; gap: 8px; }
.filter-apply {
  background: var(--accent); border: none; color: #fff;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 8px 20px; border-radius: 8px; cursor: pointer; transition: background .15s;
}
.filter-apply:hover { background: var(--acc2); }
.filter-reset {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text2); font-family: var(--font); font-size: 13px;
  padding: 7px 16px; cursor: pointer; transition: all .15s;
}
.filter-reset:hover { border-color: var(--bd2); color: var(--text); }

/* ── views ── */
.view { display:none; }
.view.on { display:block; }

/* ── home search bar (big) ── */
@keyframes searchBarIn {
  from { opacity:0; transform:translateY(-10px) scale(0.98); }
  to   { opacity:1; transform:translateY(0)      scale(1);    }
}
@keyframes searchGlow {
  0%,100% { box-shadow: 0 0 0 0px rgba(0,168,0,0); }
  50%      { box-shadow: 0 0 18px 2px rgba(0,168,0,.13); }
}
.home-search { padding: 24px 0 0; display: flex; align-items: center; gap: 10px; }
.home-bigbar {
  flex:1; display:flex; align-items:center;
  background:var(--bg2); border:1px solid var(--bd2);
  border-radius:12px; overflow:hidden; transition:box-shadow .25s, border-color .25s;
  animation: searchBarIn .45s cubic-bezier(.22,.68,0,1.2) both, searchGlow 3s ease-in-out 1s 1;
}
.home-bigbar:focus-within { box-shadow:0 0 0 3px rgba(0,168,0,.18); border-color:rgba(0,168,0,.45); }
.home-bigbar svg { flex-shrink:0; margin:0 14px; color:var(--text3); width:18px; height:18px; }
#hinput {
  flex:1; background:transparent; border:none; outline:none;
  color:var(--text); font-family:var(--font); font-size:16px; padding:14px 0 14px 16px;
}
#hinput::placeholder { color:var(--text3); }
.sbtn {
  background:var(--accent); border:none; color:#fff;
  font-family:var(--font); font-size:13px; font-weight:600;
  padding:10px 20px; margin:4px; border-radius:9px; cursor:pointer;
  transition:background .15s, transform .1s; white-space:nowrap;
}
.sbtn:hover { background:var(--acc2); }
.sbtn:active { transform:scale(.97); }
.home-filter-btn {
  background: var(--bg2); border: 1px solid var(--bd2); border-radius: 10px;
  color: var(--text2); font-family: var(--font); font-size: 13px; font-weight:600;
  padding: 12px 18px; cursor: pointer; transition: all .15s; white-space: nowrap; flex-shrink:0;
  display:flex; align-items:center; gap:6px;
}
.home-filter-btn:hover { border-color:var(--accent); color:var(--accent); }
.home-filter-btn.on { border-color:var(--accent); color:var(--accent); background:rgba(0,168,0,.08); }

/* ── section headers ── */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 0 14px; gap: 10px;
}
.sec-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.sec-more {
  font-size: 12px; color: var(--text3); cursor: pointer;
  background: none; border: none; font-family: var(--font);
  transition: color .15s;
}
.sec-more:hover { color: var(--accent); }

/* ── BIG card grid (results + featured) ── */
.bgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px; padding-bottom: 48px;
  align-items: start;
}
.bcard {
  cursor: pointer; border-radius: 12px; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--border);
  transition: transform 0.3s ease, border-color 0.2s, box-shadow 0.2s;
  animation: fadeUp .28s ease both;
  display: flex; flex-direction: row; position: relative;
}
.bcard:hover { transform: translateY(-3px); border-color: var(--bd2); box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.bcard-thumb { width: 150px; min-width: 150px; height: 225px; object-fit: cover; background: var(--bg3); display: block; flex-shrink: 0; }
.bcard-thumb-ph { width: 150px; min-width: 150px; height: 225px; background: var(--bg3); display: flex; align-items: center; justify-content: center; color: var(--text3); font-size: 36px; flex-shrink: 0; }
.bcard-body { padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1; }
.bcard-title { font-size: 16px; font-weight: 700; line-height: 1.4; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bcard-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.bcard-wl {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px; color: #fff; font-family: var(--font);
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  cursor: pointer; opacity: 0; transition: opacity .15s;
  backdrop-filter: blur(4px);
}
.bcard:hover .bcard-wl { opacity: 1; }
.bcard-wl:hover { background: var(--accent); border-color: var(--accent); }
.pill { font-size:10px; font-weight:500; padding:2px 7px; border-radius:20px; white-space:nowrap; }
.p-score { background:rgba(0,168,0,.14); color:var(--acc2); }
.p-type  { background:rgba(91,138,245,.12); color:var(--blue); }
/* per-format pill colours */
.p-fmt-tv      { background:rgba(91,138,245,.14); color:#7aa3f7; }
.p-fmt-movie   { background:rgba(229,160,60,.14);  color:#e5a03c; }
.p-fmt-ova     { background:rgba(168,85,247,.14);  color:#c47cf7; }
.p-fmt-ona     { background:rgba(20,184,166,.14);  color:#2dd4c0; }
.p-fmt-special { background:rgba(236,72,153,.14);  color:#f472b6; }
.p-fmt-music   { background:rgba(248,81,73,.14);   color:#f85149; }
.p-fmt-other   { background:var(--bg4);            color:var(--text3); }
.p-eps   { background:var(--bg4); color:var(--text3); }
.p-air   { background:rgba(76,186,126,.12); color:var(--green); }

/* ── results header ── */
.rhead { display:flex; align-items:center; justify-content:space-between; padding:20px 0 6px; gap:10px; flex-wrap:wrap; }
.rtitle { font-size:15px; color:var(--text2); }
.rtitle b { color:var(--text); }
.rcnt { font-size:12px; color:var(--text3); background:var(--bg3); padding:3px 10px; border-radius:20px; }

/* ── continue watching (4 cards) ── */
.cw-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px; padding-bottom: 0;
}
@media(max-width:700px){ .cw-grid { grid-template-columns: repeat(2,1fr); } }
.cw-card {
  display:flex; gap:14px; align-items:flex-start;
  background:var(--bg2); border:1px solid var(--border);
  border-radius:12px; padding:14px 16px; cursor:pointer;
  transition: transform 0.3s ease, border-color 0.15s;
  position:relative;
  animation: fadeUp .28s ease both;
}
.cw-card:hover { border-color:var(--bd2); transform: translateY(-2px); }
.cw-thumb { width:60px; height:84px; object-fit:cover; border-radius:7px; flex-shrink:0; background:var(--bg3); }
.cw-info { flex:1; min-width:0; }
.cw-name { font-size:13px; font-weight:600; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.35; margin-bottom:5px; }
.cw-ep   { font-size:12px; color:var(--accent); margin-bottom:4px; }
.cw-prog-wrap { height:2px; background:var(--bg4); border-radius:2px; margin-top:6px; overflow:hidden; }
.cw-prog { height:100%; background:var(--accent); border-radius:2px; }
.cw-del {
  position:absolute; top:6px; right:6px;
  background:none; border:none; color:var(--text3); cursor:pointer;
  font-size:14px; line-height:1; padding:2px; border-radius:3px; transition:color .15s;
}
.cw-del:hover { color:var(--red); }

/* ── schedule — cards + list ── */
.sched-wrap { padding-bottom: 48px; }
.sched-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; margin:14px 0; }
.sched-nav-row {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 0; overflow-x: auto; overflow-y: hidden;
  border-radius: 10px; border: 1px solid var(--border);
  scrollbar-width: none;
}
.sched-nav-row::-webkit-scrollbar { display: none; }
.sched-arrow {
  background: var(--bg3); border: none; color: var(--text2);
  font-family: var(--font); font-size: 16px; font-weight: 700;
  padding: 0 14px; cursor: pointer; transition: all .15s;
  align-self: stretch; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: sticky;
}
.sched-arrow:first-child { left: 0; }
.sched-arrow:last-child { right: 0; }
.sched-arrow:hover { background: var(--bg4); color: var(--text); }
.sched-days { display: flex; flex: 1; min-width: 0; }
.sched-day-btn {
  flex: 1; background: var(--bg3); border: none; border-left: 1px solid var(--border);
  color: var(--text2); font-family: var(--font); font-size: 13px; font-weight: 500;
  padding: 12px 6px; cursor: pointer; text-align: center; transition: all .15s;
  min-width: 80px;
}
.sched-day-btn:first-child { border-left: none; }
.sched-day-btn:hover { background: var(--bg4); color: var(--text); }
.sched-day-btn.on { background: var(--accent); color: #fff; font-weight: 600; }
.sched-day-btn .day-name { font-size: 13px; font-weight: 600; display: block; }
.sched-day-btn .day-date { font-size: 11px; opacity: .75; display: block; margin-top: 2px; }
.sched-day-btn.on .day-date { opacity: .85; }

/* card grid */
.scard {
  cursor:pointer; background:var(--bg2); border:1px solid var(--border);
  border-radius:10px; overflow:hidden; display:flex; align-items:center; gap:12px;
  padding:10px 12px; transition: transform 0.3s ease, border-color 0.15s;
}
.scard:hover { border-color:var(--bd2); transform: translateY(-2px); }
.scard-thumb { width:44px; height:62px; object-fit:cover; border-radius:6px; flex-shrink:0; background:var(--bg3); }
.scard-info { flex:1; min-width:0; }
.scard-time { font-size:11px; color:var(--accent); font-weight:600; margin-bottom:3px; }
.scard-time.now { color:var(--green); }
.scard-name { font-size:13px; font-weight:600; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-bottom:4px; }
.scard-ep { font-size:11px; color:var(--text3); }

/* list view */
.sched-list-divider { font-size: 12px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; padding: 0 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.sched-list-view { }
.sched-list-row {
  display: flex; align-items: center;
  padding: 13px 4px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s; gap: 16px;
  border-radius: 4px;
}
.sched-list-row:last-child { border-bottom: none; }
.sched-list-row:hover { background: var(--bg2); padding-left: 12px; padding-right: 12px; margin: 0 -8px; }
.sched-list-actions {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: 8px;
  opacity: 0; transition: opacity .15s;
}
.sched-list-actions button {
  background: var(--bg4); border: 1px solid var(--border); color: var(--text2);
  font-family: var(--font); font-size: 10px; padding: 2px 8px; border-radius: 5px;
  cursor: pointer; white-space: nowrap;
}
.sched-list-actions button:hover { background: var(--bg3); color: var(--text); }
.sched-list-row:hover .sched-list-actions { opacity: 1; }.sched-list-time {
  font-size: 14px; color: var(--text3); min-width: 52px;
  font-variant-numeric: tabular-nums; flex-shrink: 0; font-weight: 500;
}
.sched-list-time.now { color: var(--accent); font-weight: 700; }
.sched-list-title { flex: 1; font-size: 15px; font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-list-ep {
  font-size: 13px; color: var(--text2); flex-shrink: 0;
  display: flex; align-items: center; gap: 5px;
  width: 110px;
}
.sched-list-ep svg { color: var(--text3); flex-shrink: 0; }
.sched-show-more {
  background: none; border: none; color: var(--text2);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  padding: 18px 4px; cursor: pointer; transition: color .15s; text-align: left;
}
.sched-show-more:hover { color: var(--accent); }
.day-range-bar { display:flex; gap:6px; flex-wrap:wrap; margin:10px 0 4px; }
.day-range-pill {
  background:var(--bg3); border:1px solid var(--border); border-radius:20px;
  color:var(--text2); font-family:var(--font); font-size:11px; font-weight:500;
  padding:4px 12px; cursor:pointer; transition:all .15s; white-space:nowrap;
}
.day-range-pill:hover { border-color:var(--bd2); color:var(--text); }
.day-range-pill.on { border-color:var(--accent); color:var(--accent); background:rgba(0,168,0,.08); }
.sched-loading { display:flex; align-items:center; justify-content:center; gap:10px; padding:48px; color:var(--text3); }
.sched-empty { text-align:center; padding:48px; color:var(--text3); }
/* ── show detail ── */
.shero {
  display:flex; gap:28px; margin:24px 0 32px;
  background:var(--bg2); border:1px solid var(--border);
  border-radius:14px; padding:26px; position:relative; overflow:hidden;
}
.shbg { position:absolute; inset:0; background-size:cover; background-position:center top; opacity:.08; filter:blur(24px); transform:scale(1.15); }
.sposter { width:160px; flex-shrink:0; border-radius:8px; object-fit:cover; align-self:flex-start; box-shadow:0 8px 28px rgba(0,0,0,.5); position:relative; z-index:1; }
.spostph { width:160px; aspect-ratio:2/3; flex-shrink:0; background:var(--bg3); border-radius:8px; display:flex; align-items:center; justify-content:center; color:var(--text3); font-size:40px; position:relative; z-index:1; }
.sinfo { flex:1; min-width:0; position:relative; z-index:1; }
.stitle { font-size:clamp(18px,2.8vw,26px); font-weight:700; letter-spacing:-.02em; margin-bottom:8px; line-height:1.25; }
.smetarow { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:14px; }
.ssyn { color:var(--text2); font-size:13.5px; line-height:1.72; max-width:580px; }
.sgenres { display:flex; flex-wrap:wrap; gap:5px; margin-top:12px; }
.gtag { font-size:11px; padding:3px 9px; border-radius:20px; background:var(--bg4); color:var(--text2); cursor:pointer; transition:background .15s,color .15s; }
.gtag:hover { background:var(--accent); color:#fff; }
.studio-link:hover { background:var(--blue) !important; color:#fff !important; }
@media(max-width:580px){ .shero { flex-direction:column; } .sposter,.spostph { width:120px; } }

/* ── episodes ── */
.ep-panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; margin-bottom: 40px;
}
.ep-panel.scrollable { display: flex; flex-direction: column; max-height: calc(100vh - 380px); min-height: 400px; }
.ep-panel.scrollable .ep-list { flex: 1; min-height: 0; overflow-y: auto; }
.ep-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap;
}
.ep-panel-head-left { display:flex; align-items:center; gap:8px; min-width:0; }
.ep-panel-label { font-size: 14px; font-weight: 600; white-space: nowrap; }
.ep-panel-label span { color: var(--text3); font-weight: 400; font-size: 12px; margin-left: 6px; }
.ep-search-wrap {
  display: flex; align-items: center; gap: 0;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; transition: border-color .15s;
}
.ep-search-wrap:focus-within { border-color: var(--accent); }
.ep-search-wrap svg { margin: 0 8px; color: var(--text3); flex-shrink: 0; width: 13px; height: 13px; }
#ep-search-show, #ep-search-player {
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font); font-size: 12px;
  padding: 6px 10px 6px 0; width: 140px;
}
#ep-search-show::placeholder, #ep-search-player::placeholder { color: var(--text3); }
.ep-type-switch { display: flex; gap: 0; }
.ep-type-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 0;
  color: var(--text2); font-family: var(--font); font-size: 11px; font-weight: 600;
  padding: 5px 10px; cursor: pointer; transition: all .15s; letter-spacing: .04em;
}
.ep-type-btn:first-child { border-radius: 7px 0 0 7px; }
.ep-type-btn:last-child  { border-radius: 0 7px 7px 0; border-left: none; }
.ep-type-btn.on.sub { background: #0088cc; border-color: #0088cc; color: #fff; }
.ep-type-btn.on.dub { background: var(--accent); border-color: var(--accent); color: #fff; }
.ep-list { overflow-y: auto; display: block; }
#ep-list-show   { max-height: none; overflow-y: auto; }
.ep-list::-webkit-scrollbar { width: 4px; }
.ep-list::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }
.ep-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s; user-select: none;
}
.ep-row:last-child { border-bottom: none; }
.ep-row:hover { background: var(--bg3); }
.ep-row.active { background: rgba(0,168,0,.08); }
.ep-row.active .ep-row-num { color: var(--accent); font-weight: 700; }
.ep-row-num {
  font-size: 13px; color: var(--text3); min-width: 28px;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.ep-row-title {
  flex: 1; font-size: 14px; font-weight: 400; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.ep-row.active .ep-row-title { color: var(--accent); font-weight: 500; }
.ep-row-play {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); display: none;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.ep-row.active .ep-row-play { display: flex; }
.ep-row-play svg { width: 10px; height: 10px; color: #fff; margin-left: 1px; }
.ep-no-results { padding: 24px 16px; color: var(--text3); font-size: 13px; }
.noeps { color:var(--text3); font-size:14px; padding:20px 0; }

/* ── player ── */
.playercontent-col {
  display: flex;
  flex-direction: column;
}
.pnav  { display:flex; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.ptarea { flex:1; min-width:0; }
.peplbl { font-size:12px; color:var(--text3); font-weight:400; margin-top:2px; }
.pshow  { font-size:18px; font-weight:700; letter-spacing:-.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* source bar — stable slot above the player, never wiped by col.innerHTML */
#src-bar-slot { margin-bottom: 10px; }
.srcbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.srclbl { font-size:11px; color:var(--text3); font-weight:600; text-transform:uppercase; letter-spacing:.05em; margin-right:4px; flex-shrink:0; }

.pwrap { border-radius:12px; overflow:hidden; background:#000; margin-bottom:14px; border:1px solid var(--border); aspect-ratio:16/9; position:relative; }

video, .eiframe { width:100%; height:100%; display:block; background:#000; border:none; }
#vid { width:100%; height:100%; display:block; background:#000; outline:none; }
.ep-panel-spacer { display: none; }


.schip {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text2); font-family: var(--font); font-size: 11px; font-weight: 600;
  padding: 4px 10px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.schip:hover { border-color: var(--bd2); color: var(--text); background: var(--bg4); }
.schip.on { background: rgba(0,168,0,.14); border-color: var(--accent); color: var(--accent); }
.stats-btn { min-width:58px; justify-content:center; flex-shrink:0; }
.stats-card {
  position:fixed; top:0; left:0; z-index:99999;
  width:min(380px, calc(100vw - 24px));
  background:rgba(10,10,10,.97); border:1px solid rgba(255,255,255,.11);
  border-radius:14px; box-shadow:0 18px 48px rgba(0,0,0,.7); backdrop-filter:blur(14px);
  overflow:hidden; font-family:var(--font);
}
.stats-card[hidden] { display:none !important; }
.stats-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px 0; margin-bottom:8px;
}
.stats-title { font-size:13px; font-weight:700; color:var(--text); letter-spacing:.01em; }
.stats-close-btn {
  background:none; border:none; color:rgba(255,255,255,.4); cursor:pointer;
  font-size:16px; line-height:1; padding:2px 4px; border-radius:4px;
  transition:color .15s;
}
.stats-close-btn:hover { color:var(--text); }
.stats-tabs {
  display:flex; border-bottom:1px solid rgba(255,255,255,.09); margin:0 14px;
}
.stats-tab {
  flex:1; background:none; border:none; color:rgba(255,255,255,.45);
  font-family:var(--font); font-size:12px; font-weight:500; padding:7px 0;
  cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px;
  transition:color .15s, border-color .15s; display:flex; align-items:center;
  justify-content:center; gap:5px;
}
.stats-tab:hover { color:rgba(255,255,255,.75); }
.stats-tab.active { color:#fff; border-bottom-color:#fff; }
.stats-tab svg { opacity:.65; }
.stats-tab.active svg { opacity:1; }
.stats-tab-pane { display:none; padding:10px 14px 14px; }
.stats-tab-pane.active { display:block; }
.stats-kpi-row { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-bottom:10px; }
.stats-kpi {
  background:rgba(255,255,255,.04); border-radius:8px; padding:8px 10px;
}
.stats-kpi-label { font-size:9px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:rgba(255,255,255,.38); margin-bottom:3px; display:flex; align-items:center; gap:4px; }
.stats-kpi-val { font-size:15px; font-weight:700; color:#fff; line-height:1; }
.stats-kpi-val.stats-good { color:#4ade80 !important; }
.stats-kpi-val.stats-warn { color:#fbbf24 !important; }
.stats-kpi-val.stats-bad  { color:#f87171 !important; }
.stats-chart-block { background:rgba(255,255,255,.035); border-radius:8px; padding:10px; margin-bottom:10px; }
.stats-chart-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.stats-chart-title { font-size:11px; font-weight:600; color:rgba(255,255,255,.6); }
.stats-chart-val { font-size:11px; font-weight:700; color:var(--text); }
.stats-chart-legend { display:flex; gap:12px; align-items:center; }
.stats-chart-dot { width:7px; height:7px; border-radius:50%; }
.stats-chart-dot-label { font-size:10px; color:rgba(255,255,255,.4); }
.stats-mini-canvas { width:100%; height:52px; display:block; border-radius:4px; }
.stats-row {
  display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center;
  padding:5px 0; border-top:1px solid rgba(255,255,255,.05);
}
.stats-row:first-of-type { border-top:none; padding-top:0; }
.stats-row span:first-child { font-size:11px; color:rgba(255,255,255,.42); }
.stats-row strong { font-size:11px; font-weight:700; color:var(--text); text-align:right; }
.stats-good { color:#4ade80 !important; }
.stats-warn { color:#fbbf24 !important; }
.stats-bad  { color:#f87171 !important; }
.stats-section-label { font-size:10px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:rgba(255,255,255,.3); margin:10px 0 5px; display:flex; align-items:center; gap:6px; }
.stats-section-label::after { content:''; flex:1; height:1px; background:rgba(255,255,255,.07); }
.stats-footer { font-size:10px; color:rgba(255,255,255,.22); padding:0 14px 10px; display:flex; justify-content:space-between; }
.pepnav { display:flex; gap:7px; margin-bottom:10px; flex-wrap:wrap; align-items:center; }
.pfallback { font-size:12px; color:var(--text3); padding:6px 0; }
.flink { color:var(--blue); text-decoration:none; margin:0 3px; }
.flink:hover { text-decoration:underline; }

.card-wl-btn {
  position:absolute; bottom:6px; right:6px;
  background:rgba(0,0,0,.72); border:1px solid rgba(255,255,255,.18);
  border-radius:6px; color:#fff; font-family:var(--font);
  font-size:10px; font-weight:700; padding:3px 8px;
  cursor:pointer; opacity:0; transition:opacity .15s;
  backdrop-filter:blur(4px); z-index:2; white-space:nowrap;
}
.latest-card:hover .card-wl-btn,
.rec-card:hover .card-wl-btn,
.scard:hover .card-wl-btn,
.cw-card:hover .card-wl-btn,
.card-wl-btn:hover { background:var(--accent); border-color:var(--accent); }
/* profile card action buttons */
.phist-card-actions { display:flex; gap:4px; margin-top:6px; }
.phist-card-act {
  flex:1; background:var(--bg3); border:1px solid var(--border);
  border-radius:5px; color:var(--text2); font-family:var(--font);
  font-size:10px; font-weight:600; padding:3px 6px;
  cursor:pointer; transition:all .15s; white-space:nowrap;
}
.phist-card-act:hover { background:var(--accent); border-color:var(--accent); color:#fff; }
/* ── filter toggles & autonext ── */
.autonext-toggle { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text2); cursor:pointer; margin-left:6px; }
.autonext-toggle input { accent-color:var(--accent); cursor:pointer; }

.home-search-wrap { position:relative; flex:1; }

/* ── color settings modal ── */
.color-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 16px; }
.color-row { display:flex; flex-direction:column; gap:8px; }
.color-row > span { font-size:12px; color:var(--text2); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.color-row input[type=color] { width:100%; height:44px; border-radius:10px; border:1px solid var(--border); background:var(--bg3); cursor:pointer; padding:4px; display:block; }

/* ── latest episodes poster grid ── */
.latest-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px; margin-top: 12px;
}
@media(max-width:1400px){ .latest-grid { grid-template-columns: repeat(6,1fr); grid-template-rows: none; } }
@media(max-width:900px) { .latest-grid { grid-template-columns: repeat(4,1fr); } }
@media(max-width:700px) { .latest-grid { grid-template-columns: repeat(3,1fr); } }
.latest-card {
  cursor: pointer; border-radius: 10px; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--border);
  transition: transform 0.3s ease, border-color 0.2s;
  animation: fadeUp .28s ease both; position: relative;
  isolation: isolate;
}
.latest-card:hover { transform: translateY(-8px) !important; border-color: var(--bd2); }
.latest-poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: var(--bg3); }
.latest-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  padding: 32px 10px 10px;
}
.latest-title { font-size: 11px; font-weight: 700; color: #fff; line-height: 1.3; display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; margin-bottom:3px; }
.latest-meta { display:flex; gap:4px; align-items:center; }
.latest-ep { font-size:9px; color:var(--accent); font-weight:700; }
.latest-time { font-size:9px; color:rgba(255,255,255,.6); }

/* ── schedule browser view ── */
.browser-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media(max-width:1200px){ .browser-grid { grid-template-columns: repeat(4,1fr); } }
@media(max-width:700px) { .browser-grid { grid-template-columns: repeat(3,1fr); } }
.browser-day-header {
  grid-column: 1 / -1;
  font-size: 13px; font-weight: 700; color: var(--text2);
  padding: 16px 0 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}

.recs-section { margin-top: 24px; padding-bottom: 48px; }
.recs-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  margin-top: 12px;
}
@media(max-width:900px) { .recs-grid { grid-template-columns: repeat(6, 1fr); } }
@media(max-width:600px) { .recs-grid { grid-template-columns: repeat(4, 1fr); } }
.rec-card {
  cursor: pointer; border-radius: 10px; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--border);
  transition: transform 0.3s ease, border-color 0.2s;
  animation: fadeUp .28s ease both;
}
.rec-card:hover { transform: translateY(-8px) !important; border-color: var(--bd2); }
.rec-thumb { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--bg3); display: block; }
.rec-thumb-ph { width: 100%; aspect-ratio: 2/3; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text3); }
.rec-body { padding: 8px 10px 10px; }
.rec-title { font-size: 12px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 5px; }
.rec-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.rec-score { font-size: 10px; font-weight: 500; background: rgba(0,168,0,.14); color: var(--acc2); padding: 2px 7px; border-radius: 20px; }
.rec-format { font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 20px; background: var(--bg4); color: var(--text3); }

.seasons-bar { margin-top: 18px; }
.seasons-row {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: thin; scrollbar-color: var(--bg4) transparent;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.seasons-row::-webkit-scrollbar { height: 3px; }
.seasons-row::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }
.season-btn {
  flex-shrink: 0; position: relative; cursor: pointer;
  border-radius: 10px; overflow: hidden;
  border: 2px solid transparent;
  width: 240px; height: 120px;
  transition: border-color .15s;
  background: var(--bg3);
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.season-btn:hover { border-color: var(--bd2); }
.season-btn.active { border-color: var(--accent); }
.season-thumb {
  width: 100%; height: 100%; object-fit: cover;
  display: block; filter: brightness(.45);
}
.season-thumb-ph { width: 100%; height: 100%; background: var(--bg3); }
.season-btn.active .season-thumb { filter: brightness(.55); }
.season-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 10px 14px; text-align: center;
  font-size: 15px; font-weight: 600; color: #fff;
  line-height: 1.3;
}
.season-btn.active .season-label { color: var(--accent); }
@media (max-width: 600px) {
  .season-btn { width: 180px; height: 90px; }
  .season-label { font-size: 13px; }
}

.player-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  align-items: start;
  margin-top: 20px;
}
@media(max-width: 900px) { .player-layout { grid-template-columns: 1fr; } }
.player-col { min-width: 0; align-self: start; }

.player-ep-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
}
.player-ep-col .ep-panel {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.player-ep-col .ep-panel-head { flex-shrink: 0; }
#ep-list-player {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-height: none !important;
}

/* ── ep grid mode (50+ episodes) ── */
.ep-grid-mode { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px; }
.ep-grid-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text2); font-family: var(--font); font-size: 12px; font-weight: 500;
  padding: 9px 4px; cursor: pointer; text-align: center; transition: all .12s;
  line-height: 1;
}
.ep-grid-btn:hover { background: var(--bg4); border-color: var(--accent); color: var(--accent); }
.ep-grid-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.ep-grid-btn.last-watched { background: var(--bg4); border-color: var(--bd2); color: var(--text); }

/* range selector for 50+ */
.ep-range-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ep-range-label { font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 5px; }
.ep-range-label svg { width: 13px; height: 13px; }
.ep-range-select {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-family: var(--font); font-size: 12px;
  padding: 3px 8px; cursor: pointer; outline: none;
}
.ep-range-select:focus { border-color: var(--accent); }

/* ── MAL import modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.8);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.is-hidden { display: none; }
.ani-modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; width: 100%; max-width: 480px;
  animation: fadeUp .2s ease;
}
.ani-modal-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.ani-modal-sub { font-size: 13px; color: var(--text2); margin-bottom: 20px; line-height: 1.6; }
.ani-modal-input-row { display: flex; gap: 8px; margin-bottom: 14px; }
.ani-modal-input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: var(--font); font-size: 14px;
  padding: 10px 14px; outline: none; transition: border-color .15s;
}
.ani-modal-input:focus { border-color: var(--accent); }
.ani-modal-input::placeholder { color: var(--text3); }
.ani-modal-btn {
  background: var(--accent); border: none; color: #fff;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 10px 20px; border-radius: 8px; cursor: pointer;
  transition: background .15s; white-space: nowrap;
}
.ani-modal-btn:hover { background: var(--acc2); }
.ani-modal-btn:disabled { opacity: .5; cursor: default; }
.ani-modal-cancel {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text2); font-family: var(--font); font-size: 13px;
  padding: 9px 16px; cursor: pointer; transition: all .15s;
}
.ani-modal-cancel:hover { border-color: var(--bd2); color: var(--text); }
.ani-modal-status { font-size: 13px; color: var(--text2); min-height: 20px; margin-bottom: 16px; }
.ani-modal-status.ok  { color: var(--accent); }
.ani-modal-status.err { color: #f85149; }
.ani-modal-progress { width: 100%; height: 4px; background: var(--bg3); border-radius: 2px; margin-bottom: 14px; overflow: hidden; display: none; }
.ani-modal-progress.on { display: block; }
.ani-modal-progress-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }

/* ── history page ── */
.hist-head { display:flex; align-items:center; justify-content:space-between; padding:24px 0 16px; flex-wrap:wrap; gap:10px; }
.hist-title { font-size:18px; font-weight:700; letter-spacing:-.02em; }
.hist-clear { background:none; border:1px solid rgba(248,81,73,.3); border-radius:6px; color:#f85149; font-family:var(--font); font-size:12px; padding:5px 12px; cursor:pointer; transition:all .15s; }
.hist-clear:hover { background:rgba(248,81,73,.1); }
.hist-grid { display:flex; flex-direction:column; gap:10px; padding-bottom:60px; }
.hist-item { display:flex; align-items:center; gap:20px; background:var(--bg2); border:1px solid var(--border); border-radius:12px; padding:16px 20px; transition:border-color .15s; }
.hist-item:hover { border-color:var(--bd2); }
.hist-thumb { width:88px; height:124px; object-fit:cover; border-radius:8px; flex-shrink:0; background:var(--bg3); cursor:pointer; }
.hist-info { flex:1; min-width:0; cursor:pointer; }
.hist-name { font-size:18px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-bottom:6px; }
.hist-eprow { display:flex; align-items:center; gap:8px; margin-bottom:5px; }
.hist-ep { font-size:15px; color:var(--accent); font-weight:600; }
.hist-type { font-size:12px; color:var(--text3); background:var(--bg4); padding:2px 8px; border-radius:10px; }
.hist-date { font-size:13px; color:var(--text3); margin-top:2px; }
.hist-prog-wrap { height:4px; background:var(--bg4); border-radius:2px; margin-top:10px; max-width:360px; overflow:hidden; }
.hist-prog { height:100%; background:var(--accent); border-radius:2px; }
.hist-actions { display:flex; flex-direction:column; gap:8px; flex-shrink:0; }
.hist-play { background:var(--accent); border:none; color:#fff; font-family:var(--font); font-size:13px; font-weight:600; padding:9px 18px; border-radius:8px; cursor:pointer; transition:background .15s; white-space:nowrap; }
.hist-play:hover { background:var(--acc2); }
.hist-rm { background:none; border:1px solid var(--border); border-radius:8px; color:var(--text3); font-family:var(--font); font-size:13px; padding:8px 18px; cursor:pointer; transition:all .15s; }
.hist-rm:hover { border-color:rgba(248,81,73,.4); color:#f85149; }
.hist-empty { text-align:center; padding:80px 0; color:var(--text3); }
.hist-empty span { display:block; font-size:48px; margin-bottom:12px; }

/* ── history grid view ── */
.hist-view-toggle { display:flex; gap:0; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.hist-view-btn { background:var(--bg3); border:none; color:var(--text2); font-family:var(--font); font-size:12px; padding:6px 12px; cursor:pointer; transition:all .15s; display:flex; align-items:center; gap:5px; }
.hist-view-btn.on { background:var(--accent); color:#fff; }
.hist-card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:14px; padding-bottom:60px; }
.hist-card { cursor:pointer; border-radius:10px; overflow:hidden; background:var(--bg2); border:1px solid var(--border); transition: transform 0.3s ease, border-color 0.2s; animation:fadeUp .28s ease both; position:relative; }
.hist-card:hover { transform: translateY(-4px); border-color:var(--bd2); }
.hist-card-poster { width:100%; aspect-ratio:2/3; object-fit:cover; background:var(--bg3); display:block; }
.hist-card-body { padding:8px 10px 10px; }
.hist-card-title { font-size:12px; font-weight:600; line-height:1.35; display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; margin-bottom:4px; }
.hist-card-ep { font-size:11px; color:var(--accent); font-weight:600; margin-bottom:2px; }
.hist-card-time { font-size:10px; color:var(--text3); }
.hist-card-prog { height:3px; background:var(--bg4); border-radius:2px; margin-top:5px; overflow:hidden; }
.hist-card-bar { height:100%; background:var(--accent); border-radius:2px; }
.hist-card-rm { position:absolute; top:5px; right:5px; background:rgba(0,0,0,.6); border:none; color:#fff; border-radius:4px; font-size:12px; padding:2px 6px; cursor:pointer; opacity:0; transition:opacity .15s; z-index:3; }
.hist-card:hover .hist-card-rm { opacity:1; }

.wl-head { display:flex; align-items:center; justify-content:space-between; padding:24px 0 16px; flex-wrap:wrap; gap:10px; }
.wl-title { font-size:18px; font-weight:700; letter-spacing:-.02em; }
.wl-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:14px; padding-bottom:60px; }
.wl-card {
  background:var(--bg2); border:1px solid var(--border); border-radius:10px;
  overflow:hidden; cursor:pointer; transition: transform 0.3s ease, border-color 0.2s;
  animation: fadeUp .28s ease both;
}
.wl-card:hover { transform: translateY(-4px); border-color:var(--bd2); }
.wl-thumb { width:100%; aspect-ratio:2/3; object-fit:cover; background:var(--bg3); display:block; }
.wl-body { padding:10px 12px 12px; }
.wl-name { font-size:13px; font-weight:600; line-height:1.4; margin-bottom:6px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.wl-meta { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.wl-ep { font-size:11px; color:var(--accent); }
.wl-rm {
  background:none; border:none; color:var(--text3); cursor:pointer;
  font-size:14px; padding:2px; border-radius:3px; transition:color .15s; line-height:1;
}
.wl-rm:hover { color:#f85149; }
.wl-add-btn {
  display:inline-flex; align-items:center; gap:5px;
  background:none; border:1px solid var(--border); border-radius:8px;
  color:var(--text2); font-family:var(--font); font-size:12px;
  padding:5px 12px; cursor:pointer; transition:all .15s;
}
.wl-add-btn:hover { border-color:var(--accent); color:var(--accent); }
.wl-add-btn.added { border-color:var(--accent); color:var(--accent); background:rgba(0,168,0,.08); }

/* ── Vidking Movies / TV ─────────────────────────────────────────────────── */
#vvidking { padding: 0; }
.vidking-page { padding: 22px 28px 48px; }
.vidking-top {
  display:flex; align-items:center; gap:12px; justify-content:space-between;
  margin-bottom:14px; flex-wrap:wrap;
}
.vidking-title { font-size:18px; font-weight:700; letter-spacing:-.02em; margin-right:auto; }
.vidking-switch {
  display:flex; align-items:center; overflow:hidden;
  background:var(--bg3); border:1px solid var(--border); border-radius:8px;
}
.vidking-switch button {
  background:transparent; border:none; color:var(--text2); font-family:var(--font);
  font-size:12px; font-weight:700; padding:8px 14px; cursor:pointer;
  min-width:82px; transition:all .15s;
}
.vidking-switch button:hover { color:var(--text); background:var(--bg4); }
.vidking-switch button.on { color:#fff; background:var(--accent); }
.vidking-controls {
  display:grid; grid-template-columns:minmax(180px,240px) 110px 110px minmax(260px,1fr);
  gap:10px; align-items:end; background:var(--bg2); border:1px solid var(--border);
  border-radius:12px; padding:14px; margin-bottom:14px;
}
.vidking-field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.vidking-field.is-hidden { display:none; }
.vidking-field span {
  font-size:11px; color:var(--text3); text-transform:uppercase; letter-spacing:.06em; font-weight:700;
}
.vidking-field input {
  width:100%; background:var(--bg3); border:1px solid var(--border); border-radius:8px;
  color:var(--text); font-family:var(--font); font-size:13px; padding:9px 11px; outline:none;
}
.vidking-field input:focus { border-color:rgba(0,168,0,.45); box-shadow:0 0 0 3px rgba(0,168,0,.1); }
.vidking-url-field { grid-column:auto / span 1; }
.vidking-url-row { display:flex; gap:8px; min-width:0; }
.vidking-url-row input { flex:1; min-width:0; }
.vidking-frame-wrap {
  min-height:calc(100vh - 190px); background:var(--bg2); border:1px solid var(--border);
  border-radius:12px; overflow:hidden;
}
.vidking-frame { display:block; width:100%; height:calc(100vh - 190px); min-height:520px; border:0; background:#000; }
.vidking-empty {
  min-height:520px; display:flex; align-items:center; justify-content:center;
  color:var(--text3); font-size:14px; text-align:center; padding:24px;
}
@media(max-width:900px) {
  .vidking-controls { grid-template-columns:1fr 1fr; }
  .vidking-url-field { grid-column:1 / -1; }
}
@media(max-width:560px) {
  .vidking-page { padding:16px 14px 36px; }
  .vidking-controls { grid-template-columns:1fr; }
  .vidking-frame, .vidking-empty { height:65vh; min-height:420px; }
}

/* ── shared buttons ── */
.bbk { display:inline-flex; align-items:center; gap:5px; background:#0088cc; border:1px solid #0088cc; border-radius:8px; color:#fff; font-family:var(--font); font-size:12.5px; padding:6px 13px; cursor:pointer; transition:background .15s, border-color .15s; }
.bbk:hover { background:#0099dd; border-color:#0099dd; }
.bpri { display:inline-flex; align-items:center; gap:5px; background:var(--accent); border:none; border-radius:8px; color:#fff; font-family:var(--font); font-size:12.5px; font-weight:600; padding:7px 16px; cursor:pointer; transition:background .15s, transform .1s; }
.bpri:hover { background:var(--acc2); }
.bpri:active { transform:scale(.97); }

/* ── states ── */
.errbox { background:rgba(248,81,73,.1); border:1px solid rgba(248,81,73,.22); border-radius:10px; padding:16px 18px; margin:16px 0; color:#ff9590; font-size:13.5px; line-height:1.55; }
.errbox strong { display:block; margin-bottom:3px; font-size:14px; }
.noresult { text-align:center; padding:72px 0; color:var(--text3); }
.noresult span { display:block; font-size:44px; margin-bottom:10px; }
.spnwrap { display:flex; align-items:center; justify-content:center; padding:80px 0; }
.spn { width:34px; height:34px; border:3px solid var(--bg3); border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite; }
.sempty { padding:36px; text-align:center; background:var(--bg2); border:1px solid var(--border); border-radius:12px; color:var(--text2); font-size:14px; }
.sk { background:linear-gradient(90deg,var(--bg2) 25%,var(--bg3) 50%,var(--bg2) 75%); background-size:200% 100%; animation:shimmer 1.4s infinite; border-radius:8px; }
.skgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:18px; padding-bottom:48px; }
.skcard { border-radius:12px; overflow:hidden; }
.skthumb { width:100%; aspect-ratio:2/3; }
.skline { height:13px; margin:11px 12px 6px; border-radius:4px; }
.skline.s { width:55%; }

/* ── ANIMATION FIX: only fade, no transform to avoid squish ── */
@keyframes fadeUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes profFadeUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin { to{transform:rotate(360deg)} }
@keyframes shimmer { to{background-position:-200% 0} }

/* ── Touch / Mobile ── */
@media (hover: none) and (pointer: coarse) {
  /* Bigger tap targets on touch devices */
  .hbtn { padding: 8px 14px; min-height: 40px; }
  .schip { padding: 7px 14px; min-height: 38px; font-size: 13px; }
  .ep-btn { min-height: 38px; font-size: 13px; }
  .bbk, .bpri { padding: 10px 18px; min-height: 40px; font-size: 14px; }
  .sbtn { padding: 10px 20px; font-size: 15px; }
  .filter-btn, .home-filter-btn { padding: 8px 14px; min-height: 40px; }
  .wl-rm, .hist-rm { min-height: 36px; min-width: 36px; font-size: 16px; }
  /* Show hover-only buttons permanently on touch */
  .card-wl-btn { opacity: 1 !important; }
  .sched-list-actions { opacity: 1 !important; }
  .sched-list-actions button { min-height: 36px; padding: 4px 10px; font-size: 12px; }
  .hist-card-rm { opacity: 0; } /* keep hidden, shown on long-press via :active */
  .hist-card:active .hist-card-rm { opacity: 1; }
  /* Bigger search input */
  #hinput { font-size: 18px; padding: 16px 0 16px 16px; }
  #sinput { font-size: 16px; padding: 11px 0 11px 12px; }
  /* Episode list items bigger */
  .ep-btn { padding: 10px 12px; }
  /* Source/quality chips bigger */
  .srcbar, .qualbar { gap: 10px; }
}
@media (max-width: 480px) {
  .hist-card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .sec-title { font-size: 15px; }
  .latest-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .home-bigbar { border-radius: 10px; }
  /* Schedule list on phone: wrap to 2 lines */
  .sched-list-row { flex-wrap: wrap; gap: 6px; padding: 10px 4px; }
  .sched-list-title { width: 100%; order: -1; white-space: normal; font-size: 14px; }
  .sched-list-time { font-size: 12px; }
  .sched-list-ep { width: auto; }
  .sched-list-ep-text { display: none; }
  .sched-list-actions button { padding: 4px 8px; min-height: 32px; }
}

/* ── Touch / Mobile / Tablet friendly UI ─────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Always show action buttons on touch devices (no hover) */
  .card-wl-btn, .hist-card-rm, .cw-del { opacity: 1 !important; }

  /* Bigger tap targets for all buttons */
  .hbtn { padding: 10px 14px; gap: 7px; }
  .schip { padding: 7px 14px; font-size: 13px; min-height: 38px; }
  .bbk, .bpri { padding: 10px 18px; font-size: 14px; min-height: 44px; }
  .sbtn { padding: 12px 20px; font-size: 15px; }
  .ep-btn { min-height: 44px; font-size: 13px; }
  .wl-rm { width: 36px; height: 36px; font-size: 18px; }
  .hist-play, .hist-rm { min-height: 44px; font-size: 13px; padding: 10px 16px; }
  .sec-more { padding: 8px 14px; min-height: 40px; }

  /* Season bar — full width cards on phone */
  .season-btn { width: 80vw; max-width: 220px; height: 110px; }

  /* Player layout: stack vertically, ep list below */
  .player-layout { grid-template-columns: 1fr !important; }
  .player-ep-col { max-height: 260px; overflow-y: auto; }

  /* Episode list items bigger for touch */
  .ep-btn { padding: 12px 16px !important; }

  /* Show detail: stack poster + info */
  .shero { flex-direction: column; align-items: center; }
  .sposter, .spostph { width: 160px !important; }

  /* Continue watching: 2 cols on phones */
  .cw-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Header buttons: show labels on tablets */
  .hbtn-label { display: inline !important; }

  /* Filter panel full width */
  .filter-panel { padding: 16px !important; }
  .filter-row { flex-direction: column; gap: 10px; }
  .filter-select { width: 100%; min-height: 44px; font-size: 14px; }
  .filter-apply, .filter-reset { min-height: 44px; font-size: 14px; padding: 10px 20px; }
}

/* ── Profile view (merged from user.html) ────────────────────────────────── */
#vprofile { padding: 0; }
.prof-tabs { display: flex; align-items: center; gap: 6px; padding: 12px 28px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.prof-tab { display: flex; align-items: center; gap: 5px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text2); font-family: var(--font); font-size: 12px; padding: 5px 11px; cursor: pointer; transition: all .15s; white-space: nowrap; user-select: none; }
.prof-tab:hover { border-color: rgba(255,255,255,.18); color: var(--text); }
.prof-tab.on { border-color: var(--accent); color: var(--accent); background: rgba(0,168,0,.08); }
.prof-tab.admin-tab { border-color: rgba(248,81,73,.3); color: var(--red); }
.prof-tab.admin-tab.on { background: rgba(248,81,73,.08); }
.prof-panel { display: none; padding: 24px 28px; max-width: 1000px; margin: 0 auto; }
.prof-panel.on { display: block; }
.prof-panel.full { padding: 0; max-width: none; }
.pcard { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 14px; animation: profFadeUp .28s ease both; }
#ppanel-console .pcard { overflow: visible; }
.pcard-head { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pcard-title { font-size: 14px; font-weight: 700; }
.pcard-body { padding: 0; }
.pcard-link { font-size: 12px; color: var(--accent); cursor: pointer; background: none; border: none; font-family: var(--font); }
.pcard-link:hover { text-decoration: underline; }
.pbtn { border: none; border-radius: 7px; font-family: var(--font); font-size: 12px; font-weight: 600; padding: 5px 12px; cursor: pointer; transition: all .15s; min-height: 36px; touch-action: manipulation; }
.pbtn-green { background: var(--accent); color: #fff; }
.pbtn-green:hover { background: #00c800; }
.pbtn-ghost { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.pbtn-ghost:hover { background: var(--bg4); color: var(--text); }
.pbtn-red { background: rgba(248,81,73,.1); color: var(--red); border: 1px solid rgba(248,81,73,.25); }
.pbtn-red:hover { background: rgba(248,81,73,.2); }
.pbtn-red:disabled, .pbtn-green:disabled { opacity: .4; cursor: not-allowed; }
.padmin-zone { background: rgba(248,81,73,.05); border: 1px solid rgba(248,81,73,.2); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; animation: profFadeUp .28s ease both; }
.padmin-zone-title { font-size: 11px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.puser-table { width: 100%; border-collapse: collapse; }
.puser-table th { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; padding: 10px 18px; border-bottom: 1px solid var(--border); text-align: left; }
.puser-table td { padding: 10px 18px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.puser-table tr:last-child td { border-bottom: none; }
.puser-table tr:hover td { background: var(--bg3); }
.pperm-row { display: flex; align-items: center; gap: 8px; }
.ptoggle { width: 34px; height: 18px; border-radius: 9px; background: var(--bg4); border: 1px solid var(--border); cursor: pointer; position: relative; transition: background .2s; flex-shrink: 0; }
.ptoggle.on { background: var(--accent); border-color: var(--accent); }
.ptoggle::after { content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: left .2s; }
.ptoggle.on::after { left: 18px; }
.pupd-modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: none; align-items: center; justify-content: center; z-index: 400; }
.pupd-modal.open { display: flex; }
.pupd-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 440px; max-width: 95vw; }
.pupd-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.pupd-sub { font-size: 12px; color: var(--text2); margin-bottom: 16px; line-height: 1.5; }
.pupd-drop { border: 2px dashed var(--border); border-radius: 10px; padding: 24px; text-align: center; cursor: pointer; transition: all .15s; margin-bottom: 14px; }
.pupd-drop:hover, .pupd-drop.drag { border-color: var(--accent); background: rgba(0,168,0,.05); }
.pupd-drop p { font-size: 13px; color: var(--text2); }
.pupd-file-list { margin-bottom: 12px; }
.pupd-file-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.pupd-file-row:last-child { border-bottom: none; }
.pupd-file-name { font-family: monospace; flex: 1; }
.pupd-file-size { color: var(--text3); }
.pupd-file-warn { color: var(--yellow, #e3b341); }
.pupd-log { font-size: 11px; min-height: 16px; margin-bottom: 12px; font-family: monospace; color: var(--text2); }
.pupd-actions { display: flex; gap: 8px; justify-content: flex-end; }
/* prof page head */
.ppage-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px 14px; flex-wrap: wrap; gap: 10px; max-width: 1400px; margin: 0 auto; }
.ppage-title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }

.phist-clear { background: none; border: 1px solid rgba(248,81,73,.3); border-radius: 6px; color: var(--red); font-family: var(--font); font-size: 12px; padding: 5px 12px; cursor: pointer; transition: all .15s; }
.phist-clear:hover { background: rgba(248,81,73,.1); }
/* poster card grid — shared with existing .hist-card-grid but scoped to profile */
.phist-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 14px; padding: 0 28px 60px; max-width: 1400px; margin: 0 auto; }
.phist-card { cursor: pointer; border-radius: 10px; overflow: hidden; background: var(--bg2); border: 1px solid var(--border); transition: transform 0.3s ease, border-color 0.2s; animation: profFadeUp .28s ease both; position: relative; }
.phist-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.18); }
.phist-card-poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--bg3); display: block; }
.phist-card-body { padding: 8px 10px 10px; }
.phist-card-title { font-size: 12px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.phist-card-ep { font-size: 11px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.phist-card-time { font-size: 10px; color: var(--text3); }
.phist-card-prog { height: 3px; background: var(--bg4); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.phist-card-bar { height: 100%; background: var(--accent); border-radius: 2px; }
.phist-card-rm { position: absolute; top: 5px; right: 5px; background: rgba(0,0,0,.6); border: none; color: #fff; border-radius: 4px; font-size: 12px; padding: 2px 6px; cursor: pointer; opacity: 0; transition: opacity .15s; z-index: 3; }
.phist-card:hover .phist-card-rm { opacity: 1; }
.pempty { padding: 20px 18px; color: var(--text3); font-size: 13px; text-align: center; }
.pbadge { font-size: 10px; background: var(--accent); color: #fff; border-radius: 8px; padding: 2px 6px; font-weight: 700; }
/* admin stats grid */
.pstat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 10px; }
.pstat-box { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.pstat-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.pstat-val { font-size: 20px; font-weight: 700; color: var(--text); }
.pstat-sub { font-size: 10px; color: var(--text3); margin-top: 2px; }
.pbar { height: 4px; background: var(--bg4); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.pbar-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width .4s; }
.pbar-fill.warn { background: var(--yellow, #e3b341); }
.pbar-fill.danger { background: var(--red); }


/* ── Subtitle settings ───────────────────────────────────────────────────── */
::cue { font-family:var(--font); font-size:22px; color:#fff; background:rgba(0,0,0,.7); text-shadow:none; }
.sub-panel {
  display:none; flex-direction:column; gap:10px;
  background:var(--bg2); border:1px solid var(--border);
  border-radius:10px; padding:12px 16px; margin-bottom:10px;
}
.sub-panel.open { display:flex; }
.sub-row { display:flex; align-items:center; gap:10px; font-size:12px; color:var(--text2); }
.sub-row label { min-width:58px; color:var(--text3); }
.sub-row input[type=range] { flex:1; accent-color:var(--accent); }
.sub-row input[type=color] { width:34px; height:22px; border:none; background:none; cursor:pointer; padding:0; border-radius:4px; }
.sub-row select { background:var(--bg3); color:var(--text); border:1px solid var(--border); border-radius:6px; padding:3px 8px; font-size:12px; }
.sub-row .sub-val { min-width:36px; text-align:right; font-size:12px; color:var(--text); }
/* ── Offline DB modal ── */
.offlinedb-stat { background:var(--bg3); border:1px solid var(--border); border-radius:8px; padding:8px 14px; font-size:11px; }
.offlinedb-stat-label { color:var(--text3); font-weight:600; text-transform:uppercase; letter-spacing:.05em; margin-bottom:2px; }
.offlinedb-stat-val { font-size:16px; font-weight:700; color:var(--text); }
.offlinedb-row { display:flex; align-items:center; gap:12px; padding:10px 12px; border-bottom:1px solid var(--border); border-radius:8px; cursor:pointer; transition:background .1s; }
.offlinedb-row:last-child { border-bottom:none; }
.offlinedb-row:hover { background:var(--bg3); }
.offlinedb-thumb { width:36px; height:50px; border-radius:5px; object-fit:cover; flex-shrink:0; background:var(--bg3); }
.offlinedb-thumb-ph { width:36px; height:50px; border-radius:5px; flex-shrink:0; background:var(--bg3); display:flex; align-items:center; justify-content:center; font-size:16px; color:var(--text3); }
.offlinedb-info { flex:1; min-width:0; }
.offlinedb-title { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.offlinedb-native { font-size:11px; color:var(--text3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.offlinedb-pills { display:flex; flex-wrap:wrap; gap:4px; margin-top:5px; }
.offlinedb-ids { font-size:10px; color:var(--text3); flex-shrink:0; text-align:right; line-height:1.6; }

/* ── FIX: prevent render clipping on hover translateY (GPU layer) ── */
.bcard,
.cw-card,
.scard,
.latest-card,
.rec-card,
.hist-card,
.phist-card,
.wl-card,
.ep-grid-btn {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}
