.sticker-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 15vh 16px 5vh 16px;
    z-index: 12000;
    backdrop-filter: none;
    overflow-y: auto;
    box-sizing: border-box;
}

.sticker-popup-content {
    background: #1a1a1a;
    color: #e6e6e6;
    border: 1px solid #444;
    box-shadow: none;
    padding: 0;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    border-radius: 0;
}

.sticker-popup-header {
    background: #1e1e1e;
    color: #ffffff;
    padding: 10px 14px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    flex-shrink: 0;
    gap: 8px;
    flex-wrap: wrap;
}

.sticker-popup-header h3 {
    color: #ffffff;
    font-size: 16px;
    margin: 0;
    border: none;
    padding: 0;
    font-weight: bold;
}

.sticker-popup-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sticker-popup-toolbar-btn {
    font-family: inherit;
    font-size: 11px;
    padding: 5px 8px;
    border-radius: 0;
    cursor: pointer;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #e6e6e6;
    line-height: 1.2;
    font-weight: bold;
}

.sticker-popup-toolbar-btn:hover {
    background: #333;
}

.sticker-popup-toolbar-btn-danger {
    background: #3a2a2a;
    border-color: #553333;
    color: #ffcccc;
}

.sticker-popup-toolbar-btn-danger:hover {
    background: #4a3333;
}

.sticker-popup-toolbar-btn-ok {
    background: #2a352a;
    border-color: #3d4d3d;
    color: #d8ffd8;
}

.sticker-popup-toolbar-btn-ok:hover {
    background: #334033;
}

.sticker-popup-close-modal {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #ffffff;
    width: 26px;
    height: 24px;
    line-height: 18px;
    padding: 0;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 16px;
}

.sticker-popup-close-modal:hover {
    background: #333;
}

.sticker-popup-body {
    padding: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: center;
    color: #e6e6e6;
    flex: 1 1 auto;
    min-height: 0;
}

.sticker-popup-hint {
    margin: 0 0 10px;
    font-size: 13px;
    color: #ffd66a;
    text-align: center;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 100%;
    text-align: initial;
}

.sticker-pack-title {
    grid-column: 1 / -1;
    color: #e6e6e6;
    font-size: 13px;
    margin: 8px 0 4px;
    padding: 8px 10px;
    background: #222;
    border: 1px solid #333;
    border-radius: 0;
    font-weight: bold;
}

.sticker-grid::-webkit-scrollbar {
    width: 8px;
}

.sticker-grid::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.sticker-grid::-webkit-scrollbar-thumb {
    background: #444;
}

.sticker-item {
    background: #2e2e2e;
    border-radius: 0;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    border: 1px solid #3a3a3a;
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.sticker-item:hover:not(.locked) {
    background: #383838;
    border-color: #555;
}

.sticker-item.enabled {
    border-color: #3d6640;
    background: #243024;
}

.sticker-item.enabled:hover {
    background: #2c3a2e;
}

.sticker-item.locked {
    background: #252525;
    cursor: not-allowed;
    opacity: 0.65;
}

.sticker-preview {
    width: 70px;
    height: 70px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.sticker-name {
    color: #e6e6e6;
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    overflow: hidden;
    padding-bottom: 2px;
}

.lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #888;
}

.more-stickers-item {
    border: 1px dashed #555 !important;
    background: #222 !important;
}

.sticker-silhouette {
    position: relative;
}

.silhouette {
    filter: brightness(0) opacity(0.35);
}

.screen-sticker {
    position: fixed !important;
    cursor: move;
    z-index: 1800 !important;
    user-select: none;
    pointer-events: auto;
    touch-action: pan-x pan-y;
    transition: transform 0.1s ease, opacity 0.2s;
    transform-origin: center;
    margin: 0 !important;
    padding: 0 !important;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.screen-sticker:hover {
    z-index: 1837 !important;
}

.screen-sticker:active {
    cursor: grabbing;
}

.screen-sticker.dragging {
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.5));
}

.sticker-box {
    cursor: pointer;
    transition: transform 0.2s ease;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: fixed;
    bottom: 16px;
    left: 16px;
    width: 110px;
    height: auto;
    z-index: 1800;
    pointer-events: auto;
}

.sticker-box:hover {
    transform: scale(1.05);
}

.sticker-box:active {
    transform: scale(0.95);
}

@media (max-width: 800px) {
    .screen-sticker {
        display: none !important;
    }

    .sticker-box {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .sticker-popup {
        padding: 15vh 12px 5vh 12px;
    }

    .sticker-popup-content {
        max-height: 85vh;
    }

    .sticker-grid {
        grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
        gap: 8px;
    }

    .sticker-item {
        padding: 6px;
        min-height: 92px;
    }

    .sticker-preview {
        width: 60px;
        height: 60px;
    }

    .sticker-name {
        font-size: 10px;
    }

    .sticker-popup-header h3 {
        font-size: 15px;
    }
}
