/* 変数定義 */
:root {
    --bg-dark: #1a0505;
    --bg-gradient: radial-gradient(circle, #2c0808 0%, #1a0505 100%);
    --accent-gold: #ffcc00;
    --text-ant-gold: #e0d0b0;
    --border-deep-red: #8b0000;
    --card-gradient: linear-gradient(135deg, #3d0c0c 0%, #250808 100%);
    --shadow-black: rgba(0, 0, 0, 0.7);
}

/* 全体設定 */
body {
    background: var(--bg-dark);
    background: var(--bg-gradient);
    color: var(--text-ant-gold);
    font-family: "Sawarabi Mincho", "Noto Serif JP", serif;
    margin: 0;
    padding: 20px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

/* メインコンテナ */
.container {
    max-width: 750px;
    margin: 0 auto;
    border: 2px solid var(--border-deep-red);
    border-radius: 12px;
    padding: 40px 30px;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 10px 40px var(--shadow-black), 
                inset 0 0 15px rgba(139, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

h1, .main-title {
    text-align: center;
    color: var(--accent-gold);
    text-shadow: 2px 2px 6px #000;
    letter-spacing: 0.3em;
    margin-bottom: 40px;
    font-size: 2rem;
}

.manual-box {
    display: flex;           /* 横並びの指定 */
    flex-direction: row;     /* 横方向に並べる */
    justify-content: center; /* 中央寄せ */
    align-items: flex-start; /* 上揃え */
    gap: 5px;               /* 間の隙間 */
    margin-top: 30px;
    width: 100%;
}

.manuals {
    flex: 1;                 /* 幅を均等に分ける */
    min-width: 50px;        /* 最小幅を確保 */
    max-width: 400px;        /* 大きくなりすぎないよう制限 */
    padding: 5px;
    border-radius: 12px;
    text-align: center;
}

/* 章（Chapter）の外枠 */
.chapter-box {
    background: var(--card-gradient);
    border: 1px solid #5d1a1a;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 35px;
    box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.6);
}

.chapter-title, .chapter-header {
    font-size: 1.3rem;
    color: var(--accent-gold);
    border-bottom: 2px solid var(--accent-gold);
    margin-bottom: 20px;
    padding-bottom: 8px;
    display: inline-block;
}

/* 質問項目 */
.question-block, .question-item {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(139, 0, 0, 0.2);
    padding-bottom: 20px;
}

.section-label, .title-label {
    font-weight: bold;
    color: #fff;
    font-size: 1rem;
    display: block;
    margin-bottom: 6px;
}

.question-text {
    font-size: 0.9rem;
    color: #cccccc;
    margin: 0 0 15px 0;
    display: block;
}

/* --- チェックボックス（ラジオボタン）横並びエリア --- */
.radio-group {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px 0;
    padding: 0 10px;
}

.radio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    cursor: pointer;
}

.radio-item input {
    margin-bottom: 8px;
    width: 20px;
    height: 20px;
    accent-color: var(--accent-gold);
}

.radio-item label {
    font-size: 0.75rem;
    color: var(--text-ant-gold);
    white-space: nowrap;
}

/* 送信ボタン */
.btn-submit {
    display: block;
    width: 85%;
    max-width: 400px;
    margin: 50px auto 20px;
    padding: 18px;
    background: linear-gradient(to bottom, #8b0000, #4b0000);
    color: #ffffff;
    border: 2px solid var(--accent-gold);
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--shadow-black);
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--accent-gold);
}

/* 解説（結果画面） */
.text-box {
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 204, 0, 1);
    padding-bottom: 20px;
}

/* --- グラフ表示エリア（結果画面） --- */
.chart-container {
    display: flex;           /* 横並びの指定 */
    flex-direction: row;     /* 横方向に並べる */
    justify-content: center; /* 中央寄せ */
    align-items: flex-start; /* 上揃え */
    gap: 20px;               /* グラフ間の隙間 */
    margin-top: 30px;
    width: 100%;
}

.chart-item {
    flex: 1;                 /* 幅を均等に分ける */
    min-width: 300px;        /* 最小幅を確保 */
    max-width: 350px;        /* 大きくなりすぎないよう制限 */
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(139, 0, 0, 0.3);
    text-align: center;
}

.chart-label {
    display: block;
    color: var(--accent-gold);
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* スマホ対応：画面が狭いときは縦に並べる */
@media (max-width: 650px) {
    .chart-container {
        flex-direction: column;
        align-items: center;
    }
    .chart-item {
        width: 90%;
        min-width: unset;
    }

}

@media (max-width: 1020px) {
    .manual-box {
        flex-direction: column;
        align-items: center;
    }
    .manuaks {
        width: 60%;
        min-width: unset;
    }
    
}

/* --- 装飾用画像のスタイル --- */

.decoration-left, .decoration-right {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 100px; /* 全体の太さに合わせて調整 */
    display: flex;
    flex-direction: column; /* 縦並び */
    align-items: center;    /* 左右中央寄せ */
    z-index: -1;
    pointer-events: none;
}

.decoration-left { left: 0; }
.decoration-right { right: 0; }

/* --- 中央のアクセント画像（絶対に縮まない） --- */
.deco-line {
    width: 30%;
    height: auto;
    flex-shrink: 0; /* 潰れるのを防ぐ */
    /* 上下の延長線とくっつけたい場合はmargin: 0;にする */
    margin: 0; 
}

/* --- 上下の延長線（背景画像として限界まで引き伸ばす） --- */
.deco-line2 {
    width: 30%;
    flex-grow: 1; /* 上下の空きスペースを全力で埋める */
    
    /* 背景画像としてline2.pngを読み込む */
    /* ※style.cssから見た相対パス（../images/）になります */
    background-image: url('../images/line2.png');
    background-size: 100% 100%; /* 枠の高さに合わせて強制的に引き伸ばす */
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.7;
}


/* スマホなど画面が狭いときは非表示にする */
@media (max-width: 1024px) {
    .decoration-left, .decoration-right {
        display: none;
    }
}

