/* ==== 汎用パラパラビューア ==== */

/* ---外枠（card-grid右カラムに収まる枠）--- */
.ppv-wrapper {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: 12px;
    width: 100%;
    height: 180px;
    background: white;
}

/* 疑似枠線（内側に6px引っ込める） */
.ppv-wrapper::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid var(--line-color);
    border-radius: 12px;
    pointer-events: none;
    z-index: 2;
}

/* ---コンテナ（ppv-wrapperの子）--- */
.ppv-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 180px;
}

/* ---コマ画像 共通--- */
.ppv-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
}

/* 初期表示：0枚目だけ表示 */
.ppv-face-0 { opacity: 1; }

/* ---テキスト表示枠--- */
.ppv-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-sub);
    letter-spacing: 0.1em;
    padding: 0.3rem 0;
    background: rgba(250, 249, 245, 0.8);
    border-radius: 0 0 10px 10px;
    z-index: 3;
    transition: opacity 0.3s ease;
}

/* =====================
   エフェクト
===================== */
.ppv-effect {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ppv-ring {
    position: absolute;
    inset: 20%;
    border: 4px solid #7ba;
    border-radius: 50%;
    opacity: 0;
}
.ppv-ring2 { border-color: #9dc; }

.ppv-smoke {
    position: absolute;
    inset: 10%;
    background: radial-gradient(circle, rgba(150,150,150,0.3) 0%, rgba(150,150,150,0) 70%);
    opacity: 0;
    border-radius: 50%;
}

/* =====================
   アニメーション（.ppv-activeで起動）
===================== */
.ppv-container.ppv-active .ppv-face-0 { animation: ppv-frame-0 8s forwards; }
.ppv-container.ppv-active .ppv-face-1 { animation: ppv-frame-1 8s forwards; }
.ppv-container.ppv-active .ppv-face-2 { animation: ppv-frame-2 8s forwards; }
.ppv-container.ppv-active .ppv-face-3 { animation: ppv-frame-3 8s forwards; }

.ppv-container.ppv-active .ppv-ring  { animation: ppv-spin1 1s ease-in-out 2.5s; }
.ppv-container.ppv-active .ppv-ring2 { animation: ppv-spin2 1s ease-in-out 2.5s; }
.ppv-container.ppv-active .ppv-smoke { animation: ppv-puff  0.6s ease-out  2.5s; }

/* =====================
   キーフレーム
===================== */
@keyframes ppv-frame-0 {
    0%,  30% { opacity: 1; }
    40%, 100% { opacity: 0; }
}
@keyframes ppv-frame-1 {
    0%,  30% { opacity: 0; }
    40%, 60% { opacity: 1; }
    70%, 100% { opacity: 0; }
}
@keyframes ppv-frame-2 {
    0%,  40% { opacity: 0; transform: translateX(10px); }
    50%      { opacity: 1; }
    60%, 100% { opacity: 0; }
}
@keyframes ppv-frame-3 {
    0%,  60% { opacity: 0; transform: translateX(-10px); }
    70%      { opacity: 1; }
    80%, 100% { opacity: 0; }
}

@keyframes ppv-spin1 {
    0%   { transform: rotate(0deg)   scale(0.5); opacity: 0; }
    50%  { opacity: 1; }
    100% { transform: rotate(720deg) scale(1.2); opacity: 0; }
}
@keyframes ppv-spin2 {
    0%   { transform: rotate(0deg)    scale(0.8); opacity: 0; }
    50%  { opacity: 1; }
    100% { transform: rotate(-720deg) scale(1.4); opacity: 0; }
}
@keyframes ppv-puff {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(0.8); }
}
