:root {
  --bg: #07090f;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-solid: #10141f;
  --panel-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef1f8;
  --muted: #8e97ad;
  --accent: #6d7cff;
  --accent-2: #a855f7;
  --danger: #ff6b81;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
}

.glow-a {
  top: -220px;
  left: -140px;
  background: radial-gradient(circle, var(--accent), transparent 65%);
}

.glow-b {
  top: -180px;
  right: -180px;
  background: radial-gradient(circle, var(--accent-2), transparent 65%);
}

.top, main { position: relative; z-index: 1; }

.top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px 22px 0;
  max-width: 900px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.brand-name { font-weight: 800; }

.brand-tuk {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(109, 124, 255, 0.35);
}

.logo svg { width: 23px; height: 23px; }

.hint {
  color: var(--muted);
  font-size: 13px;
}

.spacer { flex: 1; }

.logout-form { margin: 0; }

.logout-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.logout-btn:hover {
  color: var(--text);
  border-color: rgba(109, 124, 255, 0.5);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 26px 22px 60px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(120deg, #fff 20%, #b9c2ff 60%, #d8b4fe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
}

.services {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.chip:hover:not(:disabled) { background: var(--panel-hover); transform: translateY(-1px); }

.chip.active {
  border-color: rgba(109, 124, 255, 0.65);
  background: linear-gradient(135deg, rgba(109, 124, 255, 0.18), rgba(168, 85, 247, 0.14));
  box-shadow: 0 6px 22px rgba(109, 124, 255, 0.18);
}

.chip:disabled { opacity: 0.45; cursor: default; }

.chip em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.chip-ico { font-size: 13px; color: var(--accent); }

.panel {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 7px 7px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(7, 9, 15, 0.72);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.searchbar:focus-within {
  border-color: rgba(109, 124, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(109, 124, 255, 0.14);
}

.search-ico {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex: 0 0 auto;
}

#query {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}

#query::placeholder { color: #66708a; }

#go {
  padding: 11px 20px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(109, 124, 255, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

#go:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(109, 124, 255, 0.4); }
#go:disabled { opacity: 0.6; cursor: wait; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.quality {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 9, 15, 0.6);
}

.quality .q {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.quality .q.active {
  background: linear-gradient(135deg, rgba(109, 124, 255, 0.9), rgba(168, 85, 247, 0.9));
  color: #fff;
  font-weight: 600;
}

.toolbar-note { color: var(--muted); font-size: 12px; }

.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 107, 129, 0.1);
  border: 1px solid rgba(255, 107, 129, 0.3);
  color: var(--danger);
  font-size: 14px;
}

.pay-card {
  background: linear-gradient(135deg, rgba(109, 124, 255, 0.12), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(109, 124, 255, 0.28);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.pay-title { font-weight: 700; margin-bottom: 6px; }

.pay-card p { margin: 0; font-size: 14px; line-height: 1.5; }

.pay-card p + .btn-primary { margin-top: 12px; }

.btn-primary {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(109, 124, 255, 0.32);
  transition: transform 0.15s ease;
}

.btn-primary:hover { transform: translateY(-1px); }

/* Страница доступа */
.access-wrap { max-width: 480px; margin: 4vh auto 0; }

.access-hero h1 {
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.6px;
  margin: 0 0 10px;
}

.access-hero .lead {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 16px;
}

.features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 9px;
}

.features li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
}

.features li::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(109, 124, 255, 0.14);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}

.access-card { padding: 18px; }

.access-title { margin: 0 0 4px; font-size: 18px; }

.access-sub { margin: 0 0 14px; }

.key-input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(7, 9, 15, 0.72);
  color: var(--text);
  font: 600 17px/1 "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.key-input::placeholder { letter-spacing: 3px; color: #5b6478; }

.key-input:focus {
  outline: none;
  border-color: rgba(109, 124, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(109, 124, 255, 0.14);
}

.access-btn {
  display: block;
  width: 100%;
  border: 0;
  text-align: center;
  font-size: 15px;
  padding: 13px 18px;
  cursor: pointer;
}

.captcha-block {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.captcha-img {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 64px;
  object-fit: fill;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0e1420;
}

.captcha-refresh {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  border-radius: 12px;
  height: 64px;
  width: 64px;
  flex: 0 0 auto;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.captcha-refresh:hover {
  color: var(--text);
  border-color: rgba(109, 124, 255, 0.5);
}

.captcha-input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(7, 9, 15, 0.72);
  color: var(--text);
  font: inherit;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.captcha-input:focus {
  outline: none;
  border-color: rgba(109, 124, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(109, 124, 255, 0.14);
}

.progress { margin-top: 14px; }

.progress .bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress .fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(109, 124, 255, 0.5);
  transition: width 0.4s ease;
}

.results {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.results::-webkit-scrollbar { width: 6px; }
.results::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }

.result {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  animation: rise 0.28s ease both;
}

.result:hover {
  background: var(--panel-hover);
  border-color: var(--border);
  transform: translateX(2px);
}

.result img {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  flex: 0 0 auto;
  background: #000;
}

.r-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.r-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.r-sub { color: var(--muted); font-size: 13px; }

.skeleton { pointer-events: none; }

.sk-thumb {
  width: 160px;
  height: 90px;
  border-radius: 10px;
  flex: 0 0 auto;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite;
}

.sk-line {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite;
}

.sk-line.w80 { width: 80%; }
.sk-line.w40 { width: 40%; }

.player { margin-top: 16px; animation: rise 0.3s ease both; }

video {
  width: 100%;
  max-height: 62vh;
  background: #000;
  border-radius: 14px;
  display: block;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.meta {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 12px;
}

.meta img {
  width: 96px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.meta-text { min-width: 0; }

.meta-text h2 {
  font-size: 16px;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.meta-text p { margin: 0; font-size: 13px; }

.muted { color: var(--muted); font-size: 13px; }

.status { margin: 14px 0 0; }

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
  main { padding: 20px 14px 48px; }
  .top { padding: 18px 14px 0; }
  .panel { padding: 14px; }
  #go { padding: 11px 16px; }
  .result img, .sk-thumb { width: 124px; height: 70px; }
  .r-title { font-size: 15px; }
  .r-sub { font-size: 12.5px; }
  video { max-height: 44vh; }
  .hero h1 { font-size: 28px; }
  .toolbar { flex-wrap: wrap; }
}
