.h-home{--h-grad:linear-gradient(135deg,#7c3aed 0%,#a855f7 40%,#ec4899 80%,#f97316 100%);--h-soft:rgba(147,51,234,.09);--h-r:16px;--h-pad:26px;padding:10px 12px 30px}
[data-theme=dark] .h-home{--h-soft:rgba(168,85,247,.15)}
.h-home *{box-sizing:border-box}
.h-grad{background:var(--h-grad);-webkit-background-clip:text;background-clip:text;color:transparent}

/* общий блок */
.h-sheet{position:relative;z-index:20;padding:var(--h-pad);margin-bottom:20px;border-radius:26px;background:var(--card);background:color-mix(in srgb,var(--card) 92%,transparent);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border:1px solid var(--border);box-shadow:0 10px 40px rgba(30,20,60,.08)}

/* герой */
.h-hero{position:relative;display:grid;grid-template-columns:1.1fr .9fr;gap:24px;align-items:center;padding:4px 0 24px;margin-bottom:22px;border-bottom:1px solid var(--border)}
.h-hero__main{position:relative;min-width:0}
.h-hero--compact{grid-template-columns:1fr;padding-bottom:20px}
.h-live{display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px 8px;padding:5px 12px 5px 9px;border-radius:20px;background:var(--h-soft);font-size:12.5px;font-weight:600;color:var(--text-muted)}
.h-live__dot{width:7px;height:7px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.2);animation:h-pulse 2s infinite}
.h-live #dynamicGreeting{color:var(--text);font-weight:700}
.h-live__sep{opacity:.5}
.h-live__date{display:none}
@keyframes h-pulse{50%{box-shadow:0 0 0 6px rgba(34,197,94,0)}}
.h-hero__title{margin:14px 0 10px;font-size:clamp(28px,3.6vw,44px);line-height:1.08;letter-spacing:-1px;font-weight:800;color:var(--text)}
.h-hero--compact .h-hero__title{margin-top:0;font-size:clamp(22px,2.8vw,32px);letter-spacing:-.5px}
.h-hero__sub{margin:0 0 20px;font-size:15px;line-height:1.5;color:var(--text-muted);max-width:520px}

.h-search{position:relative;display:flex!important;align-items:center!important;gap:6px;padding:5px;border-radius:16px;background:var(--bg);border:1px solid var(--border)}
.h-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--h-soft)}
.h-search__ic{width:20px!important;height:20px!important;margin-left:10px;color:var(--text-muted)}
.h-search .search-input-thin{flex:1;min-width:0;height:44px;padding:0 4px!important;border:0!important;background:none!important;box-shadow:none!important;font:inherit;font-size:16px;color:var(--text);outline:none}
.h-search .search-submit-btn{height:44px;margin:0;border-radius:12px;padding:0 20px;font-size:14px;font-weight:700}
.h-search .live-search-results{top:calc(100% + 8px)}
.h-pop{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:12px}
.h-pop span{font-size:12.5px;font-weight:600;color:var(--text-muted);margin-right:2px}
.h-pop a{padding:5px 11px;border-radius:11px;background:var(--bg);font-size:12.5px;font-weight:600;color:var(--text);text-decoration:none;transition:color .15s,background .15s}
.h-pop a:hover{background:var(--h-soft);color:var(--accent)}
.h-stats{display:flex;flex-wrap:wrap;gap:24px;margin-top:22px}
.h-stats b{display:block;font-size:20px;font-weight:800;letter-spacing:-.3px;color:var(--text)}
.h-stats span{font-size:12px;font-weight:500;color:var(--text-muted)}

.h-wall{position:relative;height:330px}
.h-wall__s{position:absolute;width:92px;height:92px;margin:-34px 0 0 -6px;padding:9px;border-radius:22px;background:var(--card);border:1px solid var(--border);box-shadow:0 6px 18px rgba(30,20,60,.08);animation:h-float 6s ease-in-out infinite;overflow:hidden}
.h-wall__s.is-big{width:130px;height:130px;border-radius:28px}
.h-wall__s:nth-child(2n){animation-duration:7.5s;animation-delay:-2s}
.h-wall__s:nth-child(3n){animation-duration:5.5s;animation-delay:-4s}
.h-wall__s img{width:100%;height:100%;object-fit:contain}
@keyframes h-float{0%,100%{transform:translateY(0) rotate(var(--r,0deg))}50%{transform:translateY(-12px) rotate(calc(var(--r,0deg) * -1))}}
.h-marquee{display:none}
@media (prefers-reduced-motion:reduce){.h-wall__s,.h-marquee div{animation:none!important}}

/* разделы */
.h-sec{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}
.h-sec h2{margin:0;font-size:18px;font-weight:800;letter-spacing:-.2px;color:var(--text)}
.h-sec a{font-weight:700;font-size:13px;color:var(--accent);text-decoration:none;white-space:nowrap}

.h-cats{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:10px;margin-bottom:12px}
.h-cat{position:relative;overflow:hidden;height:86px;padding:10px 12px;border-radius:var(--h-r);display:flex;flex-direction:column;justify-content:flex-end;background:linear-gradient(135deg,var(--g1),var(--g2));color:#fff;text-decoration:none;transition:transform .2s}
.h-cat:hover{transform:translateY(-3px)}
.h-cat i{position:absolute;top:9px;right:10px;font-style:normal;display:flex;transition:transform .3s}
.h-cat__ic{width:26px;height:26px;opacity:.92}
.h-ic{width:15px;height:15px;flex-shrink:0;vertical-align:-2px}
.h-ic--flame{width:20px;height:20px;margin-right:6px;color:#f97316;vertical-align:-3px}
.h-ic--big{width:30px;height:30px;color:var(--accent)}
.h-fmt a .h-ic{margin-right:5px}
.h-card__foot .h-ic,.h-tcard__meta .h-ic{width:13px;height:13px;margin-right:3px}
.h-cat:hover i{transform:scale(1.15) rotate(10deg)}
.h-cat b{font-size:13.5px;font-weight:700;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.h-cat small{font-size:11px;font-weight:500;opacity:.9}

.h-tags{display:flex;gap:6px;overflow-x:auto;padding:2px 0 4px;margin-bottom:24px;scrollbar-width:none}
.h-tags::-webkit-scrollbar{display:none}
.h-tags a{flex-shrink:0;padding:5px 11px;border-radius:10px;background:var(--bg);font-size:12.5px;font-weight:600;color:var(--text-muted);text-decoration:none;white-space:nowrap}
.h-tags a:hover,.h-tags a.is-on{background:var(--h-soft);color:var(--accent)}

.h-trend{display:grid;grid-auto-flow:column;grid-auto-columns:calc((100% - 42px) / 4);gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;padding:2px 0 8px;margin-bottom:24px;scrollbar-width:none}
.h-trend::-webkit-scrollbar{display:none}
.h-tcard{scroll-snap-align:start;position:relative;display:block;border-radius:var(--h-r);overflow:hidden;background:var(--bg);border:1px solid rgba(20,18,40,.08);text-decoration:none;color:var(--text);transition:transform .2s}
.h-tcard:hover{transform:translateY(-3px)}
.h-tcard__rank{position:absolute;z-index:1;top:10px;left:10px;width:26px;height:26px;border-radius:9px;background:var(--h-grad);color:#fff;font-size:13px;font-weight:800;display:flex;align-items:center;justify-content:center}
.h-tcard__cov{aspect-ratio:16/10;display:grid;grid-template-columns:1.4fr 1fr;grid-template-rows:1fr 1fr;gap:5px;padding:8px}
.h-tcard__cov img{width:100%;height:100%;min-height:0;object-fit:contain;border-radius:10px;background:var(--card)}
.h-tcard__cov img:first-child{grid-row:span 2}
.h-tcard__cov.n1{grid-template-columns:1fr}
.h-tcard__cov.n2{grid-template-columns:1fr 1fr}
.h-tcard__cov.n2 img{grid-row:span 2}
.h-tcard__meta{padding:4px 12px 12px}
.h-tcard__meta b{display:block;font-size:14px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.h-tcard__meta span{font-size:12px;font-weight:500;color:var(--text-muted)}

/* реклама */
.h-ad{position:relative;display:flex;align-items:center;justify-content:center;border-radius:var(--h-r);background:var(--bg);overflow:hidden}
.h-ad.is-empty{display:none}
.h-ad>div{width:100%;height:100%}
.h-ad--wide{height:250px;margin-bottom:22px}
.h-ad--feed{grid-column:span 2;height:250px}

/* фильтры */
.h-bar{position:sticky;top:var(--header-height,60px);z-index:30;display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 calc(var(--h-pad) * -1) 14px;padding:10px var(--h-pad);background:var(--card);background:color-mix(in srgb,var(--card) 94%,transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.h-seg,.h-sort{display:inline-flex;padding:3px;border-radius:12px;background:var(--bg)}
.h-seg a,.h-sort a{height:32px;padding:0 13px;border-radius:9px;display:flex;align-items:center;font-weight:600;font-size:13px;color:var(--text-muted);text-decoration:none;white-space:nowrap}
.h-seg a.is-on,.h-sort a.is-on{background:var(--card);color:var(--text);font-weight:700;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.h-sort{margin-left:auto}
.h-fmt{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;min-width:0}
.h-fmt::-webkit-scrollbar{display:none}
.h-fmt a{flex-shrink:0;height:32px;padding:0 11px;border-radius:10px;display:flex;align-items:center;background:var(--bg);font-size:12.5px;font-weight:600;color:var(--text-muted);text-decoration:none;white-space:nowrap}
.h-fmt a.is-on{background:var(--h-soft);color:var(--accent)}

/* сетка */
.h-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-flow:dense;align-items:start;gap:12px;margin-bottom:20px}
.h-card{position:relative;border-radius:var(--h-r);background:var(--card);border:1px solid rgba(20,18,40,.12);box-shadow:0 2px 10px rgba(20,18,40,.07);overflow:hidden;transition:transform .2s,box-shadow .2s}
[data-theme=dark] .h-card{border-color:rgba(255,255,255,.09);box-shadow:none}
.h-card:hover{transform:translateY(-3px);box-shadow:0 12px 28px -14px rgba(139,61,255,.35)}
.h-card__link{display:block;color:var(--text);text-decoration:none}
.h-card__pic{position:relative;aspect-ratio:1;padding:12px;overflow:hidden;background:var(--bg);border-bottom:1px solid rgba(20,18,40,.06)}
.h-card__pic.t-emoji{background:linear-gradient(160deg,rgba(168,85,247,.08),rgba(236,72,153,.05))}
.h-card__pic.t-stick{background:linear-gradient(160deg,rgba(14,165,233,.08),rgba(34,197,94,.05))}
.h-card__pic img,.h-card__pic video,.h-card__pic .tgs-preview{width:100%;height:100%;object-fit:contain;transition:transform .35s cubic-bezier(.3,1.6,.5,1)}
.h-card:hover .h-card__pic img,.h-card:hover .h-card__pic video{transform:scale(1.08) rotate(-3deg)}
.h-card__pic.nsfw-blur img,.h-card__pic.nsfw-blur video,.h-card__pic.nsfw-blur .tgs-preview{filter:blur(16px) saturate(.6)}
.h-card__badges{position:absolute;z-index:2;left:8px;top:8px;display:flex;gap:3px}
.h-card__badges b{height:19px;padding:0 6px;border-radius:6px;display:flex;align-items:center;font-size:9.5px;font-weight:700;letter-spacing:.3px;background:var(--card)}
.h-card__badges .is-emoji{color:var(--accent)}
.h-card__badges .is-stick{color:#0284c7}
.h-card__badges .is-anim{background:var(--h-grad);color:#fff}
.h-card__badges .is-video{background:#111;color:#fff}
.h-card__badges .is-adult{background:#ef4444;color:#fff}
.h-card__fav{position:absolute;z-index:3;top:7px;right:7px;width:30px;height:30px;border:0;border-radius:10px;background:var(--card);color:var(--text-muted);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:color .15s,transform .15s}
.h-card__fav .svg-icon{width:16px;height:16px}
.h-card__fav:hover{color:#ec4899}
.h-card__fav.active{color:#ec4899;animation:h-pop .35s}
.h-card__fav.active .svg-icon{fill:#ec4899}
@keyframes h-pop{50%{transform:scale(1.3)}}
.h-card__body{padding:9px 11px 11px}
.h-card__title{display:block;font-weight:700;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.h-card__tags{display:flex;gap:4px;margin:5px 0 6px;overflow:hidden;height:20px}
.h-card__tags .tag-badge{flex-shrink:0;padding:1px 7px!important;border:0!important;border-radius:6px;background:var(--bg)!important;font-size:11px!important;font-weight:500!important;color:var(--text-muted)!important;white-space:nowrap;cursor:pointer}
.h-card__tags .tag-badge:hover{color:var(--accent)!important}
.h-card__foot{display:flex;justify-content:space-between;gap:6px;font-size:11.5px;font-weight:500;color:var(--text-muted);white-space:nowrap}
.h-promo{grid-column:span 2;position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;gap:12px;padding:18px;border-radius:var(--h-r);background:linear-gradient(135deg,#229ED9,#1c7ed6 60%,#6d28d9);color:#fff;text-decoration:none;min-height:180px}
.h-promo::after{content:"";position:absolute;right:-10px;bottom:-14px;width:110px;height:110px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='22' y1='2' x2='11' y2='13'/%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2'/%3E%3C/svg%3E") center/contain no-repeat;opacity:.22;transform:rotate(-8deg)}
.h-promo b{font-size:17px;font-weight:700;line-height:1.2}
.h-promo p{margin:6px 0 0;opacity:.9;font-size:13px}
.h-promo span{align-self:flex-start;padding:8px 14px;border-radius:11px;background:#fff;color:#1c7ed6;font-weight:700;font-size:13px}
.h-empty{grid-column:1/-1;text-align:center;padding:44px 20px;border-radius:var(--h-r);background:var(--bg)}
.h-empty .svg-icon{width:50px;height:50px;color:var(--text-muted);opacity:.35}
.h-empty h2{margin:10px 0 6px;font-size:18px;color:var(--text)}
.h-empty p{margin:0 0 16px;color:var(--text-muted)}
.h-btn{display:inline-flex;padding:10px 18px;border-radius:12px;background:var(--accent);color:#fff;font-weight:700;text-decoration:none}
.h-sheet .pagination-container{margin:6px 0 0}
.h-sheet .ad-inline-mobile{margin:0 0 14px}

/* адаптив */
@media (max-width:1100px){
    .h-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
    .h-cats{grid-template-columns:repeat(4,minmax(0,1fr))}
    .h-trend{grid-auto-columns:calc((100% - 28px) / 3)}
}
@media (max-width:860px){
    .h-hero{grid-template-columns:1fr}
    .h-wall{display:none}
    .h-marquee{display:block;overflow:hidden;margin:18px calc(var(--h-pad) * -1) 0;-webkit-mask:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent);mask:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent)}
    .h-marquee div{display:flex;gap:8px;width:max-content;animation:h-run 40s linear infinite}
    .h-marquee img{width:62px;height:62px;padding:6px;border-radius:16px;background:var(--bg);object-fit:contain}
    @keyframes h-run{to{transform:translateX(-50%)}}
    .h-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:640px){
    .h-home{--h-pad:14px;padding:6px 6px 20px}
    .h-sheet{border-radius:22px}
    .h-hero{padding:2px 0 18px;margin-bottom:16px}
    .h-hero__title{font-size:28px;letter-spacing:-.6px;margin:10px 0 8px}
    .h-hero__sub{font-size:14px;margin-bottom:14px}
    .h-hero--compact .h-hero__title{font-size:22px}
    .h-search .search-input-thin{height:42px}
    .h-search .search-submit-btn{height:42px;width:44px;padding:0;justify-content:center}
    .h-stats{gap:18px;margin-top:16px}
    .h-stats b{font-size:17px}
    .h-sec h2{font-size:16.5px}
    .h-cats{display:grid;grid-auto-flow:column;grid-template-columns:none;grid-auto-columns:92px;overflow-x:auto;margin:0 calc(var(--h-pad) * -1) 10px;padding:0 var(--h-pad) 4px;scrollbar-width:none}
    .h-cats::-webkit-scrollbar{display:none}
    .h-cat{height:80px}
    .h-tags{margin:0 calc(var(--h-pad) * -1) 18px;padding:2px var(--h-pad) 4px}
    .h-trend{grid-auto-columns:72%;margin:0 calc(var(--h-pad) * -1) 18px;padding:2px var(--h-pad) 8px}
    .h-bar{top:var(--header-height,56px);padding:8px var(--h-pad)}
    .h-seg{flex:1}
    .h-seg a{flex:1;justify-content:center;padding:0 6px}
    .h-sort{margin-left:0}
    .h-sort a{padding:0 9px}
    .h-fmt{order:3;width:100%}
    .h-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    .h-card__pic{padding:9px}
    .h-card__tags{display:none}
    .h-card__body{padding:8px 10px 10px}
    .h-ad--wide{height:280px;margin-bottom:16px}
    .h-ad--feed{height:300px}
}
