 * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #121212; color: #f0f0f0; line-height: 1.6; }
        .container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
        header { background: #1e1e1e; padding: 15px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.3); position: sticky; top: 0; z-index: 100; }
        .header-content { display: flex; flex-direction: column; align-items: center; gap: 15px; }
        h1 { font-size: 2rem; text-align: center; margin-bottom: 10px; color: #ff6b6b; }
        .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; width: 100%; max-width: 800px; }
        .search-container { flex: 1; min-width: 200px; }
        #search { width: 100%; padding: 12px 20px; border-radius: 30px; border: 2px solid #333; background: #222; color: #fff; font-size: 1rem; outline: none; }
        #search:focus { border-color: #ff6b6b; }
        .sorting { display: flex; gap: 10px; }
        .sorting a { text-decoration: none; color: #aaa; padding: 8px 15px; border-radius: 20px; background: #222; transition: all 0.3s; font-size: 0.9rem; white-space: nowrap; }
        .sorting a:hover, .sorting a.active { background: #ff6b6b; color: white; }
        main { padding: 30px 0; }
        .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; justify-content: center; }
        .item { background: #1e1e1e; border-radius: 10px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.3); transition: transform 0.3s ease; }
        .item:hover { transform: translateY(-5px); }
        .image-container { position: relative; overflow: hidden; height: 0; padding-bottom: 150%; }
        .item-img, .item-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s ease; }
        .item-video { opacity: 0; pointer-events: none; }
        .item.has-video:hover .item-video { opacity: 1; }
        .item.has-video:hover .item-img { opacity: 0; }
        .item-content { padding: 15px; }
        .title { font-size: 1.1rem; margin-bottom: 10px; min-height: 2.4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; word-wrap: break-word; }
        .stats { font-size: 0.85rem; color: #aaa; display: flex; justify-content: space-between; }
        .item a { color: #ff6b6b; text-decoration: none; display: block; }
        .item a:hover { text-decoration: none; }
        .item a:hover h3 { text-decoration: underline; }
        .pagination { display: flex; justify-content: center; margin-top: 40px; gap: 10px; flex-wrap: wrap; }
        .pagination a, .pagination span { display: inline-block; padding: 10px 15px; background: #1e1e1e; color: #fff; text-decoration: none; border-radius: 5px; transition: background 0.3s; }
        .pagination a:hover { background: #333; }
        .pagination .current { background: #ff6b6b; color: white; }
        .pagination .disabled { opacity: 0.5; cursor: not-allowed; }
        footer { background: #1e1e1e; padding: 30px 0; margin-top: 40px; }
        .footer-content { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; }
        .footer-links a { color: #aaa; text-decoration: none; margin: 0 15px; transition: color 0.3s; }
        .footer-links a:hover { color: #ff6b6b; }
        .copyright { text-align: center; margin-top: 20px; color: #666; font-size: 0.9rem; }
        .menu-toggle { display: none; background: #222; border: 2px solid #333; border-radius: 8px; padding: 8px 12px; cursor: pointer; transition: all 0.3s; position: relative; min-width: 44px; height: 40px; align-items: center; justify-content: center; }
        .menu-toggle:hover { border-color: #ff6b6b; background: #2a2a2a; }
        .menu-toggle .arrow { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 10px solid #fff; transition: transform 0.3s ease; }
        .menu-toggle.active .arrow { transform: rotate(180deg); }
        .controls { transition: all 0.3s ease; overflow: hidden; }
        .item.touch-preview .item-video { opacity: 1 !important; pointer-events: auto; }
        .item.touch-preview .item-img { opacity: 0 !important; }
        .item a, .item { -webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
        .item a:focus { outline: none; }
        
        @media (max-width: 768px) {
            .gallery { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
            h1 { font-size: 1.7rem; }
            .controls { flex-direction: column; gap: 10px; }
            .search-container { width: 100%; }
            .footer-links a { margin: 0 8px; font-size: 0.85rem; }
            .header-content { flex-direction: column; align-items: center; gap: 0; }
            .header-top { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 0; gap: 10px; }
            h1 { font-size: 1.7rem; margin-bottom: 0; flex: 1; }
            .menu-toggle { display: flex; }
            .controls { width: 100%; max-height: 0; opacity: 0; margin-top: 0; pointer-events: none; }
            .controls.active { max-height: 200px; opacity: 1; margin-top: 15px; pointer-events: auto; }
            .sorting { display: flex; gap: 10px; margin-top: 10px; }
            .sorting a { flex: 1; text-align: center; }
        }
        
        @media (max-width: 480px) {
            .gallery { grid-template-columns: 1fr; }
            h1 { font-size: 1.5rem; }
            .pagination a, .pagination span { padding: 8px 12px; font-size: 0.9rem; }
            .sorting a { padding: 6px 12px; font-size: 0.85rem; }
            h1 { font-size: 1.5rem; padding-left: 40px; }
            .menu-toggle { padding: 6px 10px; min-width: 40px; height: 36px; }
            .menu-toggle .arrow { border-left-width: 6px; border-right-width: 6px; border-top-width: 8px; }
            .sorting { flex-direction: row; gap: 10px; }
            .sorting a { flex: 1; padding: 6px 12px; font-size: 0.85rem; text-align: center; }
            .controls.active { max-height: 150px; }
            .pagination a:first-child,
            .pagination a:nth-child(2),
            .pagination a:nth-last-child(2),
            .pagination a:last-child,
            .pagination span:first-child,
            .pagination span:nth-child(2),
            .pagination span:nth-last-child(2),
            .pagination span:last-child,
            .pagination span:not(.current) { display: none; }
            .pagination span.current { display: inline-block !important; }
            .pagination a, .pagination span { padding: 8px 12px; font-size: 0.85rem; }
        }
        
        .menu-toggle {
    -webkit-tap-highlight-color: transparent;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}    
        
        .item.has-video:hover .item-video { opacity: 1 !important; }
        .item.has-video:hover .item-img { opacity: 1; transition-delay: 0.1s; }
        .item.has-video:hover .item-video.loaded ~ .item-img { opacity: 0; }
        h1 a { color: inherit; text-decoration: none; }
        h1 a:hover { text-decoration: none; opacity: 0.9; }
        .stats { text-decoration: none !important; }
        header { position: sticky; top: 0; z-index: 100; transition: height 0.3s ease; }
    