/* KINO — бараан, mobile-first загвар */
:root {
  --bg: #0b0b0f;
  --bg-2: #14141b;
  --bg-3: #1d1d27;
  --fg: #f2f2f7;
  --fg-dim: #a0a0b0;
  --fg-faint: #6b6b7d;
  --accent: #ff4d4d;
  --accent-2: #ffd166;
  --line: #2a2a36;
  --radius: 10px;
  --maxw: 1280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 12px; }

/* ---------- Толгой ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 15, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 12px;
}
.logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--accent);
}
.site-header nav {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.site-header nav::-webkit-scrollbar { display: none; }
.site-header nav a {
  white-space: nowrap;
  color: var(--fg-dim);
  font-size: 13px;
  padding: 4px 0;
}
.site-header nav a:hover, .site-header nav a.active { color: var(--fg); }
.header-auth { margin-left: auto; font-size: 13px; color: var(--fg-dim); white-space: nowrap; }

/* ---------- Апп доторх хөтчийн зөвлөмж ---------- */
.inapp-note {
  background: var(--accent-2);
  color: #1a1a1a;
  padding: 9px 12px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.inapp-note b { font-weight: 700; }
.inapp-note button {
  background: #1a1a1a;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin-bottom: 18px;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}
.hero img { width: 100%; height: 230px; object-fit: cover; opacity: 0.55; }
.hero-body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 14px 16px;
  background: linear-gradient(to top, rgba(11,11,15,0.96), rgba(11,11,15,0));
}
.hero h1 { margin: 0 0 6px; font-size: 22px; line-height: 1.2; }
.hero p { margin: 0 0 10px; color: var(--fg-dim); font-size: 13px;
          display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Товч ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn.ghost { background: var(--bg-3); color: var(--fg); }
.btn.block { width: 100%; justify-content: center; }

/* ---------- Мөр (хэвтээ гүйдэг) ---------- */
.row { margin-bottom: 22px; }
.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 12px;
  margin-bottom: 8px;
}
.row-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.row-head a { font-size: 12px; color: var(--fg-faint); }
.strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 12px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.strip::-webkit-scrollbar { height: 4px; }
.strip::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
.strip > * { flex: 0 0 auto; scroll-snap-align: start; }

/* ---------- Кино карт ---------- */
.card { width: 124px; }
.card .thumb {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--bg-3);
  border-radius: var(--radius);
  overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .ph {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--fg-faint); font-size: 11px; text-align: center; padding: 8px;
}
.card .title {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { font-size: 11px; color: var(--fg-faint); margin-top: 2px; }
.badge {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(0,0,0,0.7);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.badge.paid { color: #fff; background: var(--accent); }

/* ---------- Сараалжин (төрлийн хуудас) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px 10px;
  padding: 0 12px 24px;
}
.grid .card { width: auto; }

/* ---------- Тоглуулагч ---------- */
.player-wrap { background: #000; }
.player-box {
  max-width: var(--maxw);
  margin: 0 auto;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.player-box video { width: 100%; height: 100%; display: block; background: #000; }
.player-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  color: var(--fg-dim);
  font-size: 14px;
}
.movie-info { padding: 14px 12px 4px; }
.movie-info h1 { margin: 0 0 6px; font-size: 20px; line-height: 1.25; }
.movie-info .meta { color: var(--fg-faint); font-size: 12.5px; margin-bottom: 10px; }
.movie-info .desc { color: var(--fg-dim); font-size: 14px; white-space: pre-line; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip {
  background: var(--bg-3);
  color: var(--fg-dim);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- Хэлбэр (form) ---------- */
.form-card {
  max-width: 380px;
  margin: 28px auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 18px;
}
.form-card h1 { margin: 0 0 14px; font-size: 19px; }
.form-card label { display: block; font-size: 12.5px; color: var(--fg-dim); margin: 10px 0 4px; }
.form-card input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  padding: 10px 12px;
  font-size: 15px;
}
.form-card .errors, .form-card .helptext {
  font-size: 11.5px;
  margin-top: 4px;
}
.form-card .errors { color: var(--accent); }
.form-card .helptext { color: var(--fg-faint); }
.form-card .alt { margin-top: 14px; font-size: 12.5px; color: var(--fg-faint); text-align: center; }
.form-card .alt a { color: var(--accent-2); }

/* ---------- Хөл ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding: 18px 12px 30px;
  color: var(--fg-faint);
  font-size: 12px;
  text-align: center;
}

.empty { padding: 50px 20px; text-align: center; color: var(--fg-faint); }

/* ---------- Том дэлгэц ---------- */
@media (min-width: 640px) {
  .card { width: 150px; }
  .hero img { height: 340px; }
  .hero h1 { font-size: 28px; }
  .movie-info h1 { font-size: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (min-width: 1024px) {
  .card { width: 168px; }
  .hero img { height: 420px; }
}

/* ---------- Хайлт (толгой дээр) ---------- */
.site-search {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.site-search input {
  width: 108px;
  min-width: 0;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
}
.site-search input:focus {
  width: 170px;
  border-color: var(--accent);
}
.site-search input::placeholder { color: var(--fg-faint); }
.site-search button {
  padding: 5px 9px;
  font-size: 13px;
  line-height: 1;
  color: var(--fg-dim);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.site-header .header-auth { margin-left: 0; }

/* ---------- Үргэлжлүүлэн үзэх (прогресс зураас) ---------- */
.card .thumb .progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
}
.card .thumb .progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* ---------- «...-аас үргэлжлүүллээ» мэдэгдэл ---------- */
.resume-note {
  position: absolute;
  left: 10px;
  bottom: 56px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 20px);
  padding: 7px 10px;
  font-size: 12px;
  color: var(--fg);
  background: rgba(11, 11, 15, 0.88);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.resume-note button {
  padding: 3px 9px;
  font-size: 12px;
  color: var(--bg);
  background: var(--accent-2);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .site-search input { width: 150px; }
  .site-search input:focus { width: 220px; }
}

/* ---------- Хадмал (WebVTT ::cue) ----------
   Хэмжээ: clamp(13px, 2.4vw, 22px) — утсан дээр хамгийн багадаа 13px,
   том дэлгэцэнд 22px-ээс хэтрэхгүй. БҮТЭН ДЭЛГЭЦЭНД ч ижил харьцаа
   (:fullscreen дээр ЯГ ижил clamp давтагдсан — зарим хөтөч бүтэн
   дэлгэцэнд ::cue-г өөрөө томруулдаг).
   Хадмал нь ДООД хэсэгт хэвээр (байрлалыг өөрчлөхгүй); видеон дээрх
   шатаасан англи текстийг хөрвүүлэх үед бүдгэрүүлдэг.
   VTT нь мөрөнд 42 тэмдэгт, 2 мөрөөр үүсдэг (srt.build_vtt). */
video::cue {
  font-size: clamp(13px, 2.4vw, 22px);
  line-height: 1.25;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  white-space: pre-line;
}
video:fullscreen::cue,
video:-webkit-full-screen::cue {
  font-size: clamp(13px, 2.4vw, 22px);
  line-height: 1.25;
  background: rgba(0, 0, 0, 0.55);
}
/* iOS/Safari-ийн дотоод тоглуулагчид (::cue-г хэсэгчлэн дэмждэг) */
video::-webkit-media-text-track-display {
  font-weight: 600;
}
