@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@font-face {
    font-family: 'SF Pro Display';
    src: url('https://fonts.cdnfonts.com/s/59278/SFPRODISPLAYREGULAR.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('https://fonts.cdnfonts.com/s/59278/SFPRODISPLAYMEDIUM.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('https://fonts.cdnfonts.com/s/59278/SFPRODISPLAYBOLD.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body {
    background: 
        linear-gradient(
            -45deg,
            rgba(88, 28, 135, 0.15),  /* Глубокий фиолетовый */
            rgba(29, 185, 84, 0.15),   /* Зеленый */
            rgba(219, 39, 119, 0.15),  /* Розовый */
            rgba(45, 100, 245, 0.15)   /* Синий */
        ),
        #0f0f0f;
    background-size: 400% 400%;
    animation: gradient 25s ease infinite;
    color: #fff;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Стили для панели статистики */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px 0;
    position: relative;
}

.stat-card {
    background: rgba(24, 24, 24, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    text-align: left;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: #222222;
    transform: translateY(-2px);
}

.stat-card h3 {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 4px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.stat-card p {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Стили для кнопки добавления */
.add-gift-btn {
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: background-color 0.3s;
}

.add-gift-btn:hover {
    background-color: #45a049;
}

/* Стили для сетки подарков */
.gifts-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
    padding: 10px 0;
}

.gift-card {
    width: calc(50% - 20px);
    margin: 10px;
    min-width: 220px;
    box-sizing: border-box;
    background: rgba(24, 24, 24, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.gift-card:hover {
    transform: translateY(-5px);
    background: #222222;
}

.gift-card:hover .gift-label, .gift-card:hover .gift-value, .gift-card:hover .gift-name {
    background: linear-gradient(90deg, #fff 0%, #b3b3b3 50%, #fff 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2.2s infinite linear;
}

.gift-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #222222;
    padding: 10px;
    transition: all 0.3s ease;
}

.gift-info {
    padding: 20px;
}

.gift-name {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gift-name-status-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.gift-details {
    display: grid;
    gap: 0;
}

.gift-detail {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.gift-detail:last-child {
    border-bottom: none;
}

.gift-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    background: linear-gradient(90deg, #fff 0%, #b3b3b3 50%, #fff 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2.2s infinite linear;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.gift-value {
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.gift-value svg {
    vertical-align: middle;
    position: relative;
    top: -1.5px;
    margin-left: 2px;
    display: inline;
}

.gift-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 15px 20px;
    background: #222222;
    border-top: 1px solid #333;
    text-align: center;
}

.action-btn {
    height: 36px;
    border: none;
    border-radius: 36px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.2s ease;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    white-space: nowrap;
    line-height: 36px;
    letter-spacing: 0.08px;
}

.action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #fff;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.action-btn:hover svg {
    opacity: 1;
}

.edit-btn {
    background-color: #282828;
}

.edit-btn:hover {
    background-color: #333;
}

.delete-btn {
    background-color: #282828;
}

.delete-btn:hover {
    background-color: #333;
}

/* Стили для модального окна */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(24, 24, 24, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 90vh;
    overflow-y: auto;
    margin: 0;
    /* Скрыть скроллбар */
    scrollbar-width: none; /* Firefox */
}
.modal-content::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: #fff;
}

/* Стили для формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #999;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 1rem;
    background: #222222;
    color: #fff;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #666;
    outline: none;
    background: #2a2a2a;
}

.submit-btn {
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* Стили для загрузки файлов */
.file-input-container {
    position: relative;
    margin-bottom: 10px;
}

.file-input-container input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-preview {
    border: 2px dashed #333;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #222222;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.file-preview:hover {
    border-color: #4CAF50;
    background: #2a2a2a;
}

.file-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.file-preview p {
    color: #999;
    margin: 0;
}

.file-preview.has-file {
    border-style: solid;
    border-color: #4CAF50;
}

/* Стили для кнопки добавления */
.add-gift-card {
    background: #181818;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    min-height: 200px;
    border: 2px dashed #333;
}

.add-gift-card:hover {
    transform: translateY(-5px);
    background: #222222;
    border-color: #4CAF50;
}

.add-gift-button {
    height: 53px;
    width: 53px;
    padding: 0;
    border-radius: 12px;
    background: rgba(24, 24, 24, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-size: 24px;
}

.add-gift-button:hover {
    background: rgba(24, 24, 24, 0.9);
    border-color: #1db954;
    color: #1db954;
    transform: translateY(-1px);
}

.add-gift-button svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.currency-toggle-button {
    height: 53px;
    width: 53px;
    padding: 0;
    border-radius: 12px;
    background: rgba(24, 24, 24, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 600;
    margin-left: 0;
}

.currency-toggle-button:hover {
    background: rgba(24, 24, 24, 0.9);
    border-color: #1db954;
    color: #1db954;
    transform: translateY(-1px);
}

.currency-toggle-button.active {
    background: rgba(29, 185, 84, 0.2);
    border-color: #1db954;
    color: #1db954;
}

.currency-toggle-button svg {
    width: 28px;
    height: 28px;
    display: block;
    margin: 0 auto;
    vertical-align: middle;
}

.currency-toggle-button span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.gift-image-wrapper {
    position: relative;
}

.gift-status {
    position: absolute;
    top: 10px;
    right: 10px;
    transform: none;
    z-index: 2;
    font-size: 0.98rem;
    font-weight: 500;
    padding: 4px 18px;
    border-radius: 16px;
    letter-spacing: 0.02em;
    user-select: none;
    transition: background 0.2s, color 0.2s;
    display: inline-block;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid transparent;
}

.gift-status-available {
    background: rgba(29, 185, 84, 0.18);
    color: #1db954;
    border: 1px solid #1db95433;
}

.gift-status-sold {
    background: rgba(180, 180, 180, 0.18);
    color: #bbb;
    border: 1px solid #bbb3;
}

.gift-status-no-skins {
    background: rgba(255, 107, 107, 0.18);
    color: #ff6b6b;
    border: 1px solid #ff6b6b33;
}

#giftStatus {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #222 url('data:image/svg+xml;utf8,<svg fill="%23999" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 8.293a1 1 0 011.414 0L10 9.586l1.293-1.293a1 1 0 111.414 1.414l-2 2a1 1 0 01-1.414 0l-2-2a1 1 0 010-1.414z"/></svg>') no-repeat right 12px center/18px 18px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: border 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    box-shadow: none;
    margin-top: 2px;
    max-height: 180px;
    overflow-y: auto;
}

#giftStatus:focus {
    border-color: #1db954;
    background-color: #232323;
}

#giftStatus option, #giftStatus optgroup {
    background: #181818;
    color: #fff;
    max-height: 36px;
    overflow-y: auto;
}

#skinStatus {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #222 url('data:image/svg+xml;utf8,<svg fill="%23999" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 8.293a1 1 0 011.414 0L10 9.586l1.293-1.293a1 1 0 111.414 1.414l-2 2a1 1 0 01-1.414 0l-2-2a1 1 0 010-1.414z"/></svg>') no-repeat right 12px center/18px 18px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: border 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    box-shadow: none;
    margin-top: 2px;
}

#skinStatus:focus {
    border-color: #1db954;
    background-color: #232323;
}

#skinStatus option, #skinStatus optgroup {
    background: #181818;
    color: #fff;
}

#editGiftStatus {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #222 url('data:image/svg+xml;utf8,<svg fill="%23999" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 8.293a1 1 0 011.414 0L10 9.586l1.293-1.293a1 1 0 111.414 1.414l-2 2a1 1 0 01-1.414 0l-2-2a1 1 0 010-1.414z"/></svg>') no-repeat right 12px center/18px 18px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: border 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    box-shadow: none;
    margin-top: 2px;
}

#editGiftStatus:focus {
    border-color: #1db954;
    background-color: #232323;
}

#editGiftStatus option, #editGiftStatus optgroup {
    background: #181818;
    color: #fff;
}

.skins-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    transform: none;
    background: rgba(40, 40, 40, 0.95);
    color: #fff;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 4px 18px;
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0;
    transition: background 0.2s, color 0.2s, border 0.2s;
    outline: none;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
    user-select: none;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
}

.skins-btn:hover {
    background: #1db954;
    color: #fff;
    border-color: #1db954;
}

.skins-modal-content, .add-skin-modal-content {
    max-width: 480px;
    width: 100%;
    padding: 28px 24px 24px 24px;
}
#skinsList {
    margin: 18px 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.skin-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(24, 24, 24, 0.85);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.07);
    padding: 14px 18px;
    gap: 18px;
    position: relative;
}
.skin-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: #222222;
    padding: 5px;
    transition: all 0.3s ease;
}

.skin-image-container {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: #222222;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.skin-image-container .skin-image,
.skin-image-container lottie-player,
.skin-image-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
    background: #222222;
    display: block;
}
.skin-info {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.skin-name {
    display: flex;
    align-items: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
}
.skin-name-text {
    flex: 1 1 0%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 30%;
}
.skin-status {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.02em;
    user-select: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}
.skin-status-available {
    background: rgba(29, 185, 84, 0.18);
    color: #1db954;
    border: 1px solid #1db95433;
}
.skin-status-sold {
    background: rgba(180, 180, 180, 0.18);
    color: #bbb;
    border: 1px solid #bbb3;
}
.skin-chance {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.02em;
    user-select: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    line-height: 1.4;
    background: rgba(45, 100, 245, 0.18);
    color: #2d64f5;
    border: 1px solid #2d64f533;
}
.skin-price {
    white-space: nowrap;
    flex-shrink: 0;
}
.skin-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    min-width: 72px;
    justify-content: flex-end;
}
.skin-edit-btn, .skin-delete-btn {
    background: rgba(40, 40, 40, 0.9);
    color: #fff;
    border: 1px solid #333;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
    outline: none;
    user-select: none;
    padding: 0;
}
.skin-edit-btn:hover {
    background-color: #1db954;
    border-color: #1db954;
}
.skin-delete-btn:hover {
    background-color: #dc3545;
}

.emoji-pack-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.emoji-pack-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
}

.emoji-pack-input input:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.1);
}

.load-pack-btn {
    padding: 10px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.load-pack-btn:hover {
    background: #45a049;
}

.load-pack-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

/* Стили для поиска */
.search-container {
    margin: 20px 0;
    padding: 0;
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    margin: 0;
}

.search-input {
    width: 100%;
    padding: 16px 48px;
    background: rgba(24, 24, 24, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.search-input:focus {
    outline: none;
    border-color: #1db954;
    background: rgba(24, 24, 24, 0.9);
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.1);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 1;
}

.search-input:focus + .search-icon {
    color: #1db954;
}

.clear-search {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.clear-search:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.reset-preview-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    user-select: none;
    padding: 0;
    z-index: 3;
    opacity: 0;
}

.gift-image-wrapper:hover .reset-preview-btn {
    opacity: 1;
}

.reset-preview-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Стили для селектора GIF-файлов */
.gif-selector-container {
    margin-top: 10px;
}

.gif-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gif-selector::-webkit-scrollbar {
    width: 6px;
}

.gif-selector::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.gif-selector::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.gif-selector::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.gif-option {
    width: 89px;
    height: 89px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gif-option:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.gif-option.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.gif-option img,
.gif-option lottie-player,
.gif-option video {
    width: 72px !important;
    height: 72px !important;
    max-width: 72px !important;
    max-height: 72px !important;
    object-fit: contain;
    display: block;
}

.gif-option .gif-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.7rem;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gif-option:hover .gif-name {
    opacity: 1;
}

.sticker-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    border-radius: 8px;
    min-height: 80px;
}

.sticker-info {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-top: 10px;
}

.gif-option:hover .gif-name {
    color: #fff;
}

.selected-gif-preview {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-gif-preview img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    border-radius: 4px;
}

.selected-gif-preview p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.selected-gif-preview.has-selection {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
}

/* Адаптивность для селектора */
@media (max-width: 768px) {
    .gif-selector {
        gap: 8px;
    }
    
    .gif-option {
        width: 60px;
        height: 60px;
    }
    
    .gif-option .gif-name {
        font-size: 0.6rem;
    }
}

@media (max-width: 600px) {
    .gif-selector {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.sticker-media {
    width: 100%;
    height: 80px;
    object-fit: contain;
    background: transparent;
    transition: all 0.3s ease;
}

.gif-option:hover .sticker-media {
    transform: scale(1.1);
}

/* Стили для квадратного SVG в контейнере анимации */
#animation-container {
    width: 89px;
    height: 89px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#animation {
    width: 89px;
    height: 89px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#animation svg {
    width: 89px !important;
    height: 89px !important;
    max-width: 89px !important;
    max-height: 89px !important;
    object-fit: contain;
}

/* Стили для lottie-player в админке */
.admin-gift-image lottie-player {
    width: 89px !important;
    height: 89px !important;
    max-width: 89px !important;
    max-height: 89px !important;
}

/* Стили для изображений в админке */
.admin-gift-image img {
    width: 89px !important;
    height: 89px !important;
    object-fit: contain;
}

/* Анимация для спиннера загрузки */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.admin-skins-btn-card {
    background: #1db954;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
    display: block;
    width: 100%;
}
.admin-skins-btn-card:hover {
    background: #159943;
}

/* Стили для индикатора загрузки кнопки */
.loading-btn {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading-btn .btn-content {
    opacity: 0;
}

.loading-btn .loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: block;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Стили для кнопки "Добавить скин" в состоянии загрузки */
#addSkinBtn.loading {
    background: #666;
    cursor: not-allowed;
}

#addSkinBtn.loading .btn-content {
    opacity: 0;
}

#addSkinBtn.loading .loading-spinner {
    opacity: 1;
}

#skinCurrencyToggleBtn.currency-toggle-button {
    width: 46px;
    min-width: 46px;
    height: 46px;
    border-radius: 8px;
    margin-left: 8px;
    background: #232323;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
    padding: 0;
}

#skinCurrencyToggleBtn.currency-toggle-button:hover {
    background: #333;
}

#skinCurrencyToggleBtn span {
    font-size: 1.2em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#skinSellPriceGroup > div {
    display: flex;
    align-items: stretch;
    width: 100%;
}

#skinSellPrice {
    border-radius: 8px;
    margin-right: 0;
    height: 46px;
    flex: 1 1 0%;
    min-width: 0;
}

.safe-area {
    padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
}

/* Стили для панели пользователя */
.user-panel {
    background: rgba(24, 24, 24, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.user-info span {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}

.logout-btn {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.8);
    transform: translateY(-1px);
}

/* Новые стили для панели пользователя */
.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.telegram-btn {
    background: rgba(0, 136, 204, 0.1);
    border: 1px solid rgba(0, 136, 204, 0.3);
    color: #0088cc;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.telegram-btn:hover {
    background: rgba(0, 136, 204, 0.8);
    border-color: rgba(0, 136, 204, 0.5);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.telegram-btn:active {
    transform: translateY(-1px);
}

.telegram-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.telegram-btn:hover svg {
    transform: scale(1.1);
}

.telegram-btn span {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    body {
        padding-top: 160px; /* 20px (обычный padding) + 60px (отступ для приложения) */
    }
    
    .user-info {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .user-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .telegram-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .logout-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* Исправления для карточек подарков на мобильных */
    .gift-status {
        top: 5px;
        right: 5px;
        font-size: 0.85rem;
        padding: 3px 12px;
        height: 28px;
    }
    
    .skins-btn {
        bottom: 5px;
        left: 5px;
        font-size: 0.85rem;
        padding: 3px 12px;
        height: 28px;
    }
    
    .gift-image {
        height: 150px;
    }
    
    .gifts-grid {
        margin: -6px;
        padding: 6px 0;
    }
    .gift-card {
        width: 100%;
        min-width: 0;
        margin: 6px 0;
    }
}

@media (max-width: 480px) {
    .gifts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px 0;
    }
    
    .gift-status {
        top: 3px;
        right: 3px;
        font-size: 0.8rem;
        padding: 2px 8px;
        height: 24px;
    }
    
    .skins-btn {
        bottom: 3px;
        left: 3px;
        font-size: 0.8rem;
        padding: 2px 8px;
        height: 24px;
    }
    
    .gift-image {
        height: 120px;
    }
}