/* ===== 스티커 갤러리 모달 (iOS Safari 폴백 + SNS 공유 폴백) =====
 * 사용처: getsticker.html (downloadCheckedStickers / shareCheckedStickers)
 * 목적:
 *  - iOS Safari는 다중 자동 다운로드를 차단하므로 모든 스티커를 한 화면에 띄우고
 *    "길게 눌러 → 이미지 저장"으로 받게 한다.
 *  - SNS 공유 폴백(Web Share 미지원/거부) 시에도 동일 모달을 사용한다.
 */
.sticker-gallery-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.78);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.sticker-gallery-modal-box {
    position: relative;
    background: #1c1530;
    color: #fff;
    border-radius: 16px;
    border: 1px solid rgba(183, 78, 145, 0.4);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 22px 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.sticker-gallery-close {
    position: absolute;
    top: 8px; right: 12px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
}
.sticker-gallery-modal-header h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #f5b7d8;
}
.sticker-gallery-modal-header p {
    margin: 6px 0;
    font-size: 13px;
    color: #ddd;
    line-height: 1.5;
}
.sticker-gallery-modal-hint {
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid #b74e91;
    padding: 8px 10px;
    margin-top: 10px !important;
    border-radius: 6px;
    font-size: 12px !important;
    color: #f0d4e7 !important;
}
.sticker-gallery-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0 14px;
}
.sticker-gallery-cell {
    position: relative;
    background:
        repeating-conic-gradient(#2a2440 0% 25%, #1f1933 0% 50%) 50% / 16px 16px;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.sticker-gallery-cell img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.sticker-gallery-dl {
    position: absolute;
    bottom: 4px; right: 4px;
    background: rgba(183, 78, 145, 0.92);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
}
.sticker-gallery-dl:hover {
    background: #b74e91;
}
.sticker-gallery-modal-footer {
    text-align: right;
    margin-top: 8px;
}
.sticker-gallery-confirm {
    background: linear-gradient(90deg, #b74e91 0%, #5e42a6 100%);
    border: 0;
    color: #fff;
    padding: 8px 22px;
    border-radius: 22px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
}
@media (max-width: 480px) {
    .sticker-gallery-modal-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .sticker-gallery-modal-box { padding: 24px 16px 16px; }
}

/* ===== 다운로드 후 투명 배경 보존 토스트 (데스크톱·Android) ===== */
.sticker-transparency-tip {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2a1f3d 0%, #1c1530 100%);
    color: #fff;
    padding: 14px 44px 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(183, 78, 145, 0.5);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 100001;
    max-width: 460px;
    width: calc(100% - 32px);
    animation: stickerTipFadeIn 0.3s ease-out;
}
@keyframes stickerTipFadeIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
.sticker-tip-title {
    font-size: 14px;
    font-weight: 700;
    color: #f5b7d8;
    margin-bottom: 6px;
}
.sticker-tip-body {
    font-size: 12.5px;
    color: #e8d4ee;
    line-height: 1.5;
}
.sticker-tip-body b {
    color: #fff;
    background: rgba(183, 78, 145, 0.35);
    padding: 1px 5px;
    border-radius: 4px;
}
.sticker-tip-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    opacity: 0.7;
}
.sticker-tip-close:hover { opacity: 1; }
