:root {
  --bg: #0d0d0f;
  --surface: #16161a;
  --border: #2a2a30;
  --text: #e4e4e7;
  --muted: #71717a;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

.hero {
  padding: 48px 0 32px;
  text-align: center;
}
.hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.search-wrap {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}
.search-wrap button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.search-wrap button:hover { background: var(--accent-hover); }

.results-header {
  padding: 16px 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding-bottom: 48px;
}
.card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.card-thumb {
  aspect-ratio: 16/10;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0,0,0,0.85);
  border-radius: 4px;
}
.card-body { padding: 12px; }
.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

.loading, .error {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.error { color: #f87171; }
.empty { text-align: center; padding: 32px; color: var(--muted); }

.block-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.recent-viewed-section, .last-search-section {
  margin-bottom: 40px;
}
.recent-viewed-section .grid-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.last-search-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.last-search-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}
.last-search-links a:hover { text-decoration: underline; color: var(--accent-hover); }
.storage-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: -8px 0 12px 0;
}
.block-empty {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }
.video-page { padding: 24px 0 48px; }
.video-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.video-meta { font-size: 0.9rem; color: var(--muted); margin-bottom: 20px; }
.video-embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  margin-bottom: 24px;
}
.video-embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.video-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  max-width: 800px;
}
.related-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.related-section .block-title { margin-bottom: 16px; }

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 24px 0 48px;
  font-size: 0.95rem;
  color: var(--muted);
}
.pager a {
  color: var(--accent);
  text-decoration: none;
}
.pager a:hover { text-decoration: underline; color: var(--accent-hover); }
.pager .current {
  color: var(--text);
  font-weight: 600;
}

.site-footer-seo {
  margin-top: 48px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent 0%, rgba(22, 22, 26, 0.5) 100%);
}
.site-footer-seo__inner { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.site-footer-seo__lead {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.5;
  max-width: 720px;
}
.site-footer-seo__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 768px) {
  .site-footer-seo__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
.site-footer-seo__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.site-footer-seo__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.site-footer-seo__list a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.site-footer-seo__list a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}
.site-footer-seo__note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 24px;
}
