:root {
    --community: #25e3a4;
    --hdskins: #8a79ef;
    --premium: #167f91;
    --top: #ff7378;
    --accent: var(--community);
    --accent-dark: #18bf87;
    --text: #616161;
    --bg: #f1f1f1;
}
body.theme-community { --accent: var(--community); --accent-dark: #18bf87; --accent-rgb: 29, 220, 163; --accent-dark-rgb: 24, 191, 135; }
body.theme-hdskins { --accent: var(--hdskins); --accent-dark: #6f5dd4; --accent-rgb: 150, 122, 214; --accent-dark-rgb: 111, 93, 212; }
body.theme-premium { --accent: var(--premium); --accent-dark: #106878; --accent-rgb: 25, 144, 163; --accent-dark-rgb: 16, 104, 120; }

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Arial, sans-serif; }
body.modal-open { overflow: hidden; }

.hero {
    min-height: 126px;
    position: relative;
    overflow: visible;
    color: white;
    background: url("bg.jpeg") center 35% / cover no-repeat;
    box-shadow: 0 3px 12px #999;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        120deg,
        rgba(var(--accent-dark-rgb), .82),
        rgba(var(--accent-rgb), .70) 58%,
        rgba(var(--accent-dark-rgb), .82)
    );
    transition: background .2s ease;
}
.hero > * {
    position: relative;
    z-index: 1;
}
.hero-inner { max-width: 1060px; min-height: 126px; margin: auto; padding: 18px 25px; display: grid; grid-template-columns: 150px 1fr 150px; align-items: start; }
.logo { display: flex; align-items: center; justify-content: flex-start; text-decoration: none; }
.logo img { display: block; width: 92px; height: auto; max-height: 92px; }
.hero-center { text-align: center; }
.hero-center h1 { margin: 10px 0 12px; color: #fff; font-size: 27px; }
.hero-spacer { width: 150px; }
.search { max-width: 330px; min-height: 45px; margin: auto; padding: 0 13px; display: flex; align-items: center; gap: 10px; background: white; border-radius: 7px; color: #aaa; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.search-icon { color: var(--accent); font-size: 25px; line-height: 1; }
.search-placeholder { font-size: 13px; }
.search b { margin-left: auto; color: var(--accent); }

.page { width: min(760px, 94%); margin: 28px auto 110px; }
.filters { display: flex; justify-content: center; gap: 42px; flex-wrap: wrap; }
.filters a, .filters span { display: inline-block; min-width: 82px; padding: 11px 22px; text-align: center; text-decoration: none; color: white; border-radius: 8px; box-shadow: 0 5px 12px #bbb; font-weight: bold; }
.filter-community { background: var(--community); }
.filter-hdskins { background: var(--hdskins); }
.filter-premium { background: var(--premium); }
.filter-top { background: var(--top); }
.filters .active { outline: 3px solid rgba(255,255,255,.95); outline-offset: -5px; transform: translateY(-1px); }

.top-block { max-width: 850px; margin: 10px auto 28px; }
.top-head { display: flex; justify-content: space-between; font-size: 13px; color: #333; }
.top-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; overflow: hidden; }
.top-row i { flex: 0 0 68px; width: 68px; height: 68px; display: grid; place-items: center; border: 2px solid var(--accent); border-radius: 50%; background: #fff; color: #bbb; font-size: 42px; font-style: normal; box-shadow: 0 5px 10px #bbb; transition: border-color .2s ease; }
.ad { height: 120px; display: none; place-items: center; border: 1px solid #777; background: #e5e5e5; color: white; font-size: 49px; font-weight: 900; text-shadow: 0 5px 10px #999; }

.grid { display: grid; grid-template-columns: repeat(4, 150px); justify-content: space-between; gap: 44px 50px; max-width: 740px; margin: 35px auto; }
.card { min-width: 0; padding: 8px; overflow: hidden; background: #fff; border: 2px solid var(--accent); border-radius: 11px; box-shadow: 0 5px 10px #aaa; transition: border-color .2s ease, transform .15s ease; }
.card:hover { transform: translateY(-2px); }
.picture { height: 105px; display: flex; align-items: center; justify-content: center; }
.picture img { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.name { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.no-preview { color: #aaa; font-size: 12px; }
.error, .empty { max-width: 760px; margin: 30px auto; padding: 18px; background: #fff; border: 1px solid #ddd; }

.pagination { display: flex; justify-content: center; gap: 15px; }
.pagination a { min-width: 42px; height: 42px; display: grid; place-items: center; text-decoration: none; color: #222; border: 2px solid var(--accent); border-radius: 5px; background: white; font-weight: bold; font-size: 18px; box-shadow: 0 5px 10px #bbb; }
.pagination .current { background: var(--accent); color: white; }

.add-skin { position: fixed; z-index: 20; right: 6%; bottom: 95px; width: 80px; height: 80px; padding: 7px 5px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 11px; background: var(--accent); color: white; box-shadow: 0 5px 12px #aaa; font-weight: bold; cursor: pointer; transition: transform .15s ease, background .2s ease; }
.add-skin:hover { transform: translateY(-2px); }
.add-skin strong { display: block; margin: 0; font-size: 36px; line-height: .82; }
.add-skin span { display: block; width: 100%; max-width: 68px; margin: 0; font-size: 10px; line-height: 1.05; white-space: normal; text-align: center; overflow-wrap: normal; }

footer { min-height: 70px; padding: 12px; text-align: center; background: var(--accent); color: white; font-weight: bold; font-size: 12px; transition: background .2s ease; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.footer-links a { padding: 4px 12px; border: 2px solid #fff; border-radius: 10px; color: #fff; text-decoration: none; }
.footer-links a:hover { background: rgba(255,255,255,.14); }
footer small { display: block; margin-top: 8px; }

.modal[hidden] { display: none; }
.modal { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.modal-dialog { position: relative; z-index: 1; width: min(480px, 100%); padding: 34px 30px 30px; text-align: center; background: white; border: 3px solid var(--accent); border-radius: 14px; box-shadow: 0 18px 60px rgba(0,0,0,.35); }
.modal-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: #777; font-size: 32px; line-height: 1; cursor: pointer; }
.modal-plus { width: 62px; height: 62px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: white; font-size: 42px; line-height: 1; }
.modal-dialog h2 { margin: 0 0 12px; color: #444; }
.modal-dialog p { margin: 0 auto 24px; max-width: 390px; line-height: 1.5; }
.store-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.store-badge { min-height: 62px; padding: 9px 14px; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; text-align: left; background: #111; color: white; border-radius: 9px; box-shadow: 0 4px 10px rgba(0,0,0,.22); }
.store-badge small { display: block; font-size: 8px; letter-spacing: .5px; }
.store-badge b { display: block; font-size: 18px; white-space: nowrap; }
.play-icon { width: 0; height: 0; border-top: 14px solid transparent; border-bottom: 14px solid transparent; border-left: 23px solid white; }
.apple-icon { width: 28px; height: 32px; position: relative; display: grid; place-items: center; color: white; font-size: 31px; line-height: 1; }
.apple-icon::after { content: ''; position: absolute; top: -2px; right: 2px; width: 9px; height: 5px; background: white; border-radius: 100% 0; transform: rotate(-35deg); }

@media (max-width: 650px) {
    .hero, .hero-inner { min-height: 136px; }
    .hero-inner { padding: 12px 18px; position: relative; grid-template-columns: 75px 1fr 0; }
    .logo img { width: 62px; max-height: 62px; }
    .hero-center { position: absolute; left: 50%; top: 54px; width: 100%; transform: translateX(-50%); }
    .hero-center h1 { font-size: 18px; margin: 0 0 8px; }
    .search { max-width: 200px; min-height: 32px; padding: 0 9px; }
    .hero-spacer { display: none; }
    .page { width: 92%; margin-top: 20px; }
    .filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0 4px; }
    .filters a, .filters span { min-width: 0; padding: 10px 5px; font-size: 12px; }
    .top-block { padding: 0 2px; margin-top: 25px; }
    .top-row i:nth-child(n+7) { display: none; }
    .top-row i { flex-basis: 43px; width: 43px; height: 43px; font-size: 25px; }
    .ad { height: 78px; margin-top: 25px; font-size: 34px; }
    .grid { grid-template-columns: repeat(2, minmax(0, 145px)); justify-content: space-around; gap: 38px 16px; margin: 40px auto; }
    .picture { height: 112px; }
    .pagination { gap: 8px; }
    .pagination a { min-width: 29px; height: 29px; font-size: 13px; }
    .add-skin {
        right: 18px;
        bottom: 105px;
        width: 80px;
        height: 80px;
        padding: 7px 5px 8px;
        gap: 2px;
    }
    .add-skin strong { font-size: 34px; line-height: .82; }
    .add-skin span { max-width: 66px; font-size: 9.5px; line-height: 1.05; white-space: normal; }
    .store-links { grid-template-columns: 1fr; }
    .modal-dialog { padding: 30px 20px 24px; }
}

/* TOP SKINS — единая версия */

.top-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #333;
}

.top-period { margin: 0; }

.top-period select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 5px 20px 5px 6px;
    background:
        transparent
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23222' stroke-width='2'/%3E%3C/svg%3E")
        no-repeat right 5px center;
    color: #222;
    font: inherit;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.top-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: 8px;
    padding: 4px 4px 14px;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    user-select: none;
}

.top-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.top-scroll.is-dragging { cursor: grabbing; }
.top-scroll.is-dragging .top-skin { pointer-events: none; }

.top-row {
    display: flex;
    width: max-content;
    min-width: 100%;
    justify-content: flex-start;
    gap: 16px;
    margin-top: 0;
    overflow: visible;
}

.top-skin {
    position: relative;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: #fff;
    color: #bbb;
    font-size: 34px;
    font-style: normal;
    text-decoration: none;
    box-shadow: 0 5px 8px rgba(0,0,0,.24);
}

.top-skin .top-preview-bg {
    position: absolute;
    inset: 0;
    display: block;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    pointer-events: none;
    user-select: none;
    transform: none;
}

/*
 * В исходном preview в первой половине расположено сразу несколько ракурсов.
 * Поэтому увеличиваем изображение примерно вдвое относительно прежних 106%,
 * чтобы в круг попадал только первый персонаж: голова, тело и часть рук.
 */
.top-skin .top-preview-community {
    background-size: auto 170%;
    background-position:  4px 4px;
}

.top-skin .top-preview-hdskins {
   background-size: auto 165%;
    background-position:  6px 4px;
}

.top-skin img.top-preview { display: none; }
.top-skin-empty { cursor: default; }

/* Полоска под активной категорией */

.filters .active {
    position: relative;
    outline: 0;
    transform: none;
}

.filters .active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -9px;
    height: 4px;
    border-radius: 4px;
    background: var(--button-accent);
    box-shadow: 0 2px 5px rgba(0,0,0,.18);
}

.filter-community { --button-accent: var(--community); }
.filter-hdskins { --button-accent: var(--hdskins); }
.filter-premium { --button-accent: var(--premium); }

body.theme-premium .ad { margin-top: 34px; }

@media (max-width: 650px) {
    .top-row { gap: 12px; }

    .top-skin {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
        font-size: 27px;
    }

    .top-period select { font-size: 10px; }
    .top-scroll { padding-bottom: 10px; }

    .filters .active::after {
        left: 8px;
        right: 8px;
        bottom: -7px;
        height: 3px;
    }

    .top-skin .top-preview-community {
        background-size: auto 170%;
        background-position: 4px 2px;
    }

    .top-skin .top-preview-hdskins {
        background-size: auto 165%;
        background-position: 6px 2px;
    }

    body.theme-premium .ad { margin-top: 28px; }
}

/* TOP 100 */
body.theme-top100 {
    --accent: var(--top);
    --accent-dark: #df565d;
    --accent-rgb: 238, 102, 111;
    --accent-dark-rgb: 223, 86, 93;
}

.filter-top {
    --button-accent: var(--top);
}

.top100-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 0 18px;
    color: #333;
}

.top100-toolbar form {
    margin: 0;
}

.top100-toolbar select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 7px 24px 7px 8px;
    background:
        transparent
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23222' stroke-width='2'/%3E%3C/svg%3E")
        no-repeat right 6px center;
    color: #222;
    font: inherit;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

body.theme-top100 .ad {
    margin-top: 0;
}

.grid-top100 .card {
    position: relative;
}

.grid-top100 .card-community {
    border-color: var(--community);
}

.grid-top100 .card-hdskins {
    border-color: var(--hdskins);
}

.grid-top100 .card-premium {
    border-color: var(--premium);
}

.rank {
    position: absolute;
    z-index: 2;
    top: 5px;
    left: 5px;
    min-width: 30px;
    padding: 3px 6px;
    border-radius: 10px;
    background: var(--top);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,.2);
}

.top100-meta {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    margin-top: 5px;
    color: #888;
    font-size: 10px;
}

.top100-meta b {
    color: var(--top);
}

@media (max-width: 650px) {
    .top100-toolbar {
        margin-top: 25px;
        font-size: 12px;
    }

    .top100-toolbar select {
        font-size: 10px;
    }
}

/* SEARCH */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.search {
    position: relative;
    max-width: 330px;
    min-height: 45px;
    margin: auto;
    padding: 0 9px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 7px;
    box-shadow: 0 4px 0 rgba(0,0,0,.2);
}

.search-submit {
    flex: 0 0 auto;
    width: 27px;
    height: 31px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 25px;
    line-height: 31px;
    cursor: pointer;
}

.search-input {
    min-width: 0;
    flex: 1 1 auto;
    height: 34px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #555;
    font: inherit;
    font-size: 13px;
}

.search-input::placeholder {
    color: #aaa;
    opacity: 1;
}

.search-input::-webkit-search-cancel-button {
    cursor: pointer;
}

.search-scope-wrap {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    height: 34px;
}

.search-scope {
    appearance: none;
    -webkit-appearance: none;
    height: 34px;
    min-width: 54px;
    padding: 0 17px 0 5px;
    border: 0;
    outline: 0;
    background:
        transparent
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%2325e3a4' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        no-repeat right 4px center;
    color: var(--accent);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 34px;
    cursor: pointer;
}

body.theme-hdskins .search-scope {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%238a79ef' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body.theme-premium .search-scope {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%23167f91' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body.theme-top100 .search-scope {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%23ff7378' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.search-summary {
    margin: 28px 0 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,.08);
    color: #555;
    font-size: 13px;
}

.search-summary span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-summary a {
    margin-left: auto;
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 650px) {
    .search {
        max-width: 240px;
        min-height: 34px;
        padding: 0 6px;
        gap: 5px;
    }

    .search-submit {
        width: 23px;
        height: 28px;
        font-size: 21px;
        line-height: 28px;
    }

    .search-input,
    .search-scope-wrap,
    .search-scope {
        height: 28px;
    }

    .search-input {
        font-size: 12px;
    }

    .search-scope {
        min-width: 50px;
        padding-right: 15px;
        font-size: 11px;
        line-height: 28px;
        background-position: right 3px center;
    }

    .search-summary {
        margin-top: 24px;
        font-size: 11px;
    }
}

/* SEARCH RESULTS — category border colors */
.grid-search .card-community {
    border-color: var(--community);
}

.grid-search .card-hdskins {
    border-color: var(--hdskins);
}

.grid-search .card-premium {
    border-color: var(--premium);
}

/* Keep the All arrow vertically centered with the label. */
.search-scope {
    background-position: right 4px 50%;
    vertical-align: middle;
}

/* Official store badges */
.store-badge.store-badge-image {
    min-height: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.store-badge-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 62px;
}



/* Language selector in header */
.hero-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.language-menu {
    position: relative;
    z-index: 50;
}

.language-menu summary {
    min-width: 126px;
    height: 38px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 7px;
    background: rgba(255,255,255,.16);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    box-shadow: 0 3px 8px rgba(0,0,0,.15);
    user-select: none;
}

.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::marker { display: none; content: ''; }
.language-menu[open] summary { background: rgba(255,255,255,.24); }

.language-flag { width: 22px; height: 22px; display: block; flex: 0 0 22px; }
.language-name { line-height: 1; white-space: nowrap; }
.language-arrow {
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .15s ease;
}
.language-menu[open] .language-arrow { transform: rotate(225deg) translate(-1px, -1px); }

.language-options {
    position: absolute;
    z-index: 100;
    top: calc(100% + 7px);
    right: 0;
    min-width: 142px;
    padding: 6px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0,0,0,.25);
}

.language-options a {
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 6px;
    color: #444;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.language-option-flag { width: 24px; height: 24px; display: block; flex: 0 0 24px; }

.language-options a:hover,
.language-options a:focus,
.language-options a.active {
    background: #f0f0f0;
}

@media (max-width: 650px) {
    .hero-actions {
        position: absolute;
        top: 10px;
        right: 8px;
        max-width: calc(100vw - 16px);
        z-index: 100;
    }

    .language-menu summary {
        min-width: 104px;
        height: 32px;
        padding: 0 8px;
        gap: 5px;
    }

    .language-flag { width: 20px; height: 20px; flex-basis: 20px; }
    .language-name { font-size: 10px; }
    .language-options { right: 0; min-width: 132px; }
}

/* Clickable catalog cards */
a.card { display: block; color: inherit; text-decoration: none; }

/* Skin detail */
.skin-detail-page { width: min(980px, 94%); }
.skin-detail-page > .ad { margin-top: 34px; }
.skin-title-block { margin: 28px 8px 14px; color: #666; }
.skin-title-block h2 { margin: 0 0 5px; max-width: 680px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 28px; }
.skin-title-block p { margin: 0; font-size: 18px; }
.skin-title-block strong { text-decoration: underline; }
.skin-layout { display: grid; grid-template-columns: minmax(0, 560px) 300px; justify-content: center; align-items: start; gap: 42px; }
.skin-main-column { min-width: 0; }
.skin-viewer-card { position: relative; width: 100%; aspect-ratio: 1 / 1; min-height: 0; overflow: hidden; border: 3px solid var(--accent); border-radius: 14px; background: #fff; box-shadow: 0 7px 16px rgba(0,0,0,.22); }
#skin_container { position: absolute; inset: 0; display: block; width: 100% !important; max-width: none; height: 100% !important; outline: none; cursor: grab; }
#skin_container:active { cursor: grabbing; }
.skin-tools { position: absolute; z-index: 3; top: 14px; right: 14px; display: grid; gap: 10px; }
.skin-tools button, .skin-tools .skin-tool-report { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 7px; background: #fff; color: #666; box-shadow: 0 4px 11px rgba(0,0,0,.25); font-size: 23px; font-weight: 800; cursor: pointer; }
.skin-tools button:hover, .skin-tools button.active, .skin-tools .skin-tool-report:hover { color: var(--accent); transform: translateY(-1px); }
.emoji-row { position: absolute; z-index: 2; left: 8px; right: 8px; bottom: 10px; display: flex; justify-content: flex-start; flex-wrap: nowrap; gap: 5px; overflow-x: auto; overflow-y: hidden; padding: 2px 0 4px; pointer-events: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.emoji-row::-webkit-scrollbar { display: none; }
.emoji-chip { flex: 0 0 auto; }
.emoji-chip { min-width: 42px; height: 27px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--accent); border-radius: 14px; background: rgba(255,255,255,.94); color: #555; font-size: 15px; }
.emoji-chip b { font-size: 12px; font-weight: 600; }
.skin-stats { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 44px; color: #707070; font-size: 28px; }
.skin-stats span { display: inline-flex; align-items: center; gap: 7px; }
.skin-stats b { font-size: 17px; }
.skin-download { min-height: 58px; padding: 0 24px; display: flex; align-items: center; justify-content: center; gap: 28px; border-radius: 12px; background: var(--accent); color: #fff; text-decoration: none; font-size: 25px; font-weight: 900; box-shadow: 0 7px 14px rgba(0,0,0,.22); }
.skin-download span { font-size: 34px; line-height: 1; }
.skin-side-column { display: grid; gap: 28px; }
.skin-side-column h3 { margin: 0 0 14px; color: #666; font-size: 23px; }
.skin-description, .skin-source { min-height: 270px; padding: 18px; display: flex; align-items: center; justify-content: center; overflow-wrap: anywhere; background: #e5e5e5; color: #666; line-height: 1.5; border-radius: 14px; }
.skin-source { min-height: 230px; }
.skin-source img { max-width: 100%; max-height: 230px; image-rendering: pixelated; }
.viewer-error { position: absolute; inset: 45% 20px auto; z-index: 4; margin: 0; text-align: center; color: #b33; }

@media (max-width: 760px) {
    .skin-detail-page { width: 92%; }
    .skin-detail-page > .ad { margin-top: 28px; }
    .skin-title-block { margin: 28px 2px 12px; }
    .skin-title-block h2 { font-size: 23px; }
    .skin-title-block p { font-size: 16px; }
    .skin-layout { grid-template-columns: 1fr; gap: 30px; }
    .skin-viewer-card { min-height: 0; aspect-ratio: 1 / 1; }
    #skin_container { width: 100% !important; height: 100% !important; }
    .skin-tools { top: 12px; right: 12px; gap: 8px; }
    .skin-tools button, .skin-tools .skin-tool-report { width: 40px; height: 40px; font-size: 20px; }
    .emoji-row { left: 5px; right: 5px; bottom: 8px; gap: 3px; }
    .emoji-chip { min-width: 35px; height: 24px; padding: 0 5px; font-size: 13px; }
    .emoji-chip b { font-size: 10px; }
    .skin-stats { gap: 30px; font-size: 25px; }
    .skin-download { min-height: 54px; font-size: 21px; }
    .skin-side-column { gap: 25px; }
    .skin-side-column h3 { font-size: 20px; }
    .skin-description { min-height: 250px; }
    .skin-source { width: min(230px, 100%); min-height: 210px; margin: auto; }
}

/* Skin detail refinements v14 */
.skin-title-block h2 { margin-bottom: 0; }
.skin-tools button img, .skin-tools .skin-tool-report img { width: 25px; height: 25px; display: block; }
.skin-tools button, .skin-tools .skin-tool-report { color: #6b6b6b; text-decoration: none; }
.skin-tools button.active { color: var(--accent); }
.skin-stats span { color: #222; }
.skin-stats img { width: 30px; height: 30px; display: block; color: #707070; }
.skin-download img { width: 34px; height: 34px; color: #fff; }
.skin-description {
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
}
@media (max-width: 760px) {
    .skin-tools button img, .skin-tools .skin-tool-report img { width: 23px; height: 23px; }
    .skin-stats img { width: 28px; height: 28px; }
    .skin-download img { width: 31px; height: 31px; }
}

/* Cookie consent */
.cookie-consent[hidden], .cookie-settings[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    z-index: 2000;
    left: 18px;
    right: 18px;
    bottom: 18px;
    max-width: 1040px;
    margin: auto;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 2px solid var(--accent);
    border-radius: 12px;
    background: rgba(255,255,255,.98);
    color: #222;
    box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.cookie-copy h2 { margin: 0 0 5px; font-size: 18px; color: #333; }
.cookie-copy p { margin: 0; max-width: 650px; font-size: 13px; line-height: 1.45; }
.cookie-copy a { color: var(--accent-dark); font-weight: 700; }
.cookie-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.cookie-actions button, .cookie-save {
    min-height: 39px;
    padding: 9px 14px;
    border-radius: 7px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.cookie-primary { border: 2px solid var(--accent); background: var(--accent); color: #fff; }
.cookie-secondary { border: 2px solid #ddd; background: #fff; color: #333; }
.cookie-settings { position: fixed; z-index: 2100; inset: 0; display: grid; place-items: center; padding: 18px; }
.cookie-settings-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.58); }
.cookie-settings-dialog {
    position: relative;
    z-index: 1;
    width: min(510px, 100%);
    padding: 26px;
    border: 3px solid var(--accent);
    border-radius: 12px;
    background: #fff;
    color: #222;
    box-shadow: 0 22px 70px rgba(0,0,0,.38);
}
.cookie-settings-dialog h2 { margin: 0 36px 18px 0; }
.cookie-settings-close { position: absolute; right: 13px; top: 9px; border: 0; background: none; font-size: 31px; cursor: pointer; }
.cookie-option { padding: 13px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid #e8e8e8; }
.cookie-option span { display: grid; gap: 3px; }
.cookie-option small { color: #666; line-height: 1.35; }
.cookie-option input { width: 20px; height: 20px; accent-color: var(--accent); }
.cookie-option-locked { opacity: .72; }
.cookie-save { width: 100%; margin-top: 15px; }
.cookie-settings-open { overflow: hidden; }
.cookie-manage { border: 0; background: none; color: #fff; font: inherit; font-weight: inherit; text-decoration: underline; cursor: pointer; }

/* Legal pages */
.legal-page { max-width: 850px; padding: 28px 30px; background: #fff; border: 2px solid var(--accent); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); color: #333; }
.legal-page h1 { margin-top: 0; }
.legal-page h2 { margin-top: 26px; }
.legal-page p, .legal-page li { line-height: 1.6; }
.legal-page a { color: var(--accent-dark); }

@media (max-width: 650px) {
    .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 15px; display: block; }
    .cookie-actions { margin-top: 13px; justify-content: stretch; }
    .cookie-actions button { flex: 1 1 130px; }
    .cookie-settings-dialog { padding: 22px 18px; }
    .legal-page { padding: 20px 17px; }
}
