/* ===================================
   映画風ワープ遷移アニメーション
   =================================== */

/* 遷移オーバーレイ - ベース */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    background: #000;
}

/* アクティブ時のワープエフェクト */
.page-transition-overlay.active {
    animation: warpTransition 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: all;
}

/* 放射状のモーションブラー用レイヤー */
.page-transition-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center,
            transparent 0%,
            transparent 10%,
            rgba(255, 255, 255, 0.05) 20%,
            rgba(255, 255, 255, 0.1) 30%,
            rgba(255, 255, 255, 0.2) 40%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0.6) 60%,
            rgba(255, 255, 255, 0.8) 70%,
            rgba(255, 255, 255, 0.95) 85%,
            #fff 100%);
    opacity: 0;
    transform: scale(0);
}

.page-transition-overlay.active::before {
    animation: radialBlur 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 光のストリーク（放射状の線） */
.page-transition-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-conic-gradient(from 0deg at 50% 50%,
            transparent 0deg,
            rgba(255, 255, 255, 0.3) 0.5deg,
            transparent 1deg,
            transparent 10deg);
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
}

.page-transition-overlay.active::after {
    animation: lightStreaks 0.6s ease-out forwards;
}

/* メインワープアニメーション */
@keyframes warpTransition {
    0% {
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }
}

/* 放射状ブラーのアニメーション */
@keyframes radialBlur {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    20% {
        opacity: 0.3;
        transform: scale(0.5);
    }

    60% {
        opacity: 0.8;
        transform: scale(2);
    }

    100% {
        opacity: 1;
        transform: scale(8);
    }
}

/* 光のストリークアニメーション */
@keyframes lightStreaks {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }

    30% {
        opacity: 0.6;
        transform: scale(1.5) rotate(45deg);
    }

    100% {
        opacity: 0;
        transform: scale(4) rotate(180deg);
    }
}

/* 吸い込まれるコンテンツエフェクト */
body.page-transitioning {
    overflow: hidden;
}

body.page-transitioning .app-container {
    animation: contentWarp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: center center;
}

@keyframes contentWarp {
    0% {
        transform: scale(1) translateZ(0);
        filter: blur(0);
    }

    30% {
        transform: scale(1.02) translateZ(0);
        filter: blur(0);
    }

    100% {
        transform: scale(0.3) translateZ(0);
        filter: blur(20px);
        opacity: 0;
    }
}

/* パーティクルは削除 - シンプルにワープ効果のみ */
.transition-particle {
    display: none;
}

/* フラッシュエフェクト用の追加レイヤー */
.warp-flash {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: #fff;
    opacity: 0;
    pointer-events: none;
}

.warp-flash.active {
    animation: flashBang 0.4s ease-out forwards;
    animation-delay: 0.4s;
}

@keyframes flashBang {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }
}

/* リンク要素のホバー効果 */
.app-card,
.info-entry-card,
a[href*=".html"] {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-card:hover,
.info-entry-card:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

/* 遷移中のカーソル */
body.page-transitioning * {
    cursor: wait !important;
    pointer-events: none !important;
}