/* --- 2. 演習幕 (0.9.97 正統復旧版) --- */
#演習幕 {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    user-select: none;
    -webkit-user-select: none;
    z-index: 8000;
}

#舞台面 {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
    background: transparent;
    z-index: 100;
}

#地図画面 {
    display: block;
    cursor: grab;
    box-shadow: 0 0 100px rgba(0, 0, 0, 1);
    background: transparent;
}

#地図画面:active {
    cursor: grabbing;
}

/* 地形情報HUD */
#地形情報HUD {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 9500;
    background: rgba(0, 50, 150, 0.4);
    /* 青透過0.4 */
    border: 1px solid var(--金);
    border-radius: 8px;
    padding: 8px 15px;
    color: #fff;
    pointer-events: none;
    min-width: 240px;
    transition: opacity 0.3s;
    backdrop-filter: blur(8px);
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#地形情報HUD .地形タイトル {
    font-size: 1.1em;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 2px;
    text-shadow: 1px 1px 2px #000;
}

#地形情報HUD .地形説明 {
    font-size: 0.85em;
    margin-bottom: 3px;
    display: inline;
    opacity: 0.9;
}

#地形情報HUD .地形パラメータ {
    font-size: 0.9em;
    color: #ffd700;
    font-weight: bold;
    display: inline;
    margin-left: 10px;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    padding-top: 5px;
}

/* 真・戦闘HUD */
#戦闘HUD {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100vw;
    height: 220px;
    display: none;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    z-index: 4000;
    pointer-events: none;
}

.必殺サブ窓 {
    font-size: 0.75rem;
    color: var(--金);
    opacity: 0.8;
    margin-top: 2px;
}

.ユニットカード {
    width: 320px;
    height: 160px;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    position: relative;
    padding: 25px;
    box-sizing: border-box;
    pointer-events: auto;
    border: none !important;
}

.ユニットカード::before,
#HUD予測::before {
    content: "";
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 30px solid transparent;
    border-image-source: url('./img/s03ui_ステータス外枠.png');
    border-image-slice: 100;
    pointer-events: none;
    z-index: 10;
    /* コンテンツより後ろ */
}

.ユニットカード.自軍側 {
    border-left: 4px solid var(--決定);
    border-radius: 10px 0 0 10px;
}

#演習背景層 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0.35;
    z-index: 1;
    display: none;
    pointer-events: none;
}

.ユニットカード.敵軍側 {
    flex-direction: row-reverse;
    text-align: right;
    border-right: 4px solid var(--警告);
    border-radius: 0 10px 10px 0;
}

.HUD肖像容器 {
    position: absolute;
    width: 220px;
    height: 220px;
    bottom: 0;
    pointer-events: none;
    z-index: 15;
    /* 枠より前 */
}

.自軍側 .HUD肖像容器 {
    left: -40px;
}

.敵軍側 .HUD肖像容器 {
    right: -40px;
}

.HUD肖像 {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8));
    transform: scale(1.4);
}

.HUD詳細 {
    flex: 1;
    z-index: 20;
    /* 枠(10)より前 */
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.自軍側 .HUD詳細 {
    padding-left: 90px;
}

.敵軍側 .HUD詳細 {
    padding-right: 90px;
}

.HUD名 {
    font-size: 1.3rem;
    font-weight: bold;
    font-family: 'Shippori Mincho';
    color: #fff;
    position: absolute;
    top: -5px;
    width: 100%;
}

.自軍側 .HUD名 {
    left: auto;
    right: 15px;
    text-align: right;
}

.敵軍側 .HUD名 {
    right: auto;
    left: 15px;
    text-align: left;
}

.HUD兵種 {
    color: var(--金);
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin-top: 35px;
}

.HUD体力線 {
    width: 100%;
    height: 8px;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.HUD体力量 {
    height: 100%;
    /* 1.5s に延長して、ダメージ減少の経過をドラマチックに見せる */
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.HUD体力数値 {
    font-family: 'Outfit';
    font-size: 2.2rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(0, 0, 0, 1);
}

.自軍側 .HUD体力数値 {
    text-align: left;
}

.敵軍側 .HUD体力数値 {
    text-align: right;
}

/* 中央の予測連結ブリッジ */
#HUD予測 {
    width: 340px;
    height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 5;
    margin: 0 -10px;
    pointer-events: auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    position: relative;
    border: none !important;
}

.HUD取消ボタン {
    position: absolute;
    top: -50px;
    /* 予測窓の上部に配置 */
    left: 50%;
    transform: translateX(-50%);
    background: #444;
    color: #fff;
    border: 2px solid var(--金);
    padding: 8px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    border-radius: 6px;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    white-space: nowrap;
}

.HUD取消ボタン:hover {
    background: var(--警告);
    border-color: var(--警告);
}

.予測ブリッジ {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    padding: 0 10px;
}

.予測値グループ {
    text-align: center;
}

.予測大文字 {
    font-size: 1.8rem;
    font-family: 'Outfit';
    font-weight: bold;
    display: block;
}

.予測大文字.減少 {
    color: var(--警告);
    font-size: 2.2rem;
}

.予測大文字.命中,
.予測大文字.的中 {
    color: var(--金);
}

/* キャンセルボタン */
.解除ボタン {
    background: transparent;
    color: #888;
    border: 1px solid #444;
    padding: 10px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.8rem;
}

.解除ボタン:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

#戦況パネル {
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    z-index: 5000;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#戦況パネル.左側 {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

#顔絵エリア {
    width: 100%;
    height: 280px;
    background: #111;
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#肖像画 {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#肖像画.肖像画アニメ {
    animation: portraitFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes portraitFadeIn {
    from {
        opacity: 0;
        transform: scale(1.05) translateY(5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* オキニ演出 */
.オキニ輝き {
    position: relative;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), inset 0 0 25px rgba(255, 215, 0, 0.25) !important;
}

.オキニ輝き::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--金);
    border-radius: inherit;
    pointer-events: none;
    animation: okiniGlow 2.5s infinite ease-in-out alternate;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

@keyframes okiniGlow {
    from {
        opacity: 0.3;
        box-shadow: 0 0 10px var(--金), inset 0 0 5px var(--金);
    }
    to {
        opacity: 1;
        box-shadow: 0 0 35px var(--金), inset 0 0 15px var(--金);
    }
}

#表示名 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

#兵種名 {
    color: var(--決定);
    font-weight: bold;
    letter-spacing: 3px;
    font-size: 0.92rem;
    margin-bottom: 15px;
}

#能力一覧 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 10px;
}

.能力行 {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.能力ラベル {
    font-size: 0.82rem;
    color: #888;
}

.能力数値 {
    font-weight: bold;
    font-family: 'Outfit';
}

#指揮統制 {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#進軍状況報 {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

#設定切替群 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

.設定ボタン {
    font-size: 0.74rem;
    padding: 10px 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-align: center;
    backdrop-filter: blur(5px);
}

.設定ボタン.青 {
    background: rgba(41, 128, 185, 0.2);
    border-color: rgba(52, 152, 219, 0.5);
    color: #85d7ff;
    box-shadow: inset 0 0 10px rgba(52, 152, 219, 0.2);
}

.設定ボタン.青:hover {
    background: rgba(52, 152, 219, 0.4);
}

.設定ボタン.橙 {
    background: rgba(211, 84, 0, 0.2);
    border-color: rgba(230, 126, 34, 0.5);
    color: #ffb380;
    box-shadow: inset 0 0 10px rgba(230, 126, 34, 0.2);
}

.設定ボタン.橙:hover {
    background: rgba(230, 126, 34, 0.4);
}

.小ボタン {
    font-size: 0.75rem;
    padding: 10px;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    cursor: pointer;
}

#アイテムボタン {
    height: 45px;
    background: var(--成功);
    color: #fff;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

#待機ボタン {
    height: 45px;
    background: var(--成功);
    color: #fff;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

#終了ボタン {
    height: 45px;
    background: var(--決定);
    color: #fff;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

#一括待機ボタン {
    position: fixed;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20000;
    background: rgba(41, 128, 185, 0.9);
    color: #fff;
    border: 3px solid #fff;
    padding: 12px 30px;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    display: none;
    pointer-events: auto;
    white-space: pre-wrap;
    line-height: 1.4;
    text-align: center;
}

.確認ダイアログ {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--金);
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    z-index: 9500;
    min-width: 400px;
}

.確認ダイアログ p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #fff;
}

.選択列 {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.確認ダイアログ button {
    padding: 12px 30px;
    font-size: 1.2rem;
    cursor: pointer;
    background: #333;
    color: #fff;
    border: 1px solid var(--金);
    transition: 0.2s;
}

.確認ダイアログ button:hover:not(.無効) {
    background: var(--決定);
    transform: scale(1.05);
}

#中断ボタン {
    margin-top: 12px;
    margin-right: 12px;
    width: 110px;
    font-size: 0.8rem;
    background: #551111;
    color: #fff;
    border: none;
    padding: 8px;
    cursor: pointer;
    opacity: 0.4;
}

#告知層 {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    display: none;
    z-index: 100000;
    pointer-events: none;
}

.演出帯 {
    width: 600px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 25px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    animation: speedSlide 0.9s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.青軍 {
    background: linear-gradient(90deg, #2980b9 80%, transparent);
    border-left: 6px solid #fff;
}

.赤軍 {
    background: linear-gradient(90deg, #c0392b 80%, transparent);
    border-left: 6px solid #fff;
}

.黄軍 {
    background: linear-gradient(90deg, #f1c40f 80%, transparent);
    border-left: 6px solid #fff;
}

.告知メッセージ {
    font-size: 1.6rem;
    font-weight: bold;
    letter-spacing: 4px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-style: italic;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#演習道具窓 {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-top: 5px solid var(--成功);
    padding: 20px;
    z-index: 9000;
    color: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(39, 174, 96, 0.3);
    border-radius: 12px;
}

#演習道具窓 .道具題 {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--成功);
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    text-align: center;
}

.道具題 {
    font-size: 0.8rem;
    color: var(--金);
    letter-spacing: 2px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(241, 196, 15, 0.3);
    padding-bottom: 5px;
}

.道具行 {
    display: flex;
    flex-direction: column;
    padding: 8px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: 0.2s;
}

.道具行:hover {
    background: rgba(255, 255, 255, 0.15);
    border-left: 3px solid var(--金);
}

.道具上段 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.道具名 {
    font-weight: bold;
    font-size: 1rem;
}

.道具数 {
    font-family: 'Outfit';
    font-size: 0.9rem;
    color: var(--金);
}

.道具解説 {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 3px;
    line-height: 1.2;
}

/* フローティングメニュー */
#アクションメニュー {
    position: fixed;
    z-index: 50000;
    display: none;
    pointer-events: none;
    left: 300px;
    top: 500px;
}

#親アクションボタン {
    width: 100px;
    height: 100px;
    cursor: grab;
    pointer-events: auto;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 15px rgba(0, 150, 255, 0.6));
    transition: transform 0.2s;
}

/* 演出用動画ウィンドウ (プレイヤー風) */
.動画窓 {
    position: fixed;
    bottom: 80px;
    right: 330px;
    width: 320px;
    height: 180px;
    z-index: 25000;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--金);
    border-radius: 8px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.2);
    pointer-events: auto;
}

.動画窓.活性 {
    display: flex;
}

.動画窓ヘッダー {
    height: 34px;
    background: linear-gradient(to bottom, rgba(40, 40, 40, 0.95), rgba(20, 20, 20, 0.95));
    border-bottom: 1px solid rgba(255, 215, 0, 0.4);
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    user-select: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.動画窓:hover .動画窓ヘッダー {
    opacity: 1;
}

#演出動画タイトル {
    font-size: 0.75rem;
    color: var(--金);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.窓操作群 {
    display: flex;
    align-items: center;
    gap: 8px;
}

#演出音量 {
    width: 60px;
    height: 4px;
    cursor: pointer;
    accent-color: var(--金);
}

.窓小ボタン {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.窓小ボタン:hover {
    color: var(--警告);
}

.動画窓本体 {
    flex: 1;
    background: #000;
    position: relative;
    overflow: hidden;
}

#演出動画本体 {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.動画窓リサイズ {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 70%, var(--金) 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.動画窓:hover .動画窓リサイズ {
    opacity: 0.8;
}

#子アクションウィンドウ {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.93);
    padding: 12px;
    border-radius: 8px;
    backdrop-filter: blur(20px);
    pointer-events: auto;
    border: 1px solid rgba(255, 215, 0, 0.6);
    width: 160px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 1);
    box-sizing: border-box;
}

#個別コマンド領域 {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    pointer-events: auto !important;
}

.メニュー行 {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.進軍状況 {
    color: #ffd700;
    font-size: 0.85rem;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    padding-bottom: 5px;
    border-bottom: 1px dashed rgba(255, 215, 0, 0.3);
    margin-bottom: 5px;
    width: 100%;
    text-align: center;
}

.アクションボタン {
    flex: 1;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    font-size: 1rem;
    min-width: 80px;
    border: none;
    background: url('./img/s03ui_ボタン単体.png') no-repeat center;
    background-size: 100% 100%;
    color: #ffd700;
    cursor: pointer;
    font-weight: bold;
    text-shadow: 1px 1.5px 2px #000;
    transition: all 0.2s;
    pointer-events: auto !important;
}

.アクションボタン:hover {
    filter: brightness(1.3);
    transform: scale(1.05);
}

#アクションメニュー.展開 #子アクションウィンドウ {
    display: flex;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* --- プレミアム装飾追加 (レイアウト非依存) --- */

/* 地形情報HUDの質感向上 */
#地形情報HUD {
    background: linear-gradient(135deg, rgba(0, 30, 90, 0.7) 0%, rgba(10, 20, 40, 0.85) 100%) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7), inset 0 0 15px rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255, 215, 0, 0.5) !important;
}

/* 戦況パネルの高級感 */
#戦況パネル {
    background: linear-gradient(to bottom, rgba(15, 20, 25, 0.9), rgba(25, 30, 40, 0.95)) !important;
    border-left: 1px solid rgba(212, 175, 55, 0.3) !important;
}

#表示名 {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.15), transparent);
}

/* アクションメニューのボタン強調 */
.アクションボタン:hover {
    filter: brightness(1.4) drop-shadow(0 0 8px var(--金)) !important;
}

/* 【最重要】タイプライター演出を完全に排除し、瞬間表示を強制 */
.告知メッセージ, #窓本文, #ストーリーテキスト {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    border-right: none !important;
    white-space: pre-wrap !important;
    overflow: visible !important;
}

/* body全体の背景漏れ防止 */
body { background: #000; }
