* { margin: 0; padding: 0; box-sizing: border-box; }
    body {
      font-family: 'Segoe UI', system-ui, sans-serif;
      background: linear-gradient(145deg, #0b1120 0%, #192132 100%);
      min-height: 100vh;
      color: #f1f5f9;
      padding: 0 20px 20px;
    }
    .container { max-width: 1400px; margin: 0 auto; }
    .header {
      display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
      padding: 15px 0; gap: 15px; border-bottom: 1px solid #334155; margin-bottom: 25px;
    }
    .logo {
      font-size: 2rem; font-weight: 800;
      background: linear-gradient(135deg, #fbbf24, #ec4899);
      -webkit-background-clip: text; background-clip: text; color: transparent;
      cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
    }
    /* Улучшенный поиск */
    .search-box {
      flex: 1; min-width: 260px; max-width: 520px; position: relative;
    }
    .search-box input {
      width: 100%; padding: 14px 50px 14px 20px; border-radius: 50px;
      border: 2px solid #334155; background: #0f172a; color: white;
      font-size: 1rem; outline: none; transition: all 0.3s ease;
    }
    .search-box input:focus {
      border-color: #fbbf24; box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
    }
    .search-box button {
      position: absolute; right: 1px; top: 37%; transform: translateY(-50%);
      width: 42px; height: 42px; border-radius: 50%; border: none;
      background: #fbbf24; color: #0f172a; font-size: 1.2rem; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: background 0.2s;
    }
    .search-box button:hover { background: #f59e0b; }
    .auth-btns { display: flex; gap: 10px; }
    .btn {
      padding: 10px 20px; border-radius: 30px; background: #334155; border: 1px solid #475569;
      color: white; cursor: pointer; font-weight: 500; transition: all 0.2s; white-space: nowrap; font-size: 0.9rem;
    }
    .btn:hover { background: #fbbf24; color: #0f172a; border-color: #fbbf24; }
    .btn-primary { background: #fbbf24; color: #0f172a; border: none; font-weight: 600; }
    .user-menu { display: flex; align-items: center; gap: 15px; }
    .view { display: none; }
    .view.active { display: block; }
    .categories {
      display: flex; gap: 10px; margin-bottom: 25px; flex-wrap: wrap; justify-content: center;
    }
    .category-btn {
      padding: 12px 25px; border-radius: 30px; background: #1e293b; border: 1px solid #334155;
      color: #cbd5e1; cursor: pointer; font-weight: 600; transition: all 0.2s;
      display: flex; align-items: center; gap: 8px;
    }
    .category-btn.active { background: #fbbf24; color: #0f172a; border-color: #fbbf24; box-shadow: 0 0 15px #fbbf2440; }
    .category-btn.redirect { background: #8b5cf6; border-color: #8b5cf6; color: white; }
    .category-btn.redirect:hover { background: #7c3aed; }
    .weather-slider-section { margin-bottom: 30px; }
    .weather-slider-title { font-size: 1.3rem; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
    .movie-scroll { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 10px; }
    .movie-scroll::-webkit-scrollbar { height: 4px; }
    .movie-scroll::-webkit-scrollbar-thumb { background: #475569; border-radius: 10px; }
    .movie-card.slider-card { min-width: 130px; max-width: 130px; border-radius: 16px; }
    .movie-card.slider-card .movie-poster { height: 180px; }
    .movie-card.slider-card .movie-info { padding: 8px; }
    .movie-card.slider-card .movie-title { font-size: 0.85rem; }
    .movie-card.slider-card .movie-year { font-size: 0.7rem; }
    .movie-card.slider-card .fav-icon { width: 28px; height: 28px; font-size: 14px; top: 6px; right: 6px; }
    .movie-card {
      background: #1e293b; border-radius: 20px; overflow: hidden; cursor: pointer;
      transition: transform 0.2s, border-color 0.2s; border: 1px solid #334155;
      position: relative; width: 100%;
    }
    .movie-card:hover { transform: translateY(-5px); border-color: #fbbf24; }
    .movie-poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
    .movie-info { padding: 10px; }
    .movie-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .movie-year { font-size: 0.8rem; color: #94a3b8; }
    .fav-icon {
      position: absolute; top: 10px; right: 10px; background: #00000080; backdrop-filter: blur(4px);
      width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
      color: white; font-size: 16px; opacity: 0; transition: opacity 0.2s; border: none; cursor: pointer;
    }
    .movie-card:hover .fav-icon { opacity: 1; }
    .fav-icon.active { color: #fbbf24; opacity: 1; }
    .movies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; margin-top: 10px; }
    .loader { text-align: center; padding: 40px; }
    .spinner { width: 50px; height: 50px; border: 4px solid #ffffff1a; border-left-color: #fbbf24; border-radius: 50%; animation: spin 0.8s infinite linear; margin: 0 auto; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .empty-state { text-align: center; padding: 40px; background: #1e293b; border-radius: 20px; color: #94a3b8; }
    .pagination { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
    .pagination button { padding: 10px 25px; border-radius: 30px; font-weight: 600; }
    .pagination button:disabled { opacity: 0.5; cursor: default; }
    .mood-buttons { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-bottom: 25px; }
    .mood-btn {
      padding: 15px 25px; border-radius: 30px; background: #2d3a4f; border: 1px solid #475569;
      color: #f1f5f9; font-size: 1.2rem; cursor: pointer; transition: all 0.2s;
      display: flex; align-items: center; gap: 10px;
    }
    .mood-btn:hover { background: #fbbf24; color: #0f172a; border-color: #fbbf24; transform: scale(1.02); }
    .mood-btn.active { background: #fbbf24; color: #0f172a; border-color: #fbbf24; }
    .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); z-index: 1000; justify-content: center; align-items: center; }
    .modal.active { display: flex; }
    .modal-content { background: #1e293b; border: 1px solid #475569; border-radius: 30px; padding: 30px; color: white; max-width: 800px; width: 90%; max-height: 90vh; overflow-y: auto; animation: fadeIn 0.3s ease; }
    @keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
    .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
    .close-btn { background: none; border: none; color: #94a3b8; font-size: 28px; cursor: pointer; padding: 0 5px; }
    .close-btn:hover { color: white; }
    input[type="text"], input[type="password"] { width: 100%; padding: 12px 16px; border-radius: 30px; background: #0f172a; color: white; border: 1px solid #475569; margin-bottom: 15px; font-size: 1rem; outline: none; }
    input:focus { border-color: #fbbf24; }
    .btn-block { width: 100%; justify-content: center; }
    .error-text { color: #ef4444; margin-top: 10px; display: none; }
    .back-btn { margin-bottom: 20px; background: transparent; border: 1px solid #475569; color: #cbd5e1; }
    .back-btn:hover { background: #334155; }

        .mood-test {
          display: none;
          position: fixed;
          top: 0; left: 0;
          width: 100%; height: 100%;
          background: rgba(0,0,0,0.7);
          backdrop-filter: blur(4px);
          justify-content: center;
          align-items: center;
          z-index: 1000;
        }
        .mood-test.active {
          display: flex;
        }
        .modal-content .close {
          position: absolute;
          top: 15px; right: 20px;
          font-size: 2rem;
          cursor: pointer;
          color: #e0e0e0;
        }
        .modal-content .close:hover { color: #bb86fc; }
        .step {
          display: none;
          flex-direction: column;
          gap: 15px;
        }
        .step.active { display: flex; }
        .step h3 { font-size: 1.5rem; margin-bottom: 10px; }
        .step button {
          background: transparent;
          border: 1px solid #bb86fc;
          color: #e0e0e0;
          padding: 12px 20px;
          border-radius: 12px;
          font-size: 1rem;
          cursor: pointer;
          transition: 0.2s;
          width: 100%;
          text-align: left;
        }
        .step button:hover {
          background: #bb86fc;
          color: #000;
        }
        #resultsContainer {
          display: none;
          margin-top: 20px;
        }
        .results-grid {
          display: grid;
          grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
          gap: 15px;
        }
        .loading-spinner {
          width: 40px; height: 40px;
          border: 4px solid rgba(255,255,255,0.2);
          border-top-color: #bb86fc;
          border-radius: 50%;
          animation: spin 0.8s linear infinite;
          margin: 20px auto;
        }
        @keyframes spin { to { transform: rotate(360deg); } }


    .view {
      display: none;
    }
    .view.active {
      display: block;
    }

    /* Кнопки жанров */
    .genre-buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 0.8rem;
      margin-bottom: 2rem;
    }
    .genre-btn {
      background: var(--surface, #1e1e1e);
      border: 1px solid #444;
      color: #e0e0e0;
      padding: 0.7rem 1.4rem;
      border-radius: 30px;
      cursor: pointer;
      font-size: 1rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      transition: 0.2s;
    }
    .genre-btn:hover,
    .genre-btn.active {
      background: var(--primary, #bb86fc);
      color: #000;
      border-color: var(--primary, #bb86fc);
    }

    /* Пагинация для жанров (и для других разделов, если нужно) */
    #genrePagination {
      display: flex;
      justify-content: center;
      gap: 10px;
      margin-top: 2rem;
    }
    #genrePagination button {
      background: var(--surface, #1e1e1e);
      border: 1px solid #444;
      color: #e0e0e0;
      padding: 0.5rem 1rem;
      border-radius: 8px;
      cursor: pointer;
    }
    #genrePagination button:hover {
      background: var(--primary, #bb86fc);
      color: #000;
    }
    #genrePagination button:disabled {
      opacity: 0.5;
      cursor: default;
    }

    /* Модальное окно быстрой подборки */
    .mood-test {
      display: none;
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100%;
      background: rgba(0,0,0,0.7);
      backdrop-filter: blur(4px);
      justify-content: center;
      align-items: center;
      z-index: 1000;
    }
    .mood-test.active {
      display: flex;
    }
    .modal-content .close {
      position: absolute;
      top: 15px; right: 20px;
      font-size: 2rem;
      cursor: pointer;
      color: #e0e0e0;
    }
    .modal-content .close:hover { color: #bb86fc; }
    .step {
      display: none;
      flex-direction: column;
      gap: 15px;
    }
    .step.active { display: flex; }
    .step h3 { font-size: 1.5rem; margin-bottom: 10px; }
    .step button {
      background: transparent;
      border: 1px solid #bb86fc;
      color: #e0e0e0;
      padding: 12px 20px;
      border-radius: 12px;
      font-size: 1rem;
      cursor: pointer;
      transition: 0.2s;
      width: 100%;
      text-align: left;
    }
    .step button:hover {
      background: #bb86fc;
      color: #000;
    }
    #resultsContainer {
      display: none;
      margin-top: 20px;
    }
    .results-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 15px;
    }
    .loading-spinner {
      width: 40px; height: 40px;
      border: 4px solid rgba(255,255,255,0.2);
      border-top-color: #bb86fc;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      margin: 20px auto;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* Общие стили для карточек (если style.css их не даёт) */
    .movies-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 1.2rem;
      margin-top: 1.5rem;
    }
    .movie-card {
      background: var(--surface, #1e1e1e);
      border-radius: 12px;
      overflow: hidden;
      transition: transform 0.2s;
      cursor: pointer;
    }
    .movie-card:hover { transform: scale(1.03); }
    .movie-card img {
      width: 100%;
      height: 240px;
      object-fit: cover;
      display: block;
    }
    .movie-card .info {
      padding: 0.7rem;
    }
    .movie-card .title {
      font-weight: 600;
      font-size: 0.9rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .movie-card .year {
      font-size: 0.8rem;
      color: #aaa;
      margin-top: 0.2rem;
    }
    .loader {
      display: flex;
      justify-content: center;
      padding: 2rem;
    }
    .spinner {
      width: 40px; height: 40px;
      border: 4px solid rgba(255,255,255,0.2);
      border-top-color: var(--primary, #bb86fc);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
