/* --- 4. 準備画面・機能・マニュアル --- */
#固定機能バー {
    position: fixed;
    top: 20px;
    right: 340px;
    display: flex;
    gap: 15px;
    z-index: 60000;
}

.機能アイコン {
    width: 42px;
    height: 42px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px;
    box-sizing: border-box;
    transition: 0.3s;
    backdrop-filter: blur(10px);
}

.機能アイコン:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#手引窓 {
    position: fixed;
    top: 50%;
    left: 45%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: auto;
    max-height: 85vh;
    background: rgba(10, 10, 20, 0.98);
    backdrop-filter: blur(40px);
    border: 2px solid var(--金);
    border-radius: 12px;
    z-index: 50000;
    display: none;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 0 120px rgba(0, 0, 0, 1);
    color: #eee;
    overflow: hidden;
}

.手引ヘッダー {
    padding: 25px 35px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.手引題 {
    color: var(--金);
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.手引タブ欄 {
    display: flex;
    gap: 5px;
    overflow-x: auto;
}

.手引タブ {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
    border-radius: 4px 4px 0 0;
    white-space: nowrap;
}

.手引タブ:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.手引タブ.活性 {
    background: var(--金);
    color: #000;
    font-weight: bold;
    border-color: var(--金);
}

.手引本体 {
    flex: 1;
    overflow-y: scroll;
    padding: 20px 40px 40px;
    min-height: 0;
}

.手引本体::-webkit-scrollbar {
    width: 8px;
}

.手引本体::-webkit-scrollbar-thumb {
    background: var(--金);
    border-radius: 4px;
}

.手引本体::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.手引タブ内容 {
    display: none;
    animation: fadeIn 0.4s ease;
    /* 内部パーツによる余計なマージンを排除 */
}

.手引タブ内容.活性 {
    display: block;
}

.手引節 {
    margin-bottom: 35px;
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--金);
}

.手引節 h3 {
    color: var(--金);
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(241, 196, 15, 0.3);
    padding-bottom: 8px;
}

.手引節 a {
    color: var(--金);
    text-decoration: none;
    transition: 0.3s;
}

.手引節 a:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

.手引強調 {
    color: var(--金);
    font-weight: bold;
}

.手引小見出し {
    font-weight: bold;
    display: block;
    margin: 15px 0 5px;
    color: #fff;
    font-size: 1.05rem;
}

.手引閉じる {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--金);
    font-size: 1.5rem;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* 成長限界強調 */
.上限達 {
    color: #00ffff !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.手引閉じる:hover {
    background: var(--警告);
    color: #fff;
    transform: rotate(90deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 2. 攻略準備画面 (PREPARATION) --- */
#準備画面 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0c 0%, #1a1a1f 100%);
    padding: 60px;
    box-sizing: border-box;
    display: none;
    flex-direction: column;
    color: #fff;
    z-index: 3000;
}

#準備ヘッダー {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    /* 40pxから削減 */
    border-bottom: 2px solid rgba(241, 196, 15, 0.3);
    padding-bottom: 10px;
}

#準備タイトル {
    font-family: 'Shippori Mincho', serif;
    font-size: 2.2rem;
    /* 章番号を強調 */
    color: var(--金);
    margin: 0;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: baseline;
}

#ソート項目群 {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 20px;
}

.ソート行 {
    display: flex;
    gap: 8px;
}

.ソートボタン {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 4px;
}

.ソートボタン:hover {
    background: rgba(255, 215, 0, 0.2);
    color: var(--金);
    border-color: var(--金);
}

#出撃操作群 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.コンパクト操作列 {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px 15px;
    gap: 20px;
}

.操作グループ {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.操作グループ:last-of-type {
    border-right: none;
}

.出撃状況 {
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: 60px;
}

#出撃ラベル {
    font-size: 0.65rem;
    opacity: 0.6;
    text-transform: uppercase;
}

#出撃数表示 {
    font-size: 1.25rem;
    font-weight: bold;
    font-family: 'Outfit';
    color: #fff;
}

.戦場選択,
.兵装管理,
.システム {
    display: flex;
    gap: 5px;
}

.完了ボタン {
    background: linear-gradient(to bottom, #f1c40f, #d4af37);
    border: none;
    color: #000;
    padding: 8px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.2);
    transition: 0.3s;
    white-space: nowrap;
}

.完了ボタン:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(241, 196, 15, 0.4);
}

#準備メイン {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow: hidden;
    margin-top: 10px;
    /* 余白を最小化 */
    min-height: 0;
}

#キャラ詳細パネル {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.編成画面名前拡大 {
    font-size: 2.2rem;
    letter-spacing: 0.2rem;
    white-space: nowrap;
    /* キャラの名前を改行させない */
}

/* 地形情報HUD：2_スタイル_3_バトル.css に集約するため、ここでは補足定義のみ残す */
#地形情報HUD {
    pointer-events: none;
}

#地形情報HUD .地形タイトル {
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 1px 1px 2px #000;
    display: inline-block;
    margin-right: 15px;
}

#地形情報HUD .地形説明 {
    font-size: 0.75rem;
    display: inline-block;
}

#地形情報HUD .地形パラメータ {
    font-size: 0.75rem;
    color: #ffd700;
    font-weight: bold;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    margin-top: 3px;
    padding-top: 2px;
}

#キャラ選択リスト {
    width: 450px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
    /* 高さを制限してスクロールを発生させる */
    display: flex;
    flex-direction: column;
}

#キャラ選択リスト::-webkit-scrollbar {
    width: 6px;
}

#キャラ選択リスト::-webkit-scrollbar-thumb {
    background: var(--金);
    border-radius: 3px;
}

.リスト項目 {
    display: flex;
    align-items: center;
    padding: 18px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.リスト項目:hover,
.リスト項目.選択中 {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--金);
}

.リスト項目.出撃中 {
    background: rgba(241, 196, 15, 0.05);
    box-shadow: inset 4px 0 0 var(--金);
}

.リスト顔アイコン {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    margin-right: 25px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.リスト名前群 {
    display: flex;
    flex-direction: column;
}

.リスト名 {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.リストサブ情報 {
    font-size: 0.9rem;
    opacity: 0.6;
}

#キャラ詳細パネル {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 50px;
    position: relative;
    overflow: hidden;
    display: flex;
}

#詳細背景イラスト {
    position: absolute;
    right: -10%;
    bottom: -5%;
    height: 110%;
    width: 70%;
    background-size: contain;
    background-position: bottom right;
    background-repeat: no-repeat;
    opacity: 0.35;
    pointer-events: none;
    z-index: 1;
    filter: drop-shadow(0 0 20px #000);
}

.詳細行 {
    position: relative;
    display: flex;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 15px;
    padding-bottom: 5px;
}

.詳細行::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 25%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.数値強調 {
    font-size: 2.2rem;
    font-family: 'Outfit';
    color: var(--金);
}

.編成画面名前拡大 {
    font-size: 2.3rem;
    color: var(--金);
    font-weight: bold;
}

.詳細エリアリスト {
    margin-top: 15px;
}

.エリア見出し {
    font-size: 0.8rem;
    color: #888;
    display: block;
    margin-bottom: 5px;
}

.リスト内包 {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.補助ボタン小 {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ccc;
    padding: 5px 15px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
}

.補助ボタン小:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.能力項目 {
    background: rgba(0, 0, 0, 0.5);
    border-left: 3px solid var(--金);
    padding: 12px 20px;
    border-radius: 0 5px 5px 0;
}

.能力称 {
    font-size: 0.8rem;
    opacity: 0.6;
    letter-spacing: 0.1rem;
}

.能力値 {
    font-size: 1.8rem;
    font-weight: bold;
    font-family: 'Outfit';
}

#詳細スキルエリア {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.スキル項目 {
    background: rgba(0, 0, 0, 0.5);
    border-left: 3px solid var(--警告);
    padding: 15px 25px;
    border-radius: 0 5px 5px 0;
    max-width: 500px;
}

.スキル名 {
    color: var(--金);
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.スキル説明 {
    font-size: 0.95rem;
    opacity: 0.8;
}

.オキニハート {
    color: #e74c3c;
    margin-left: 5px;
    text-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
    display: inline-block;
    animation: pulse 1.5s infinite ease-in-out;
}

.詳細オキニ {
    cursor: pointer;
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.2s ease;
    user-select: none;
}

.詳細オキニ.活性,
.詳細オキニ.有効 {
    color: #e74c3c;
    filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.6));
    animation: pulse 1.5s infinite ease-in-out;
}

#補助幕 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #1a1a1a 0%, #050505 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 2000;
}

#補助ヘッダー {
    text-align: center;
    margin-bottom: 50px;
    border-bottom: 2px solid #c9a063;
    padding-bottom: 20px;
}

#補助見出し {
    font-size: 3rem;
    color: #c9a063;
    text-shadow: 0 0 15px rgba(201, 160, 99, 0.5);
    font-family: 'Outfit';
}

#現在の進行状況 {
    font-size: 1.2rem;
    opacity: 0.8;
}

#補助メニュー {
    display: flex;
    gap: 30px;
}

.補助項 {
    width: 100%;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(201, 160, 99, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.補助項:hover {
    background: rgba(201, 160, 99, 0.15);
    border-color: #c9a063;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.項目見出し {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
}

.項目説明 {
    font-size: 1rem;
    color: #aaa;
    line-height: 1.6;
}

/* モーダル窓 */
.モーダル {
    display: none;
    position: fixed;
    z-index: 9000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: flex-start;
    /* top基準 */
    padding-top: 50px;
    /* 上部余白 */
}

.モーダル中身 {
    background: #111;
    border: 2px solid #c9a063;
    padding: 40px;
    width: 95%;
    max-width: 1400px;
    max-height: 90%;
    overflow-y: auto;
    border-radius: 10px;
    color: #fff;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
}

#準備道具エリア {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

#準備道具エリア .スキル項目 {
    width: 320px;
    flex-shrink: 0;
}

.閉じるボタン {
    margin-top: 30px;
    background: transparent;
    border: 1px solid #c9a063;
    color: #c9a063;
    padding: 10px 40px;
    cursor: pointer;
    transition: 0.3s;
}

.閉じるボタン:hover {
    background: #c9a063;
    color: #000;
}

/* --- 試作UI素材適用 --- */
.試作ステータス枠 {
    position: relative;
    background: rgba(0, 0, 0, 0.85) !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    padding: 2.5rem !important;
    z-index: 1;
}

.パネル装飾枠 {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 30px solid transparent;
    border-image-slice: 100;
    border-image-repeat: stretch;
    pointer-events: none;
    z-index: 100;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* --- 道具リストのリッチ装飾 (超安定版) --- */
/* リスト本体 */
.道具リスト本体 {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    width: 100% !important;
}

.道具行 {
    display: flex !important;
    flex-direction: row !important; /* 横並びを強制 */
    align-items: center !important;
    min-height: 40px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-left: 4px solid transparent !important;
    transition: 0.1s all ease !important;
    padding: 0 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.道具行:hover {
    filter: brightness(1.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* カラム幅の絶対的な死守 */
.道具行_名 { 
    flex: 0 0 50% !important; 
    width: 50% !important;
    font-size: 0.85rem !important; 
    font-weight: bold !important; 
    text-shadow: 1px 1px 2px #000 !important; 
    white-space: nowrap !important; 
    overflow: hidden !important; 
    text-overflow: ellipsis !important; 
}

.道具行_効 { 
    flex: 0 0 35% !important; 
    width: 35% !important;
    font-size: 0.72rem !important; 
    opacity: 0.6 !important; 
    padding: 0 8px !important; 
    white-space: nowrap !important; 
    overflow: hidden !important; 
    text-overflow: ellipsis !important; 
}

.道具行_ボ { 
    flex: 0 0 15% !important; 
    width: 15% !important;
    text-align: right !important; 
}

/* 種類別アクセント (!important で上書きを防止) */
.道具行.回復 { border-left-color: #ffffff !important; background: linear-gradient(90deg, rgba(255,255,255,0.15) 0%, transparent 50%) !important; }
.道具行.武器 { border-left-color: #ff69b4 !important; background: linear-gradient(90deg, rgba(255,105,180,0.15) 0%, transparent 50%) !important; }
.道具行.防具 { border-left-color: #87cefa !important; background: linear-gradient(90deg, rgba(135,206,250,0.15) 0%, transparent 50%) !important; }
.道具行.強化 { border-left-color: #ffd700 !important; background: linear-gradient(90deg, rgba(255,215,0,0.15) 0%, transparent 50%) !important; }
.道具行.道具 { border-left-color: #aaaaaa !important; background: linear-gradient(90deg, rgba(170,170,170,0.1) 0%, transparent 50%) !important; }

