/* PV用のスタイル設定 */
.pv-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}

#pv-container {
    position: relative;
    width: 800px;
    height: 600px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.pv-scene {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;    width: 100% !important;
    height: 100% !important;    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    color: white;
    text-align: center;
    visibility: hidden !important;
}

.pv-scene.active {
    opacity: 1 !important;
    z-index: 10;
    visibility: visible !important;
    display: flex !important;
}

.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.character {
    position: absolute;
    bottom: 20px;
    height: 400px;
    width: 300px;
    background-size: contain;
    background-position: bottom center;
    background-repeat: no-repeat;
    z-index: 5;
    animation: character-enter 1s ease-out forwards;
}

/* キャラクター名表示用のスタイル */
.character-name {
    position: absolute;
    bottom: 430px; /* キャラクターの上に表示 */
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
    transform: translateX(-50%);
    left: 50%;
    z-index: 20; /* 最前面に表示 */
    opacity: 0;
    animation: name-appear 0.8s ease-out forwards;
    animation-delay: 1s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* 読みやすさのための影を追加 */
}

@keyframes name-appear {
    from {
        transform: translateX(-50%) translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes character-enter {
    from { 
        transform: translateY(50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.dialogue {
    position: absolute;
    bottom: 100px; /* さらに上に移動して、コントロールボタンとの重なりを防ぐ */
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 15px 25px;
    font-size: 1.2rem;
    max-width: 80%;
    text-align: center;
    animation: dialogue-appear 1s ease-out forwards;
    animation-delay: 0.5s;
    opacity: 0;
    z-index: 15; /* 確実に他の要素より前面に表示 */
}

@keyframes dialogue-appear {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dialogue-center {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px 30px;
    font-size: 1.5rem;
    max-width: 80%;
    text-align: center;
    animation: fade-in 1.5s ease-out forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

#pv-title-screen, #pv-final {
    background: linear-gradient(135deg, #1E3A8A, #5B21B6);
    text-align: center;
}

#pv-title-screen h1, #pv-final h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #e60073, 0 0 40px #e60073;
    animation: title-glow 1.5s ease-in-out infinite alternate;
}

@keyframes title-glow {
    from { text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #e60073, 0 0 20px #e60073; }
    to { text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #ff4da6, 0 0 40px #ff4da6; }
}

.subtitle {
    font-size: 1.5rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.play-button {
    margin-top: 2rem;
    padding: 15px 40px;
    background-color: #E11D48;
    border-radius: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 1.5s infinite;
}

.play-button:hover {
    background-color: #F43F5E;
    transform: scale(1.05);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.characters-group {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    height: 300px;
    position: absolute;
    bottom: 100px;
}

.character-mini {
    width: 100px;
    height: 200px;
    margin: 0 5px;
    background-size: contain;
    background-position: bottom center;
    background-repeat: no-repeat;
    transform: scale(0);
    animation: pop-in 0.5s ease-out forwards;
}

.character-mini:nth-child(1) { animation-delay: 0.1s; }
.character-mini:nth-child(2) { animation-delay: 0.2s; }
.character-mini:nth-child(3) { animation-delay: 0.3s; }
.character-mini:nth-child(4) { animation-delay: 0.4s; }
.character-mini:nth-child(5) { animation-delay: 0.5s; }
.character-mini:nth-child(6) { animation-delay: 0.6s; }

@keyframes pop-in {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

#pv-controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 100;
}

#pv-controls button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    background-color: rgba(30, 64, 175, 0.8);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#pv-controls button:hover {
    background-color: rgba(59, 130, 246, 0.9);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* 背景のオーバーレイ */
.pv-scene::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 50%);
    z-index: 1;
    pointer-events: none;
}

/* 動画要素のスタイル */
.video-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    opacity: 0.6;
    animation: particleAnimation 15s infinite linear;
}

@keyframes particleAnimation {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-20vh) translateX(50px);
        opacity: 0;
    }
}

.character-animation {
    animation: character-float 3s ease-in-out infinite;
}

@keyframes character-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.cloud-animation {
    position: absolute;
    opacity: 0.7;
    animation: cloud-drift 20s infinite linear;
}

@keyframes cloud-drift {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ハートエフェクト */
.heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ff4081"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') no-repeat center center;
    background-size: contain;
    pointer-events: none;
    opacity: 0;
    animation: heart-float 4s ease-in-out forwards;
}

@keyframes heart-float {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.5);
    }
    20% {
        opacity: 0.8;
    }
    80% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1.5);
    }
}

/* テック記号のエフェクト */
.tech-symbol {
    position: absolute;
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    opacity: 0;
    animation: symbol-rotate 6s ease-in-out forwards;
}

@keyframes symbol-rotate {
    0% {
        opacity: 0;
        transform: rotate(0deg) scale(0.5);
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(360deg) scale(1.5);
    }
}

/* ビデオシーンの特殊なテキスト */
.video-text {
    position: absolute;
    color: white;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    z-index: 3;
    opacity: 0;
    animation: text-appear 1s forwards;
}

@keyframes text-appear {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.dramatic-scene {
    position: relative;
    overflow: hidden;
}

.dramatic-scene::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    animation: pulse 5s infinite alternate;
    z-index: 2; /* 重なり順を明示的に設定 */
}

/* テキストが見えないことがあるので高めにする */
.dramatic-scene .dialogue-center {
    position: relative;
    display: block !important;
    z-index: 30 !important;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    margin-bottom: 50px;
    max-width: 80%;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    font-weight: bold;
    font-size: 1.2rem;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.3;
    }
}

/* 音符エフェクト */
.music-note {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 3;
    opacity: 0.8;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
}

.music-notes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* 浮遊ハートエフェクト */
.floating-heart {
    position: absolute;
    width: 15px;
    height: 15px;
    z-index: 3;
    filter: drop-shadow(0 0 3px rgba(255, 64, 129, 0.7));
    pointer-events: none;
}

.floating-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* キラキラエフェクト */
.sparkle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
