/* スプラッシュ画面 CSS */

/* オーバーレイ基本設定 */
#splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 99999;
    opacity: 1;
    transition: opacity 1000ms ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* フェードアウト */
#splash-overlay.fadeOut {
    opacity: 0;
    pointer-events: none;
}

/* スプラッシュコンテナ */
.splash-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ロゴ画面 */
.logo-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.logo {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1000ms ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo.fadein {
    opacity: 1;
    transform: translateY(0);
}

.logo.fadeOut {
    opacity: 0;
    transform: translateY(-20px);
}

.logo-image {
    max-width: 500px;
    max-height: 300px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 150, 200, 0.3));
    transition: all 1000ms ease-in-out;
}

.logo.fadein .logo-image {
    animation: logoGlow 2s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(0, 150, 200, 0.3));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(0, 150, 200, 0.6));
        transform: scale(1.02);
    }
}

/* 元のテキストロゴスタイルは削除 */
.logo h1 {
    display: none;
}

.logo .subtitle {
    display: none;
}

/* トレーラー画面 */
.trailer-screen {
    position: absolute;
    width: 90%;
    max-width: 1000px;
    height: 80%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: all 1000ms ease-in-out;
    z-index: 2;
    display: none; /* 初期状態で非表示 */
}

.trailer-screen.fadein,
.trailer-screen.op {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    display: block; /* 表示時に block に変更 */
}

/* 動画コンテナ */
.video-container {
    width: 100%;
    height: calc(100% - 80px);
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.youtube-player {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1000ms ease-in-out;
}

.youtube-player.fadein {
    opacity: 1;
}

.youtube-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 閉じるボタン */
.splash-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.splash-close.fadein {
    opacity: 1;
    transform: scale(1);
}

.splash-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.splash-close:active {
    transform: scale(0.95);
}

/* ツール（動画選択部分） */
.tool {
    position: absolute;
    bottom: 20px;
    width: 100%;
    height: 80px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0);
    transition: all 1000ms ease-in-out;
    z-index: 10;
}

.sub2 {
    display: flex !important;
    gap: 20px;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0);
    transition: all 1000ms ease-in-out;
}

.video-selector {
    background: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    outline: none;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.video-selector:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.video-selector.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.video-selector:active {
    transform: translateY(0);
}

/* bodyスクロール制御 */
body.splash-active {
    overflow: hidden;
    height: 100vh;
}

/* ローディング効果 */
@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.logo.fadein h1 {
    animation: pulse 2s ease-in-out infinite;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .logo-image {
        max-width: 300px;
        max-height: 150px;
    }
    
    .trailer-screen {
        width: 95%;
        height: 85%;
    }
    
    .splash-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .sub2 {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .video-selector {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 100px;
    }
    
    .tool {
        height: 120px;
    }
    
    .video-container {
        height: calc(100% - 120px);
    }
}

@media (max-width: 480px) {
    .logo-image {
        max-width: 250px;
        max-height: 125px;
    }
    
    .trailer-screen {
        width: 98%;
        height: 90%;
    }
    
    .splash-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高コントラスト対応 */
@media (prefers-contrast: high) {
    .logo h1 {
        color: #fff;
        text-shadow: 2px 2px 4px #000;
    }
    
    .video-selector {
        border-color: #fff;
        background: #000;
    }
    
    .splash-close {
        border-color: #fff;
        background: #000;
    }
}