/* ===== VIEWS ===== */
  .view { display: none; flex: 1; width: 100%; }
  .view.active { display: block; }

  .not-found {
    min-height: 62vh; padding: 80px 24px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
  }
  .not-found-code {
    color: var(--accent); font-family: Oswald, sans-serif; font-size: clamp(72px, 12vw, 144px);
    font-weight: 700; line-height: .9; letter-spacing: -.05em; opacity: .9;
  }
  .not-found h1 { margin: 22px 0 10px; font-size: clamp(30px, 5vw, 52px); }
  .not-found p { max-width: 520px; margin: 0 0 26px; color: var(--text-dim); }
  .not-found .mini-btn { padding: 12px 22px; }

  /* ===== HERO (home view) ===== */
  .hero {
    position: relative;
    width: 100%;
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: 0 clamp(20px, 4vw, 48px);
    background:
      linear-gradient(to top, var(--bg) 2%, rgba(9,9,11,0.55) 45%, rgba(9,9,11,0.85) 100%),
      linear-gradient(to right, rgba(9,9,11,0.92) 8%, rgba(9,9,11,0.35) 55%),
      var(--hero-image, url('/assets/images/hero-avangard.jpg')) center / cover;
    border-bottom: 1px solid var(--border);
  }

  .hero-content { max-width: 680px; }

  .badge {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 6px;
    background: rgba(255, 94, 26, 0.12);
    border: 1px solid rgba(255, 94, 26, 0.4);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 22px;
  }

  .hero h1 {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 18px;
  }

  .meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 22px;
    color: var(--text-dim);
    font-size: 14px;
  }

  .meta-row span {
    padding: 0 13px;
    border-right: 1px solid rgba(255,255,255,0.12);
  }
  .meta-row span:first-child { padding-left: 0; }
  .meta-row span:last-child { border-right: none; }
  .meta-row .rating { color: var(--accent); font-weight: 600; }

  .hero p.desc {
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 32px;
    max-width: 540px;
  }

  .hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
  .hero-edit { display: none; }
  .hero-edit[hidden] { display: none !important; }
  body.is-admin .hero-edit:not([hidden]) { display: inline-flex; align-items: center; }

  .btn {
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-family: inherit;
  }

  .btn-primary { background: var(--accent); color: #fff; }
  .btn-primary:hover { background: #ff7033; }

  .btn-secondary {
    background: var(--panel);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.1);
  }
  .btn-secondary:hover { border-color: var(--accent); }

  /* ===== SECTIONS (catalog) ===== */
  .section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 50px clamp(20px, 4vw, 48px) 20px;
  }

  .section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 22px;
  }

  .movie-grid {
    display: grid;
    /* auto-fill, а не auto-fit: при 1–2 тайтлах карточка не растягивается на всю ширину */
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
    width: 100%;
  }

  .movie-card {
    background: var(--panel);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    width: 100%;
    position: relative;
  }
  .movie-card:hover { border-color: var(--border); transform: translateY(-5px); }

  .poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--panel-light);
  }

  .poster-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
  }
  .movie-card:hover .poster-wrap img { transform: scale(1.06); }

  /* если вместо постера пришёл широкий логотип — вписываем целиком, а не растягиваем */
  .poster-wrap img.poster-wide, .poster img.poster-wide { object-fit: contain; background: #08080a; }
  .movie-card:hover .poster-wrap img.poster-wide { transform: none; }
  .card:hover .poster img.poster-wide { transform: none; }

  .poster-overlay { display: none; }

  /* компактная кнопка-закладка вместо всплывающей плашки */
  .fav-toggle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(9,9,11,0.72);
    backdrop-filter: blur(4px);
    color: rgba(255,255,255,0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    z-index: 3;
    transition: all 0.18s ease;
  }
  .fav-toggle svg { width: 14px; height: 14px; display: block; }
  .fav-toggle:hover {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(255,94,26,0.18);
  }
  .fav-toggle.added {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(255,94,26,0.22);
  }

  .card-progress {
    font-size: 11px;
    color: var(--accent);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .card-progress:empty { display: none; }

  .rating-badge {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(9,9,11,0.85);
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
  }

  .new-badge {
    position: absolute;
    top: 10px; left: 10px;
    background: var(--accent);
    color: #fff;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
  }

  .card-info { padding: 12px; }
  .card-info h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .card-info p { font-size: 11px; color: var(--text-dim); }
