/* ═══════════════════════════════════════════════════════════════════════
   KinoPro — kinochilar.com proxy
   bepul.net dan ilhomlangan modern dark UI
   ═══════════════════════════════════════════════════════════════════════ */

:root,
html[data-theme="dark"] {
  --bg:            #0a0e1a;
  --bg-deep:       #060912;
  --panel:         #131a2e;
  --panel-soft:    #1a2240;
  --panel-hover:   #232c4d;
  --line:          #283358;
  --line-soft:     #1d2540;

  --text:          #ecf0f7;
  --text-soft:     #c4cce0;
  --muted:         #8a93b0;
  --muted-2:       #6a7494;

  --accent:        #f59e0b;
  --accent-hover:  #fbb736;
  --accent-soft:   rgba(245, 158, 11, .14);
  --accent-glow:   rgba(245, 158, 11, .35);

  --danger:        #ef4444;
  --success:       #22c55e;
  --info:          #3b82f6;

  --shadow-sm:     0 2px 8px rgba(0, 0, 0, .35);
  --shadow:        0 12px 36px rgba(0, 0, 0, .45);
  --shadow-lg:     0 24px 60px rgba(0, 0, 0, .55);

  --radius-sm:     10px;
  --radius:        16px;
  --radius-lg:     22px;
  --radius-xl:     28px;
}

html[data-theme="light"] {
  --bg:            #f1f3f8;
  --bg-deep:       #e7eaf2;
  --panel:         #ffffff;
  --panel-soft:    #f6f8fc;
  --panel-hover:   #eef2f8;
  --line:          #d8dde8;
  --line-soft:     #e6eaf2;

  --text:          #1a1f2e;
  --text-soft:     #303949;
  --muted:         #5a6478;
  --muted-2:       #7a8499;

  --accent:        #d97706;
  --accent-hover:  #f59e0b;
  --accent-soft:   rgba(217, 119, 6, .12);
  --accent-glow:   rgba(217, 119, 6, .25);

  --shadow-sm:     0 2px 6px rgba(15, 23, 42, .06);
  --shadow:        0 8px 24px rgba(15, 23, 42, .08);
  --shadow-lg:     0 16px 40px rgba(15, 23, 42, .12);
}

/* ───────────────────────────── BASE ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(245, 158, 11, .08), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(59, 130, 246, .06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 400 15px/1.6 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

/* Scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--bg-deep); }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid var(--bg-deep); }
*::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ───────────────────────────── SHELL ──────────────────────────── */
.kp-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER CARD — bepul.net uslubidagi yumaloq qatlam
   ═══════════════════════════════════════════════════════════════ */
.kp-header {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.kp-header::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 320px; height: 100%;
  background: radial-gradient(circle at top right, var(--accent-glow), transparent 70%);
  opacity: .35;
  pointer-events: none;
}

.kp-header__row {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 18px;
}

/* ─── Catalog button ─── */
.kp-catalog-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 18px;
  min-width: 84px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  transition: all .2s ease;
}
.kp-catalog-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.kp-catalog-btn__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 22px;
}
.kp-catalog-btn__bars span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.kp-catalog-btn[aria-expanded="true"] .kp-catalog-btn__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.kp-catalog-btn[aria-expanded="true"] .kp-catalog-btn__bars span:nth-child(2) { opacity: 0; }
.kp-catalog-btn[aria-expanded="true"] .kp-catalog-btn__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ─── Logo ─── */
.kp-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.kp-logo:hover { text-decoration: none; }
.kp-logo__icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 16px var(--accent-glow));
}
.kp-logo__icon svg { width: 100%; height: 100%; display: block; }
.kp-logo__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kp-logo__name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.1;
}
.kp-logo__tagline {
  font-size: .85rem;
  color: var(--muted);
  font-weight: 500;
}

/* ─── Search ─── */
.kp-search {
  display: flex;
  align-items: stretch;
  height: 56px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
  min-width: 0;
}
.kp-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.kp-search__input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  padding: 0 24px;
  min-width: 0;
}
.kp-search__input::placeholder { color: var(--muted-2); }
.kp-search__btn {
  background: var(--accent);
  border: 0;
  width: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a1206;
  transition: background .2s ease;
  flex-shrink: 0;
}
.kp-search__btn:hover { background: var(--accent-hover); }

/* ─── Theme toggle ─── */
.kp-theme {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text-soft);
  font-size: .9rem;
  font-weight: 600;
  transition: all .2s ease;
}
.kp-theme:hover {
  border-color: var(--accent);
  color: var(--text);
}
.kp-theme__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ef4444);
  box-shadow: 0 0 12px var(--accent-glow);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION TABS — gorizontal scroll bilan
   ═══════════════════════════════════════════════════════════════ */
.kp-nav {
  margin: 0 0 22px;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-sm);
}
.kp-nav__scroll {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.kp-nav__scroll::-webkit-scrollbar { height: 4px; }
.kp-nav__item {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: all .18s ease;
  text-decoration: none;
  flex-shrink: 0;
}
.kp-nav__item:hover {
  color: var(--text);
  background: var(--panel-hover);
  text-decoration: none;
}
.kp-nav__item--active {
  background: var(--bg-deep);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */
.kp-main {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  min-height: 60vh;
}

.page--watch .kp-main {
  padding: 18px;
}

.kp-main h1,
.kp-main > h2:first-child {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 800;
  margin: 0 0 18px;
  line-height: 1.25;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.kp-main h1::after,
.kp-main > h2:first-child::after {
  content: '›';
  color: var(--accent);
  font-weight: 400;
  font-size: 1.2em;
}
.kp-main h2 { font-size: 1.4rem; font-weight: 700; margin: 22px 0 12px; color: var(--text); }
.kp-main h3 { font-size: 1.15rem; font-weight: 700; margin: 18px 0 10px; color: var(--text); }
.kp-main h4 { font-size: 1rem; font-weight: 700; margin: 16px 0 8px; color: var(--text); }
.kp-main p  { margin: 0 0 14px; color: var(--text-soft); line-height: 1.7; }

.kp-main img { border-radius: var(--radius-sm); margin: 8px 0; }
.kp-main iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  background: #000;
  display: block;
  margin: 16px 0;
}

/* Watch sahifasi: poster va asosiy rasm — kichikroq ekranda yaxshi ko'rinishi */
.kp-main--watch > img:first-of-type,
.kp-main--watch > p:first-of-type img {
  max-width: 380px;
  margin: 0 auto 16px;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ═══════════════════════════════════════════════════════════════
   CARD GRID — KinoPro normalize qilingan kartalar
   ═══════════════════════════════════════════════════════════════ */
.kp-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
  margin: 10px 0 24px;
}

.kp-card-grid--clean {
  gap: 18px;
  margin-top: 0;
}

.kp-card {
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0) 28%),
    var(--panel-soft);
  border: 1px solid rgba(255,255,255,.07);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  position: relative;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .22);
}
.kp-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(10,14,26,0), rgba(10,14,26,.08));
  pointer-events: none;
}
.kp-card:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 158, 11, .46);
  box-shadow: 0 22px 42px rgba(0, 0, 0, .34), 0 0 0 1px rgba(245, 158, 11, .08);
}

.kp-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.kp-card__link:hover { text-decoration: none; color: inherit; }

.kp-card__poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--bg-deep);
  overflow: hidden;
}
.kp-card__poster::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.52));
  pointer-events: none;
}
.kp-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease, filter .25s ease;
  margin: 0;
  border-radius: 0;
}
.kp-card:hover .kp-card__img {
  transform: scale(1.055);
  filter: saturate(1.04) brightness(.88);
}

.kp-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 9px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  border-radius: 999px;
  background: rgba(11, 16, 32, .88);
  color: #fff;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 16px rgba(0,0,0,.18);
  text-transform: uppercase;
  z-index: 2;
}
.kp-card__badge--hd  { background: rgba(59,130,246,.92); color: #fff; }
.kp-card__badge--fhd { background: rgba(139,92,246,.92); color: #fff; }
.kp-card__badge--4k  { background: rgba(239,68,68,.92); color: #fff; }
.kp-card__badge--sd  { background: rgba(15,23,42,.88); color: #fff; }

.kp-card__play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 1rem;
  color: #14110c;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 24px rgba(0,0,0,.3);
  transition: transform .22s ease, background .22s ease;
  pointer-events: none;
  z-index: 2;
}
.kp-card:hover .kp-card__play {
  transform: scale(1.07);
  background: var(--accent);
}

.kp-card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 14px;
  z-index: 1;
}

.kp-card__title {
  margin: 0;
  font-size: .88rem;
  font-weight: 750;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.7em;
}

.kp-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 128px;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .18);
  color: var(--accent-hover);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .03em;
}
.kp-card:hover .kp-card__cta {
  background: rgba(245, 158, 11, .18);
  border-color: rgba(245, 158, 11, .3);
}

.kp-archive-clean {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kp-archive-clean__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(520px 220px at 100% 0%, rgba(245,158,11,.08), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)),
    var(--panel-soft);
}

.kp-archive-clean__eyebrow {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.kp-archive-clean__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.kp-archive-clean__title {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -.02em;
}

.kp-archive-clean__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: .82rem;
  font-weight: 700;
}

.kp-clean-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding-top: 4px;
}

.kp-clean-pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  font-size: .88rem;
}
.kp-clean-pagination__item:hover {
  text-decoration: none;
  color: #1a1206;
  background: var(--accent);
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   ASL KINOCHILAR HTML BLOKLARI UCHUN STIL (normalize qilinmagan)
   ═══════════════════════════════════════════════════════════════ */

/* Tasvirlar va matn paragraflari */
.kp-main strong,
.kp-main b { color: var(--text); font-weight: 700; }

.kp-main hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}

.kp-main ul,
.kp-main ol { margin: 8px 0 16px; padding-left: 24px; color: var(--text-soft); }
.kp-main li { margin: 4px 0; }

.kp-main blockquote {
  margin: 14px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  background: var(--panel-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-soft);
  font-style: italic;
}

/* Aktor / rejissor link "tag" lar */
.kp-main a[href*="/xfsearch/"] {
  display: inline-block;
  padding: 4px 12px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid transparent;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 600;
  transition: all .15s ease;
}
.kp-main a[href*="/xfsearch/"]:hover {
  background: var(--accent);
  color: #1a1206;
  text-decoration: none;
  border-color: var(--accent-hover);
}

/* Episode (qism) tugmalari — Qism1, Qism2, ... */
.kp-main a[href*="/episode/"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 14px;
  margin: 4px;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: .85rem;
  font-weight: 700;
  transition: all .15s ease;
}
.kp-main a[href*="/episode/"]:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1206;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--accent-glow);
  text-decoration: none;
}

/* Player tab tugmalari (#player_1, #player_2, ...) */
.kp-main a[href^="#player_"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  margin: 4px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #1a1206;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: 0 6px 16px var(--accent-glow);
}
.kp-main a[href^="#player_"]:hover {
  transform: translateY(-2px);
  text-decoration: none;
  filter: brightness(1.05);
}

/* "Tomosha qilish" tugmalari — boshqa CTA tugmalar */
.kp-main a[href*="t.me/"],
.kp-main a[href*="telegram"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: #229ED9;
  color: #fff;
  font-weight: 700;
  margin: 4px 0;
}
.kp-main a[href*="t.me/"]:hover { text-decoration: none; filter: brightness(1.1); }

/* Pagination */
.kp-main .pages,
.kp-main .pagination,
.kp-main .pagecontent,
.kp-main .navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 24px 0;
  align-items: center;
  justify-content: center;
}
.kp-main .pages a,
.kp-main .pages span,
.kp-main .pages strong,
.kp-main .pagination a,
.kp-main .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  font-size: .9rem;
}
.kp-main .pages a:hover,
.kp-main .pagination a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.kp-main .pages strong,
.kp-main .pages span:not([class]),
.kp-main .pagination .current {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #1a1206;
  border-color: transparent;
}

/* Pastki "Ayni paytda tomosha qilinmoqda" bloki — kichik kartalar */
.kp-main h3 + a img,
.kp-main h2 + a img {
  border-radius: var(--radius-sm);
}

/* Ratings, sifat indikatorlari (HD/FHD matni) */
.kp-main img[src*="Uzbekistan"],
.kp-main img[src*="Russian"],
.kp-main img[src*="icon.png"] {
  display: inline-block !important;
  width: 24px !important;
  height: auto !important;
  margin: 0 6px 0 0 !important;
  vertical-align: middle;
  border-radius: 4px;
}

/* CAPTCHA va antibot — yashirish */
.kp-main img[src*="antibot"] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   CATALOG DRAWER (chap tomondan ochiluvchi)
   ═══════════════════════════════════════════════════════════════ */
.kp-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.kp-drawer-overlay.is-open { opacity: 1; visibility: visible; }

.kp-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1090;
  width: 320px;
  max-width: 88vw;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-deep) 100%);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 60px rgba(0, 0, 0, .5);
  transform: translateX(-100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}
.kp-drawer.is-open { transform: translateX(0); }

.kp-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.kp-drawer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}
.kp-drawer__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--danger));
  box-shadow: 0 0 12px var(--accent-glow);
}
.kp-drawer__close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .18s ease;
}
.kp-drawer__close:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.kp-drawer__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 32px;
}

.kp-drawer__section { margin-bottom: 22px; }
.kp-drawer__section:last-child { margin-bottom: 0; }

.kp-drawer__heading {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 10px;
  padding: 0 10px;
}

.kp-drawer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kp-drawer__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .18s ease;
}
.kp-drawer__link:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent);
  transform: translateX(4px);
  text-decoration: none;
}
.kp-drawer__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-size: 14px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.kp-footer {
  margin-top: 28px;
  padding: 24px 18px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.kp-footer__copy {
  margin: 0 0 6px;
  color: var(--text-soft);
  font-size: .9rem;
  font-weight: 600;
}
.kp-footer__note {
  margin: 0;
  color: var(--muted-2);
  font-size: .82rem;
}

/* ═══════════════════════════════════════════════════════════════
   ERROR PAGE
   ═══════════════════════════════════════════════════════════════ */
.kp-error {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 60px 30px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-top: 40px;
}
.kp-error__title {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--text);
}
.kp-error__text {
  color: var(--muted);
  margin: 0 0 24px;
}
.kp-error__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--accent);
  color: #1a1206 !important;
  font-weight: 700;
  text-decoration: none;
}
.kp-error__btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}


/* Section headings and archive spacing */
.kp-main > h1,
.kp-main > h2,
.kp-main > h3,
.kp-main .kp-card-grid + h2,
.kp-main .kp-card-grid + h3 {
  letter-spacing: -.02em;
}

.kp-main > h2,
.kp-main > h3 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: clamp(1.2rem, 1.8vw, 1.7rem);
}

.kp-main p:empty,
.kp-main div:empty {
  display: none;
}

/* Watch page cleanup */
.page--watch .kp-footer {
  display: none;
}

.kp-watch-clean {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.kp-watch-clean__bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.kp-watch-clean__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.kp-watch-clean__text {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.kp-watch-clean .fs-navigation-section {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)), var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.kp-watch-clean .fs-section-title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.kp-watch-clean .fs-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kp-watch-clean .fs-link-grid > div[style] {
  width: 100% !important;
  margin: 2px 0 0 !important;
  color: var(--accent) !important;
  font-size: .8rem !important;
  font-weight: 800 !important;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.kp-watch-clean .fs-card-link {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 84px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(11, 16, 32, .54);
  color: var(--text) !important;
  text-decoration: none !important;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.kp-watch-clean .fs-card-link:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(245, 158, 11, .08);
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
}

.kp-watch-clean .fs-card-link--active,
.kp-watch-clean .fs-card-link[aria-current="page"] {
  border-color: rgba(59,130,246,.55);
  background: rgba(59,130,246,.14);
  color: #dbeafe !important;
}

.kp-watch-clean .fs-card-label {
  font-size: .68rem;
  line-height: 1.1;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.kp-watch-clean .fs-card-value {
  font-size: .94rem;
  line-height: 1.15;
  color: inherit;
  font-weight: 800;
}

.kp-watch-clean--empty {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  color: var(--muted);
}

/* Compact legacy content if some cards stay unnormalized */
.kp-main a > img {
  border-radius: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .kp-card-grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 14px; }
}
@media (max-width: 1100px) {
  .kp-card-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
  .kp-header__row {
    grid-template-columns: auto auto 1fr;
    grid-template-rows: auto auto;
  }
  .kp-header__row .kp-search { grid-column: 1 / -1; }
  .kp-theme { grid-row: 1; grid-column: 3; justify-self: end; }
}
@media (max-width: 860px) {
  .kp-shell { padding: 14px 14px 32px; }
  .kp-header { padding: 18px; border-radius: var(--radius); }
  .kp-card-grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; }
  .kp-logo__name { font-size: 1.3rem; }
  .kp-logo__tagline { font-size: .78rem; }
  .kp-logo__icon { width: 52px; height: 52px; }
  .kp-main { padding: 20px; border-radius: var(--radius); }
  .kp-search { height: 48px; }
  .kp-search__btn { width: 48px; }
  .kp-theme__label { display: none; }
  .kp-theme { padding: 12px 14px; }
  .kp-catalog-btn { padding: 11px 14px; min-width: 0; }
  .kp-catalog-btn__label { display: none; }
}
@media (max-width: 600px) {
  .kp-shell { padding: 10px 10px 24px; }
  .kp-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .kp-header__row {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }
  .kp-logo__text { display: none; }
  .kp-card__body { padding: 10px 9px 11px; gap: 8px; }
  .kp-card__title { font-size: .76rem; min-height: 3.4em; }
  .kp-card__cta { min-width: 100%; font-size: .72rem; padding: 8px 10px; }
  .kp-main { padding: 16px; }
  .kp-nav__item { padding: 10px 14px; font-size: .85rem; }
  .kp-main h1 { font-size: 1.2rem; }
}
@media (max-width: 420px) {
  .kp-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kp-card__play { width: 38px; height: 38px; }
  .kp-watch-clean .fs-card-link { min-width: calc(50% - 4px); }
}


@media (max-width: 600px) {
  .kp-archive-clean__head { padding: 14px 14px 15px; }
  .kp-archive-clean__count { width: 100%; justify-content: center; }
}
/* ═══════════════════════════════════════════════════════════════
   WATCH PLAYER ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */
.kp-watch-shell {
  margin: 0 0 18px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 260px at 100% 0%, rgba(245,158,11,.08), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)),
    var(--panel-soft);
  box-shadow: var(--shadow-sm);
}

.kp-watch-shell__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.kp-watch-shell__title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 800;
}
.kp-watch-shell__title::after { display: none !important; }

.kp-watch-shell__sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.kp-watch-shell__open {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #15100a;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(245, 158, 11, .22);
}
.kp-watch-shell__open:hover { color: #15100a; filter: brightness(1.04); }

.kp-watch-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

.kp-watch-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: min(68vh, 620px);
  display: block;
  border: 0;
  background: #000;
  margin: 0 !important;
}

.kp-episode-link,
.kp-player-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  margin: 0 8px 10px 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text-soft) !important;
  font-weight: 700;
  text-decoration: none !important;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}
.kp-episode-link:hover,
.kp-player-action-link:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(245,158,11,.08);
  color: var(--text) !important;
}
.kp-episode-link--active {
  background: rgba(59,130,246,.14);
  border-color: rgba(59,130,246,.55);
  color: #dbeafe !important;
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.2);
}

.kp-legacy-player-hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .kp-watch-shell {
    padding: 14px;
  }
  .kp-watch-shell__head {
    flex-direction: column;
    align-items: stretch;
  }
  .kp-watch-shell__open {
    width: 100%;
  }
  .kp-watch-frame {
    min-height: 240px;
  }
}

.kp-search-clean {
  gap: 18px;
}

.kp-search-note {
  margin: 0;
  color: var(--text-soft);
  font-size: .96rem;
  line-height: 1.6;
}

.kp-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 26px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)), var(--panel-soft);
  color: var(--text-soft);
  text-align: center;
}

.kp-empty-state p {
  margin: 0;
  max-width: 680px;
}
