:root {
  color-scheme: dark;
  --bg: #06101d;
  --panel: #0c1929;
  --panel-soft: rgba(15, 31, 49, .82);
  --line: rgba(255, 255, 255, .1);
  --text: #f6f9fc;
  --muted: #99a9ba;
  --cyan: #14c8f4;
  --cyan-strong: #00aeea;
  --danger: #ff6470;
  --focus-ring: 0 0 0 3px rgba(20, 200, 244, .95), 0 12px 32px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 75% 5%, rgba(18, 104, 135, .22), transparent 30rem),
    linear-gradient(180deg, #071321 0%, #050c16 100%);
  font: 16px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }
button, a, input { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible {
  box-shadow: var(--focus-ring);
}
.hidden { display: none !important; }

.topbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto 0;
  height: 62px;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 38px);
  padding: 0 clamp(18px, 3vw, 46px);
  background: linear-gradient(180deg, rgba(4, 11, 19, .96), rgba(4, 11, 19, .72));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .055em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #02131c;
  background: linear-gradient(135deg, #56e8ff, #00aeea);
  font-weight: 1000;
  box-shadow: 0 0 24px rgba(20, 200, 244, .3);
}
.brand-mark.large { width: 54px; height: 54px; border-radius: 14px; font-size: 25px; }
.nav {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: stretch;
  align-self: stretch;
  gap: clamp(10px, 1.25vw, 18px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  flex: 0 0 auto;
  position: relative;
  border: 0;
  background: none;
  color: #b8c4d0;
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  font-weight: 700;
}
.nav-link:hover, .nav-link.active { color: #fff; }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--cyan);
}
.top-actions { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-button, .profile-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
  cursor: pointer;
}
.icon-button {
  width: 38px; height: 38px; border-radius: 11px;
  font-size: 23px; line-height: 1;
}
.profile-button {
  height: 38px; border-radius: 11px; padding: 0 13px 0 10px;
  display: flex; align-items: center; gap: 9px;
}
.profile-dot { width: 10px; height: 10px; border-radius: 50%; background: #7a8998; }
.profile-dot.connected { background: #41df94; box-shadow: 0 0 12px #41df94; }

.search-panel {
  position: fixed;
  z-index: 19;
  top: 62px;
  left: 0; right: 0;
  padding: 12px clamp(18px, 8vw, 140px);
  background: rgba(5, 13, 23, .94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.search-box {
  max-width: 820px;
  margin: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 6px 7px 6px 15px;
  border: 1px solid rgba(20, 200, 244, .42);
  border-radius: 15px;
  background: #0b1828;
}
.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-size: 16px;
}
.search-box button {
  border: 0; border-radius: 9px; padding: 8px 19px;
  background: var(--cyan); color: #00121b; font-weight: 800; cursor: pointer;
}

.hero {
  position: relative;
  height: min(54vh, 510px);
  min-height: 390px;
  overflow: hidden;
}
.hero-backdrop {
  position: absolute; inset: 0;
  background:
    linear-gradient(120deg, rgba(14, 71, 92, .7), rgba(5, 11, 18, .05)),
    url("https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=2000&q=80") center/cover;
  transform: scale(1.02);
  transition: background-image .5s ease;
}
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, #06101d 0%, rgba(6, 16, 29, .82) 32%, rgba(6, 16, 29, .12) 75%),
    linear-gradient(0deg, #06101d 0%, transparent 42%);
}
.hero-content {
  position: relative;
  z-index: 1;
  width: min(610px, 72vw);
  padding: clamp(108px, 15vh, 145px) 0 0 clamp(24px, 4vw, 62px);
}
.eyebrow { color: var(--cyan); font-weight: 850; font-size: 13px; letter-spacing: .18em; }
.hero h1 { margin: 8px 0 7px; max-width: 650px; font-size: clamp(34px, 4vw, 54px); line-height: 1; letter-spacing: -.04em; }
.hero-meta { color: #d9e3eb; font-weight: 700; }
.hero-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #b6c3ce;
  max-width: 560px;
  font-size: clamp(14px, 1.2vw, 17px);
}
.hero-actions { display: flex; gap: 9px; margin-top: 18px; }
.primary-button, .secondary-button, .danger-button {
  min-height: 42px;
  border-radius: 10px;
  padding: 0 19px;
  border: 1px solid transparent;
  font-weight: 850;
  cursor: pointer;
}
.primary-button { color: #00121b; background: linear-gradient(135deg, #55e7ff, var(--cyan-strong)); }
.primary-button:disabled { opacity: .45; cursor: default; }
.secondary-button { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); }
.danger-button { color: #ffdadd; background: rgba(255, 100, 112, .13); border-color: rgba(255, 100, 112, .4); }
.compact { min-height: 36px; padding: 0 15px; font-size: 14px; }

.content { position: relative; z-index: 2; padding: 0 clamp(18px, 3vw, 46px) 52px; margin-top: -24px; }
.connection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1160px;
  margin: 0 auto 20px;
  padding: 12px 15px;
  border: 1px solid rgba(20, 200, 244, .25);
  border-radius: 14px;
  background: rgba(9, 27, 42, .92);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .2);
}
.connection-banner div { display: grid; gap: 3px; }
.connection-banner span { color: var(--muted); }
.media-row { margin: 0 0 24px; }
.row-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 9px; }
.row-heading h2 { margin: 0; font-size: clamp(19px, 1.6vw, 23px); }
.row-heading span { color: var(--muted); font-size: 14px; }
.card-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(138px, 12vw, 168px);
  gap: 11px;
  overflow-x: auto;
  padding: 4px 4px 11px;
  scroll-snap-type: x proximity;
  scrollbar-color: #274054 transparent;
}
.media-card {
  position: relative;
  border: 0;
  padding: 0;
  background: #0c1929;
  color: #fff;
  text-align: left;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}
.media-card:hover, .media-card:focus-visible {
  z-index: 2;
  transform: translateY(-3px) scale(1.025);
  outline: 3px solid var(--cyan);
  outline-offset: 1px;
  box-shadow: 0 15px 34px rgba(0, 0, 0, .44), 0 0 20px rgba(20, 200, 244, .18);
}
.poster {
  aspect-ratio: 2 / 3;
  background:
    linear-gradient(110deg, #102338 28%, #17314b 42%, #102338 58%) center/220% 100%,
    #102338;
  background-repeat: no-repeat;
  background-size: cover;
}
.poster:not(.poster-loaded) { animation: poster-shimmer 1.35s linear infinite; }
.poster.poster-loaded { background-position: center; }
.card-info { padding: 8px 9px 10px; }
.card-title { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 800; }
.card-meta { display: flex; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 11px; }
.rating { color: #ffd35c; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.12); }
.progress span { display: block; height: 100%; background: var(--cyan); }
.empty-state { min-height: 260px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-state strong { color: #fff; font-size: 24px; }
.catalog-loading { display: grid; gap: 18px; color: var(--muted); }
.catalog-loading > strong { font-size: 18px; }
.skeleton-row { display: grid; gap: 10px; overflow: hidden; }
.skeleton-heading, .skeleton-card {
  display: block;
  border-radius: 10px;
  background: linear-gradient(110deg, #0d1d2e 28%, #17314b 42%, #0d1d2e 58%);
  background-size: 220% 100%;
  animation: poster-shimmer 1.35s linear infinite;
}
.skeleton-heading { width: 190px; height: 24px; }
.skeleton-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(138px, 12vw, 168px);
  gap: 11px;
}
.skeleton-card { aspect-ratio: 2 / 3.72; }
@keyframes poster-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.modal { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(1, 6, 12, .82); backdrop-filter: blur(12px); }
.details-card, .settings-card {
  position: relative;
  z-index: 1;
  width: min(860px, 96vw);
  max-height: min(650px, 92vh);
  overflow: auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 17px;
  background: #0b1828;
  box-shadow: 0 30px 100px rgba(0,0,0,.7);
}
.details-card { display: grid; grid-template-columns: minmax(220px, 34%) 1fr; }
.details-poster { min-height: 490px; background: #102338 center/cover no-repeat; }
.details-body { align-self: center; padding: clamp(24px, 3.5vw, 44px); }
.details-body h2 { margin: 7px 0; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.04; }
.details-meta { color: #d0dae3; font-weight: 700; }
.details-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  color: var(--muted);
  line-height: 1.55;
  margin: 16px 0 21px;
}
.details-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.feedback-button.is-like {
  color: #baffcf;
  border-color: rgba(76, 232, 132, .72);
  background: rgba(38, 159, 85, .28);
}
.feedback-button.is-dislike {
  color: #ffd0d0;
  border-color: rgba(255, 112, 112, .68);
  background: rgba(172, 58, 58, .28);
}
.torrent-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(20, 200, 244, .24);
  border-radius: 15px;
  background: rgba(4, 15, 25, .72);
}
.torrent-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.torrent-heading div { display: grid; gap: 3px; }
.torrent-heading span, .torrent-status { color: var(--muted); font-size: 13px; }
.torrent-status { margin-top: 14px; }
.torrent-results { display: grid; gap: 9px; margin-top: 12px; }
.torrent-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
}
.torrent-copy { min-width: 0; }
.torrent-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #e9f2f8;
  font-size: 13px;
  font-weight: 750;
}
.torrent-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.torrent-meta .seeds { color: #55e89b; }
.torrent-progress { margin-top: 12px; height: 7px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.1); }
.torrent-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-strong), #54e8ff); transition: width .3s ease; }
.torrent-item button { white-space: nowrap; }
.close-button {
  position: absolute; z-index: 2; top: 11px; right: 11px;
  width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px;
  color: #fff; background: rgba(2, 8, 14, .78); font-size: 25px; line-height: 1; cursor: pointer;
}
.settings-card { width: min(560px, 96vw); padding: 27px; }
.settings-heading { display: flex; align-items: center; gap: 16px; }
.settings-heading h2 { margin: 0; }
.settings-heading p { margin: 4px 0 0; color: var(--muted); }
.pair-block { margin: 21px 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); }
.pair-code-wrap { display: flex; align-items: center; gap: 12px; }
.pair-code-wrap code { flex: 1; padding: 13px 15px; border-radius: 10px; color: var(--cyan); background: #06101d; font-size: 20px; font-weight: 900; }
.pair-block small { display: block; margin-top: 12px; color: var(--muted); }
.version-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 21px 0 0; }
.version-grid div { padding: 13px; border-radius: 11px; background: rgba(255,255,255,.04); }
.version-grid dt { color: var(--muted); font-size: 12px; }
.version-grid dd { margin: 4px 0 0; font-weight: 800; }
.toast {
  position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translateX(-50%);
  padding: 13px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: #10243a; box-shadow: 0 14px 40px rgba(0,0,0,.45);
}

@media (max-width: 820px) {
  .topbar { height: 58px; padding: 0 13px; }
  .nav {
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    height: 44px;
    padding: 0 12px;
    gap: 17px;
    background: rgba(4, 11, 19, .96);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
  }
  .profile-button span:last-child { display: none; }
  .profile-button { width: 42px; padding: 0; justify-content: center; }
  .search-panel { top: 102px; padding: 10px; }
  .hero { height: 504px; min-height: 504px; }
  .hero-content { width: 92vw; padding-left: 18px; padding-top: 154px; }
  .hero h1 { font-size: 36px; }
  .hero-shade { background: linear-gradient(0deg, #06101d 0%, rgba(6,16,29,.45) 75%); }
  .content { padding-left: 12px; padding-right: 12px; margin-top: -18px; }
  .connection-banner { align-items: flex-start; flex-direction: column; }
  .details-card { grid-template-columns: 1fr; }
  .details-poster { min-height: 300px; max-height: 40vh; }
  .details-body { padding: 22px; }
  .torrent-item { grid-template-columns: 1fr; }
  .version-grid { grid-template-columns: 1fr; }
  .pair-code-wrap { align-items: stretch; flex-direction: column; }
}

@media (min-width: 1500px) {
  .card-track { grid-auto-columns: 158px; }
  .hero { height: 500px; }
}

@media (pointer: coarse) {
  .nav-link, .primary-button, .secondary-button, .danger-button,
  .icon-button, .profile-button { min-height: 44px; }
}

/* kino22 red theme */
:root {
  --tg-bg: #120406 !important;
  --tg-text: #fff5f5 !important;
  --tg-hint: #d7a6aa !important;
  --tg-card: #2a0b0f !important;
  --tg-button: #e21d2f !important;
  --tg-button-text: #ffffff !important;
  --bg: #120406 !important;
  --panel: #26080d !important;
  --panel-soft: rgba(50, 10, 16, .88) !important;
  --text: #fff5f5 !important;
  --muted: #d7a6aa !important;
  --cyan: #ff4050 !important;
  --cyan-strong: #e0001b !important;
  --danger: #ff7a86 !important;
  --accent: #ef233c !important;
  --card: #2a0b0f !important;
  --hint: #d7a6aa !important;
  --border: rgba(255, 120, 130, .22) !important;
  --yt-bg: #160507 !important;
  --yt-surface: rgba(48, 10, 15, .95) !important;
  --yt-surface-strong: #300a0f !important;
  --yt-text: #fff4f5 !important;
  --yt-muted: #d4a1a6 !important;
  --yt-line: rgba(255, 130, 140, .18) !important;
  --yt-navy: #6d0712 !important;
  --yt-blue: #e31b36 !important;
  --yt-blue-soft: #431018 !important;
  --yt-violet: #b80f2b !important;
  --yt-violet-soft: #3a0d15 !important;
  --yt-coral: #ff4b5f !important;
  --yt-coral-soft: #451018 !important;
  --yt-green: #d52a3c !important;
  --yt-green-soft: #3b1015 !important;
  --yt-danger: #ff6875 !important;
}

html,
body {
  background-color: #120406 !important;
}

body {
  background-image:
    radial-gradient(circle at 78% 4%, rgba(220, 15, 42, .34), transparent 32rem),
    radial-gradient(circle at 10% 24%, rgba(120, 0, 18, .22), transparent 28rem),
    linear-gradient(180deg, #190507 0%, #090203 100%) !important;
}

.topbar,
.search-panel {
  background: linear-gradient(180deg, rgba(35, 4, 9, .98), rgba(24, 3, 7, .88)) !important;
}

.brand-mark,
.primary-button,
.search-box button,
.progress span,
.torrent-progress span {
  color: #fff !important;
  background: linear-gradient(135deg, #ff4050, #c90020) !important;
  box-shadow: 0 0 26px rgba(226, 29, 47, .34);
}

.nav-link.active::after,
.profile-dot.connected {
  background: #ff4050 !important;
  box-shadow: 0 0 14px rgba(255, 64, 80, .72) !important;
}

.search-box,
.details-card,
.settings-card,
.movie-card,
.torrent-panel,
.pair-block {
  border-color: rgba(255, 85, 100, .2) !important;
  background-color: rgba(42, 7, 13, .94) !important;
}

.hero-shade {
  background: linear-gradient(90deg, #170407 0%, rgba(23, 4, 7, .84) 34%, rgba(23, 4, 7, .15) 76%),
              linear-gradient(0deg, #120406 0%, transparent 44%) !important;
}

.eyebrow,
.rating,
.pair-code-wrap code,
a {
  color: #ff5a68;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline-color: #ff5a68 !important;
  box-shadow: 0 0 0 3px rgba(255, 64, 80, .55) !important;
}

html[data-theme="dark"],
html[data-theme="light"] {
  --accent: #ef233c !important;
  --accent-text: #ffffff !important;
}
