/* main_dg.css — DG1専用 menuヘッダ拡張 + 部隊管理リッチUI */

/* === 部隊管理画面 (中央配置モーダル) === */
/* v0.4.110: z-index 90040→100002 に上げて Lv10ログインメニュー(z-index:100000) より前面に。 */
/* v0.6.50: 横幅85%中央配置に変更 (ユーザー指示「右上BGMボタンと被って戻れない、 左上Lv10ログインメニューと被ってz-index負けで操作不可、 横幅85%にしてアイコン一回り大きく、 12部隊が窮屈」)。
   旧: position fixed; inset:0 (全画面) → 右上閉じるボタンが BGM/音量ボタン (z-index:100110) と重なる、 左上タイトルが Lv10共通UIアイコン群 と重なる
   新: inset 60px 7.5% (上60px+左右7.5%、 横幅85%) + box-shadow + border-radius で 浮いたモーダル感、 BGM/音量ボタン(右上top:14px)と Lv10ログインメニュー(左上)の予約スペースを避ける */
#dg-formation-screen {
    position: fixed; top: 60px; bottom: 30px; left: 7.5%; right: 7.5%; z-index: 100002;
    background:
        radial-gradient(ellipse at top left, rgba(60,80,140,0.18) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(140,80,60,0.14) 0%, transparent 50%),
        linear-gradient(180deg, rgba(8,12,22,0.97), rgba(4,6,12,0.98));
    backdrop-filter: blur(10px);
    display: flex; flex-direction: column;
    color: #e8e8e8;
    font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    animation: dg-fadein 0.3s ease-out;
    border: 1px solid rgba(255,215,0,0.25);
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.7), 0 0 0 9999px rgba(0,0,0,0.55);
    overflow: hidden;
}
@keyframes dg-fadein { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

/* ヘッダ */
.dg-form-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 24px;
    background: linear-gradient(180deg, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
    border-bottom: 1px solid rgba(255,215,0,0.25);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.dg-form-title {
    font-size: 22px; font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.4), 0 2px 4px rgba(0,0,0,0.6);
    margin: 0;
    letter-spacing: 0.05em;
}
.dg-form-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* 共通ボタン */
.dg-btn {
    background: linear-gradient(180deg, #2a3a55, #1a2540);
    color: #fff; border: 1px solid #4a6090;
    padding: 7px 14px; font-size: 13px;
    border-radius: 6px; cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-family: inherit;
}
.dg-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #3a4a65, #2a3550);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(80,120,200,0.35);
}
.dg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.dg-btn-primary { background: linear-gradient(180deg, #4a7a3a, #2a5a1a); border-color: #6a9a5a; }
.dg-btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #5a8a4a, #3a6a2a); box-shadow: 0 4px 12px rgba(100,200,80,0.35); }
.dg-btn-danger { background: linear-gradient(180deg, #7a3a3a, #5a1a1a); border-color: #9a5a5a; }
.dg-btn-close {
    background: transparent; border: none;
    font-size: 22px; color: #aaa;
    width: 32px; height: 32px;
    cursor: pointer; line-height: 1;
    transition: all 0.2s;
    border-radius: 50%;
}
.dg-btn-close:hover { color: #fff; background: rgba(255,255,255,0.1); transform: rotate(90deg); }

/* 部隊カードグリッド */
/* v0.6.50: minmax 360px→400px (12部隊作成時に部隊カードを若干広く)、 padding を底50→32px に縮めて表示領域確保 */
.dg-form-body {
    flex: 1; overflow-y: auto;
    padding: 18px 22px 32px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 14px;
    align-content: start;
}
.dg-form-body::-webkit-scrollbar { width: 10px; }
.dg-form-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
.dg-form-body::-webkit-scrollbar-thumb { background: rgba(255,215,0,0.2); border-radius: 5px; }
.dg-form-body::-webkit-scrollbar-thumb:hover { background: rgba(255,215,0,0.4); }

/* 部隊カード */
.dg-team-card {
    background:
        linear-gradient(135deg, rgba(40,55,90,0.55), rgba(20,30,55,0.65)),
        radial-gradient(circle at top right, rgba(80,140,255,0.1), transparent 60%);
    border: 1px solid rgba(150,180,255,0.22);
    border-radius: 14px;
    padding: 14px;
    box-shadow:
        0 4px 20px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.06);
    transition: all 0.25s;
    min-height: 200px;
    display: flex; flex-direction: column;
}
.dg-team-card.drag-over {
    border-color: #ffd700;
    background:
        linear-gradient(135deg, rgba(60,80,130,0.7), rgba(40,55,90,0.75)),
        radial-gradient(circle at center, rgba(255,215,0,0.08), transparent 70%);
    box-shadow: 0 0 24px rgba(255,215,0,0.4), inset 0 0 12px rgba(255,215,0,0.1);
    transform: scale(1.01);
}
.dg-team-card.full { border-color: rgba(255,140,140,0.4); }
.dg-team-card.deploy {
    border-color: #ffd700;
    box-shadow: 0 0 18px rgba(255,215,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.dg-team-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.dg-team-name {
    font-size: 15px; font-weight: 700;
    color: #6cb0ff;
    background: transparent;
    border: none;
    border-bottom: 1px dashed transparent;
    padding: 2px 4px;
    flex: 1;
    transition: border-color 0.2s;
    font-family: inherit;
    min-width: 0;
}
.dg-team-name:hover, .dg-team-name:focus {
    border-bottom-color: rgba(108,176,255,0.5);
    outline: none;
    color: #88c0ff;
}
.dg-team-deploy-badge {
    background: linear-gradient(180deg, #ffd700, #b88800);
    color: #000;
    font-size: 9px; font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-shadow: none;
}
.dg-team-count {
    font-size: 11px; color: #aaa;
    background: rgba(0,0,0,0.4);
    padding: 3px 10px; border-radius: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.dg-team-count.full { color: #ff8888; background: rgba(80,20,20,0.5); }
.dg-team-delete {
    background: transparent; border: none; color: #888;
    font-size: 14px; cursor: pointer;
    padding: 2px 6px; border-radius: 4px;
    transition: all 0.2s;
}
.dg-team-delete:hover { color: #f66; background: rgba(255,80,80,0.15); }

/* v0.6.50: minmax 96px→112px (アイコン拡大 48→64 に対応)、 gap 6→8px */
.dg-team-members {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 8px;
    flex: 1;
    align-content: start;
    min-height: 110px;
}
.dg-team-empty {
    color: #555; font-size: 12px; font-style: italic;
    text-align: center;
    padding: 24px 8px;
    grid-column: 1/-1;
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 6px;
}

/* 部隊所属なしカード(下部、横長) */
.dg-team-card.no-team {
    grid-column: 1/-1;
    background:
        linear-gradient(135deg, rgba(30,30,40,0.5), rgba(20,20,30,0.65));
    border-style: dashed;
    border-color: rgba(255,255,255,0.12);
    min-height: 120px;
}
.dg-team-card.no-team .dg-team-name {
    color: #888;
    cursor: default;
}

/* キャラカード */
.dg-char-card {
    background: linear-gradient(180deg, rgba(60,75,100,0.55), rgba(35,45,70,0.7));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 4px 6px;
    cursor: grab;
    transition: all 0.2s;
    text-align: center;
    position: relative;
    user-select: none;
    overflow: hidden;
}
.dg-char-card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.04));
    pointer-events: none;
    border-radius: 8px;
}
.dg-char-card:hover {
    transform: translateY(-3px);
    border-color: #ffd700;
    box-shadow: 0 6px 16px rgba(255,215,0,0.25), 0 0 0 1px rgba(255,215,0,0.4);
}
.dg-char-card:active { cursor: grabbing; }
.dg-char-card.dragging { opacity: 0.4; transform: scale(0.92); }
/* v0.5.47: 部隊管理画面の派遣中キャラはグレー化+📤マーク (ドラッグ不可、 詳細表示のみ可) */
.dg-char-card.dispatched {
    filter: grayscale(0.7) brightness(0.65);
    cursor: not-allowed;
    opacity: 0.7;
}
.dg-char-card.dispatched:hover { filter: grayscale(0.5) brightness(0.85); transform: none; }
.dg-char-card .dg-char-dispatch-mark {
    position: absolute;
    top: 4px; right: 4px;
    font-size: 14px;
    text-shadow: 0 0 6px rgba(255,180,80,0.7), 0 1px 2px #000;
    pointer-events: none;
    z-index: 2;
}

/* v0.6.50: アイコン拡大 48→64px (ユーザー指示「アイコンも一回り大きく」) */
.dg-char-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    object-fit: cover; object-position: center 30%;
    margin: 0 auto 5px;
    display: block;
    border: 2px solid rgba(255,255,255,0.18);
    background: #222;
}

/* ============================================================
 * v0.5.84: 画像フォルダ別 object-position 再検証 (実画像サイズ調査結果反映)
 *
 *  実画像中央値: img_k=433x577(混在 1.0/1.33) / img_k2=360x360(正方形) / img_k3=1024x1024(正方形)
 *  ─ img_k3 はAI生成全身像で顔位置が画像高さの15-22%付近 → 18%
 *  ─ img_k2 は既存360x360バストアップで顔位置中央〜上 → 25-30%(.dg-char-icon側既存値で対応)
 *  ─ img_k は アスペクト比1.0と1.33が混在のためCSS一律不可 → data-aspect属性をJSで付与し
 *    縦長(1.33系)は20%/正方形(1.0系)は30%で個別に上書き(下記 img_k[data-aspect])
 *  v0.5.65 旧設定 img_k3=12%/img_k=18% は img_k3の上ズレ+img_k混在誤差 で 顔切れ報告あり、改善。
 * ============================================================ */
img[src^="img_k3/"] {
    object-position: center 18% !important;  /* AI生成全身像 顔位置再調整 12→18% */
}
img[src^="img_k/"][data-aspect="tall"] {
    object-position: center 20% !important;  /* 縦長 433x577系 顔位置上部寄り */
}
img[src^="img_k/"][data-aspect="square"] {
    object-position: center 30% !important;  /* 正方形 360x360系 中央寄り */
}
/* data-aspect未付与のimg_k (JS未実行/読込失敗時) はデフォルト center center で安全側 */
/* img_k2 は 既存仕様 (object-position: center 25-30%) を維持 (上書きなし) */
.dg-char-name {
    font-size: 11px; font-weight: 600;
    color: #eee;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding: 0 4px;
}
.dg-char-name.online {
    color: #ffd700;
    text-shadow: 0 0 4px rgba(255,215,0,0.45);
}
.dg-char-rank {
    position: absolute; top: 3px; left: 3px;
    font-size: 9px; font-weight: 800;
    background: rgba(0,0,0,0.75);
    padding: 1px 5px; border-radius: 3px;
    line-height: 1.2;
    z-index: 2;
}
.dg-char-class {
    position: absolute; top: 3px; right: 3px;
    font-size: 9px; font-weight: 800;
    padding: 1px 5px; border-radius: 3px;
    color: #000;
    line-height: 1.2;
    z-index: 2;
    text-shadow: 0 0 2px rgba(255,255,255,0.5);
}

/* === キャラ詳細モーダル (v0.4.85: 全画面背景化、キャラ画像をfull背景にテキストオーバーレイ配置) === */
#dg-char-detail {
    position: fixed; inset: 0; z-index: 100050 /* v0.6.96 */;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    padding: 8px;  /* v0.5.118: 16→8px に縮小 (内側85vwを最大化、 上下に余白少々のみ) */
    animation: dg-fadein 0.25s ease-out;
}
.dg-detail-box {
    position: relative;
    background: linear-gradient(135deg, #0f1525, #060a14);
    border: 1px solid rgba(255,215,0,0.35);
    border-radius: 14px;
    /* v0.4.85: 大画面化(画面幅96%、高さ92vh) */
    /* v0.5.70: ユーザー指示「プロフィールがでかすぎる」 → 適度なサイズへ縮小 (max-width 1400→1100, height 92→80vh) */
    /* v0.5.108: 横幅も狭める (ユーザー指示「縦幅だけでなく横幅も狭めて、 グラフ系はいじらず画面右側を大幅に詰める」)
                 width 88vw→72vw / max 1100→880px / min 720→640px。 */
    width: 72vw;
    max-width: 880px;
    min-width: 640px;
    height: 80vh;
    min-height: 560px;
    color: #eee;
    box-shadow:
        0 16px 60px rgba(0,0,0,0.8),
        0 0 100px rgba(255,215,0,0.10),
        inset 0 1px 0 rgba(255,255,255,0.08);
    overflow: hidden;
}
/* v0.4.115: キャラ画像を背景full配置 → 右寄り40%幅・高さ70% に変更。
   ぼかし(brightness 0.55) も控えめ(0.85) に減らして「立ち絵」として視認可能に。
   背景ではないため inset:0 やめ、右側のみ専用エリアに配置。テキストパネルは画像と被らない。
   v0.4.143: ユーザー要望「右寄せすぎ問題解消・枠はみ出しOK・もっと大きく」対応。
   right:2% → right:5%、width:40% → width:55%、height:70% → height:96%、top:12%→top:2%
   で右ペイン内ほぼ全面に拡大。background-size:contain は維持(画像比率歪み防止)、
   テキストパネル(.dg-detail-content)とは pointer-events:none で重なってもクリック貫通。 */
.dg-detail-bg {
    /* v0.5.123: パネル右半分の背景レイヤーに ─ キャラ画像は右55%エリアにフル配置、 テキストは半透明グラデで重なる */
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    z-index: 0;
    background-size: contain;
    background-position: right center;
    background-repeat: no-repeat;
    opacity: 1.0;
    filter: brightness(1.0) saturate(1.1) drop-shadow(0 4px 12px rgba(0,0,0,0.6));
    pointer-events: none;
    border-radius: 0 14px 14px 0;
}
/* v0.4.115: ::after の縦横フェードグラデは廃止 (背景full配置でなくなったため) */
.dg-detail-bg::after {
    display: none;
}
/* v0.4.145: 動画版背景 ─ .dg-detail-bg と同等の位置・サイズで動画を再生。
   動画ありキャラは初期=動画優先で表示、静止画ボタンで .dg-detail-bg に切替。 */
.dg-detail-bg-video {
    /* v0.5.123: .dg-detail-bg と同位置 (右55%エリア) でフル配置 */
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    z-index: 0;
    object-fit: cover;
    object-position: center top;
    border-radius: 0 14px 14px 0;
    pointer-events: none;
    filter: brightness(0.95) saturate(1.1) drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}
.dg-detail-content {
    position: relative;
    z-index: 1;
    padding: 18px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* v0.5.123: ユーザー指示「画像を背部(背景)に表示+重ねる」 採用 ─
       キャラ画像は .dg-detail-bg として 背景レイヤー (z-index:0) で重なる。
       テキストは全幅利用 (padding-rightなし) +半透明グラデで 右側ほど透けてキャラ画像が見える。
       これで「画像分のpadding確保で文字圧迫」 という根本問題を解消。 */
    width: 85vw;
    max-width: 1300px;
    min-width: 800px;
    max-height: 88vh;
    box-sizing: border-box;
    /* 半透明グラデ: 左0.92不透明(文字読みやすい) → 右0.20透明(キャラ画像が透ける) */
    background: linear-gradient(90deg, rgba(15,21,37,0.92) 0%, rgba(15,21,37,0.88) 45%, rgba(15,21,37,0.50) 70%, rgba(15,21,37,0.20) 100%);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255,215,0,0.35);
    border-radius: 14px;
    box-shadow: 0 16px 60px rgba(0,0,0,0.8), 0 0 100px rgba(255,215,0,0.10), inset 0 1px 0 rgba(255,255,255,0.08);
}
/* v0.5.123→v0.5.124: テキスト要素を背景画像より前に配置 (z-index:2)。
   ★絶対配置の .dg-detail-bg/.dg-detail-bg-video を 除外 (:not セレクタ) ─
   v0.5.123 で `> *` が 全子要素に position:relative を強制適用していたため、
   .dg-detail-bg/video の position:absolute が relative に上書きされて 通常フロー入りで巨大表示する致命バグ。 */
.dg-detail-content > *:not(.dg-detail-bg):not(.dg-detail-bg-video) {
    position: relative;
    z-index: 2;
}
/* 背景レイヤー (z-index:0) は absolute 維持で 右55%エリアに固定配置 */
.dg-detail-content > .dg-detail-bg,
.dg-detail-content > .dg-detail-bg-video {
    z-index: 0 !important;
    position: absolute !important;
}
/* v0.5.118: select内部要素のはみ出し防止 (突き抜け対策) */
.dg-detail-content select,
.dg-detail-content .dg-detail-select {
    max-width: 100%;
    box-sizing: border-box;
    text-overflow: ellipsis;
    overflow: hidden;
}
/* v0.4.37: 内部の可変要素を固定範囲に押し込めて、キャラ切替時に高さがブレない */
.dg-detail-skills {
    min-height: 70px;
    max-height: 130px;
    overflow-y: auto;
    padding: 4px 0;
}
.dg-detail-2col {
    flex-shrink: 0;
}
.dg-detail-form {
    margin-top: auto; /* 下に固定 */
    flex-shrink: 0;
}
/* v0.4.145: 詳細モーダル ドロップダウン共通CSS ─ 暗色背景+15pxフォント+ボーダー
   ブラウザ既定の白背景を上書き、テキスト視認性UP。 */
/* v0.5.11: 部隊編成画面の出撃部隊selectにも同じスタイル適用 (ユーザー指摘「ドロップメニュー内CSSが適用されておらず文字が見えない」) */
.dg-detail-select,
#dg-deploy-team {
    font-size: 15px !important;
    background: #1a1a1a !important;
    color: #eee !important;
    border: 1px solid #555 !important;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}
.dg-detail-select option,
#dg-deploy-team option {
    background: #1a1a1a;
    color: #eee;
    padding: 6px 8px;
    font-size: 15px;
}
.dg-detail-select:focus,
#dg-deploy-team:focus {
    outline: 1px solid #ffd700;
}
.dg-detail-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === v0.4.32 ステータス画面リッチ刷新 (ui02キャラ個人.png 参考) === */
.dg-detail-2col {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    margin-bottom: 14px;
}
.dg-detail-pane-stats {
    display: flex; flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.dg-detail-pane-portrait {
    position: relative;
    display: flex; flex-direction: column;
    gap: 8px;
}

/* 大ポートレート (280x360, ui02ライク) */
.dg-portrait-large {
    position: relative;
    width: 100%; height: 360px;
    border-radius: 12px;
    border: 3px solid #ffd700;
    background:
        linear-gradient(180deg, rgba(40,80,140,0.25) 0%, rgba(20,40,80,0.4) 100%),
        radial-gradient(circle at top, rgba(255,215,0,0.12), transparent 60%);
    overflow: hidden;
    box-shadow: 0 0 32px rgba(255,215,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.dg-portrait-large-img,
.dg-portrait-large-video {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center 25%;
    display: block;
}
.dg-portrait-name-badge {
    position: absolute; left: 10px; top: 10px;
    background: linear-gradient(180deg, rgba(0,0,0,0.85), rgba(0,0,0,0.6));
    border: 1px solid #ffd700;
    color: #ffd700;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 14px; font-weight: 700;
    text-shadow: 0 0 6px rgba(255,215,0,0.6);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.dg-portrait-lv-badge {
    position: absolute; right: 10px; top: 10px;
    background: linear-gradient(180deg, #ffd700, #b88800);
    color: #000;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 13px; font-weight: 800;
    box-shadow: 0 2px 6px rgba(255,215,0,0.4);
}
.dg-portrait-rank-badge {
    position: absolute; right: 10px; bottom: 10px;
    background: rgba(0,0,0,0.85);
    border: 2px solid currentColor;
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 16px; font-weight: 800;
    text-shadow: 0 0 8px currentColor;
    backdrop-filter: blur(2px);
}
.dg-portrait-controls-v2 {
    display: flex; gap: 6px;
    padding: 8px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
}
.dg-portrait-controls-v2 .dg-portrait-btn { width: 32px; height: 32px; }

/* ACE POINT風 大きな戦功表示 */
.dg-acepoint {
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(180,120,0,0.1));
    border: 1px solid rgba(255,215,0,0.4);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    box-shadow: inset 0 0 12px rgba(255,215,0,0.1);
}
.dg-acepoint-label {
    font-size: 10px;
    color: #aaa;
    letter-spacing: 0.2em;
    margin-bottom: 2px;
    text-transform: uppercase;
}
.dg-acepoint-value {
    font-size: 26px;
    color: #ffd700;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 12px rgba(255,215,0,0.6);
    letter-spacing: 0.05em;
    line-height: 1;
}

/* 戦績ミニ (キル/デス/MVP/総戦闘) */
.dg-record-mini {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 8px;
}
.dg-record-mini-item {
    text-align: center;
}
.dg-record-mini-label {
    font-size: 9px; color: #888;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.dg-record-mini-value {
    font-size: 16px; color: #fff;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* セクション見出し */
.dg-section-title {
    font-size: 11px; color: #ffd700;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin: 8px 0 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,215,0,0.25);
    text-transform: uppercase;
}

/* ステータス行(縦長並び、参考画像ライク) */
.dg-stat-grid-v2 {
    display: flex; flex-direction: column;
    gap: 4px;
}
.dg-stat-row-v2 {
    display: grid;
    grid-template-columns: 60px 50px 1fr 50px;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}
.dg-stat-row-v2:hover { background: rgba(255,255,255,0.04); }
.dg-stat-row-v2 .dg-stat-icon {
    font-size: 11px; color: #88c0ff;
    font-weight: 700;
}
.dg-stat-row-v2 .dg-stat-num {
    font-size: 18px; color: #fff;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.dg-stat-row-v2 .dg-stat-bar-v2 {
    height: 14px;
    background: rgba(0,0,0,0.5);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
}
.dg-stat-row-v2 .dg-stat-fill-v2 {
    height: 100%;
    background: linear-gradient(90deg, #2a78cc 0%, #4a9eff 30%, #88ff88 60%, #ffd700 100%);
    transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 8px rgba(255,215,0,0.3);
}
/* v0.4.146: 装備バフ/デバフ色レイヤ ─ 紫=増加 / 赤=減少。
   absolute配置で .dg-stat-fill-v2 の右端に追加された分として表示。 */
.dg-stat-row-v2 .dg-stat-fill-buff {
    position: absolute; top: 0; bottom: 0;
    background: linear-gradient(90deg, #a060d8, #d080ff);
    box-shadow: inset 0 0 6px rgba(255,160,255,0.4);
    transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dg-stat-row-v2 .dg-stat-fill-debuff {
    position: absolute; top: 0; bottom: 0;
    background: linear-gradient(90deg, #c83434, #ff6060);
    box-shadow: inset 0 0 6px rgba(255,80,80,0.4);
    transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* v0.4.146: バー上のオーバーレイテキスト (射程/発砲音/重量)
   v0.4.149: ユーザー要望でフォント+4px (10→14px)、視認性向上 */
.dg-stat-row-v2 .dg-stat-overlay {
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 0 3px #000, 0 1px 2px rgba(0,0,0,0.9);
    pointer-events: none;
    letter-spacing: 0.04em;
}
/* v0.4.149: 詳細モーダル内フォントを全体+2px (ユーザー要望) ─
   #dg-char-detail スコープ限定で base 16px、各CSSクラスを+2px 上書き。
   インラインstyle指定は残るが、CSSルール側で当ててる箇所が大半でカバーされる。
   .dg-stat-bar-v2 の高さもオーバーレイ14pxに合わせて 14→20px に増量。 */
#dg-char-detail { font-size: 16px; }
#dg-char-detail .dg-section-title,
#dg-char-detail .dg-stat-row-v2 .dg-stat-icon,
#dg-char-detail .dg-stat-row-v2 .dg-stat-grade,
#dg-char-detail .dg-stat-label,
#dg-char-detail .dg-stat-value,
#dg-char-detail .dg-equip-value { font-size: 17px; }
#dg-char-detail .dg-stat-num { font-size: 20px; }
#dg-char-detail .dg-acepoint-value { font-size: 22px; }
#dg-char-detail .dg-record-mini-value { font-size: 17px; }
/* v0.4.200: 戦績mini-itemのpaddingを切り詰めて縦サイズ短縮 */
#dg-char-detail .dg-record-mini-item { padding: 4px 6px; }
#dg-char-detail .dg-record-mini-label { font-size: 11px; }
#dg-char-detail .dg-acepoint { padding: 6px 10px; }
#dg-char-detail .dg-acepoint-label { font-size: 11px; }
#dg-char-detail .dg-skill-tag,
#dg-char-detail .dg-acepoint-label,
#dg-char-detail .dg-record-mini-label,
#dg-char-detail .dg-equip-label,
#dg-char-detail .dg-detail-meta,
#dg-char-detail .dg-detail-meta span { font-size: 15px; }
#dg-char-detail .dg-detail-select,
#dg-char-detail .dg-detail-select option { font-size: 17px !important; }
/* バー高さもオーバーレイ文字に合わせて拡大 */
#dg-char-detail .dg-stat-row-v2 .dg-stat-bar-v2 { height: 20px; }
.dg-stat-row-v2 .dg-stat-grade {
    font-size: 11px; color: #888;
    text-align: right;
}

/* オンライン/オフライン状態バッジ */
.dg-online-badge {
    display: inline-block;
    padding: 3px 9px; border-radius: 4px;
    font-size: 10px; font-weight: 700;
    background: linear-gradient(180deg, #ffd700, #b88800);
    color: #000;
    box-shadow: 0 0 8px rgba(255,215,0,0.4);
}
.dg-offline-badge {
    display: inline-block;
    padding: 3px 9px; border-radius: 4px;
    font-size: 10px; font-weight: 700;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: #aaa;
}

/* 装備サマリ */
.dg-equip-summary {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 8px;
}
.dg-equip-cell {
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    padding: 6px 8px;
}
.dg-equip-label {
    font-size: 9px; color: #888;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.dg-equip-value {
    font-size: 12px; color: #fff;
    font-weight: 600;
    margin-top: 2px;
}

/* レスポンシブ: 768px以下は1列 */
@media (max-width: 768px) {
    .dg-detail-2col { grid-template-columns: 1fr; }
    .dg-portrait-large { height: 280px; }
}

/* ============================================================
 *  v0.4.35 フォントサイズ統一: 下限13px / 強調15px / 見出し22px
 *  小さくて読みづらかった全箇所を一括修正
 * ============================================================ */

/* 見出しレベル (22px) */
.dg-form-title { font-size: 22px; }
.dg-detail-name { font-size: 22px; }
.dg-portrait-rank-badge { font-size: 22px; padding: 5px 14px; }
.dg-stat-num { font-size: 22px; }
.dg-acepoint-value { font-size: 28px; }
.dg-record-mini-value { font-size: 20px; }

/* 強調レベル (15px) */
.dg-team-name { font-size: 15px; }
.dg-skills-title { font-size: 15px; letter-spacing: 0.05em; }
.dg-portrait-name-badge { font-size: 15px; padding: 5px 14px; }
.dg-portrait-lv-badge { font-size: 15px; padding: 4px 11px; }
.dg-equip-value { font-size: 15px; font-weight: 700; }
.dg-section-title { font-size: 15px; padding-bottom: 5px; }
.dg-stat-row-v2 .dg-stat-icon { font-size: 15px; font-weight: 700; }
.dg-stat-row-v2 .dg-stat-grade { font-size: 15px; font-weight: 700; }
.dg-stat-label { font-size: 15px; }
.dg-stat-value { font-size: 15px; }

/* サイドバー強調 */
/* v0.4.109: チーム名を中央配置 (左上のLv10ログインメニュー領域と視覚的に被らないため) */
#サイドバー内容 .dg-side-team-name { font-size: 17px !important; flex: 1; text-align: center; }
#サイドバー内容 .dg-side-action-btn { font-size: 17px !important; padding: 8px; }
#サイドバー内容 .dg-side-action-btn2 { font-size: 17px !important; padding: 8px; }

/* 通常レベル (13px下限) */
.dg-team-count { font-size: 13px; padding: 4px 12px; }
.dg-team-empty { font-size: 13px; padding: 28px 8px; }
.dg-char-name { font-size: 13px; }
.dg-char-rank { font-size: 13px; padding: 2px 6px; }
.dg-char-class { font-size: 13px; padding: 2px 6px; }
.dg-detail-meta { font-size: 13px; }
.dg-detail-meta span { font-size: 13px; padding: 4px 11px; }
.dg-skill-tag { font-size: 13px; padding: 4px 12px; }
.dg-form-row label { font-size: 13px; }
.dg-form-row label small { font-size: 13px; }
.dg-form-row select,
.dg-form-row input[type="text"] { font-size: 13px; padding: 8px 11px; }
.dg-deploy-tab { font-size: 13px; padding: 8px 16px; }
.dg-acepoint-label { font-size: 13px; letter-spacing: 0.15em; }
.dg-record-mini-label { font-size: 13px; letter-spacing: 0.05em; }
.dg-equip-label { font-size: 13px; }
.dg-online-badge, .dg-offline-badge { font-size: 13px; padding: 4px 11px; }
.dg-btn { font-size: 13px; padding: 8px 16px; }

/* サイドバー通常 */
#サイドバー内容 .dg-side-team-header { font-size: 15px; padding: 9px 12px; }
#サイドバー内容 .dg-side-arrow { font-size: 13px; width: 12px; }
#サイドバー内容 .dg-side-deploy { font-size: 13px; min-width: 52px; height: 26px; padding: 0 8px; }
#サイドバー内容 .dg-side-count { font-size: 13px; padding: 3px 10px; }
/* v0.4.82: キャラ名フォント拡大 13px→15px、padding上下も少し増 */
#サイドバー内容 .dg-side-char { font-size: 15px; padding: 7px 10px; }
#サイドバー内容 .dg-side-rank { font-size: 13px; min-width: 28px; height: 20px; line-height: 18px; padding: 1px 6px; }
#サイドバー内容 .dg-side-empty { font-size: 13px; padding: 8px; }
#サイドバー内容 .dg-side-mana-bar { font-size: 13px; padding: 8px 14px; }
#サイドバー内容 .dg-side-mana-bar small { font-size: 13px; font-weight: 400; }

/* 細い説明テキストも 13pxを下限に */
.dg-portrait-controls-v2 span { font-size: 13px !important; }

/* ============================================================
 *  v0.4.40 会話ダイアログ立ち絵対応 (本実装)
 *  話者の左/右に立ち絵を表示、左上→右下→左上 と交互配置
 * ============================================================ */
/* v0.6.99: サバゲ会話 (#dg-talk-screen) を デモゲノベル風 (.Go吹出系/330_ノベル.css) に統一 ─ ユーザー指示「サバゲのセリフ形式は独自のものを廃止しデモゲノベルcss統一」。
   完全な#Goセリフレイヤー統合は将来作業 (412_会話.js GoTalk.シーン表示の大規模改修必要)、
   今回は サバゲ独自セリフ枠の見た目を デモゲノベル風 (黒透過半透明+白縁取り名前+太字本文+立ち絵55vh) に近づける簡易統一。 */
#dg-talk-screen {
    pointer-events: auto;
    font-family: 'NotoSerifJP', 'Shippori Mincho', serif;
}
.dg-talk-portrait-img {
    position: fixed;
    bottom: 80px;
    height: 55vh;
    max-width: 28vw;
    object-fit: contain;
    object-position: bottom center;
    z-index: 100041;
    pointer-events: none;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.7));
    animation: dg-talk-slidein 0.3s ease-out;
}
.dg-talk-portrait-img.left { left: 2vw; }
.dg-talk-portrait-img.right { right: 2vw; }
@keyframes dg-talk-slidein {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dg-talk-box {
    position: relative;
    z-index: 100042;
    background: rgba(0,0,0,0.7);
    border: none;
    border-radius: 0;
    padding: 22px 32px 18px;
    width: 96%;
    max-width: none;
    margin: 0 auto 28px;
    color: #fff;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    cursor: pointer;
}
.dg-talk-speaker {
    color: #ffd700;
    font-family: 'MS Gothic', 'ＭＳ ゴシック', monospace;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 14px;
    -webkit-text-stroke: 1.5px #000;
    paint-order: stroke fill;
    text-shadow: none;
    letter-spacing: 0.05em;
}
.dg-talk-text {
    font-size: 22px;
    line-height: 1.6;
    min-height: 64px;
    color: #fff;
    font-weight: 500;
    white-space: pre-wrap;
    text-shadow: 2px 2px 4px #000;
}
.dg-talk-next {
    text-align: right;
    font-size: 13px; color: #aaa;
    margin-top: 8px;
    animation: dg-talk-blink 1.2s infinite;
}
@keyframes dg-talk-blink { 50% { opacity: 0.4; } }
.dg-talk-skip {
    position: absolute;
    top: 12px; right: 14px;
    font-size: 13px;
    background: rgba(0,0,0,0.6);
    color: #aaa;
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid #555;
    cursor: pointer;
    z-index: 100043;
}
.dg-talk-skip:hover { color: #fff; border-color: #fff; }

/* グリッド幅も大きいフォントに合わせて調整 */
.dg-stat-row-v2 { grid-template-columns: 70px 110px 1fr 60px; padding: 4px 10px; align-items: center; }
/* v0.4.185: 数値+補正の (+35) を1行強制+折返禁止、フォント微調整で縦伸び抑止 */
.dg-stat-row-v2 .dg-stat-num { white-space: nowrap; line-height: 1.1; }
.dg-stat-row-v2 .dg-stat-num small { font-size: 0.6em; margin-left: 3px; }
.dg-stat-row { grid-template-columns: 56px 1fr 50px; }
.dg-detail-head {
    display: flex; gap: 16px; align-items: flex-start;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
/* キャラポートレート: 160x200 長方形(画像+動画切替+テーマ再生対応) */
.dg-detail-portrait {
    position: relative;
    width: 160px; height: 200px;
    border-radius: 14px;
    border: 3px solid #ffd700;
    background: #222;
    overflow: hidden;
    box-shadow: 0 0 28px rgba(255,215,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.dg-detail-portrait-img,
.dg-detail-portrait-video {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 25%;
    display: block;
}
.dg-portrait-controls {
    position: absolute; bottom: 6px; right: 6px;
    display: flex; gap: 5px;
    z-index: 2;
}
.dg-portrait-btn {
    width: 30px; height: 30px;
    background: rgba(0,0,0,0.75);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 15px;
    cursor: pointer;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(2px);
    padding: 0;
}
.dg-portrait-btn:hover {
    background: rgba(255,215,0,0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(255,215,0,0.4);
}
.dg-portrait-btn.active {
    background: linear-gradient(180deg, #ffd700, #b88800);
    color: #000;
    border-color: #ffd700;
}

/* 旧 .dg-detail-icon は他用途で残す(縮小サイズ) */
.dg-detail-icon {
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 3px solid #ffd700;
    object-fit: cover; object-position: center 30%;
    box-shadow: 0 0 24px rgba(255,215,0,0.35);
    flex-shrink: 0;
    background: #222;
}
.dg-detail-info { flex: 1; min-width: 0; }
.dg-detail-name {
    font-size: 22px; font-weight: 700;
    margin: 0 0 8px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
    letter-spacing: 0.03em;
}
.dg-detail-name.online {
    color: #ffea7a;
    text-shadow: 0 0 12px rgba(255,234,122,0.6);
}
.dg-detail-meta {
    display: flex; gap: 6px; flex-wrap: wrap;
    font-size: 11px; color: #ccc;
}
.dg-detail-meta span {
    padding: 3px 9px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    font-weight: 600;
}

/* パラメータバー */
.dg-detail-stats {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}
.dg-stat-row {
    display: grid; grid-template-columns: 50px 1fr 44px;
    align-items: center; gap: 10px;
    font-size: 13px;
}
.dg-stat-label { color: #aaa; font-weight: 600; }
.dg-stat-bar {
    height: 9px;
    background: rgba(0,0,0,0.5);
    border-radius: 5px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
}
.dg-stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a9eff 0%, #88ff88 50%, #ffd700 100%);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 8px rgba(255,215,0,0.3);
}
.dg-stat-value {
    font-weight: 700;
    color: #fff;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* スキル一覧 */
.dg-detail-skills {
    margin-bottom: 18px;
}
.dg-skills-title {
    font-size: 12px; color: #aaa;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.dg-skill-tag {
    display: inline-block;
    background: linear-gradient(180deg, rgba(80,120,200,0.4), rgba(40,80,160,0.55));
    border: 1px solid rgba(150,180,255,0.35);
    color: #fff;
    padding: 3px 11px;
    margin: 2px;
    font-size: 11px; font-weight: 600;
    border-radius: 12px;
    cursor: help;
}
.dg-skill-tag.rank-S, .dg-skill-tag.rank-SS {
    background: linear-gradient(180deg, rgba(255,80,80,0.4), rgba(160,40,40,0.55));
    border-color: rgba(255,150,150,0.4);
}
.dg-skill-tag.rank-A {
    background: linear-gradient(180deg, rgba(255,180,40,0.4), rgba(180,120,20,0.55));
    border-color: rgba(255,200,100,0.4);
}
.dg-skill-tag.rank-B {
    background: linear-gradient(180deg, rgba(80,160,255,0.4), rgba(40,100,200,0.55));
    border-color: rgba(120,180,255,0.4);
}
.dg-skill-tag.rank-D {
    background: linear-gradient(180deg, rgba(120,120,120,0.4), rgba(60,60,60,0.55));
    border-color: rgba(150,150,150,0.3);
    opacity: 0.7;
}

/* 編集フォーム */
.dg-detail-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.dg-form-row { display: flex; flex-direction: column; gap: 4px; }
.dg-form-row label {
    font-size: 11px; color: #aaa;
    font-weight: 600;
}
.dg-form-row label small { font-weight: 400; }
/* v0.4.70: プルダウン色をメニューバー類似の暗色+白テキストに統一、選択中はサイドバーホバーと同じ青系 */
.dg-form-row select, .dg-form-row input[type="text"] {
    background: linear-gradient(180deg, #1a1d2a, #0f1525);
    border: 1px solid #2a3550;
    color: #fff;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
}
/* v0.4.71: <option> は linear-gradient不可・OS優先。単色+!important+box-shadow強制で確実に上書き */
.dg-form-row select option {
    background-color: #0f1525 !important;
    color: #fff !important;
    padding: 6px 10px;
}
/* 選択中・ホバー時は左サイドバー .dg-side-char:hover と同じ青系単色 */
.dg-form-row select option:checked,
.dg-form-row select option:hover,
.dg-form-row select option:focus {
    background: #3a5aa8 !important;
    background-color: #3a5aa8 !important;
    box-shadow: 0 0 10px 100px #3a5aa8 inset !important;  /* WebKit/Chromium のシステム背景を強制上書き */
    color: #fff !important;
}
.dg-form-row select:focus, .dg-form-row input:focus {
    border-color: #ffd700;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,215,0,0.2);
}
.dg-form-row select:disabled { opacity: 0.5; cursor: not-allowed; }

/* ロビー編成パネル拡張 */
.dg-deploy-tabs {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-bottom: 10px;
}
.dg-deploy-tab {
    padding: 6px 14px;
    background: rgba(40,50,80,0.5);
    border: 1px solid rgba(255,255,255,0.12);
    color: #aaa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
    font-family: inherit;
}
.dg-deploy-tab:hover { background: rgba(60,80,120,0.6); color: #fff; }
.dg-deploy-tab.active {
    background: linear-gradient(180deg, #4a7a3a, #2a5a1a);
    color: #fff;
    border-color: #6a9a5a;
    box-shadow: 0 2px 8px rgba(100,200,80,0.3);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .dg-form-body { grid-template-columns: 1fr; padding: 12px; }
    .dg-form-header { padding: 10px 12px; }
    .dg-form-title { font-size: 18px; }
    .dg-detail-form { grid-template-columns: 1fr; }
    .dg-detail-head { flex-direction: column; align-items: center; text-align: center; }
}

/* ============================================================
 *  サイドバー部隊リスト (main.js のリンクシステムを上書き)
 *  v0.4.15: dg.lv10.jp ではサイドバー内容を部隊専用UIに完全置換
 * ============================================================ */

/* フィルタボタン(♪/🎬/🔗)は menu/main.js L1106-1108 の #lv10-filter-* を非表示
   将来何かに再利用予定のため、HTML自体は menu 側で残し、CSSのみで隠す。 */
#lv10-filter-mp3,
#lv10-filter-mp4,
#lv10-filter-other { display: none !important; }

/* サイドバー先頭がmenuヘッダ4アイコンと重ならないようマージン確保 */
#サイドバー内容 .dg-side-actions:first-child {
    margin-top: 52px;
}

/* D&D行単位の挿入位置インジケータ(キャラ間の並び順変更用) */
#サイドバー内容 .dg-side-char.drop-before { box-shadow: inset 0 3px 0 #ffd700, 0 0 8px rgba(255,215,0,0.3); }
#サイドバー内容 .dg-side-char.drop-after  { box-shadow: inset 0 -3px 0 #ffd700, 0 0 8px rgba(255,215,0,0.3); }

/* 部隊カード(サイドバー版) */
#サイドバー内容 .dg-side-team {
    margin-bottom: 6px;
    border: 1px solid rgba(150,180,255,0.18);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(40,55,90,0.4), rgba(20,30,55,0.55));
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#サイドバー内容 .dg-side-team.deploy {
    border-color: rgba(255,215,0,0.55);
    box-shadow: 0 0 14px rgba(255,215,0,0.18);
}
#サイドバー内容 .dg-side-team.no-team {
    background: linear-gradient(180deg, rgba(30,30,40,0.4), rgba(20,20,30,0.55));
    border-style: dashed;
    border-color: rgba(255,255,255,0.12);
}
#サイドバー内容 .dg-side-team.drag-over {
    border-color: #ffd700;
    box-shadow: 0 0 16px rgba(255,215,0,0.35);
    transform: scale(1.01);
}

#サイドバー内容 .dg-side-team-header {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 10px;
    cursor: pointer;
    background: rgba(0,0,0,0.35);
    font-size: 12px;
    font-weight: 700;
    color: #ccc;
    user-select: none;
}
#サイドバー内容 .dg-side-team-header:hover { background: rgba(80,120,200,0.2); }

#サイドバー内容 .dg-side-arrow {
    font-size: 9px; color: #888;
    transition: transform 0.2s;
    display: inline-block;
    width: 10px;
}
#サイドバー内容 .dg-side-team.collapsed .dg-side-arrow { transform: rotate(-90deg); }

#サイドバー内容 .dg-side-team-name {
    flex: 1;
    color: #6cb0ff;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#サイドバー内容 .dg-side-team.deploy .dg-side-team-name { color: #ffd700; }
#サイドバー内容 .dg-side-team.no-team .dg-side-team-name { color: #888; }

#サイドバー内容 .dg-side-deploy {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    color: #aaa;
    height: 20px; min-width: 36px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 700;
    padding: 0 6px;
}
#サイドバー内容 .dg-side-deploy:hover { background: rgba(255,215,0,0.1); color: #fff; }
#サイドバー内容 .dg-side-deploy.active {
    background: linear-gradient(180deg, #ffd700, #b88800);
    color: #000;
    border-color: #ffd700;
}

#サイドバー内容 .dg-side-count {
    font-size: 10px;
    color: #888;
    background: rgba(0,0,0,0.35);
    padding: 2px 7px;
    border-radius: 8px;
    flex-shrink: 0;
}

#サイドバー内容 .dg-side-members {
    padding: 4px;
    display: flex; flex-direction: column;
    gap: 2px;
}
#サイドバー内容 .dg-side-team.collapsed .dg-side-members { display: none; }

#サイドバー内容 .dg-side-char {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: grab;
    transition: background 0.15s;
    font-size: 12px;
    user-select: none;
}
#サイドバー内容 .dg-side-char:hover { background: rgba(80,120,200,0.28); }
#サイドバー内容 .dg-side-char:active { cursor: grabbing; }
#サイドバー内容 .dg-side-char.dragging { opacity: 0.4; }
/* v0.5.28: 派遣中キャラはグレー化、 ドラッグ不可 (詳細表示のみOK) */
#サイドバー内容 .dg-side-char.dispatched {
    filter: grayscale(0.7) brightness(0.65);
    cursor: not-allowed;
    opacity: 0.7;
}
#サイドバー内容 .dg-side-char.dispatched:hover { background: rgba(120,80,40,0.25); filter: grayscale(0.5) brightness(0.85); }
#サイドバー内容 .dg-side-char .dg-side-dispatch-mark {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.85;
    text-shadow: 0 0 4px rgba(255,180,80,0.5);
}

#サイドバー内容 .dg-side-rank {
    display: inline-block;
    min-width: 22px; height: 16px;
    text-align: center;
    color: #000;
    font-weight: 800;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

#サイドバー内容 .dg-side-name {
    flex: 1;
    color: #ddd;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#サイドバー内容 .dg-side-name.online {
    color: #ffd700;
    text-shadow: 0 0 4px rgba(255,215,0,0.45);
}

#サイドバー内容 .dg-side-empty {
    color: #555; font-size: 11px; font-style: italic;
    text-align: center;
    padding: 6px;
}

#サイドバー内容 .dg-side-actions {
    display: flex; gap: 6px; margin: 8px 0;
    flex-wrap: wrap;
}
/* v0.4.67: 主要ボタン(派遣/出撃)=70%, secondary(編成)=30% に幅配分 */
#サイドバー内容 .dg-side-action-btn2 {
    flex: 7;
    padding: 8px;
    background: linear-gradient(180deg, #905090, #C056C0);
    border: 1px solid #6a9a5a;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 0;
}
#サイドバー内容 .dg-side-action-btn2:hover {
    background: linear-gradient(180deg, #A060A0, #D066D0);
    transform: translateY(-1px);
}
#サイドバー内容 .dg-side-action-btn {
    flex: 7;
    padding: 7px;
    background: linear-gradient(180deg, #4a7a3a, #2a5a1a);
    border: 1px solid #6a9a5a;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 0;
}
#サイドバー内容 .dg-side-action-btn:hover {
    background: linear-gradient(180deg, #5a8a4a, #3a6a2a);
    transform: translateY(-1px);
}
#サイドバー内容 .dg-side-action-btn.secondary {
    flex: 3;
    background: linear-gradient(180deg, #2a3a55, #1a2540);
    border-color: #4a6090;
}
#サイドバー内容 .dg-side-action-btn.secondary:hover {
    background: linear-gradient(180deg, #A1A256, #B39533);
}

/* マナ表示バー (v0.4.23, v0.4.68 下端固定化, v0.4.69 ブラウザ差異吸収で100pxへ)
   親 #左サイドバー が position:fixed なので absolute子は親基準で配置される。
   bottom:100px で下端から余白固定(75pxだとブラウザ/拡張により足りない場合あり)。
   サイドバー開閉(left:-300px ⇄ 0) に自動追従する。 */
#サイドバー内容 .dg-side-mana-bar {
    position: absolute;
    left: 8px; right: 8px;
    /* v0.4.109: bottom 100→175px に上げてmp3ミニプレーヤー予約スペース(下端〜120-140px)を確保。
       雇用権バー(bottom:130px)との上下関係は維持。 */
    bottom: 175px;
    margin: 0;
    text-align: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(80,40,160,0.4), rgba(40,20,100,0.5));
    border: 1px solid rgba(180,140,255,0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #e0c0ff;
    font-weight: 700;
    box-shadow: inset 0 0 8px rgba(180,140,255,0.15);
}
#サイドバー内容 .dg-side-mana-bar #dg-side-mana {
    color: #ffd5ff;
    text-shadow: 0 0 6px rgba(255,180,255,0.5);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
 *  会話ダイアログ (412_会話.js が生成)
 *  v0.4.20: チュートリアル/ゲーム前/勝敗セリフ等の共通UI
 * ============================================================ */
#dg-talk-screen {
    position: fixed; inset: 0; z-index: 100055 /* v0.6.96 */;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.65) 80%, rgba(0,0,0,0.85));
    display: flex; align-items: flex-end; justify-content: center;
    padding: 0 20px 40px;
    cursor: pointer;
    animation: dg-fadein 0.3s ease-out;
}
.dg-talk-box {
    width: 100%; max-width: 800px;
    background: linear-gradient(135deg, rgba(20,30,50,0.96), rgba(10,20,40,0.96));
    border: 2px solid rgba(255,215,0,0.55);
    border-radius: 12px;
    padding: 18px 26px 14px;
    color: #eee;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 60px rgba(255,215,0,0.18);
    position: relative;
    animation: dg-talk-slidein 0.4s cubic-bezier(0.2, 1, 0.4, 1) backwards;
}
@keyframes dg-talk-slidein {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.dg-talk-speaker {
    color: #ffd700;
    font-size: 14px; font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    text-shadow: 0 0 6px rgba(255,215,0,0.4);
}
.dg-talk-text {
    font-size: 16px;
    line-height: 1.65;
    min-height: 56px;
    color: #f5f5f5;
}
.dg-talk-next {
    text-align: right;
    font-size: 11px; color: #aaa;
    margin-top: 6px;
    animation: dg-talk-blink 1.4s infinite;
}
@keyframes dg-talk-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.dg-talk-skip {
    position: absolute;
    top: 8px; right: 12px;
    font-size: 11px;
    color: #888;
    background: rgba(0,0,0,0.4);
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    user-select: none;
}
.dg-talk-skip:hover { color: #fff; background: rgba(255,80,80,0.3); border-color: rgba(255,80,80,0.5); }

/* v0.4.106: キャラ作成アイコン選択 — グリッド内のホバーは控えめハイライトのみ。
   拡大プレビューは別レイヤー(#dg-icon-preview, position:fixed)に出してグリッドの
   overflow:auto によるクリップを回避。グリッドの max-height は維持してスクロール可能。 */
.dg-create-icon { transition: box-shadow 0.18s, border-color 0.18s; }
.dg-create-icon:hover {
    box-shadow: 0 0 14px rgba(208,136,255,0.7);
    border-color: rgba(208,136,255,1.0) !important;
}

/* v0.4.196: 専用プレビュー要素 — 作成モーダル(.dg-create-modal の中) 右上にくっつけて表示。
   親モーダルが position:relative ならその右上、画面右上ではなくモーダル内部基準。 */
#dg-create-modal #dg-icon-preview,
#dg-icon-preview {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 220px;
    height: 220px;
    background: rgba(20,20,30,0.96);
    border: 2.5px solid #d088ff;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0,0,0,0.85), 0 0 36px rgba(208,136,255,0.55);
    z-index:109999;
    display: none;
    overflow: hidden;
    pointer-events: none;
    backdrop-filter: blur(8px);
}
#dg-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    display: block;
}
#dg-icon-preview::after {
    content: 'PREVIEW';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(208,136,255,0.85);
    letter-spacing: 0.15em;
    background: rgba(0,0,0,0.6);
    padding: 2px 10px;
    border-radius: 3px;
}
