/* Stage 3: compact navigation, restored catalogue and game templates. */
@media(min-width:1200px){
 .header .nav{gap:10px;margin-top:12px}
 .header .nav li:nth-child(1){width:76px}.header .nav li:nth-child(2){width:90px}.header .nav li:nth-child(3){width:80px}.header .nav li:nth-child(4){width:110px}.header .nav li:nth-child(5){width:56px}.header .nav li:nth-child(6){width:48px}
 .header .nav a{font-size:12px}.header .nav a>span:last-child{line-height:14px}
 .header .nav .ico{width:30px;height:30px;background-size:contain;margin-bottom:4px}
}
@media(max-width:1199px){
 .header .nav .ico{width:30px;height:30px;background-size:contain;margin-bottom:4px;vertical-align:top}
 .header .nav a{font-size:12px;line-height:14px;min-height:62px}.header .nav li{margin:14px 0}
}
.gallery-multi.gallery-grid{display:block;columns:2;column-gap:0}
.gallery-multi>.gallery-cell{break-inside:avoid;page-break-inside:avoid}
.gallery-multi .photo-item{width:100%;max-width:none!important}
.gallery-multi img{width:100%;height:auto}
.top-sort-bx{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.top-sort-bx .date{margin-left:auto;white-space:nowrap}
.section-page{--side-width:424px;--side-gap:16px}
.section-layout{display:grid;grid-template-columns:minmax(0,1fr) var(--side-width);gap:var(--side-gap);align-items:start}
.section-layout .aside{float:none;width:auto;margin:0;min-width:0}
.section-layout .catalog-bx{min-width:0}
.section-page .top-block>.row{display:grid;grid-template-columns:minmax(0,1fr) var(--side-width);gap:16px;margin:0}
.section-page .top-block>.row>div{max-width:none;width:auto;float:none;padding:0;flex:none}
.aside h2{margin:0;font-size:16px;font-weight:400}
.section-grid.gallery-standard{grid-template-columns:repeat(3,minmax(0,1fr))}
.section-grid.gallery-mobile{grid-template-columns:repeat(6,minmax(0,1fr))}
.filter-status:empty{display:none}
.title-block.game-title{position:relative;margin-bottom:30px}
.full-game .title-block h1{margin:0;font-size:24px;font-weight:400}
.full-game .title-block h1 span{font-size:16px;font-weight:300}
.game-information{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:32px;margin-top:10px;font-size:14px;color:#666}
.game-information>.made-bx:last-child{text-align:right}
.game-information .made-bx .t{margin:4px 0;line-height:1.45;display:block}.game-information strong{font-weight:600}
.game-info-toggle{display:none;background:none;border:0;color:#777;font-size:24px;cursor:pointer}
.format-nav{margin:0 0 22px;color:#a3a3a3;font-size:18px}
.format-collection{scroll-margin-top:20px}
.wallpaper-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:start}
.wallpaper-grid:before,.wallpaper-grid:after{display:none}
.wallpaper-grid .photo-item img{width:100%;height:auto}
.wallpaper-toggle{position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;cursor:pointer}
.wallpaper-toggle:focus-visible{outline:2px solid #efa200;outline-offset:2px}
.wallpaper .frame{box-sizing:border-box;overflow:auto;pointer-events:none;z-index:3;padding:10px}
.wallpaper:hover .frame,.wallpaper:focus-within .frame,.wallpaper.is-open .frame,.wallpaper .missing-frame{display:block}
.wallpaper .frame a{pointer-events:auto;color:#fff!important}
.resolution-groups{display:flex;justify-content:space-around;gap:10px;flex-wrap:wrap}
.wallpaper .frame .tt{font-size:11px;line-height:1.2}
.wallpaper .frame .list a{display:inline-block;min-height:20px}
.wallpaper .frame .list a:hover,.wallpaper .frame .list a:focus-visible{color:#efa200!important}
.missing-preview{min-height:100px;padding:12px}.missing-frame{position:static!important;height:auto!important}
.dialog-close{position:absolute;right:8px;top:6px;width:40px;height:40px;border:0;background:none;color:#efa200;font-size:30px;cursor:pointer}
.info-dialog h2{font-size:20px;line-height:1.4;margin-right:30px}
.info-dialog .game-information{display:block;color:#fff}.info-dialog .game-information>.made-bx{text-align:left}.info-dialog a{color:#efa200}
#wallpaper-viewer{width:1100px;padding:20px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}
#wallpaper-viewer>img{max-width:100%;width:auto;max-height:calc(100dvh - 190px);height:auto;display:block;margin:auto}
.viewer-title{margin:0 40px 15px 0;font-size:16px;line-height:1.4}
.viewer-controls{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:15px}
.viewer-controls a{color:#efa200}.viewer-controls button{background:#444;color:#fff;border:1px solid #efa200;font-size:22px;min-width:44px;min-height:40px}
.viewer-status:empty{display:none}
.catalog-top-table th{font-weight:600;padding:10px;text-align:left;border-bottom:1px solid #d8d8d8}
.catalog-top-table .ranking-game{display:flex;align-items:center;gap:15px}
.ranking-game img{width:100px;max-height:80px;object-fit:contain;flex:none}
.catalog-top-table{min-width:530px}.test-ranking{font-size:14px}
@media(max-width:1439px){.section-page{--side-width:270px;--side-gap:10px}}
@media(max-width:1199px){.top-sort-bx .sort{margin-bottom:0}.section-grid.gallery-mobile{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:991px){
 .section-layout{grid-template-columns:minmax(0,1fr)}
 .section-page .top-block>.row{display:block}.section-page .top-block>.row>div{width:100%}
 .game-title .game-information{display:none}.game-info-toggle{display:inline-block;vertical-align:middle;min-width:44px;min-height:44px;margin-left:5px}
 .game-title h1{display:inline}.game-title{padding-bottom:12px}
 .wallpaper-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .aside .bx{margin-top:10px}
}
@media(max-width:767px){
 .gallery-multi.gallery-grid{columns:1}.wallpaper-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .section-grid.gallery-standard{grid-template-columns:repeat(2,minmax(0,1fr))}.section-grid.gallery-mobile{grid-template-columns:repeat(3,minmax(0,1fr))}
 .full-game .title-block h1{font-size:21px}.game-information{font-size:13px}.format-nav{font-size:16px;line-height:1.6}
}
@media(max-width:480px){.wallpaper-grid,.section-grid.gallery-standard{grid-template-columns:1fr}.section-grid.gallery-mobile{grid-template-columns:repeat(2,minmax(0,1fr))}.top-sort-bx .date{font-size:13px}.viewer-controls{gap:8px;font-size:14px}}
/* Legacy clearfix pseudo-elements must not occupy CSS grid tracks. */
.section-page .top-block>.row::before,.section-page .top-block>.row::after{display:none}

/* Stage 4: original inner1/inner2/inner3/inner4 component hierarchy. */
.section-layout>.catalog{float:none;width:auto;min-width:0}
.section-layout{overflow:visible}
.section-layout .cat-list li{display:flex;justify-content:space-between;gap:8px;align-items:start}
.section-layout .cat-list .name{float:none;min-width:0;overflow-wrap:anywhere}
.section-layout .cat-list .n{float:none;flex:none;white-space:nowrap}
.game-information>.made-bx{font-size:14px;text-align:left;margin-top:0;color:inherit;min-width:0}
.game-information .made-bx .t a{font-weight:300;color:#a3a3a3}
.wallpaper-grid.catalog-single-row>.gallery-cell{width:auto}
.text-view .alpha-grid{display:block;columns:2;column-gap:30px}
.alpha-grid .alpha-item{break-inside:avoid;margin-bottom:20px;padding:0 8px}
.catalog-bx .alpha-item .letter{font-size:22px;font-weight:600;color:#f0a02f;margin:0 0 5px;line-height:1.4}
.alpha-grid .letter-list li{display:flex;justify-content:space-between;align-items:start;gap:10px;padding:0;margin:0 0 5px}
.alpha-grid .letter-list .name{float:none;min-width:0}
.alpha-grid .letter-list .n{position:static;flex:none;white-space:nowrap;width:auto;font-size:15px}
.catalog-bx .alpha-grid .letter-list a{color:#333;font-size:15px}
.catalog-bx .alpha-grid .letter-list a:hover{color:#f0a02f}
.catalog-top-table thead{background:#f3f3f3;text-transform:uppercase}
.catalog-top-table .ranking-game{min-width:0;overflow-wrap:anywhere}
.catalog-top-table .ranking-game img{width:70px}
@media(max-width:991px){.text-view .alpha-grid{columns:1}.info-dialog .game-information>.made-bx{margin:0}}
@media(max-width:767px){.catalog-top-table .ranking-game img{width:50px}.alpha-grid .letter-list .n{font-size:13px}}

/* Stage 5: restore footer groups and native icon dimensions. */
.footer{display:grid;grid-template-columns:33% 26% minmax(0,1fr) max-content;gap:0;align-items:start}
.footer .footer-links{display:contents}
.footer .footer-contact{flex-direction:column;align-items:flex-end;gap:10px}
.footer .social{white-space:nowrap}
.footer .social img[alt="VK"]{width:26px;height:14px}
.footer .social img[alt="Обратная связь"]{width:20px;height:16px}
.footer .social a{width:42px;height:42px}
/* The section search and sidebar share the same right edge and track. */
@media(min-width:992px){.section-page .top-block{padding-right:0}.section-page .top-block>.row{margin-right:-1px;gap:var(--side-gap)}}
.search-page{--side-width:424px;--side-gap:16px}
.search-result>a{flex:0 0 calc((100% - var(--side-width) - var(--side-gap) - 32px)/3)}
.search-result img{display:block;width:100%;height:auto;max-width:none;max-height:none}
.search-result{align-items:flex-start}
.search-result>div{flex:1}
.catalog-top-table th{font-size:inherit;font-weight:400}
.catalog-bx .catalog-top-table a{color:#333}
.catalog-top-table th:last-child{text-align:right}
.catalog-top-table .ranking-game img{width:50px;max-height:50px}
.catalog-top-table .ranking-game{gap:10px}
.game-information .made-bx .t{margin-left:0}
@media(max-width:1439px){.footer{grid-template-columns:22% 26% minmax(0,1fr) max-content}.search-page{--side-width:270px;--side-gap:10px}}
@media(max-width:991px){
 .footer{grid-template-columns:1fr max-content;gap:25px}.footer .footer-links{display:grid;grid-template-columns:1fr 1fr;gap:30px;grid-row:2;grid-column:1/-1}.footer .footer-contact{grid-column:2;grid-row:1}
 .search-page{--side-width:0px;--side-gap:0px}
}
@media(max-width:767px){
 .footer{display:flex;flex-direction:column;align-items:center;gap:30px}.footer .footer-contact{align-items:center}.footer .footer-links{display:grid;grid-template-columns:1fr 1fr;gap:30px}
 .search-result>a{flex-basis:45%}.search-result{gap:15px}
}
@media(max-width:480px){.footer .footer-links{grid-template-columns:1fr;gap:15px}.footer-links .links li{margin-bottom:5px}}
/* At 320px the original right-hand toggle overlaps the unchanged logo. */
@media(max-width:359px){.toggle_mnu:not(.active){left:0;right:auto}}
/* Original hover backgrounds reset background-size; keep compact icons intact. */
.header .nav a:hover .ico,.header .nav a:focus-visible .ico{background-size:contain}

/* Stage 5.1: only game information and ranking hover preview. */
.game-information[hidden]{display:none}
.ranking-preview{position:fixed;z-index:1000;pointer-events:none;margin:0;padding:4px;background:#333;border:1px solid #efa200;box-sizing:border-box}
.ranking-preview[hidden]{display:none}
.ranking-preview img{display:block;max-width:100%;height:auto}
/* Keep the approved right-group width after removing its text link. */
.footer .footer-contact{min-width:117px}

/* Stage 5.2: the two requested components only. */
@media(min-width:992px){
 .title-block.game-title-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:32px;align-items:start;margin-bottom:10px}
 .game-title-split .game-publisher{display:block;margin:0}
 .game-title-split .game-publisher .made-bx{text-align:right}
 .game-details{margin-top:0;margin-bottom:30px}
}
@media(max-width:991px){.game-details{display:none}}
@media(min-width:992px){
 .game-details{grid-template-columns:minmax(0,3fr) minmax(0,1fr)}
}

/* Stage 5.3: game metadata, rating numeric columns and catalogue tools only. */
.full-game .game-information,.full-game .game-information>.made-bx{font-size:13px}
.full-game .game-information .t{margin:0;line-height:1.45}
.full-game .game-details a{font-size:inherit}
@media(min-width:992px){.title-block.game-title-split{margin-bottom:6px}}
.ranking-page .catalog-top-table th:nth-child(3),
.ranking-page .catalog-top-table th:nth-child(4),
.ranking-page .catalog-top-table td:nth-child(3),
.ranking-page .catalog-top-table td:nth-child(4){text-align:center}
.aside[aria-label="Инструменты каталога"] .all-wallpapers{display:block;width:100%;box-sizing:border-box;text-align:center;margin-top:8px}
/* Preserve the existing mobile table track after shortening its heading. */
@media(max-width:767px){.ranking-page .catalog-top-table td:nth-child(4){min-width:85px}}
.aside[aria-label="Инструменты каталога"] .all-wallpapers{font-size:15px;color:#333;text-decoration:none;border:1px solid #bdbdbd;border-radius:15px;background:#eee;padding:3px 5px}
.aside[aria-label="Инструменты каталога"] .all-wallpapers:hover,
.aside[aria-label="Инструменты каталога"] .all-wallpapers:focus-visible{color:#fff;border-color:#efa200;background:#efa200}
@media(max-width:1439px){.aside[aria-label="Инструменты каталога"] .all-wallpapers{font-size:12px}}

/* Stage 5.4: retain main.css alphabet buttons; only distribute their cells. */
.aside[aria-label="Инструменты каталога"] .alpha-list{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px 0;justify-items:center}
.aside[aria-label="Инструменты каталога"] .alpha-list li{margin:0;display:block}
.aside[aria-label="Инструменты каталога"] .alpha-list .alpha-wide{grid-column:span 2}
/* Non-links use the exact original .alpha-list a dimensions and decoration. */
.aside[aria-label="Инструменты каталога"] .alpha-list .inactive{min-width:26px;text-align:center;font-size:15px;color:#aaa;display:block;text-decoration:none;border:1px solid #bdbdbd;border-radius:15px;background:#eee;padding:3px 5px}
.aside[aria-label="Инструменты каталога"] .alpha-list .inactive.bigger{padding:3px 14px}
/* Match the existing sidebar edges without moving its content or the info text. */
@media(max-width:991px){
 .section-page:has(.section-layout>.aside) .top-block{overflow:visible}
 .section-page:has(.section-layout>.aside) .top-block .search-form{margin-left:-16px;width:calc(100% + 32px)}
}

/* Stage 5.5: requested alphabet, title alignment, resolution placement and search. */
.aside[aria-label="Инструменты каталога"] .alpha-list{grid-template-columns:repeat(auto-fit,26px);column-gap:4px;justify-content:space-between}
.aside[aria-label="Инструменты каталога"] .alpha-list .alpha-wide{width:100%}
.aside[aria-label="Инструменты каталога"] .alpha-list .alpha-wide>*{width:100%;padding-left:0;padding-right:0}
@media(min-width:992px){.full-game .game-title-split>h1{align-self:end}}
.full-game .resolution-groups{display:flex;justify-content:flex-start;gap:0;margin-left:-5px;margin-right:-5px}
.full-game .resolution-groups>div{width:33.33333333%;padding-left:5px;padding-right:5px}
.full-game .wallpaper .frame .tt{font-size:13px;line-height:1.2}
.full-game .wallpaper .frame .list a{display:inline;min-height:0}
.search-page #search-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:30px}
.search-page .search-result{gap:16px;min-width:0}
.search-page .search-result>a{flex:0 0 50%}
.search-page .search-result img{width:100%;height:auto;max-width:none;max-height:none}
.search-page .search-result h2{font-size:20px;margin-bottom:10px}
.search-page .search-result p{font-size:13px;line-height:1.45;margin:6px 0}
.search-page .search-formats a{display:inline-block}
@media(max-width:991px){.search-page #search-results{grid-template-columns:minmax(0,1fr)}}
@media(max-width:480px){.search-page .search-result{gap:12px}.search-page .search-result>a{flex-basis:45%}.search-page .search-result h2{font-size:18px}}

/* Mobile menu: align with .main content edge (existing 5px inner padding). */
@media(max-width:767px){
 #wrapper .header .toggle_mnu:not(.active){left:auto;right:5px}
}

/* Shared mobile logo position, matching the approved game header. */
@media(max-width:767px){.header .logo{text-align:left;padding-left:0}}

/* Mobile ranking reuses the weekly sidebar list typography and dividers. */
.mobile-ranking{display:none}
.mobile-ranking .bx-title{font-weight:400;margin:0}
.mobile-ranking .cat-list{margin:0;padding:0;list-style:none}
@media(max-width:767px){
 .ranking-page .desktop-ranking{display:none}
 .ranking-page .mobile-ranking{display:block;margin-bottom:10px;background:#fff;border:1px solid #cacaca;border-top:3px solid #efa200;padding:10px}
 .ranking-page .mobile-ranking .cat-list li{display:grid;grid-template-columns:calc(3ch * .875) minmax(0,1fr) max-content;gap:8px 6px;padding-left:0;align-items:start}
 .ranking-page .mobile-ranking .cat-list li:after{content:none}
 .ranking-page .mobile-ranking .rank-number{font-size:14px;color:#333;text-align:left}
 .ranking-page .mobile-ranking .ranking-game{color:#333;text-decoration:none}
}

/* Final mobile-only footer order and unbroken wide alphabet labels. */
@media(max-width:767px){
 .footer .footer-links{order:0;grid-template-columns:1fr}
 .footer .footer-contact{order:1}
 .footer .copy{order:2;text-align:center}
 .aside[aria-label="Инструменты каталога"] .alpha-list .alpha-wide>*{white-space:nowrap}
}

@media(max-width:767px){.ranking-page .mobile-ranking .cat-list .n{margin-left:9px}}

@media(max-width:767px){.ranking-page .mobile-ranking .cat-list .name{padding-right:calc(3ch * .125 / .875)}}
