/* 基本スタイル */
body {
    font-family: 'Helvetica Neue', 'Hiragino Kaku Gothic ProN', 'Meiryo', 'Arial', sans-serif;
    background-color: #F0F2F5; /* 明るいグレー */
    color: #333; /* 基本テキスト色 */
    margin: 0;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column; /* ▼▼▼【修正】横並びから縦積みに変更 */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box; /* ▼▼▼【追加】パディングを高さに含める */
}

#main-container {
    max-width: 800px;
    width: 100%;
    position: relative;
}

/* ヘッダー */
header h1 {
    font-size: 2.5em;
    color: #3A5FCD; /* メインの濃いブルー */
    margin-bottom: 0;
    text-shadow: none;
}
header p {
    font-size: 1.2em;
    color: #667;
    margin-top: 5px;
}

/* ステップ共通 */
.step {
    display: none;
    background-color: #FFFFFF;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5EAF0;
}
.step.active {
    display: block;
}
.content h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
}

/* ボタンスタイル */
.btn, .gate-btn {
    display: inline-block;
    background-color: #3A5FCD; /* メインの濃いブルー */
    color: #FFFFFF;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(58, 95, 205, 0.2);
}
.btn:hover {
    background-color: #3252a8; /* 少し暗いブルー */
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(58, 95, 205, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: #3A5FCD;
    border: 2px solid #3A5FCD;
    box-shadow: none;
    padding: 10px 20px; /* サイズを調整 */
    font-size: 1em;     /* サイズを調整 */
}
.btn-secondary:hover {
    background-color: #3A5FCD;
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(58, 95, 205, 0.2);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.button-group-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.note {
    font-size: 1em;
    color: #555;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* Step 2: DVDリスト */
#dvd-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    max-height: 40vh;
    overflow-y: auto;
    text-align: left;
    padding: 15px;
    background-color: #F8F9FA;
    border-radius: 8px;
    border: 1px solid #E5EAF0;
}
.dvd-item {
    display: flex;
    align-items: baseline;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.2s;
}
.dvd-item input[type="checkbox"] {
    margin-top: 0; 
    flex-shrink: 0; /* チェックボックスが縮まないようにする */
}
.dvd-item:hover {
    background-color: #E9ECEF;
}
.dvd-item label {
    cursor: pointer;
    margin-left: 8px;
    line-height: 1.5; /* 行の高さを指定してベースラインを安定させる */
}
.dvd-list-controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Step 3: 診断ゲート */
.gate-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.gate-btn {
    width: 100%;
    padding: 20px;
    text-align: left;
    background-color: #FFF;
    color: #333;
    border: 2px solid #E5EAF0;
    box-shadow: none;
    position: relative; /* 位置指定の基準にする */
}
.gate-btn:hover {
    border-color: #3A5FCD;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.gate-btn h3 {
    margin-top: 0;
    font-size: 1.3em;
    color: #3A5FCD;
}
.gate-btn p {
    font-size: 0.9em;
    color: #555;
}
.gate-btn.selected {
    border: 3px solid #00D1FF; /* アクセントカラー */
    box-shadow: 0 0 15px rgba(0, 209, 255, 0.3);
    transform: translateY(0);
}

/* 診断画面 */
#question-counter {
    font-size: 1em;
    color: #3A5FCD;
    font-weight: bold;
    margin-bottom: 10px;
}
/* 診断A/Bのボタン (縦積み) */
#options-container.button-group-vertical .btn {
    width: 80%;
    background-color: #FFF;
    color: #3A5FCD;
    border: 2px solid #3A5FCD;
    box-shadow: none;
    
    box-sizing: border-box; 
    height: auto;           
    white-space: normal;    
    margin: 0;              
    padding: 15px 20px;     
}

/* マウス操作時（ホバー）のみ :hover スタイルを適用 */
@media (hover: hover) {
    #options-container.button-group-vertical .btn:hover {
        background-color: #3A5FCD;
        color: #FFF;
    }
}


/* ローディング画面 */
#loading-overlay {
    position: fixed; /* 常に画面に固定 */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.spinner {
    border: 8px solid #E5EAF0;
    border-top: 8px solid #00D1FF; /* アクセントカラー */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}
#loading-text {
    color: #3A5FCD;
    margin-top: 20px;
    font-size: 1.2em;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Step 4: 診断結果 */
#result-card {
    background-color: #F8F9FA;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 5px solid #00D1FF; /* アクセントカラー */
    text-align: left;
}
#result-title {
    color: #3A5FCD;
}
#result-quote {
    font-style: italic;
    border-left: 3px solid #bdc3c7;
    padding-left: 15px;
    margin-top: 20px;
    color: #555;
}

#reason-section {
    margin-top: 20px;
    margin-bottom: 30px;
}
#reason-section h4 {
    font-size: 1.3em;
    margin-top: 0;
    color: #3A5FCD;
}
#reason-text strong {
    color: #00D1FF; /* アクセントカラー */
    font-weight: bold;
}

/* パッケージプラン */
#campaign-section h3 {
    font-size: 1.5em;
}
.package-container {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
}
.package-plan {
    background: #FFF;
    padding: 15px;
    border-radius: 8px;
    width: 30%;
    border: 1px solid #E5EAF0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.package-plan:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
#plan-6 {
    border: 2px solid #00D1FF; /* アクセントカラー */
}

#plan-complete {
    border: 2px solid #e6b800; /* ゴールド */
}

.package-theme {
    font-size: 0.9em;
    font-style: normal; /* italic から normal に変更 */
    color: #3A5FCD;
    min-height: 2.5em;
    margin-bottom: 10px;
}

.plan-badge {
    font-size: 1.0em;
    font-weight: bold;
    margin: 5px 0 15px 0;
    padding: 6px 12px;
    border-radius: 5px;
    display: inline-block;
}
.badge-special {
    background-color: #f0e6ff; /* 薄い紫 */
    color: #8e44ad; /* 紫 */
}
.badge-popular {
    background-color: #fff5e6; /* 薄いオレンジ */
    color: #e67e22; /* オレンジ */
}
.badge-best {
    background-color: #ffe6e6; /* 薄い赤 */
    color: #c0392b; /* 濃い赤 */
}

.badge-ultimate {
    background-color: #fff9e6; /* 薄い黄色 */
    color: #e6b800; /* ゴールド */
}

.price-info, .perks-info {
    padding: 10px 0;
    margin: 10px 20px;
    border-top: 1px solid #E5EAF0;
}
.price-info p, .perks-info p {
    margin: 5px 0;
    font-size: 0.95em;
}
.price-total {
    font-size: 1.3em !important;
    font-weight: bold;
    color: #3A5FCD;
}

.package-plan ul {
    list-style: none;
    padding: 0 20px 10px 20px;
    text-align: left;
    font-size: 0.9em;
}
.package-plan ul li {
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* ▼▼▼【修正】カーソルをポインターに変更済み（変更なし） ▼▼▼ */
    cursor: pointer; 
    padding: 4px 6px; /* クリック領域を確保 */
    border-radius: 4px;
    transition: background-color 0.2s;
}
.package-plan ul li:hover {
    background-color: #f0f2f5; /* ホバーエフェクト */
    /* ▼▼▼【修正点1】ホバー時のスタイルを強化 ▼▼▼ */
    font-weight: bold;
    color: #3A5FCD; /* メインカラーに変更 */
    /* ▲▲▲ 修正ここまで ▲▲▲ */
}

/* ▼▼▼【修正点2】価格表モーダルを開くボタンのスタイル ▼▼▼ */
#btn-show-price-table {
    display: block; /* ブロック要素に変更 */
    width: 60%;     /* 幅を指定 */
    margin: 20px auto 0 auto; /* 中央寄せ */
}


/* 戻るボタン */
.btn-back {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: transparent;
    color: #778;
    border: 1px solid #ccc;
    padding: 10px 20px; /* サイズを調整 */
    font-size: 1em;     /* サイズを調整 */
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-back:hover {
    background: #778;
    color: #FFF;
    border-color: #778;
}

/* スロットマシン */
.slot-machine-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
    margin-top: 30px;
    margin-bottom: 30px;
    background-color: #F8F9FA;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    width: 100%; /* 親要素に対して幅を最大限に利用 */
    margin-left: auto; /* 中央寄せ */
    margin-right: auto; /* 中央寄せ */
}
.slot-machine-display {
    font-size: 2.5em;
    font-weight: bold;
    color: #3A5FCD;
    text-shadow: 0 0 10px rgba(0, 209, 255, 0.3);
    overflow: hidden; /* はみ出した部分を隠す */
    white-space: nowrap; /* テキストを折り返さない */
    text-overflow: ellipsis; /* はみ出したテキストを...で表示 */
    max-width: 100%; /* 親要素の幅を超えないようにする */
    box-sizing: border-box; /* パディングとボーダーをwidthに含める */
    padding: 0 10px; /* 左右に少しパディングを追加して、テキストが端に寄りすぎないようにする */
    text-align: center; /* 中央揃え */
    flex-shrink: 1; /* 必要に応じて縮小 */
}
.slot-machine-display.reeling {
    filter: blur(2px);
    opacity: 0.7;
    max-width: 100%; 
    white-space: nowrap; 
    text-overflow: ellipsis; 
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    body { padding: 10px; }
    .step { padding: 20px; }
    .content h2 { font-size: 1.5em; }
    .button-group { flex-direction: column; }
    .gate-container { grid-template-columns: 1fr; }
    .package-container { flex-direction: column; }
    .package-plan { width: 100%; margin-bottom: 15px; }

    /* ▼▼▼【修正点2】価格表ボタン（スマホ）▼▼▼ */
    #btn-show-price-table {
        width: 90%;
    }
    
    #dvd-list-container {
        grid-template-columns: 1fr; /* スマホでは1列にする */
    }
}

/* 診断C: キーワード選択画面 */
.keyword-container {
    display: flex; /* Flexboxに変更 */
    flex-wrap: wrap; /* 折り返しを許可 */
    justify-content: center; /* 中央揃え */
    gap: 15px; /* ボタン間の隙間 */
}

#options-container .keyword-btn {
    width: auto; /* 幅を自動に */
    padding: 10px 20px; /* パディングを調整 */
    text-align: center; /* テキストを中央揃えに */
    background-color: #FFF;
    color: #333;
    border: 2px solid #E5EAF0;
    box-shadow: none;
}

/* ▼▼▼【ここからが今回の修正箇所です】▼▼▼ */
/* 以前の :hover スタイルは削除 */

.author-signature {
    display: block; 
    text-align: right; 
    margin-top: 10px; 
    font-style: normal; 
    color: #555; 
}

#result-banner {
    max-width: 100%; 
    height: auto; 
    margin-top: 20px; 
    margin-bottom: 20px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); 
}

/* Step 1: ステータス確認 */
#step1 .content h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
    line-height: 1.5; 
}

#step1 .button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
}

#step1 .btn {
    padding: 15px 30px;
    font-size: 1.2em;
}

/* Step 0: トップページ */
#step0 .content h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
    line-height: 1.5; 
}

#step0 .button-group {
    margin-top: 40px; 
}

#step0 .btn {
    padding: 20px 40px; 
    font-size: 1.4em; 
}

/* Step 2: 所持DVDの登録 */
#step2 .content h2 {
    font-size: 1.6em;
    margin-bottom: 20px;
}

#step2 #btn-register-dvds {
    margin-top: 20px;
}

#step2 #btn-back-to-start {
    margin-top: 10px;
}

/* 診断画面 (A, B, Cで共通利用) */
#diagnosis-screen .content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#diagnosis-screen .content h2 {
    font-size: 1.6em;
    margin-bottom: 20px;
    min-height: 3.2em; 
    display: flex;
    align-items: center;
    justify-content: center;
}

#diagnosis-screen #btn-run-diag-c {
    margin-top: 20px;
}

#diagnosis-screen #btn-back-to-gate {
    position: static; 
    margin-top: 30px; 
}

/* Step 4: 診断結果 */
#step4 .content {
    text-align: left; 
}

#step4 header h1 {
    text-align: center; 
}

#step4 #btn-restart {
    display: block; 
    margin: 40px auto 0 auto; 
    width: 50%;
}

#campaign-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #E5EAF0;
    text-align: center;
}

#campaign-section h3 {
    margin-bottom: 15px;
}

#campaign-section > p {
    text-align: left;
    margin-bottom: 30px;
}

.package-plan h4 {
    font-size: 1.2em;
    color: #333;
    margin-top: 0;
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .package-container {
        flex-direction: column;
        align-items: center;
    }
    .package-plan {
        width: 80%;
        margin-bottom: 20px;
    }
}

/* 所要時間のスタイル */
.time-estimate {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.9em;
    font-weight: bold;
    color: #99a;
}

/* --- モーダルウィンドウ --- */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
}

.modal {
    display: none; 
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #FFF;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 101;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left; 
}

/* ▼▼▼【ここを修正しました】▼▼▼ */
.modal-close {
    position: absolute;
    top: 15px; /* 10px -> 15px */
    right: 20px; /* 15px -> 20px */
    font-size: 2.5em;
    font-weight: 300;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 0;
    z-index: 102; /* 念のため追加 */
}
/* ▲▲▲【修正はここまで】▲▲▲ */

.modal-close:hover {
    color: #333;
}

/* モーダル表示用のクラス */
.modal-open {
    display: block;
}

/* モーダル内の画像 */
#modal-dvd-banner {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* モーダル内の引用 (結果ページからスタイルを継承) */
.modal blockquote {
    font-style: italic;
    border-left: 3px solid #bdc3c7;
    padding-left: 15px;
    margin-top: 20px;
    color: #555;
}

/* --- 申込みボタン（診断結果ページ用） --- */

.btn-order,
.btn-order-single {
    background-color: #e67e22; 
    color: #FFFFFF;
    border: none;
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
    text-align: center;
}

.btn-order:hover,
.btn-order-single:hover {
    background-color: #d35400; 
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
}

/* パッケージプラン内のボタン */
.btn-order {
    width: 90%; 
    margin: 15px auto 10px auto;
    display: block;
}

/* 単品DVDのボタン */
.btn-order-single {
    width: 80%; 
    margin: 25px auto 10px auto;
    display: block;
}

/* --- フッタースタイル --- */
#site-footer {
    text-align: center;
    margin-top: 30px; 
    padding: 20px;
    font-size: 0.9em;
    color: #888; 
    width: 100%;
}

#site-footer p {
    margin: 0;
}

/* ▼▼▼【修正点3】ここから新しい価格表モーダルのスタイル ▼▼▼ */

/* 価格表モーダルは横幅を広くする */
#price-table-modal {
    max-width: 800px; 
}

/* テーブルを包むラッパー (レスポンシブ対応) */
.price-table-wrapper {
    width: 100%;
    overflow-x: auto; /* スマホでテーブルがはみ出たら横スクロール */
    margin-top: 20px;
}

.price-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    min-width: 700px; /* 横スクロールを発生させる最小幅 */
}

.price-table-wrapper th,
.price-table-wrapper td {
    border: 1px solid #ccc;
    padding: 10px 12px;
    text-align: center;
    vertical-align: middle;
}

.price-table-wrapper th {
    background-color: #f4f6f8;
    color: #333;
    font-weight: bold;
}

/* 1列目（購入枚数） */
.price-table-wrapper td:nth-child(1) {
    font-weight: bold;
}
/* 2列目（単価） */
.price-table-wrapper td:nth-child(2) {
    text-align: right;
    width: 130px;
}
/* 5列目（合計額） */
.price-table-wrapper td:nth-child(5) {
    text-align: right;
    font-weight: bold;
    width: 130px;
}

/* テーブルのtbodyの奇数行 */
.price-table-wrapper tbody tr:nth-of-type(odd) {
    background-color: #fdfdfd;
}

/* モーダル内の注釈 */
.modal-notes {
    margin-top: 20px;
    font-size: 0.9em;
    color: #555;
    border-top: 1px solid #eee;
    padding-top: 15px;
}
.modal-notes p {
    margin: 5px 0;
}
/* ▲▲▲【修正点3】修正ここまで ▲▲▲ */

/* ▼▼▼【修正点4】プログレスバーのスタイルを追加 ▼▼▼ */
.progress-bar-container {
    width: 80%;
    height: 10px;
    background-color: #E5EAF0;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: #00D1FF; /* アクセントカラー */
    border-radius: 5px;
    transition: width 0.4s ease;
}
/* ▲▲▲ 修正ここまで ▲▲▲ */

/* ▼▼▼【診断C】ここからが今回の修正箇所です ▼▼▼ */

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

/* キーワードボタンの基本スタイルに追記 */
#options-container .keyword-btn {
    transition: all 0.3s ease; 
    animation: float 6s ease-in-out infinite; 
}

/* 偶数番目 */
#options-container .keyword-btn:nth-child(even) {
    animation-delay: -3s; 
    animation-duration: 5s; 
}

/* --- (★) ホバー時 (オレンジ系統) --- */
#options-container .keyword-btn:hover {
    animation-play-state: paused; /* 浮遊を停止 */
    transform: scale(1.1); /* 拡大 */
    
    color: #d35400; /* 濃いオレンジ文字 */
    border-color: #e67e22; /* オレンジ枠 */
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.3); /* オレンジ影 */
}


/* --- (★) 選択時 (オレンジ系統) --- */
#options-container .keyword-btn.selected {
    animation-play-state: paused; /* アニメーションを一時停止 */
    transform: scale(1.1); /* 1.1倍に拡大 */
    
    background-color: #FFFFFF; 
    color: #d35400; /* 濃いオレンジ文字 */
    border: 3px solid #e67e22; /* オレンジ枠 */
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.3); /* オレンジ影 */
    
    padding: 9px 19px; /* padding再指定 (borderが 2px -> 3px になるため) */
}

/* 診断C: キーワード選択画面 */
.keyword-container {
    display: flex; /* Flexboxに変更 */
    flex-wrap: wrap; /* 折り返しを許可 */
    justify-content: center; /* 中央揃え */
    gap: 15px; /* ボタン間の隙間 */
}

#options-container .keyword-btn {
    width: auto; /* 幅を自動に */
    padding: 10px 20px; /* パディングを調整 */
    text-align: center; /* テキストを中央揃えに */
    background-color: #FFF;
    color: #333;
    border: 2px solid #E5EAF0;
    box-shadow: none;
}


/* ▲▲▲ 診断C 修正ここまで ▲▲▲ */

/* --- クリック可能であることを示す注意書き --- */
.click-note {
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    color: #e67e22; /* オレンジ系の色で注意を引く */
    background-color: #fff9e6; /* 薄い背景色 */
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid #e67e22;
    margin-top: 15px;
    margin-bottom: 20px !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.click-note .note-icon {
    font-size: 1.2em;
    margin-right: 8px;
}