/* ── ポップアップ広告モーダル ── */
.popup-ad-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    animation: popupFadeIn 0.35s ease forwards;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
@keyframes popupFadeIn {
    to { opacity: 1; }
}
.popup-ad-overlay.closing {
    animation: popupFadeOut 0.25s ease forwards;
}
@keyframes popupFadeOut {
    to { opacity: 0; }
}

.popup-ad-modal {
    position: relative;
    max-width: 420px; width: 100%;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    animation: popupSlideUp 0.35s 0.05s ease forwards;
}
@keyframes popupSlideUp {
    to { transform: scale(1) translateY(0); }
}

/* 閉じるボタン */
.popup-ad-close {
    position: absolute; top: 8px; right: 8px;
    width: 32px; height: 32px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none; border-radius: 50%;
    font-size: 1.1rem; line-height: 32px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s, transform 0.15s;
}
.popup-ad-close:hover {
    background: rgba(0,0,0,0.75);
    transform: scale(1.1);
}

/* 画像 */
.popup-ad-image {
    display: block; width: 100%; height: auto;
    cursor: pointer;
}
.popup-ad-image.no-link { cursor: default; }

/* メッセージ */
.popup-ad-message {
    padding: 0.8rem 1rem;
    font-size: 0.88rem;
    color: #444;
    text-align: center;
    line-height: 1.5;
    background: #fafafa;
}

/* 「今後表示しない」チェックボックス */
.popup-ad-dismiss {
    display: flex; align-items: center; justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: #f5f5f5;
    border-top: 1px solid #eee;
    font-size: 0.78rem; color: #888;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.popup-ad-dismiss:hover {
    background: #eee;
}
.popup-ad-dismiss input {
    width: 15px; height: 15px;
    accent-color: #10b981;
    cursor: pointer;
}

/* モバイル調整 */
@media (max-width: 480px) {
    .popup-ad-overlay { padding: 1rem; }
    .popup-ad-modal { max-width: 340px; }
}
