:root {
  --bg-deep: #0b0a0f;
  --bg-panel: #14121d;
  --bg-card: #1b1826;
  --bg-card-hover: #231f31;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(212, 175, 55, 0.42);
  --gold: #d4af37;
  --gold-soft: #f2de9b;
  --gold-bg: rgba(212, 175, 55, 0.13);
  --text-main: #f3f1f8;
  --text-muted: #9e99b0;
  --text-dim: #6f6a82;
  --accent-emerald: #34d399;
  --accent-purple: #a78bfa;
  --accent-VK: #4c75a3;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(ellipse 110% 70% at 50% -10%, #231b35 0%, var(--bg-deep) 55%);
  color: var(--text-main);
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.15rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 10, 15, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #d4af37 0%, #8a6611 100%);
  color: #0b0a0f;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gold-soft);
}

.logo-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lang-select,
.filter-select {
  appearance: none;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.45rem 1.8rem 0.45rem 0.75rem;
  font-size: 0.84rem;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.lang-select:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--gold);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--gold);
  color: #0b0a0f;
  font-size: 0.73rem;
  font-weight: 700;
  margin-left: 0.35rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 2.2rem 0 1.6rem;
  max-width: 780px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--gold-soft);
  background: var(--gold-bg);
  border: 1px solid var(--border-gold);
  border-radius: 99px;
  padding: 0.25rem 0.85rem;
  margin-bottom: 0.85rem;
  letter-spacing: 0.03em;
}

.hero-title {
  font-size: clamp(1.55rem, 3.6vw, 2.35rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 0%, #f2de9b 65%, #d4af37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Panels */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow-soft);
}

.vk-panel {
  background: linear-gradient(145deg, rgba(76, 117, 163, 0.16) 0%, rgba(20, 18, 29, 0.96) 65%);
  border-color: rgba(76, 117, 163, 0.35);
}

.rec-panel {
  border-color: var(--border-gold);
}

.panel-header,
.rec-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  margin-bottom: 1.15rem;
}

.step-pill {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.step-pill-gold {
  color: var(--gold);
  font-weight: 600;
}

.panel-title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 600;
}

.panel-desc {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 580px;
}

/* Inputs & Buttons */
.input-text,
.input-search {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 9px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
}

.input-text:focus,
.input-search:focus {
  outline: none;
  border-color: var(--gold);
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.chip-btn {
  border: none;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.58rem 1rem;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #d4af37 0%, #b38919 100%);
  color: #0b0a0f;
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--gold-soft);
  border: 1px solid var(--border-gold);
}

.btn-secondary:hover {
  background: var(--gold-bg);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* VK Block */
.vk-input-row {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.vk-input-row .input-text {
  flex: 1;
}

.vk-demos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.vk-demos-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chip-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.38rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.chip-btn:hover,
.chip-btn.is-active {
  border-color: var(--gold);
  background: var(--gold-bg);
  color: var(--gold-soft);
}

.vk-status {
  margin-top: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 9px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.35);
  font-size: 0.86rem;
  color: #d1fae5;
}

/* Mood Grid */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.mood-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  color: var(--text-main);
}

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

.mood-card.is-selected {
  border-color: var(--gold);
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.18) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 0 1px var(--gold);
}

.mood-icon {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
  display: block;
}

.mood-name {
  font-weight: 600;
  font-size: 0.92rem;
  display: block;
  margin-bottom: 0.2rem;
}

.mood-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: block;
  line-height: 1.3;
}

/* Seed Movies Grid */
.seeds-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.selected-seeds-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: 9px;
  margin-bottom: 0.9rem;
}

.seed-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--gold-soft);
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  font-size: 0.78rem;
}

.seed-pill button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
}

.seed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.85rem;
}

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

.seed-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
}

.seed-card.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold);
}

.seed-poster-wrap {
  aspect-ratio: 2 / 3;
  background: #100e17;
  position: relative;
  overflow: hidden;
}

.seed-poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.seed-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(11, 10, 15, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.seed-card.is-selected .seed-check {
  background: var(--gold);
  border-color: var(--gold);
  color: #0b0a0f;
}

.seed-info {
  padding: 0.55rem 0.65rem;
}

.seed-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.seed-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Recommendations List */
.rec-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
}

.taste-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 9px;
  border-left: 3px solid var(--gold);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rec-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.rec-card {
  display: grid;
  grid-template-columns: 165px 1fr;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: border-color 0.18s ease;
}

.rec-card:hover {
  border-color: var(--border-gold);
}

.rec-poster {
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #100e17;
  position: relative;
}

.rec-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rec-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.rec-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.slot-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
}

.slot-core {
  background: var(--gold-bg);
  color: var(--gold-soft);
  border: 1px solid var(--border-gold);
}

.slot-gem {
  background: rgba(52, 211, 153, 0.14);
  color: var(--accent-emerald);
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.slot-explore {
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(167, 139, 250, 0.4);
}

.match-score {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
}

.rec-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.rec-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.rec-orig {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.rec-meta {
  font-size: 0.82rem;
  color: var(--gold-soft);
}

.rec-why {
  background: rgba(212, 175, 55, 0.07);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.83rem;
  color: #ece6d3;
}

.rec-synopsis {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 4, 9, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
}

.modal-header,
.modal-footer {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-footer {
  border-bottom: none;
  border-top: 1px solid var(--border-subtle);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.08rem;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
}

.modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.wl-item-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.wl-item-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 0 2.2rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: var(--gold-soft);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 680px) {
  .vk-input-row {
    flex-direction: column;
  }
  .mood-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .rec-card {
    grid-template-columns: 1fr;
  }
  .rec-poster {
    max-width: 180px;
  }
  .seed-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
