/* Collections (track collections/): the tile of a part (the "Коллекции" tab of inf.php, the loot box show) */

/* [1] RARITY - own tokens of the module (decision 7 - exception from the palette of theme.css). ember - collection
   parts, "Огненный янтарь" of background-palettes.json; legendary, mythic - boxes and parcels of the opening show,
   rarity-legendary.svg and rarity-mythic.svg of halloween-shop.html */
.cl-rarity-ember { --cl-center: #ef730c; --cl-edge: #361006; --cl-rim: #ffb75b; }
.cl-rarity-legendary { --cl-center: #d79a2b; --cl-edge: #351b08; --cl-rim: #edbf62; }
.cl-rarity-mythic { --cl-center: #b92836; --cl-edge: #29090e; --cl-rim: #f16d72; }

/* [2] TILE - 80x80, the picture is a background set by JS when the tab opens (collections-tab.js) */
.cl-tile {
    position: relative;
    display: block;
    width: 80px;
    height: 80px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: transparent;
    box-sizing: border-box;
}
.cl-tile.is-found {
    background:
        linear-gradient(to bottom, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.15)),
        radial-gradient(circle closest-side, var(--cl-center), color-mix(in srgb, var(--cl-center) 60%, var(--cl-edge)) 62%, var(--cl-edge));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cl-rim) 65%, transparent);
}
.cl-tile:not(.is-found) {
    box-shadow: inset 0 0 0 1px var(--border, #c8c2bb);
}
.cl-tile .cl-img {
    display: block;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
}
.cl-tile:not(.is-found) .cl-img { opacity: 0.48; }
/* Animation - a layer over the static picture, shown by opacity: the static one never disappears (no blink) */
.cl-tile .cl-anim {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}
.cl-tile.is-animating .cl-anim { opacity: 1; }
/* The animated frames are transparent around the figure: the static one is hidden once the layer is fully shown
   (else it shows through) and comes back at once when the layer starts to fade */
.cl-tile .cl-img { transition: visibility 0s; }
.cl-tile.is-animating .cl-img { visibility: hidden; transition: visibility 0s linear 0.15s; }

/* [3] TAB of inf.php: tab buttons in the header of the gifts block, the grid of a collection */
.data h3 .cl-tab {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.data h3 .cl-tab + .cl-tab { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--border, #c8c2bb); }
.data h3 .cl-tab.is-active { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
/* Inactive - bold as the active one (no width jump on switching), only muted */
.data h3 .cl-tab:not(.is-active) { color: var(--text-muted, #6e6560); }
.data h3 .cl-tab:hover, .data h3 .cl-tab:focus-visible { color: var(--text, #2a2624); }
.data h3 .cl-tab + .item.achieve { margin-left: 10px; }

/* The block shows one panel: gifts (block-content, collapse) or collections */
.cl-tabs .cl-panel { display: none; }
.cl-tabs.cl-show-collections .cl-panel { display: block; }
.cl-tabs.cl-show-collections > .block-content,
.cl-tabs.cl-show-collections > .collapse,
.cl-tabs.cl-show-collections > .bottom-overlay { display: none; }

.cl-panel { padding: 12px 15px; }
/* A collection - as wide as its grid, centered; the title and the counter over the grid (preview (8).html); a line
   under it parts it from the next collection */
.cl-collection {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 4px 0 6px;
    box-sizing: border-box;
}
.cl-collection:not(:last-child) {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border, #c8c2bb);
}
.cl-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border, #c8c2bb);
    font-size: 16px;
    font-weight: bold;
    color: var(--text, #2a2624);
}
.cl-count { font-size: 12px; font-weight: normal; white-space: nowrap; color: var(--text-muted, #6e6560); }
.cl-grid {
    display: grid;
    grid-template-columns: repeat(5, 80px);
    gap: 8px;
    justify-content: center;
}
.cl-grid .cl-tile { cursor: pointer; transition: box-shadow 0.12s ease; }
.cl-grid .cl-tile:focus-visible { outline: 2px solid var(--accent-tertiary, #6a4a8a); outline-offset: 2px; }

/* Hint of a part (#sp_tooltip of inf.php) */
#sp_tooltip .cl-tip-lore { font-style: italic; }
#sp_tooltip .cl-tip-meta { color: var(--text-muted, #6e6560); font-size: 12px; }

@media (max-width: 480px) {
    .cl-head { font-size: 14px; }
    .cl-grid { grid-template-columns: repeat(5, 56px); gap: 6px; }
    .cl-grid .cl-tile { width: 56px; height: 56px; }
}
