/* 基本ルールページ専用スタイル */

.basic-page {
    padding-top: 80px;
    padding-bottom: 100px;
    background-color: #ffffff;
    overflow-x: hidden;
}

.text-center {
    text-align: center;
}

.mt-5 {
    margin-top: 60px;
}

/* ヒーローセクション */
.basic-hero {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 50px;
}

.basic-title {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #000, #444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.basic-subtitle {
    font-size: 1.5rem;
    color: #888;
    font-weight: 700;
}

/* 共通セクションスタイル */
.basic-section {
    padding: 150px 0;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.basic-section h2 {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #111;
    margin-bottom: 20px;
    line-height: 1.4;
}

.bg-light {
    background-color: #fbfbfd;
    border-radius: 40px;
    margin: 0 20px;
}

/* スクロール連動アニメーションの補足 */
.fade-in-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* セクション1：ぷよの形グリッド */
.puyo-types-grid {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    flex-wrap: wrap;
}

.puyo-item {
    background: #fff;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.04);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.puyo-item:hover {
    transform: translateY(-20px) scale(1.05);
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

.puyo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* セクション2：消えるアニメーション */
.puyo-erase-demo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.erase-animation-container {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 40px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0,0,0,0.06);
    overflow: hidden;
}

.erase-img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

@keyframes popOut {
    0%, 45% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50%, 95% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes popIn {
    0%, 45% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
    50%, 95% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
}

.before-erase { animation: popOut 3s cubic-bezier(0.2, 0.8, 0.2, 1) infinite; }
.after-erase { animation: popIn 3s cubic-bezier(0.2, 0.8, 0.2, 1) infinite; }

/* --- ラベルとデモコンテナを縦に並べるラッパー --- */
.demo-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px; 
}

/* 1P / 2P 共通のラベルスタイル */
.player-label {
    font-size: 1.4rem; 
    font-weight: 900;
    color: #fff;
    padding: 8px 35px; 
    border-radius: 40px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    letter-spacing: 0.1em;
    display: inline-block;
}

.p1-label {
    background: #3498db; 
}

.p2-label {
    background: #e74c3c; 
}

/* セクション3：連鎖アニメーション */
.rensa-demo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center; 
    gap: 50px; 
    flex-wrap: wrap;
}

.rensa-animation-container,
.step-animation-container {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 40px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0,0,0,0.06);
    overflow: hidden;
}

.opponent-side {
    background: #fbfbfd;
}

.rensa-img,
.step-img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transform: translate(-50%, -50%);
    opacity: 0;
}

@keyframes rensaStep1 { 0%, 15% { opacity: 1; } 15.1%, 100% { opacity: 0; } }
@keyframes rensaStep2 { 0%, 15% { opacity: 0; } 15.1%, 30% { opacity: 1; } 30.1%, 100% { opacity: 0; } }
@keyframes rensaStep3 { 0%, 30% { opacity: 0; } 30.1%, 45% { opacity: 1; } 45.1%, 100% { opacity: 0; } }
@keyframes rensaStep4 { 0%, 45% { opacity: 0; } 45.1%, 60% { opacity: 1; } 60.1%, 100% { opacity: 0; } }
@keyframes rensaStep5 { 0%, 60% { opacity: 0; } 60.1%, 95% { opacity: 1; } 95.1%, 100% { opacity: 0; } }
@keyframes rensaStep6 {
    0%, 60% { opacity: 0; transform: translate(-50%, -80%) scale(0.9); }
    65%, 95% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    95.1%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.rensa-step-1 { animation: rensaStep1 5s infinite; }
.rensa-step-2 { animation: rensaStep2 5s infinite; }
.rensa-step-3 { animation: rensaStep3 5s infinite; }
.rensa-step-4 { animation: rensaStep4 5s infinite; }
.rensa-step-5 { animation: rensaStep5 5s infinite; }
.rensa-step-6 { animation: rensaStep6 5s infinite cubic-bezier(0.175, 0.885, 0.32, 1.275); }


/* セクション4：勝利・敗北デモ */
.win-lose-demo {
    display: flex;
    justify-content: center;
    align-items: center; 
    gap: 50px;
    flex-wrap: wrap;
}

.result-container {
    position: relative;
    width: 280px;  
    height: 420px; 
    padding: 25px; 
    border-radius: 40px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0,0,0,0.06);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease;
}

.result-container:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

.result-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* 「×」マークの強調スタイル */
.cross-mark {
    color: #e74c3c; 
    font-family: "Arial Black", Arial, sans-serif; 
    font-weight: 900;
    font-size: 1.3em;
    display: inline-block;
    transform: scale(1.3); 
    margin: 0 10px; 
}


/* ==========================================
   追加アニメーションセクション
   ========================================== */
.step-demo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center; 
    gap: 40px; 
    flex-wrap: wrap;
}

/* ゲージ溜めアニメーション（4ステップ） */
@keyframes gaugeStep1 { 0%, 24% { opacity: 1; } 24.1%, 100% { opacity: 0; } }
@keyframes gaugeStep2 { 0%, 24% { opacity: 0; } 24.1%, 49% { opacity: 1; } 49.1%, 100% { opacity: 0; } }
@keyframes gaugeStep3 { 0%, 49% { opacity: 0; } 49.1%, 74% { opacity: 1; } 74.1%, 100% { opacity: 0; } }
@keyframes gaugeStep4 { 0%, 74% { opacity: 0; } 74.1%, 95% { opacity: 1; } 95.1%, 100% { opacity: 0; } }

.gauge-step-1 { animation: gaugeStep1 4s infinite; }
.gauge-step-2 { animation: gaugeStep2 4s infinite; }
.gauge-step-3 { animation: gaugeStep3 4s infinite; }
.gauge-step-4 { animation: gaugeStep4 4s infinite; }

/* フィーバーインアニメーション（3ステップ） */
@keyframes feverInStep1 { 0%, 32% { opacity: 1; } 32.1%, 100% { opacity: 0; } }
@keyframes feverInStep2 { 0%, 32% { opacity: 0; } 32.1%, 65% { opacity: 1; } 65.1%, 100% { opacity: 0; } }
@keyframes feverInStep3 { 0%, 65% { opacity: 0; } 65.1%, 95% { opacity: 1; } 95.1%, 100% { opacity: 0; } }

.fever-in-step-1 { animation: feverInStep1 3s infinite; }
.fever-in-step-2 { animation: feverInStep2 3s infinite; }
.fever-in-step-3 { animation: feverInStep3 3s infinite; }

/* 連鎖の種 浮遊アニメーション */
@keyframes floatUpDown {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, -55%); }
}
.fever-seed-img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    animation: floatUpDown 3s ease-in-out infinite;
}

/* フィーバー連鎖アニメーション（7ステップ） */
@keyframes feverRensa1 { 0%, 13% { opacity: 1; } 13.1%, 100% { opacity: 0; } }
@keyframes feverRensa2 { 0%, 13% { opacity: 0; } 13.1%, 27% { opacity: 1; } 27.1%, 100% { opacity: 0; } }
@keyframes feverRensa3 { 0%, 27% { opacity: 0; } 27.1%, 41% { opacity: 1; } 41.1%, 100% { opacity: 0; } }
@keyframes feverRensa4 { 0%, 41% { opacity: 0; } 41.1%, 55% { opacity: 1; } 55.1%, 100% { opacity: 0; } }
@keyframes feverRensa5 { 0%, 55% { opacity: 0; } 55.1%, 69% { opacity: 1; } 69.1%, 100% { opacity: 0; } }
@keyframes feverRensa6 { 0%, 69% { opacity: 0; } 69.1%, 83% { opacity: 1; } 83.1%, 100% { opacity: 0; } }
@keyframes feverRensa7 { 0%, 83% { opacity: 0; } 83.1%, 95% { opacity: 1; } 95.1%, 100% { opacity: 0; } }

.fever-rensa-step-1 { animation: feverRensa1 6s infinite; }
.fever-rensa-step-2 { animation: feverRensa2 6s infinite; }
.fever-rensa-step-3 { animation: feverRensa3 6s infinite; }
.fever-rensa-step-4 { animation: feverRensa4 6s infinite; }
.fever-rensa-step-5 { animation: feverRensa5 6s infinite; }
.fever-rensa-step-6 { animation: feverRensa6 6s infinite; }
.fever-rensa-step-7 { animation: feverRensa7 6s infinite; }


/* ==========================================
   CTA（Call To Action）セクション
   ========================================== */
.cta-section {
    background: linear-gradient(180deg, #ffffff 0%, #f4f6f8 100%);
    padding-bottom: 200px; /* 最後のセクションは余白を大きく */
}

.cta-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #3498db, #9b59b6);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    padding: 20px 50px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(155, 89, 182, 0.4);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: pulseCTA 2.5s infinite;
}

.cta-text {
    position: relative;
    z-index: 2;
}

.cta-arrow {
    position: relative;
    z-index: 2;
    margin-left: 15px;
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

/* ボタン内の光が走るエフェクト */
.cta-button::after {
    content: '';
    position: absolute;
    top: 0; 
    left: -100%; 
    width: 50%; 
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    animation: shineCTA 3s infinite;
    z-index: 1;
}

.cta-button:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 40px rgba(155, 89, 182, 0.6);
    animation: none; /* ホバー時は脈打ちを止める */
}

.cta-button:hover .cta-arrow {
    transform: translateX(10px); /* 矢印が右にスライド */
}

@keyframes pulseCTA {
    0% { transform: scale(1); box-shadow: 0 10px 30px rgba(155, 89, 182, 0.4); }
    50% { transform: scale(1.03); box-shadow: 0 15px 40px rgba(155, 89, 182, 0.6); }
    100% { transform: scale(1); box-shadow: 0 10px 30px rgba(155, 89, 182, 0.4); }
}

@keyframes shineCTA {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .basic-title { font-size: 3rem; }
    .basic-section { padding: 80px 0; }
    .basic-section h2 { font-size: 2rem; }
    .puyo-types-grid { gap: 20px; }
    .puyo-item {
        width: 150px;
        height: 150px;
        padding: 20px;
    }
    .bg-light { margin: 0 10px; border-radius: 20px; }
    
    .demo-column { gap: 15px; }
    
    .player-label { 
        font-size: 1.1rem; 
        padding: 6px 25px; 
    }
    
    .erase-animation-container,
    .rensa-animation-container,
    .step-animation-container {
        width: 250px;
        height: 250px;
    }
    
    .rensa-demo-wrapper, 
    .win-lose-demo, 
    .step-demo-wrapper { gap: 30px; }
    
    .result-container {
        width: 220px;
        height: 330px;
        padding: 15px;
    }
    
    .cta-button {
        font-size: 1.2rem;
        padding: 15px 35px;
    }
}