:root { --bg: #0a0a0a; --bg-2: #111; --card: #141414; --panel: #1a1a1a; --line: #2a2a2a; --text: #fff; --muted: #888; --dim: #555; --red: #e50914; --red-dark: #c40812; --gold: #f5c518; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: "Segoe UI", system-ui, Roboto, sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
img { display: block; }
button, input, select { font: inherit; }
button { cursor: pointer; }
ul { list-style: none; }
.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.15em; }
.container { max-width: 1024px; margin: 0 auto; padding: 0 20px; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* ad placeholders */
.adx { margin: 8px auto; text-align: center; max-width: 100%; display: flex; justify-content: center; padding: 0 12px; }
.adx-group { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 12px auto; width: 100%; }
.adx-group .adx { margin: 0 auto; width: 100%; }
.adx-ph { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; border: 1px dashed var(--red); border-radius: 6px; color: var(--red); background: rgba(229, 9, 20, .07); font: 700 11px/1 system-ui, sans-serif; letter-spacing: .6px; text-transform: uppercase; }
.adx-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 300; background: var(--bg); box-shadow: 0 -3px 14px rgba(0, 0, 0, .45); padding: 6px 12px; }
.adx-sticky .adx-ph { width: 100%; height: 56px; }
.adx-sticky-close { position: absolute; top: -13px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: #e5484d; color: #fff; border: 2px solid var(--bg); font: 700 14px/20px system-ui, sans-serif; }
.adx-pov { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 6; width: 300px; max-width: 80%; aspect-ratio: 6 / 5; background: #0b0b0b; border-radius: 10px; box-shadow: 0 6px 26px rgba(0, 0, 0, .6); overflow: hidden; display: flex; }
.adx-pov .adx-ph { width: 100%; height: 100%; border-radius: 10px; }
.adx-pov-close { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff; border: 1px solid rgba(255, 255, 255, .65); font: 700 15px/24px system-ui, sans-serif; z-index: 7; }

/* nav */
.ip-nav { background: var(--bg-2); border-bottom: 1px solid #1f1f1f; position: sticky; top: 0; z-index: 200; }
.ip-nav-in { max-width: 1024px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 20px; }
.logo { font-size: 22px; font-weight: 900; letter-spacing: -.5px; color: var(--red); }
.ip-links { display: flex; gap: 4px; flex: 1; align-items: center; }
.ip-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); padding: 6px 12px; border-radius: 6px; transition: .2s; }
.ip-links a:hover, .ip-links a.on { color: #fff; background: #222; }
.ip-search { flex: 0 0 260px; position: relative; margin-left: auto; }
.ip-search input { width: 100%; background: #1e1e1e; border: 1px solid var(--line); color: #fff; padding: 8px 38px 8px 14px; border-radius: 20px; outline: none; }
.ip-search input:focus { border-color: var(--red); }
.ip-search button { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); display: flex; }
.search-box { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; max-height: 70vh; overflow: auto; display: none; z-index: 250; text-align: left; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.search-box.open { display: block; }
.search-box a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #222; color: #ddd; }
.search-box a:hover { background: #222; color: #fff; }
.search-box img, .search-box .noimg { width: 34px; height: 50px; object-fit: cover; border-radius: 4px; background: #222; flex: none; }
.search-box small { color: var(--muted); display: block; font-size: 12px; }
.search-box .none { display: block; padding: 12px; color: var(--muted); }

/* home: search hero */
.hss { background: #0d0d0d; padding: 36px 20px 40px; text-align: center; }
.hss-logo { display: inline-block; font-size: 40px; font-weight: 900; color: var(--red); letter-spacing: -1px; margin-bottom: 20px; }
.hss-wrap { max-width: 460px; margin: 0 auto; position: relative; }
.hss-form { display: flex; background: #1a1a1a; border: 1px solid var(--line); border-radius: 30px; overflow: hidden; }
.hss-form input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: #fff; padding: 13px 20px; font-size: 15px; }
.hss-form button { background: var(--red); border: none; color: #fff; padding: 0 22px; font-size: 16px; display: flex; align-items: center; }
.hss-form button:hover { background: var(--red-dark); }

/* sections */
.sec { padding: 36px 0 8px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.sec-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.sec-title .ic { color: var(--red); }
.see-all { color: var(--red); font-size: 13px; font-weight: 600; }
.see-all:hover { text-decoration: underline; }

/* poster cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card { background: var(--card); border-radius: 10px; overflow: hidden; transition: .2s; }
.card:hover, .tcard:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0, 0, 0, .6); }
.poster { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: linear-gradient(135deg, #1a1a2e, #16213e); }
.poster::before { content: '🎬'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.poster img { position: relative; width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.card:hover .poster img { transform: scale(1.05); }
.badge { position: absolute; top: 7px; left: 7px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; }
.hd { position: absolute; bottom: 7px; right: 7px; background: rgba(0, 0, 0, .7); color: var(--gold); font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 3px; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .5); opacity: 0; transition: .2s; }
.card:hover .overlay { opacity: 1; }
.overlay span { background: var(--red); color: #fff; padding: 7px 16px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.info { padding: 9px; }
.info .t { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.info .m { display: flex; gap: 6px; font-size: 11px; color: var(--muted); align-items: center; min-height: 14px; }
.star { color: var(--gold); }

/* trend row */
.trend-wrap { position: relative; padding: 0 20px; }
.trend-list { display: flex; gap: 12px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.trend-list::-webkit-scrollbar { display: none; }
.tcard { position: relative; flex: 0 0 160px; border-radius: 10px; overflow: hidden; background: var(--panel); transition: .2s; }
.tcard .num { position: absolute; bottom: 0; left: 4px; font-size: 64px; font-weight: 900; line-height: 1; color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .45); pointer-events: none; }
.trend-nav { position: absolute; top: 40%; transform: translateY(-50%); width: 34px; height: 34px; background: rgba(0, 0, 0, .8); border: none; border-radius: 50%; color: #fff; z-index: 10; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: .2s; }
.trend-nav:hover { background: var(--red); }
.trend-nav.prev { left: 0; }
.trend-nav.next { right: 0; }

/* latest episodes box */
.ep-box { background: var(--bg-2); border-radius: 10px; position: relative; padding: 46px 14px 14px; }
.ep-tab { position: absolute; top: 0; left: 0; background: #0d0d0d; padding: 10px 18px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; border-radius: 10px 0; }
.ep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.epcard { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--panel); border-radius: 8px; transition: .15s; min-width: 0; }
.epcard:hover { background: #222; }
.epcard .thumb { width: 100px; height: 75px; flex: none; overflow: hidden; border-radius: 6px; background: #0d0d0d; }
.epcard .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.epcard .i { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.epcard b { font-size: 15px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epcard span { font-size: 13px; color: #999; }
.epcard small { font-size: 12px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* list pages */
.page-head { display: flex; align-items: center; gap: 10px; padding: 24px 0 14px; border-bottom: 2px solid var(--red); margin-bottom: 18px; }
.page-head .ic { color: var(--red); font-size: 18px; }
.page-head h1 { font-size: 18px; font-weight: 700; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.filters select { background: var(--panel); color: #ccc; border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; font-size: 12px; outline: none; }
.filters select:focus { border-color: var(--red); }
.sub-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; padding-left: 10px; border-left: 3px solid var(--red); }

/* series page */
.dp-hero { position: relative; min-height: 340px; background: #000 center top / cover no-repeat; display: flex; align-items: flex-end; padding-bottom: 40px; }
.dp-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, rgba(0, 0, 0, .93), rgba(0, 0, 0, .55) 60%, rgba(0, 0, 0, .25)), linear-gradient(to top, rgba(0, 0, 0, .9), transparent 55%); }
.dp-hero .container { position: relative; width: 100%; }
.dp-title { font-size: 36px; font-weight: 800; line-height: 1.1; margin-bottom: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.chip.imdb { background: var(--gold); color: #000; }
.chip.soft { background: rgba(255, 255, 255, .12); color: #ddd; border: 1px solid rgba(255, 255, 255, .25); }
.chip.green { background: #22c55e; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-red, .btn-dark { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 6px; font-size: 13px; font-weight: 700; border: 1px solid transparent; transition: .15s; color: #fff; }
.btn-red { background: var(--red); }
.btn-red:hover { background: var(--red-dark); }
.btn-dark { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); font-weight: 600; }
.btn-dark:hover { background: rgba(255, 255, 255, .2); }
.btn-off { opacity: .4; pointer-events: none; }
.dp-body { background: #0f0f0f; }
.dp-grid { display: grid; grid-template-columns: 1fr 290px; gap: 32px; padding: 32px 0; }
.dp-top { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.dp-top .poster { width: 150px; flex: none; border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .6); }
.dp-desc { color: #aaa; font-size: 13px; line-height: 1.75; }
.tabs { display: flex; border-bottom: 1px solid #1e1e1e; margin-bottom: 20px; }
.tabs span { font-size: 13px; font-weight: 600; color: #fff; padding: 12px 20px; border-bottom: 2px solid var(--red); }
.season-btns { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.season-btns button { background: var(--panel); border: 1px solid var(--line); color: var(--muted); padding: 6px 18px; border-radius: 5px; font-size: 12px; font-weight: 600; transition: .15s; }
.season-btns button:hover { border-color: #555; color: #fff; }
.season-btns button.on { background: var(--red); border-color: var(--red); color: #fff; }
.ep-list { display: flex; flex-direction: column; gap: 6px; }
.ep-item { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid #1e1e1e; border-radius: 7px; padding: 12px 16px; transition: .15s; }
a.ep-item:hover { border-color: #3a3a3a; background: #222; }
.ep-item .i { flex: 1; min-width: 0; }
.ep-item b { display: block; font-size: 13px; font-weight: 600; color: #ccc; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-item span { font-size: 11px; color: var(--dim); }
.ep-item .go { color: var(--red); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; flex: none; }
div.ep-item { opacity: .5; }
.side .poster { border-radius: 8px; margin-bottom: 16px; box-shadow: 0 4px 20px rgba(0, 0, 0, .5); }
.info-box { background: var(--panel); border: 1px solid #1e1e1e; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.info-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 12px; }
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row .l { color: var(--dim); flex: none; }
.info-row .v { color: #ccc; font-weight: 600; text-align: right; }
.genres { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.genres span { background: rgba(229, 9, 20, .12); border: 1px solid rgba(229, 9, 20, .3); color: #ff7070; font-size: 10px; padding: 2px 8px; border-radius: 10px; }
.side .adx { padding: 0; }
.rec { padding: 8px 0 32px; }

/* watch page */
.bp-hero { position: relative; min-height: 130px; background: #000 center / cover; padding: 24px 0; }
.bp-hero::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .83); }
.bp-hero .container { position: relative; }
.bp-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.bp-name { font-size: 13px; color: #aaa; margin-bottom: 8px; }
.bp-hero .dp-desc { margin-bottom: 14px; max-width: 760px; }
.bp-body { background: #0f0f0f; padding-bottom: 40px; }
.player-wrap { padding-top: 12px; }
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.cover { position: absolute; inset: 0; z-index: 4; background: #000 center / cover; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cover::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.play-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.play-btn { width: 76px; height: 76px; background: rgba(229, 9, 20, .92); border-radius: 50%; display: flex; align-items: center; justify-content: center; border: none; color: #fff; font-size: 30px; transition: .2s; padding-left: 5px; }
.cover:hover .play-btn { background: var(--red); transform: scale(1.1); }
.play-hint { color: rgba(255, 255, 255, .7); font-size: 13px; }
.cover.off { cursor: default; }
.ep-nav { display: flex; gap: 10px; align-items: stretch; padding: 16px 0; }
.nc { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; transition: .15s; flex: 1; max-width: 260px; min-width: 0; }
.nc:hover { border-color: #444; background: #222; }
.nc.off { opacity: .35; pointer-events: none; }
.nc.next { margin-left: auto; justify-content: flex-end; text-align: right; }
.nc .arrow { font-size: 18px; color: var(--red); display: flex; }
.nc .ni { min-width: 0; }
.nc small { display: block; font-size: 11px; color: var(--dim); margin-bottom: 2px; }
.nc b { display: block; font-size: 13px; font-weight: 600; color: #ccc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-all { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 22px; font-size: 13px; font-weight: 600; color: #ccc; white-space: nowrap; transition: .15s; }
.nc-all:hover { border-color: var(--red); color: var(--red); }
.bp-panel { padding: 16px 0 0; }
.bp-list { display: flex; flex-direction: column; gap: 4px; max-height: 400px; overflow-y: auto; }
.bp-list::-webkit-scrollbar { width: 4px; }
.bp-list::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
.bp-item { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid #1e1e1e; border-radius: 6px; padding: 10px 14px; font-size: 13px; color: var(--muted); transition: .15s; }
a.bp-item:hover { border-color: #3a3a3a; background: #222; color: #fff; }
.bp-item.current { border-color: var(--red); color: #fff; background: #200a0a; font-weight: 600; }
.bp-item.current::before { content: '▶'; color: var(--red); font-size: 11px; }
div.bp-item { opacity: .45; }
.bp-item em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--dim); }

/* footer */
.ip-footer { background: #0d0d0d; border-top: 1px solid #1a1a1a; margin-top: 50px; padding: 40px 0 90px; }
.ft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 26px; }
.ft-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.ft-grid ul { display: flex; flex-direction: column; gap: 8px; }
.ft-grid a { color: var(--muted); font-size: 13px; }
.ft-grid a:hover { color: #fff; }
.ft-about { padding-top: 26px; border-top: 1px solid #1a1a1a; color: #6b6b6b; font-size: 12.5px; line-height: 1.95; margin-bottom: 20px; }
.ft-about h2 { color: #c7c7c7; font-size: 15px; margin-bottom: 10px; }
.ft-bottom { text-align: center; padding-top: 20px; border-top: 1px solid #1a1a1a; color: #444; font-size: 12px; }

/* phone bottom nav (hidden on desktop) */
.ip-bottom { display: none; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .ep-grid { grid-template-columns: 1fr 1fr; }
  .tcard { flex-basis: 140px; }
  .dp-grid { grid-template-columns: 1fr; }
  .side .poster { display: none; }
}
@media (max-width: 640px) {
  .container { padding: 0 12px; }
  .ip-nav-in { padding: 0 12px; height: 52px; gap: 10px; }
  .ip-links { display: none; }
  .ip-search { flex: 1 1 auto; min-width: 0; max-width: 260px; }
  .ip-search input { font-size: 13px; padding: 7px 32px 7px 12px; }
  .logo { font-size: 19px; }
  .hss { padding: 24px 12px 28px; }
  .hss-logo { font-size: 32px; margin-bottom: 14px; }
  .sec { padding: 24px 0 6px; }
  .sec-title { font-size: 15px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .info { padding: 6px; }
  .info .t { font-size: 11px; }
  .info .m { font-size: 10px; }
  .trend-wrap { padding: 0 28px; }
  .tcard { flex-basis: 120px; }
  .tcard .num { font-size: 48px; }
  .ep-grid { grid-template-columns: 1fr; }
  .epcard .thumb { width: 80px; height: 60px; }
  .epcard b { font-size: 14px; }
  .dp-hero { min-height: 240px; padding-bottom: 24px; }
  .dp-title { font-size: 22px; }
  .dp-top { flex-direction: column; }
  .dp-top .poster { width: 110px; }
  .bp-title { font-size: 17px; }
  .ep-nav { flex-wrap: wrap; }
  .nc { max-width: none; flex-basis: calc(50% - 5px); }
  .nc-all { order: 3; flex-basis: 100%; }
  .ft-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .ip-footer { padding: 28px 0 150px; }
  .adx-sticky { bottom: calc(60px + env(safe-area-inset-bottom)); }
  .adx-sticky .adx-ph { height: 44px; }
  .ip-bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 290; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg-2); border-top: 1px solid #1f1f1f; }
  .ip-bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11px; }
  .ip-bottom a .ic { font-size: 18px; }
  .ip-bottom a.on { color: var(--red); }
}

/* admin */
.admin-main { padding-top: 20px; padding-bottom: 50px; }
.btn { display: inline-block; padding: 9px 18px; border-radius: 6px; background: var(--red); color: #fff; font-weight: 700; border: 1px solid transparent; }
.btn:hover { background: var(--red-dark); }
.btn.ghost { background: transparent; color: #fff; border-color: #444; }
.btn.ghost:hover { border-color: #777; }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn.danger { background: #a33; }
.box { background: var(--card); border: 1px solid #1e1e1e; border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.box h2 { margin: 0 0 12px; font-size: 16px; padding-left: 10px; border-left: 3px solid var(--red); }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
input[type=text], input[type=password], input[type=url] { width: 100%; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); color: #fff; border-radius: 6px; outline: none; }
input[type=text]:focus, input[type=password]:focus, input[type=url]:focus { border-color: var(--red); }
.row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.results { display: grid; gap: 6px; margin-top: 10px; }
.result { display: flex; gap: 10px; align-items: center; padding: 6px; background: var(--bg); border-radius: 6px; cursor: pointer; }
.result.on { outline: 2px solid var(--red); }
.result img { width: 40px; height: 60px; object-fit: cover; background: #333; }
.list { display: grid; gap: 6px; }
.item { display: flex; gap: 10px; align-items: center; padding: 6px; background: var(--bg); border-radius: 6px; }
.item img { width: 32px; height: 48px; object-fit: cover; background: #333; }
.item .n { flex: 1; min-width: 0; }
.msg { margin-top: 8px; font-size: 13px; color: #f88; }
.msg.ok { color: #8f8; }
.eprow { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; }
.eprow .k { color: var(--red); font-weight: 700; }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 3px; background: #333; color: var(--muted); }
.tag.ok { background: #1e4d2b; color: #8f8; }

/* ---- front (PHP) additions ---- */
.adx { position: relative; }
.adx-link { display: inline-block; line-height: 0; max-width: 100%; }
.adx-link img { display: block; width: 100%; height: auto; object-fit: contain; }
.adx-code { max-width: 100%; overflow: hidden; }
.slot-tag { position: absolute; top: 2px; left: 14px; z-index: 5; background: #ffc107; color: #000; font: 700 10px/1 system-ui, sans-serif; padding: 3px 6px; border-radius: 3px; pointer-events: none; }
.adx-sticky .adx, .adx-pov .adx { margin: 0; padding: 0; width: 100%; }
.adx-pov .adx { height: 100%; }
.adx-pov .adx-ph { width: 100% !important; height: 100% !important; }
.adx-pov .adx-link, .adx-pov .adx-link img { width: 100%; height: 100%; max-width: none !important; max-height: none !important; }
.adx-sticky .adx-link img { max-height: 90px; margin: 0 auto; }
.admin-bar { background: #ffc107; color: #000; font-size: 12px; font-weight: 600; text-align: center; padding: 5px 10px; }
.admin-bar a { text-decoration: underline; }
.ep-list[hidden], .bp-list[hidden] { display: none; }

/* ---- front admin panel ---- */
textarea, .admin-main select { width: 100%; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); color: #fff; border-radius: 6px; outline: none; font: inherit; }
textarea { font: 12px/1.5 Consolas, monospace; resize: vertical; }
textarea:focus, .admin-main select:focus { border-color: var(--red); }
.admin-main select { width: auto; }
.a-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.a-tabs a { padding: 8px 16px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13px; }
.a-tabs a.on { background: var(--red); border-color: var(--red); color: #fff; }
.a-tabs .right { margin-left: auto; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; background: #1e4d2b; color: #b6f5c4; }
.flash.err { background: #4d1e1e; color: #f5b6b6; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 8px; color: #ddd; font-size: 13px; margin: 6px 0; }
.check input { width: 16px; height: 16px; accent-color: var(--red); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.slot { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.slot-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.slot-head b { font-size: 13px; }
.slot-head code { display: block; color: #ffc107; font-size: 11px; margin-top: 2px; }
.slot .f-image, .slot .f-html { display: none; }
.slot[data-mode=image] .f-image, .slot[data-mode=html] .f-html { display: block; }
.slot-prev { margin-top: 8px; background: #000; border-radius: 4px; padding: 4px; text-align: center; }
.slot-prev img { max-width: 100%; max-height: 90px; margin: 0 auto; }
.slot a.see { font-size: 12px; color: var(--red); }
.save-bar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 12px; z-index: 5; }

/* ---- mobile improvements (same block in public/style.css and front/assets/style.css) ---- */
html { -webkit-text-size-adjust: 100%; }
a, button, select, input, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.adx-ph { height: var(--h, auto); gap: .4em; }
.sz-m { display: none; }
.trend-list { scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.tcard { scroll-snap-align: start; }
.season-btns button { min-height: 34px; }

/* touch screens: swipe instead of arrows, no sticky hover effects after a tap */
@media (hover: none) and (pointer: coarse) {
  .trend-nav { display: none; }
  .trend-wrap { padding: 0; }
  .card:hover, .tcard:hover { transform: none; box-shadow: none; }
  .card:hover .poster img { transform: none; }
  .card:hover .overlay { opacity: 0; }
}

@media (max-width: 640px) {
  /* ads: mobile sizes and labels; slots inside the page column use its padding */
  .adx { margin: 6px auto; }
  .container .adx { padding: 0; }
  .adx-ph { height: var(--mh, var(--h, auto)); }
  .adx-ph[style*="--mw"] { width: var(--mw) !important; }
  .adx-sticky .adx-ph { height: 50px; }
  .adx-pov .adx-ph { width: 100% !important; height: 100% !important; }
  .sz-pc { display: none; }
  .sz-m { display: inline; }
  .adx-group { margin: 8px auto; }
  .adx-sticky { padding: 4px 8px; }
  .adx-sticky-close { width: 32px; height: 32px; top: -16px; font-size: 16px; line-height: 28px; }

  /* 16px text in fields stops iOS from zooming in on focus; bigger tap targets */
  input, select, textarea, .ip-search input, .hss-form input, .filters select { font-size: 16px; }
  .ip-search input { padding: 8px 44px 8px 14px; }
  .ip-search button { right: 2px; width: 40px; height: 40px; justify-content: center; align-items: center; }
  .ip-search .search-box { position: fixed; left: 8px; right: 8px; top: auto; min-width: 0; max-height: 60vh; }
  .logo { padding: 8px 0; }
  .see-all { padding: 12px 0 12px 12px; margin: -12px 0; }
  .sec-head { margin-bottom: 14px; }
  .hss-form button { padding: 0 18px; }

  /* list filters: category on its own row, year and sort side by side */
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters select { width: 100%; min-height: 42px; padding: 8px 10px; }
  .filters select:first-child { grid-column: 1 / -1; }

  /* season tabs: one swipeable row */
  .season-btns { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px; scroll-snap-type: x proximity; }
  .season-btns::-webkit-scrollbar { display: none; }
  .season-btns button { flex: none; min-height: 40px; padding: 8px 16px; font-size: 13px; scroll-snap-align: start; }

  /* series page: small poster beside the text, equal hero buttons */
  .dp-top { flex-direction: row; gap: 14px; margin-bottom: 18px; }
  .dp-top .poster { width: 96px; }
  .hero-btns > a { flex: 1; justify-content: center; padding: 11px 12px; min-height: 44px; }
  .ep-item { padding: 12px 14px; min-height: 52px; }

  /* watch page: edge-to-edge player, overlay ad that fits inside it */
  .player { margin: 0 -12px; width: calc(100% + 24px); border-radius: 0; }
  .bp-hero .dp-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .adx-pov { width: auto; height: 82%; max-width: 92%; }
  .adx-pov-close { width: 32px; height: 32px; line-height: 28px; }
  .play-btn { width: 64px; height: 64px; font-size: 26px; }
  .nc, .nc-all { min-height: 52px; }
  .bp-item { padding: 12px 14px; min-height: 44px; }
}

@media (max-width: 360px) {
  .container { padding: 0 10px; }
  .season-btns { margin-left: -10px; margin-right: -10px; padding: 0 10px; }
  .player { margin: 0 -10px; width: calc(100% + 20px); }
  .grid { gap: 5px; }
  .hss-logo { font-size: 28px; }
  .chip { padding: 3px 9px; }
  .hero-btns > a { font-size: 12px; padding: 10px 8px; gap: 6px; }
  .tcard { flex-basis: 108px; }
}

/* front admin on phones */
.slots { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
