/* --- ページ全体の基本設定 --- */
body {
    background-color: #0F111A;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: sans-serif;
    overflow: hidden;
    padding-left: 280px;
    box-sizing: border-box;
}

/* --- キャラクターカードのコンテナ設定 --- */
.character-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: flex-start; /* ★重要：リストを左揃えにする */
    align-items: center;
    position: relative; /* 矢印ボタンの基準点とする */
    overflow: hidden; /* ★重要：はみ出したカードリストを隠す */
}

/* --- キャラクターカードを並べるリストの設定 --- */
.character-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    /* ★変更：左右の余白をさらに広げ、端のカードが完全に見えるように調整 */
    padding: 0 250px;
    height: 100%;
    transition: transform 0.5s ease;
}

/* --- キャラクターカード本体の通常時の設定 --- */
.character-card {
    position: relative;
    width: 600px;
    height: 600px;
    margin: 0 -205px;
    background-color: #333;
    cursor: pointer;
    clip-path: polygon(70% 0%, 100% 0%, 30% 100%, 0% 100%);
    transition: all 0.2s ease; /* 全てのアニメーションを滑らかに */
}

/* 絞り込みで非表示になる時のスタイル */
.character-card.is-hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.character-card .card-content {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* --- レイヤー分けされたサムネイル画像のスタイル --- */
.thumb-bg, .thumb-char, .thumb-vfx {
    position: absolute; /* 親要素(card-content)を基準に配置 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像の比率を保ったまま、親要素を完全に覆う */
}

/* --- ホバー時に表示する「切り抜き」背景のスタイル --- */
.hover-bg-clipped {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 4; /* サムネイルより手前、名前より後ろに配置 */
    opacity: 0; /* 通常時は非表示 */
    transition: opacity 0.3s ease;
}

/* ★オンマウス時に「切り抜き」背景を表示させる */
.character-card:hover .hover-bg-clipped {
    opacity: 1;
}


/* 背景用の画像スタイル */
.thumb-bg {
    z-index: 1; /*一番後ろに配置 */
    /* 例：背景を少し暗くする場合 */
    /* filter: brightness(0.7); */
}

/* キャラクター用の画像スタイル */
.thumb-char {
    z-index: 2; /*中間に配置 */
}

/* エフェクト用の画像スタイル */
.thumb-vfx {
    z-index: 3; /*一番手前に配置 */
    /* 例：エフェクト画像を半透明にして重ねる場合 */
    opacity: 0.8;
    /* 例：エフェクトをスクリーン（加算）で合成する場合 */
    /* mix-blend-mode: screen; */
}

.character-name {
    position: absolute;
    bottom: 20px;
    left: 10%;
    transform: translateX(0%);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 0 0 5px black;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 21;
}

/* --- ★重要：オンマウス時のカードの変化 --- */
.character-card:hover {
    width: 800px; /* オンマウスで幅を広げる */
    margin: 0 -100px; /* 広がった分、重なりを調整 */
    z-index: 5;
    clip-path: polygon(53% 0%, 100% 0%, 47% 100%, 0% 100%);
}

.character-card:hover .character-name {
    opacity: 0;
}

/* マウスが乗った時の、重ねた画像の処理 */
.character-card:hover .thumb-bg,
.character-card:hover .thumb-char,
.character-card:hover .thumb-vfx {
    opacity: 0; /* すべての画像を透明にする（アニメーション適用） */
    transition: opacity 0.3s ease; /* 0.3秒かけてスッと消える */
}

/* --- ページ切り替え用のスタイル --- */
.content-view {
    display: none;
    width: 100%;
    height: 100%;
}
.content-view.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- 横スクロール用の矢印のスタイル --- */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 80px;
    line-height: 0;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    z-index: 15;
}
.scroll-arrow:hover {
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
}
.scroll-arrow.left {
    left: 0;
}
.scroll-arrow.right {
    right: 0;
}


/* --- サイドメニュー、武器、ポップアップ、ホバー画像のスタイルは変更なし --- */
/* (以下、既存のCSSが続きます) */

.side-menu { position: fixed; left: 0; top: 0; width: 280px; height: 100vh; background-color: #0A0C12; color: #fff; padding: 60px 40px; box-sizing: border-box; border-right: 1px solid #2a2f42; z-index: 100; }
.menu-item { margin-bottom: 40px; cursor: pointer; }
.menu-item .main-title { display: block; font-size: 2.5em; font-weight: bold; color: #656a7d; transition: color 0.3s ease; }
.menu-item .sub-title { font-size: 1.2em; color: #434759; text-transform: uppercase; letter-spacing: 2px; transition: color 0.3s ease; }
.menu-item.active .main-title { color: #fff; }
.menu-item.active .sub-title { color: #ff9900; }
.sub-menu { margin-top: 80px; }
.sub-menu-title { font-size: 1.2em; font-weight: bold; color: #a9aecd; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #2a2f42; }
.sub-menu ul { list-style: none; padding: 0; margin: 0; }
.sub-menu li a { display: block; color: #656a7d; text-decoration: none; font-size: 1.1em; padding: 12px 0; transition: color 0.3s ease, padding-left 0.3s ease; }
.sub-menu li a:hover { color: #fff; padding-left: 10px; }
#weapons-view { padding: 40px; box-sizing: border-box; }
.weapons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 30px; width: 100%; max-width: 1200px; }
.weapon-item { background-color: #1a1c24; border: 1px solid #2a2f42; border-radius: 5px; padding: 20px; text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.weapon-item:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.weapon-item img { width: 100px; height: 100px; object-fit: contain; margin-bottom: 15px; }
.weapon-item .weapon-name { font-size: 1.2em; font-weight: bold; color: #fff; }
.weapon-item .weapon-type { color: #888; margin-top: 5px; }
.modal-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; z-index: 1000; }
.modal-container.show { opacity: 1; visibility: visible; }
.modal-content { background-color: #222; color: #fff; padding: 30px; border-radius: 5px; border: 2px solid #ff9900; width: 90%; max-width: 800px; position: relative; transform: scale(0.8); transition: transform 0.4s ease; }
.modal-container.show .modal-content { transform: scale(1); }
.modal-close-btn { position: absolute; top: 10px; right: 20px; font-size: 30px; font-weight: bold; color: #fff; cursor: pointer; z-index: 1; }
.modal-body { display: flex; align-items: center; gap: 30px; }
#modal-stand-image { flex-shrink: 0; width: 250px; height: auto; max-height: 400px; object-fit: contain; }
#modal-name { margin: 0 0 15px 0; font-size: 2.5em; }
#modal-description { font-size: 1.1em; line-height: 1.6; }

/* --- 独立したホバー画像用のコンテナ --- */
#hover-image-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 1000px;
    height: 750px;
    pointer-events: none;
    z-index: 20;
    opacity: 0; /* 通常時は透明 */
    
    /* ★★★ 最重要修正点 ★★★ */
    /* transitionの対象から left と top を外す */
    transition: opacity 0.3s ease, transform 0.3s ease;
    
    /* 初期位置を「少し縮小」して「左斜め下」にずらす */
    transform: scale(0.95) translate(-100px, 100px);
}

#hover-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- ホバー画像が表示状態の時のスタイル --- */
#hover-image-container.is-visible {
    opacity: 1; /* 不透明にする */
    transform: scale(1) translate(0, 0); /* 本来のサイズと位置に戻す */
}

/* --- レイヤー分けされたホバー画像のスタイル --- */
#hover-image-container .hover-bg,
#hover-image-container .hover-char,
#hover-image-container .hover-vfx {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}



/* 背景用の画像スタイル */
.hover-bg {
    z-index: 2; /* 中間 */
    /* ★変更：背景は遅延なし(0s)で最初に表示 */
    transition: opacity 0.4s ease 0s, transform 0.4s ease 0s;
}

/* キャラクター用の画像スタイル */
.hover-char {
    z-index: 3; /* 手前 */
    /* ★変更：キャラクターは0.1秒遅れて表示 */
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

/* ホバーエフェクト用の画像スタイル */
.hover-vfx {
    z-index: 1; /* 一番後ろ */
    transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

/* --- ホバー時に表示される名前用のコンテナ --- */
#hover-name-container {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none; /* マウス操作を邪魔しないように */
    z-index: 22; /* ★ホバー画像(z-index:20)より手前に表示 */
    opacity: 0;
    /* ★変更：画像と同じフェードインアニメーションに統一 */
    transition: opacity 0.3s ease;

    /* 文字のスタイルは .character-name から拝借 */
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 0 0 5px black;
}
/* 表示される時のスタイル */
#hover-name-container.is-visible {
    opacity: 1;
}

/* --- ポップアップ内の追加要素のスタイル --- */

/* キャッチコピーのスタイル */
.modal-tagline {
    font-size: 1.1em;
    font-style: italic;
    color: #ccc;
    padding-left: 15px;
    border-left: 3px solid #ff9900;
    margin: 15px 0 25px 0;
}

/* プロフィールリストのスタイル */
.modal-profile-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}
.modal-profile-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #333;
    font-size: 1em;
}
.modal-profile-list li:last-child {
    border-bottom: none;
}
.modal-profile-list strong {
    color: #aaa;
    margin-right: 20px;
}

/* 紹介文の見出しのスタイル */
.modal-description-title {
    font-size: 1.2em;
    color: #ff9900;
    margin-top: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

/* --- ポップアップ内の名前（アルファベット）のスタイル --- */
.modal-name-wrapper {
    display: flex;
    align-items: baseline; /* 名前とアルファベット名の底辺を揃える */
    gap: 15px; /* 名前間のスペース */
}

#modal-name-en {
    font-size: 1.2em;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
}

/* --- ポップアップ内のステータスグラフのスタイル --- */
#modal-stats-graph {
    margin: 25px 0;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.stat-bar-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.stat-label {
    width: 120px; /* ラベルの幅を固定 */
    flex-shrink: 0;
    color: #aaa;
    font-weight: bold;
}

/* グラフの背景（トラック部分） */
.stat-bar {
    flex-grow: 1;
    background-color: #111;
    height: 15px;
    border-radius: 0px;
    overflow: hidden;
    border: 1px solid #444;
}

/* グラフのバー本体 */
.bar-fill {
    width: 0; /* ★初期状態の幅を0に設定 */
    height: 100%;
    background: linear-gradient(90deg, #ff9900, #ffc57a); /* グラデーション */
    border-radius: 0px;
    /* ★アニメーション設定：幅が1秒かけて滑らかに変化する */
    transition: width 1s ease-out;
}

.stat-value {
    width: 40px; /* 数値が表示されるエリアの幅を確保 */
    text-align: right; /* 右揃えにする */
    font-weight: bold;
    color: #fff;
    margin-left: 15px; /* グラフとの間隔 */
}