/* ========================================
   Create Question Page 1 Styles
   - Rule setting page
   ======================================== */

/* メイン見出し（main-heading） */
.main-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 1.33rem;
    position: relative;
    text-align: center;
}

.main-heading::after {
    content: '';
    position: absolute;
    bottom: -0.67rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background-color: #cbd5e0;
}

/* 初期化ボタンのグレーアウト（create-p1専用） */
#freeRuleResetButton:disabled {
    background: #9ca3af; /* グレー背景 */
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

#freeRuleResetButton:disabled:hover {
    transform: none;
    box-shadow: none;
}

#freeRuleResetButton:disabled:active {
    transform: none;
}

/* タイプ初期化ボタンのグレーアウト（training_setting専用） */
.irregular-button3 #conditionTypeResetButton:disabled {
    background: #9ca3af; /* グレー背景 */
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.irregular-button3 #conditionTypeResetButton:disabled:hover {
    transform: none;
    box-shadow: none;
    background: #9ca3af;
}

.irregular-button3 #conditionTypeResetButton:disabled:active {
    transform: none;
}

/* オプション初期化ボタンのグレーアウト（training_setting専用） */
.irregular-button3 #optionResetButton:disabled {
    background: #9ca3af; /* グレー背景 */
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.irregular-button3 #optionResetButton:disabled:hover {
    transform: none;
    box-shadow: none;
    background: #9ca3af;
}

.irregular-button3 #optionResetButton:disabled:active {
    transform: none;
}

/* モード選択用のコンテナ（グループ化のみ） */
.mode-selector-container {
    margin-bottom: 0;
    width: 100%;
}

.mode-selector-options {
    display: flex;
    gap: 3rem; /* 2rem → 3rem に変更して横幅を広げる */
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.mode-selector-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-selector-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* 対戦形式セクション（グループ化のみ） */
.battle-format-section {
    margin-bottom: 0;
    width: 100%;
}

/* ゲームモード選択セクション */
.game-mode-section {
    margin-bottom: 1rem;
    width: 100%;
}

.format-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem; /* gapを追加して横幅を広げる */
}

.format-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0; /* 縮小を防ぐ */
}

.format-option:first-child {
    margin-right: 0; /* 真ん中に配置するため削除 */
}

.format-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* レギュレーション指定モード */
.regulation-content {
    display: none;
}

.regulation-content.active {
    display: block;
}

.regulation-select label {
    display: block;
    font-size: 0.8rem; /* 元のサイズに戻す */
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

/* .regulation-box は共通クラス .pulldown-display-box を使用 */

/* 自由指定モード */
.free-content {
    display: none;
}

.free-content.active {
    display: block;
}

.free-setting-label {
    display: block;
    font-size: 0.8rem; /* 0.9rem → 0.8rem に変更 */
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.free-input-box {
    /* 背景、ボーダー、パディング、シャドウを削除 */
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 0;
    box-shadow: none;
}

.free-input-box label {
    display: none; /* ラベルを非表示 */
}

/* .free-setting-input は共通クラス .pulldown-display-box を使用 */

/* オプション設定風ボタンレイアウト */
.option-layout {
    width: 100%;
    margin: 1rem auto 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    box-sizing: border-box;
}

.option-layout--other {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.option-layout__button {
    width: 90%;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    border-radius: 30px;
    color: #ffffff;
    font-size: clamp(1.15rem, 3vw, 1.35rem);
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
}

.option-layout__button--primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.option-layout__button--secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.option-layout__button--tertiary {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

.option-layout__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.option-layout__row {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.option-layout__row--top {
    justify-content: center;
}

.option-layout__row--bottom {
    justify-content: center;
}


/* 作問ページへボタンはgo-to-homeクラスを使用 */
#questionForm {
    margin-top: 2rem;
}

/* オーバーレイ内のスタイル（共通スタイルはoverlay.cssに移動） */

.free-condition-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}


.free-rule-detail-view-content {
    margin: 1rem 0;
}

/* overlay-confirm-message と overlay-close-button-bottom は overlay.css に統合済み */

/* レスポンシブ */
@media (max-width: 640px) {
    .option-layout__row {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .option-layout__button {
        width: 90%;
        max-width: 90%;
        height: 40px;
        min-height: 40px;
        max-height: 40px;
    }
}

@media (min-width: 641px) and (max-width: 1263px) {
    .option-layout {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding-left: 4%;
        padding-right: 4%;
    }

    .option-layout__row--top .option-layout__button,
    .option-layout__row--bottom .option-layout__button {
        flex: 0 0 44%;
        width: 44%;
        max-width: 44%;
    }

    .option-layout__row--bottom {
        flex-direction: row;
        justify-content: center;
        gap: 4%;
    }
}

@media (min-width: 1264px) {
    .option-layout {
        flex-direction: row;
        justify-content: space-between;
        align-items: stretch;
        padding-left: 2%;
        padding-right: 2%;
        column-gap: 2%;
    }

    .option-layout__row {
        display: contents;
    }

    .option-layout__button {
        flex: 0 0 30%;
        width: 30%;
        max-width: 30%;
    }
}

