:root {
  --bg-body: #0c0f17;
  --bg-header: rgba(12, 15, 23, 0.94);
  --bg-card: rgba(15, 23, 42, 0.55);
  --bg-card-hover: rgba(30, 41, 59, 0.65);
  --bg-footer: #080a0f;
  --bg-input: #0f172a;
  --border-subtle: #1e293b;
  --border-hover: #334155;
  --text-main: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-bg: rgba(245, 158, 11, 0.12);
  --accent-border: rgba(245, 158, 11, 0.28);
  --emerald: #10b981;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
}

::selection {
  background-color: var(--accent);
  color: #000;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font: inherit;
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #090d16;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.22);
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
}

.brand-text span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.genre-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  height: 100%;
  padding: 0 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.genre-btn:hover {
  color: #fff;
}

.genre-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.season-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid var(--border-hover);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.main-content {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 540px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-info {
  padding: 22px 24px;
  border-top: 1px solid rgba(30, 41, 59, 0.75);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.player-info-main {
  flex: 1;
  min-width: 260px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.badge-accent {
  background: var(--accent-bg);
  color: var(--accent-hover);
  border: 1px solid var(--accent-border);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 6px;
}

.badge-age {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-secondary);
  border: 1px solid var(--border-hover);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}

.meta-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.player-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.player-desc {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 820px;
  line-height: 1.6;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-hover);
  color: var(--text-main);
  font-size: 0.825rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-outline:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 11px;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #090d16;
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.22);
  transition: filter 0.15s ease, transform 0.15s ease;
}

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

.catalog-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.catalog-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.count-label {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 11px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 8px 12px 8px 34px;
  font-size: 0.85rem;
  color: var(--text-main);
  width: 220px;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  border-color: var(--accent);
}

.sort-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
}

.sort-select:focus {
  border-color: var(--accent);
}

.trailers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.trailer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.trailer-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.trailer-card.is-playing {
  border-color: var(--accent);
}

.poster-box {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1e293b;
  overflow: hidden;
}

.poster-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.trailer-card:hover .poster-box img {
  transform: scale(1.04);
}

.poster-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.trailer-card:hover .poster-overlay {
  opacity: 1;
}

.play-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.95);
  color: #090d16;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.duration-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(8, 10, 15, 0.86);
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 5px;
}

.year-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(8, 10, 15, 0.82);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-body {
  padding: 15px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.card-genre {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
}

.card-age {
  font-size: 0.68rem;
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
  padding: 0 5px;
  border-radius: 4px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.trailer-card:hover .card-title {
  color: var(--accent-hover);
}

.card-desc {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-footer-link {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(30, 41, 59, 0.6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.card-footer-link a:hover {
  color: var(--accent-hover);
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--accent-hover);
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.spec-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 10px 12px;
}

.spec-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.spec-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.prose-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 860px;
  margin: 0 auto;
}

.prose-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: #fff;
}

.prose-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--accent-hover);
}

.prose-card p, .prose-card li {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 12px;
}

.prose-card ul {
  padding-left: 20px;
}

.error-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
}

.error-box {
  max-width: 440px;
}

.error-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 18px;
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.12);
}

.error-code {
  font-size: 3.75rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
}

.error-subtitle {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 10px;
  color: var(--text-main);
}

.error-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 10px;
  margin-bottom: 26px;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-footer);
  color: var(--text-dim);
  font-size: 0.78rem;
  padding: 26px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

@media (max-width: 1024px) {
  .trailers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .season-pill {
    display: none;
  }
  .trailers-grid {
    grid-template-columns: 1fr;
  }
  .search-input {
    width: 100%;
  }
  .controls-bar {
    width: 100%;
  }
  .search-box {
    flex: 1;
  }
  .player-title {
    font-size: 1.2rem;
  }
  .prose-card {
    padding: 22px 18px;
  }
}
