/*
 * Модуль «Подарки». Цвета — в переменных: never и standart берут оформление у самого шаблона
 * (блоки .block, заголовки), здесь только то, чего в шаблонах нет.
 * Раскладка: never — как на скриншотах giftbox (полоска цены слева внизу), standart — как на gvardiacs (плашки сверху и снизу).
 */
:root {
    --gifts-accent: #ff7591;
    --gifts-accent-dark: #c2556f;
    --gifts-primary: #4c6bff;
    --gifts-primary-2: #3a55d6;
    --gifts-ok: #1fb36c;
    --gifts-ok-2: #17a58f;
    --gifts-panel: #262a31;
    --gifts-card: #41454f;
    --gifts-card-hi: #4b4f59;
    --gifts-card-border: transparent;
    --gifts-modal: #30343b;
    --gifts-inner: rgba(255, 255, 255, .04);
    --gifts-text: #fff;
    --gifts-muted: #aeb4c2;
    --gifts-line: rgba(255, 255, 255, .09);
    --gifts-chip: #17181c;
    --gifts-field: rgba(0, 0, 0, .22);
    --gifts-tool: rgba(255, 255, 255, .08);
    --gifts-tool-hover: rgba(255, 255, 255, .16);
}

html.gifts-skin-never {
    --gifts-accent: #ff4fb8;
    --gifts-accent-dark: #a32c78;
    --gifts-primary: #ff4fb8;
    --gifts-primary-2: #c2379a;
    --gifts-panel: #131821;
    --gifts-card: #171d2a;
    --gifts-card-hi: #1d2536;
    --gifts-card-border: #1d2436;
    --gifts-modal: #131821;
    --gifts-inner: #0c101a;
    --gifts-muted: #9aa5bd;
    --gifts-line: #1d2436;
    --gifts-chip: #0c101a;
    --gifts-field: #0e121c;
    --gifts-tool: #ffffff0d;
    --gifts-tool-hover: #ffffff1a;
}

html.gifts-skin-standart {
    --gifts-accent: #ec29df;
    --gifts-accent-dark: #7b2cff;
    --gifts-primary: #b13be0;
    --gifts-primary-2: #7b2cff;
    --gifts-panel: #220829;
    --gifts-card: rgba(60, 20, 66, .72);
    --gifts-card-hi: rgba(97, 33, 89, .72);
    --gifts-card-border: rgba(236, 41, 223, .18);
    --gifts-modal: #220829;
    --gifts-inner: rgba(97, 33, 89, .28);
    --gifts-muted: #d9b8dc;
    --gifts-line: rgba(236, 41, 223, .38);
    --gifts-chip: #17051f;
    --gifts-field: #2a0b33;
    --gifts-tool: rgba(97, 33, 89, .75);
    --gifts-tool-hover: rgba(236, 41, 223, .45);
}

html.gifts-modal-open {
    overflow: hidden;
}

.gifts-page,
.gifts-page *,
.gifts-modal,
.gifts-modal *,
.gifts-block,
.gifts-block *,
.gifts-banner,
.gifts-banner * {
    box-sizing: border-box;
}

.gifts-ico {
    flex: none;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ——— Панель страницы. В never и standart фон и рамку даёт класс шаблона .block ——— */
.gifts-page {
    color: var(--gifts-text);
    margin-bottom: 20px;
}

html:not(.gifts-skin-never):not(.gifts-skin-standart) .gifts-page {
    padding: 24px;
    background: var(--gifts-panel);
    border: 1px solid var(--gifts-line);
    border-radius: 12px;
}

.gifts-page-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 30px;
}

.gifts-page-head h2 {
    position: relative;
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 4px 0 12px;
    color: var(--gifts-text);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    overflow-wrap: break-word;
    background: radial-gradient(38% 60% at 50% 50%, color-mix(in srgb, var(--gifts-accent) 42%, transparent) 0, transparent 100%);
}

.gifts-page-head h2::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gifts-accent) 30%, var(--gifts-accent) 70%, transparent);
}

.gifts-tool {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--gifts-tool);
    color: var(--gifts-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
}

.gifts-tool:hover,
.gifts-tool:focus {
    background: var(--gifts-tool-hover);
    color: var(--gifts-text);
    text-decoration: none;
}

html.gifts-skin-never .gifts-tool:hover,
html.gifts-skin-never .gifts-tool:focus {
    border-color: #5a2146;
}

.gifts-tool svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.gifts-tool--inv {
    background: var(--gifts-accent-dark);
    color: #fff;
}

.gifts-tool--inv:hover,
.gifts-tool--inv:focus {
    background: var(--gifts-accent);
    color: #fff;
}

.gifts-tool--inv .gifts-tool-count {
    background: rgba(0, 0, 0, .35);
}

.gifts-tool--round {
    width: 40px;
    padding: 0;
    border-radius: 50%;
}

.gifts-tool-count {
    min-width: 18px;
    padding: 2px 5px;
    border-radius: 9px;
    background: var(--gifts-accent);
    color: #fff;
    font-size: 11px;
    text-align: center;
}

.gifts-tool-count[hidden] {
    display: none;
}

.gifts-tools {
    display: flex;
    gap: 8px;
    flex: none;
}

.gifts-hint-row {
    position: relative;
    margin: 0 0 22px;
    padding: 0 42px;
    text-align: center;
}

.gifts-hint {
    margin: 0;
    color: var(--gifts-text);
    font-size: 14px;
}

.gifts-sound {
    position: absolute;
    top: 50%;
    right: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: var(--gifts-tool);
    color: var(--gifts-text);
    cursor: pointer;
}

.gifts-sound svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    vertical-align: middle;
}

.gifts-sound .gifts-sound-off {
    display: none;
}

.gifts-sound.is-off {
    color: var(--gifts-muted);
}

.gifts-sound.is-off .gifts-sound-on {
    display: none;
}

.gifts-sound.is-off .gifts-sound-off {
    display: inline;
}

.gifts-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--gifts-muted);
    padding: 34px 10px;
    font-size: 14px;
}

.gifts-loader {
    grid-column: 1 / -1;
    width: 34px;
    height: 34px;
    margin: 34px auto;
    border-radius: 50%;
    border: 3px solid var(--gifts-line);
    border-top-color: var(--gifts-accent);
    animation: gifts-spin .8s linear infinite;
}

@keyframes gifts-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ——— Магазин: карточки подарков (как на gvardiacs) ——— */
.gifts-store {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 50px 26px;
    padding: 10px 4px 22px;
}

.gifts-card {
    position: relative;
    display: block;
    height: 260px;
    border-radius: 12px;
    border: 1px solid var(--gifts-card-border);
    background: linear-gradient(154deg, var(--gifts-card-hi) 10%, var(--gifts-card) 60%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
    color: var(--gifts-text);
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.gifts-card:hover,
.gifts-card:focus {
    transform: translateY(-5px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
    color: var(--gifts-text);
    text-decoration: none;
}

.gifts-card-name {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    max-width: calc(100% - 30px);
    padding: 3px 12px;
    border-radius: 15px;
    background: radial-gradient(100% 100% at 50% 0, var(--gifts-accent) 0%, var(--gifts-accent-dark) 140%);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gifts-card-count {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 6px 9px;
    border-radius: 10px;
    background: var(--gifts-chip);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.gifts-bolt {
    display: inline-block;
    width: 8px;
    height: 13px;
    background: #ffb400;
    clip-path: polygon(60% 0, 0 58%, 42% 58%, 26% 100%, 100% 36%, 56% 36%);
}

.gifts-card-img {
    position: absolute;
    top: 14px;
    left: 12px;
    right: 12px;
    bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gifts-card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform .25s ease;
}

.gifts-card:hover .gifts-card-img img {
    transform: scale(1.04);
}

.gifts-card-price {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 50%);
    z-index: 2;
    min-width: 98px;
    max-width: calc(100% - 24px);
    padding: 11px 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: var(--gifts-accent-dark);
    box-shadow: 0 0 14px color-mix(in srgb, var(--gifts-accent) 45%, transparent);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html.gifts-skin-standart .gifts-card-price {
    background: linear-gradient(135deg, #7b2cff 0%, #ec29df 55%, #ff72a8 100%);
    border-color: transparent;
}

/* ——— never: как на скриншотах giftbox — цена полоской слева внизу, название сверху слева ——— */
html.gifts-skin-never .gifts-store {
    gap: 22px;
    padding: 0;
}

html.gifts-skin-never .gifts-card {
    height: 248px;
    overflow: hidden;
    border-radius: 15px;
    background: linear-gradient(160deg, var(--gifts-card-hi), var(--gifts-card) 70%);
    box-shadow: none;
}

html.gifts-skin-never .gifts-card:hover,
html.gifts-skin-never .gifts-card:focus {
    border-color: #5a2146;
    box-shadow: 0 8px 26px rgba(255, 79, 184, .16);
}

html.gifts-skin-never .gifts-card-name {
    top: 12px;
    left: 12px;
    transform: none;
    max-width: calc(100% - 92px);
    padding: 0;
    border-radius: 0;
    background: none;
    color: #ebebeb;
    font-size: 13px;
    font-weight: 600;
    line-height: 26px;
}

html.gifts-skin-never .gifts-card-count {
    top: 8px;
    right: 8px;
    border: 1px solid var(--gifts-line);
}

html.gifts-skin-never .gifts-card-img {
    top: 36px;
    left: 10px;
    right: 10px;
    bottom: 12px;
}

html.gifts-skin-never .gifts-card-price {
    left: 8px;
    bottom: 8px;
    transform: none;
    min-width: 58%;
    max-width: calc(100% - 16px);
    padding: 7px 28px 7px 10px;
    border: 0;
    border-radius: 8px 0 0 8px;
    background: linear-gradient(90deg, rgba(255, 79, 184, .92) 0, rgba(163, 44, 120, .75) 55%, rgba(163, 44, 120, 0) 100%);
    box-shadow: none;
    text-align: left;
}

/* ——— Страница подарка: сетка 5×3 ——— */
.gifts-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    perspective: 1200px;
}

.gifts-cell {
    --neon: #ff3b3b;
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1.42;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    appearance: none;
    color: inherit;
}

.gifts-cell[data-color="1"] { --neon: #ff3b3b; }
.gifts-cell[data-color="2"] { --neon: #2bff38; }
.gifts-cell[data-color="3"] { --neon: #3d8bff; }
.gifts-cell[data-color="4"] { --neon: #ff9d1c; }
.gifts-cell[data-color="5"] { --neon: #ff33b4; }

.gifts-cell-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .7s cubic-bezier(.2, .8, .25, 1);
}

.gifts-cell:hover .gifts-cell-inner,
.gifts-cell:focus-visible .gifts-cell-inner {
    transform: translateY(-4px);
}

.gifts-cell.is-flipped .gifts-cell-inner {
    transform: rotateY(180deg);
}

.gifts-cell-front,
.gifts-cell-back {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 3px solid var(--neon);
    background: #1b1c24;
    box-shadow: 0 0 14px var(--neon), inset 0 0 12px rgba(0, 0, 0, .55);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

html.gifts-skin-never .gifts-cell-front,
html.gifts-skin-never .gifts-cell-back {
    background: #0c101a;
}

.gifts-cell-front img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    transition: transform .25s ease;
}

.gifts-cell:hover .gifts-cell-front img {
    transform: scale(1.06);
}

.gifts-cell-back {
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    transform: rotateY(180deg);
    border-color: #ffd34d;
    box-shadow: 0 0 22px #ffd34d;
}

.gifts-cell-back img {
    flex: 1;
    min-height: 0;
    max-width: 100%;
    object-fit: contain;
}

.gifts-cell.is-opening .gifts-cell-inner {
    animation: gifts-shake .45s ease-in-out infinite;
}

@keyframes gifts-shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-2.5deg); }
    75% { transform: rotate(2.5deg); }
}

.gifts-grid.is-locked .gifts-cell {
    cursor: default;
}

.gifts-grid.is-locked .gifts-cell:not(.is-winner):not(.is-opening) {
    opacity: .4;
    filter: grayscale(.45);
    transition: opacity .3s, filter .3s;
}

.gifts-result {
    margin-top: 24px;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--gifts-line);
    background: var(--gifts-inner);
    text-align: center;
    animation: gifts-rise .35s ease;
}

.gifts-result[hidden] {
    display: none;
}

@keyframes gifts-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.gifts-result-title {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--gifts-text);
}

.gifts-result-lines .gifts-line {
    font-size: 15px;
}

.gifts-result-note {
    margin-top: 8px;
    color: var(--gifts-muted);
    font-size: 13px;
}

.gifts-line {
    color: var(--gifts-text);
    font-size: 13px;
    line-height: 1.45;
}

.gifts-line span {
    color: var(--gifts-muted);
}

.gifts-line.is-done {
    opacity: .55;
    text-decoration: line-through;
}

.gifts-rarity {
    flex: none;
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    white-space: nowrap;
    background: linear-gradient(90deg, #ff6b6b, #ff9a5a);
}

.gifts-rarity--legendary { background: linear-gradient(90deg, #ffb400, #ff7a00); }
.gifts-rarity--rare { background: linear-gradient(90deg, #b44dff, #ff4fb8); }
.gifts-rarity--uncommon { background: linear-gradient(90deg, #2d8bff, #33c7ff); }

/* ——— Окна ——— */
.gifts-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 10, 20, .6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: gifts-fade .15s ease;
}

@keyframes gifts-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gifts-modal-box {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 26px 26px 24px;
    border-radius: 18px;
    background: var(--gifts-modal);
    border: 1px solid var(--gifts-line);
    box-shadow: 0 18px 56px rgba(0, 0, 0, .5);
    color: var(--gifts-text);
    text-align: center;
}

.gifts-modal--wide .gifts-modal-box {
    max-width: 680px;
    text-align: left;
}

.gifts-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--gifts-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.gifts-modal-close:hover {
    color: var(--gifts-text);
    background: var(--gifts-tool-hover);
}

.gifts-modal-title {
    margin: 0 30px 14px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--gifts-text);
}

.gifts-modal-title.is-upper {
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
}

.gifts-modal--wide .gifts-modal-title {
    margin-left: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gifts-line);
}

.gifts-modal-text {
    margin: 6px 0 4px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gifts-text);
}

.gifts-modal-note {
    margin-top: 10px;
    font-size: 14px;
    color: var(--gifts-muted);
}

.gifts-price-mark {
    color: var(--gifts-accent);
    font-weight: 800;
}

.gifts-modal-question {
    font-size: 19px;
    font-weight: 800;
    color: var(--gifts-text);
}

.gifts-modal-icon {
    position: relative;
    width: 76px;
    height: 76px;
    margin: 4px auto 14px;
    border-radius: 20px;
    background: var(--gifts-tool-hover);
}

.gifts-modal-icon--clock {
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

html.gifts-skin-never .gifts-modal-icon--clock {
    background: linear-gradient(135deg, #ff4fb8, #7b4dff);
}

.gifts-modal-icon--clock::before {
    content: "";
    position: absolute;
    inset: 20px;
    border: 3px solid #fff;
    border-radius: 50%;
}

.gifts-modal-icon--clock::after {
    content: "";
    position: absolute;
    left: 37px;
    top: 27px;
    width: 12px;
    height: 12px;
    border-left: 3px solid #fff;
    border-bottom: 3px solid #fff;
}

.gifts-modal-icon--gift {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    line-height: 1;
}

.gifts-countdown {
    margin-top: 8px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #8ea3ff;
}

html.gifts-skin-never .gifts-countdown {
    color: #ff4fb8;
}

.gifts-modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.gifts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 132px;
    min-height: 42px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s;
}

.gifts-btn:hover {
    filter: brightness(1.1);
    text-decoration: none;
}

.gifts-btn:disabled {
    opacity: .55;
    cursor: wait;
}

.gifts-btn--primary {
    background: linear-gradient(135deg, var(--gifts-primary), var(--gifts-primary-2));
    color: #fff;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--gifts-primary) 28%, transparent);
}

.gifts-btn--primary:hover,
.gifts-btn--primary:focus {
    color: #fff;
}

.gifts-btn--light {
    background: var(--gifts-tool);
    border-color: var(--gifts-line);
    color: var(--gifts-text);
}

.gifts-btn--light:hover,
.gifts-btn--light:focus {
    color: var(--gifts-text);
}

html:not(.gifts-skin-never):not(.gifts-skin-standart) .gifts-btn--light {
    background: #eef2f7;
    color: #111827;
}

.gifts-btn--ok {
    background: linear-gradient(135deg, var(--gifts-ok), var(--gifts-ok-2));
    color: #fff;
}

/* ——— Инвентарь и история ——— */
.gifts-inv-item {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 14px;
    border: 1px solid var(--gifts-line);
    background: var(--gifts-inner);
}

.gifts-inv-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gifts-inv-img {
    flex: none;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--gifts-tool);
    overflow: hidden;
}

.gifts-inv-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gifts-inv-info {
    flex: 1;
    min-width: 0;
}

.gifts-inv-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--gifts-text);
    overflow-wrap: break-word;
}

.gifts-inv-lines {
    margin: 4px 0;
}

.gifts-inv-date {
    font-size: 12px;
    color: var(--gifts-muted);
}

.gifts-inv-actions {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gifts-inv-extra {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gifts-line);
}

.gifts-inv-extra:empty,
.gifts-inv-extra[hidden] {
    display: none;
}

.gifts-inv-extra-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.gifts-inv-extra-actions .gifts-btn {
    min-width: 110px;
}

.gifts-inv-done {
    color: #4ee59b;
    font-size: 14px;
    font-weight: 700;
}

.gifts-inv-error {
    color: #ff8080;
    font-size: 13px;
    margin-top: 6px;
}

.gifts-inv-error[hidden] {
    display: none;
}

.gifts-inv-note {
    font-size: 13px;
    color: var(--gifts-muted);
    margin-bottom: 8px;
}

.gifts-inv-key {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .25);
    color: var(--gifts-text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.gifts-inv-key p {
    margin: 0 0 6px;
}

.gifts-field {
    display: block;
    margin: 0 0 8px;
}

.gifts-field > span {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gifts-text);
}

.gifts-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--gifts-line);
    background: var(--gifts-field);
    color: var(--gifts-text);
    font-size: 14px;
    outline: none;
}

.gifts-input:focus {
    border-color: var(--gifts-accent);
}

.gifts-field-error {
    display: block;
    margin-top: 4px;
    color: #ff8080;
    font-size: 12px;
    font-style: normal;
}

.gifts-hist-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gifts-line);
}

.gifts-hist-row:last-child {
    border-bottom: 0;
}

.gifts-hist-name {
    flex: 0 0 170px;
    min-width: 0;
}

.gifts-hist-name b {
    display: block;
    font-size: 14px;
    color: var(--gifts-text);
    overflow-wrap: break-word;
}

.gifts-hist-name span {
    display: block;
    font-size: 12px;
    color: var(--gifts-muted);
}

.gifts-hist-name .gifts-hist-price {
    color: var(--gifts-accent);
    font-weight: 700;
}

.gifts-hist-prize {
    flex: 1;
    min-width: 0;
    text-align: center;
}

/* ——— Блоки на главной и в профиле ——— */
.gifts-block {
    color: var(--gifts-text);
}

html:not(.gifts-skin-never):not(.gifts-skin-standart) .gifts-block {
    padding: 20px;
    margin: 0 0 20px;
    border-radius: 14px;
    background: var(--gifts-panel);
    border: 1px solid var(--gifts-line);
}

.gifts-block[hidden],
.gifts-banner[hidden] {
    display: none;
}

/* профиль never: вкладка — растягивающийся flex, без этого блок вытягивается на всю её высоту */
#information > .gifts-block,
#information > .gifts-banner {
    width: 100%;
    align-self: flex-start;
}

.gifts-block-title {
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 800;
    color: var(--gifts-text);
}

.gifts-mini-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.gifts-mini {
    min-width: 0;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--gifts-card-border);
    background: linear-gradient(154deg, var(--gifts-card-hi) 10%, var(--gifts-card) 60%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

.gifts-mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.gifts-mini-head .gifts-rarity {
    padding: 2px 6px;
    font-size: 9px;
}

.gifts-mini-name {
    flex: 1;
    min-width: 0;
    color: #ffb48a;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html.gifts-skin-never .gifts-mini-name {
    color: #ff8fd0;
}

.gifts-mini-img {
    height: 92px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gifts-mini-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gifts-mini-user {
    display: block;
    color: #a5b4d8;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gifts-mini-time {
    margin-top: 3px;
    color: #7ccf8f;
    font-size: 11px;
}

/* ——— Баннер ——— */
.gifts-banner {
    margin: 0 0 20px;
}

html.gifts-skin-never .gifts-banner {
    margin-bottom: 10px;
}

.gifts-banner-link {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-height: 130px;
    padding: 16px 18px;
    border-radius: 15px;
    border: 1px solid var(--gifts-card-border);
    overflow: hidden;
    background: var(--gifts-card);
    color: #fff;
    text-decoration: none;
    transition: border-color .2s;
}

.gifts-banner-link:hover,
.gifts-banner-link:focus {
    color: #fff;
    text-decoration: none;
    border-color: var(--gifts-accent);
}

.gifts-banner-img {
    position: absolute;
    inset: 0;
    background: center right / cover no-repeat;
    opacity: 0;
    transition: opacity .8s ease;
}

.gifts-banner-img.is-on {
    opacity: 1;
}

.gifts-banner-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, .78) 10%, rgba(0, 0, 0, .25) 75%);
}

/* таймер идёт — подарок пока недоступен: картинка приглушена, как на скриншоте */
.gifts-banner-link.is-waiting .gifts-banner-shade {
    background: rgba(12, 16, 26, .68);
}

.gifts-banner-link.is-waiting .gifts-banner-img {
    filter: grayscale(.55);
}

.gifts-banner-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 88%;
}

.gifts-banner-content b {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
}

.gifts-banner-content > span {
    font-size: 13px;
    line-height: 1.35;
    color: rgba(255, 255, 255, .85);
}

.gifts-banner-timer {
    position: relative;
    font-size: 11px;
    color: #fff;
}

.gifts-banner-timer i {
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
}

.gifts-banner-timer u {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .35);
    text-decoration: none;
    font-family: Consolas, "Courier New", monospace;
    font-weight: 700;
}

/* ——— Телефон ——— */
@media (max-width: 991.98px) {
    .gifts-store {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .gifts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .gifts-card {
        height: 220px;
    }

    html.gifts-skin-never .gifts-card {
        height: 220px;
    }

    .gifts-page-head h2 {
        font-size: 20px;
    }

    .gifts-inv-main {
        flex-wrap: wrap;
    }

    .gifts-inv-actions {
        flex-direction: row;
        width: 100%;
    }

    .gifts-inv-actions .gifts-btn {
        flex: 1;
        min-width: 0;
    }

    .gifts-hist-row {
        flex-wrap: wrap;
    }

    .gifts-hist-name {
        flex: 1 1 60%;
    }

    .gifts-hist-prize {
        flex-basis: 100%;
        text-align: left;
    }
}

@media (max-width: 479.98px) {
    .gifts-store {
        grid-template-columns: minmax(0, 1fr);
    }

    .gifts-card,
    html.gifts-skin-never .gifts-card {
        height: 250px;
    }

    .gifts-page-head {
        margin-bottom: 24px;
    }

    .gifts-page-head h2 {
        font-size: 19px;
    }

    /* в магазине standart кнопка инвентаря широкая: заголовок уходит на свою строку */
    .gifts-page-head--store {
        flex-wrap: wrap;
    }

    .gifts-page-head--store h2 {
        order: -1;
        flex: 0 0 100%;
    }

    .gifts-modal-title.is-upper {
        font-size: 20px;
    }

    .gifts-modal-box {
        padding: 22px 16px 18px;
    }

    .gifts-btn {
        min-width: 110px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gifts-cell-inner,
    .gifts-card,
    .gifts-card-img img,
    .gifts-cell-front img,
    .gifts-banner-img {
        transition: none;
    }

    .gifts-cell.is-opening .gifts-cell-inner {
        animation: none;
    }
}
