/* 基本的なスタイル */
body {
    font-family: sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
}

.header {
    background-color: #1a2c4e;
    color: white;
    padding: 10px 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header h1 {
    margin: 0;
    font-size: 24px;
}

/* --- チーム編成エリア --- */
.team-section {
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* モード切替ボタン */
.mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}
.mode-btn {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.mode-btn:hover {
    background-color: #e0e0e0;
}
.mode-btn.active {
    background-color: #4a69bd;
    color: white;
    border-color: #4a69bd;
}

/* チームスロットとメモ欄のコンテナ */
/*
.team-layout-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}*/
/* チームスロットとメモ欄のコンテナ */
.team-layout-container {
    display: flex;
    /* justify-content: center; */ /* ← 不要であれば削除 */
    flex-direction: column; /* ★変更：要素を縦に並べる */
    align-items: center;    /* ★追加：中央揃えにする */
    gap: 30px;              /* ★変更：上下の間隔を調整 */
    flex-wrap: wrap;
    /* align-items: flex-start; */ /* ← 不要であれば削除 */
}




/* チームスロット全体のコンテナ */
.team-slots-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
/* 各パーティーの行 */
.party-row {
    display: flex;
    align-items: center;
    gap: 15px;
}
.party-label {
    font-weight: bold;
    width: 60px; /* ラベルの幅を固定 */
    text-align: right;
}
.team-slots {
    display: flex;
    gap: 15px;
}
/* スロットのコンテナ */
.slot-unit {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.team-slot {
    /*width: 120px;
    height: 180px;*/
    /*width: 100px;
    height: 300px;*/
    width: 100px;  
    height: 231.25px;

    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
    font-size: 14px;
    color: #888;
    box-sizing: border-box;
    padding: 10px;
    transition: background-color 0.2s, border-color 0.2s;
}

/* Psychubeスロットのスタイル */
.psychube-slot {
    width: 80px;
    height: 120px;
    border: 2px dashed #dcdcdc;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fdfdfd;
    font-size: 11px;
    color: #aaa;
    transition: all 0.2s;
    box-sizing: border-box;
    padding: 5px;
    overflow: hidden;
    position: relative;
}

/* 中身が入ったPsychubeスロットのスタイル */
.psychube-slot.slot-filled {
    border: none;
    padding: 0;
    cursor: pointer;
    background-color: #333;
    /*background-color: #e0e0e0;*/
    /* ↓↓↓↓↓↓【重要】中央揃えを解除するための指定 ↓↓↓↓↓↓ */
    align-items: stretch;
    justify-content: normal;
}

/* Psychubeスロット内のカード要素の文字サイズを調整 */
.psychube-slot .card-footer .name {
    font-size: 10px;
    margin: 1px 0;
}
.psychube-slot .card-footer .rarity {
    font-size: 8px;
}
.psychube-slot .card-header {
    display: none;
}
/* Psychubeスロット内のフッター（星と名前）を下部に配置する */
.psychube-slot .card-info-overlay {
    justify-content: flex-end;
}

/* チームメモ */
/* チーム名入力欄のスタイル */
.team-title-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid #eee;
    font-size: 20px;
    font-weight: bold;
    padding: 8px 0;
    margin-bottom: 15px;
    box-sizing: border-box;
    background-color: transparent;
    transition: border-color 0.2s;
}
.team-title-input:focus {
    outline: none;
    border-color: #4a69bd;
}

/* チーム説明欄 */
/* チーム説明欄のテキストエリア */
.loaded-team-info textarea {
    width: 100%; /* ★変更：親要素いっぱいに広げる */
    height: 120px; /* ★変更：初期の高さを設定 */
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
    padding: 10px; /* ★変更：内側余白を調整 */
}
.loaded-team-info textarea:focus {
    outline: none;
    border-color: #4a69bd;
    box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.15);
}
/* チーム説明欄のコンテナ */
.loaded-team-info {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
    width: 80%; /* ★変更：幅を広げる */
    max-width: 800px; /* ★追加：最大幅を設定 */
}
.loaded-team-info h4 {
    margin: 0 0 10px 0;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.loaded-team-info button {
    flex: 1;
    padding: 10px 20px;
    background: #4a69bd;
    border: 2px solid #ddd;
    border-radius: 20px;
    /*border-bottom: 3px solid transparent;*/
    cursor: pointer;
    font-size: 16px;
    color: #ffffff;
}
.loaded-team-info.button.active {
    border-bottom-color: #4a69bd;
    font-weight: bold;
    color: #333;
}

/* フォーム内のボタングループ */
.loaded-team-info .button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.loaded-team-info .button-group button {
    flex: 1;
}
/* クリアボタンの色を調整 */
#clear-team-button {
    background-color: #c0392b; /* 赤色 */
}

.save-status {
    font-size: 12px;
    color: #27ae60;
    text-align: right;
    height: 1em;
    margin-top: 5px;
}

/* ドラッグ＆ドロップ用スタイル */
.drag-over {
    background-color: #e0eaff;
    border-style: solid;
}
.team-slot.dragging {
    opacity: 0.4;
}

/* メインコンテンツ（フィルターと一覧） */
.main-content {
    padding: 20px;
}

/* フィルターエリア */
.filter-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
#search-bar {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: block;
    margin: 0 auto 20px auto;
    font-size: 16px;
}
.filter-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}
.filter-group {
    text-align: center;
    flex: 1;
    max-width: 45%;
}
.filter-group-separator {
    width: 1px;
    background-color: #eee;
    align-self: stretch;
}
.filter-label {
    font-size: 16px;
    font-weight: bold;
    color: #444;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}
.filter-row .filter-label {
    border-bottom: none;
    margin-top: 0;
}

/* 属性/ダメージタイプフィルターボタン */
.attribute-filters, .damage-type-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.attribute-filter, .damage-type-filter {
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.attribute-filter:hover, .damage-type-filter:hover {
    transform: scale(1.05);
}

/* 属性/ダメージタイプフィルターの選択中スタイル */
.attribute-filters.filter-active .attribute-filter,
.damage-type-filters.filter-active .damage-type-filter {
    opacity: 0.6;
    transform: scale(0.95);
}
.attribute-filters.filter-active .attribute-filter.selected,
.damage-type-filters.filter-active .damage-type-filter.selected {
    opacity: 1;
    transform: scale(1.05);
    border-color: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.7);
}

/* ソートセクションのスタイル */
.sort-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}
.sort-label {
    font-weight: bold;
    color: #555;
    font-size: 14px;
}
.sort-btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s, border-color 0.2s;
}
.sort-btn:hover {
    background-color: #e0e0e0;
}
.sort-btn.active {
    background-color: #4a69bd;
    color: white;
    border-color: #4a69bd;
}

/* 属性ごとの色分け (透明度を追加) */
.attr-beast { background-color: rgba(130, 56, 56, 0.85); }
.attr-plant { background-color: rgba(40, 102, 55, 0.85); }
.attr-star { background-color: rgba(92, 135, 180, 0.85); }
.attr-mineral { background-color: rgba(170, 130, 74, 0.85); }
.attr-spirit { background-color: rgba(174, 102, 180, 0.85); }
.attr-intellect { background-color: rgba(189, 170, 93, 0.85); }

/* ダメージタイプごとの色分け (透明度を追加) */
.type-reality { background-color: rgba(230, 126, 34, 0.85); }
.type-mental { background-color: rgba(155, 89, 182, 0.85); }

/* タグ/専門分野フィルター */
.specialty-filters, .tag-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.tag-filter {
    display: flex;
    align-items: center;
    background-color: #e2e8f0;
    border-radius: 12px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}
.tag-filter input {
    display: none;
}
.tag-filter.checked {
    background-color: #4a69bd;
    color: white;
}

/* キャラクター一覧 */
.character-list-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, 100px); /* ★変更：カードの幅に合わせる */
    justify-content: center; /* 全体を中央揃えにする */
    gap: 15px;
}

/* --- 新しいキャラクターカードのスタイル（スロット共通版） --- */


/* カードとスロット（中身あり）の共通コンテナスタイル */
.character-card,
.team-slot.slot-filled {
    /* コンテナの基本設定 */
    display: block;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);

    /* カードのサイズを固定値に変更 160x370 */
    /*width: 120px;  /* ← 変更 */
    /*height: 277.5px; /* ← 変更 */
    width: 100px;
    height: 231.25px;

    /* 背景画像の設定 */
    background-image: url('images/characters/background/background.png');
    background-size: cover;
    background-position: center;
    background-color: #333;
    
    /* スタイルを統一するため、枠線などをリセット */
    border: none;
    padding: 0;
    border-radius: 8px;
    color: inherit;
    font-size: inherit;
}

/* カードとスロット（中身あり）にホバーした時に画像を拡大 */
.character-card:hover .character-portrait,
.team-slot.slot-filled:hover .character-portrait {
    transform: scale(1.1);
}

/* レイヤー1: キャラクターのポートレート画像 */
.character-portrait {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* コンテナ全体を覆うように調整 */
    z-index: 2; /* 背景画像(z-index: 1)の上に表示 */
    transition: transform 0.3s ease-out;
}

/* レイヤー2: レアリティを示すシャドウ画像 */
.card-rarity-shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* カード全体を覆う */
    z-index: 3; /* ポートレートの上に表示 */
    pointer-events: none; /* クリックイベントを透過させる */
}

/* レイヤー3: 属性アイコン */
.card-attribute-icon {
    position: absolute;
    top: 0px;  /* 上からの位置 */
    left: 0px;    /* 左からの位置 */
    width: 20%;   /* アイコンの幅 */
    height: auto;
    object-fit: contain;
    z-index: 4; /* シャドウの上に表示 */
    pointer-events: none; /* クリックイベントを透過させる */
}

/* レイヤー4: 文字情報などを表示するオーバーレイ */
.card-info-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* 全ての画像の上に表示 */
    color: #fff;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 内容を下揃えにする */
    /*background: linear-gradient(to top, rgba(0,0,0,0.8) 10%, transparent 60%); /* 下部を暗くするグラデーション */
    pointer-events: none;
}

/* 古いヘッダーは属性アイコンになったため非表示に */
.card-header {
    display: none;
}

/* フッター（名前とレアリティ）のスタイル調整 */
.card-footer {
    text-align: center;
    padding: 0 5px;
}
.card-footer .rarity {
    font-size: 12px;
    color: #f9ca24;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    margin-bottom: 2px;
}
.card-footer .name {
    margin: 2px 0;
    font-size: 13.5px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
}
.card-footer .tags {
    display: none; /* タグは一旦非表示に */
}

.damage-type {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    border-radius: 4px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.specialties {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}
.specialty-tag {
    background-color: #e0e0e0;
    color: #555;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 4px;
    font-weight: bold;
}

/* フッター */
.footer {
    background-color: #333;
    color: #ccc;
    padding: 20px;
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}
.language-switcher {
    margin-bottom: 15px;
}
.lang-button {
    background-color: #555;
    color: #fff;
    border: 1px solid #777;
    border-radius: 4px;
    padding: 5px 10px;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.lang-button:hover {
    background-color: #777;
}
.lang-button.active {
    background-color: #4a69bd;
    border-color: #4a69bd;
}
.disclaimer-text p { margin: 5px 0; }
.disclaimer-text strong { color: #fff; }

/* ヘッダーのメニューボタン */
.menu-button {
    position: absolute;
    left: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

/* --- サイドパネル --- */
.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
}
.side-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px;
    height: 100%;
    background-color: #f4f4f9;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}
.close-panel-button {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #555;
}

/* パネルナビゲーション */
.panel-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}
.panel-nav-button {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}
.panel-nav-button.active {
    border-bottom-color: #4a69bd;
    font-weight: bold;
    color: #333;
}
.panel-content {
    display: none;
}
.panel-content.active {
    display: block;
}

.panel-section { margin-bottom: 30px; }
.panel-section h3 {
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 15px;
}
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.button-group button {
    flex: 1;
    padding: 8px;
}

/* 保存済みチームリスト */
#saved-teams-list { list-style: none; padding: 0; margin: 0; }
#saved-teams-list li {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
}
#saved-teams-list .team-info strong { font-size: 18px; display: block; margin-bottom: 5px; }
#saved-teams-list .team-info p { font-size: 14px; color: #666; margin: 0 0 15px 0; white-space: pre-wrap; }
#saved-teams-list .team-actions { display: flex; gap: 5px; flex-wrap: wrap; }
#saved-teams-list .team-actions button {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
#saved-teams-list .load-btn { background-color: #27ae60; color: white; border-color: #27ae60; }
#saved-teams-list .delete-btn { background-color: #c0392b; color: white; border-color: #c0392b; }
#saved-teams-list .share-btn { background-color: #3498db; color: white; border-color: #3498db; }
#saved-teams-list .edit-btn { background-color: #f39c12; color: white; border-color: #f39c12; }

/* 編集フォーム */
.edit-form input, .edit-form textarea { width: 100%; margin-bottom: 5px; padding: 8px; box-sizing: border-box; }
.edit-form-actions { display: flex; gap: 5px; }
.edit-form-actions button { flex: 1; }

/* --- 共有モーダル --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-content {
    background: #fff;
    /*background-image: linear-gradient(to bottom, #434343, hsl(var(--b2)) 20rem);*/
    padding: 25px;
    border-radius: 8px;
    /*width: 90%;
    max-width: 500px;*/
    width: 90%;
    height: 70%;
    position: relative;
    text-align: center;
}
.close-modal-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #888;
}
.share-url-wrapper {
    display: flex;
    margin: 15px 0;
}
#share-url-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 4px 0 0 4px;
}
#copy-url-button {
    padding: 8px 12px;
    border: 1px solid #4a69bd;
    background-color: #4a69bd;
    color: white;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    white-space: nowrap;
}
#qrcode-display img {
    margin: 10px auto;
    display: block;
    border: 5px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 100%; /*コンテナ幅を超えないようにする*/
    height: auto;
}

/* CSSの順番、競合によりモーダルが表示されてしまう */
.hidden { display: none !important; }



/* ミニビュー本体 */
.mini-team-view {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 999;
  transition: opacity 0.3s, transform 0.3s;
  
  transform-origin: top right;
  
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(5px);
}
.mini-team-view.hidden {
  opacity: 0;
  transform: translateY(-20px) scale(0.95); /* 非表示時のアニメーションを調整 */
  pointer-events: none;
}
.mini-team-view.hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

/* ★★★ 変更点 ★★★ モードごとの縮小率を調整 */
.mini-team-view:not(.mode-limbo):not(.mode-4parties) {
    transform: scale(0.7);
}
.mini-team-view.mode-limbo {
    transform: scale(0.6);
}
.mini-team-view.mode-4parties {
    transform: scale(0.55);
}


/* ミニビューのドラッグ中スタイル */
.mini-team-view.drag-over {
  box-shadow: 0 0 0 4px rgba(74, 105, 189, 0.3);
  border-radius: 8px; /* ドラッグ中の枠線を丸くする */
}
.mini-team-view .team-slot.drag-over-slot,
.mini-team-view .psychube-slot.drag-over-slot {
    background-color: #e0eaff;
}

/* 各パーティーの行 */
.mini-team-view .party-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ★★★ 変更点 ★★★ MiniView内の各種スタイルをメインビューと統一 */
.mini-team-view .slot-unit {
    gap: 5px;
}
.mini-team-view .team-slot {
    /*width: 120px;
    height: 180px;*/
    width: 90px;
    height: 200px;
}
.mini-team-view .psychube-slot {
    width: 80px;
    height: 120px;
}
.mini-team-view .card-info-overlay {
    padding: 10px;
}
.mini-team-view .card-footer .name {
    font-size: 10px;
}
.mini-team-view .card-footer .rarity {
    font-size: 10px;
}
.mini-team-view .card-footer .tags {
    font-size: 11px;
    margin-top: 4px;
}
.mini-team-view .card-header {
    display: flex; /* 再表示 */
}

/* ★★★ 変更点 ★★★ MiniViewのPsychubeは画像のみにする */
.mini-team-view .psychube-slot .card-info-overlay {
    display: none;
}

/* ★★★ 変更点 ★★★ 不要になった二重のtransform: scaleを削除 */
/* Standardモード (1パーティー) */
/* .mini-team-view:not(.mode-limbo):not(.mode-4parties) .team-slots-container { ... } */

/* Limboモード (2パーティー) */
/* .mini-team-view.mode-limbo .team-slots-container { ... } */

/* 4 Partiesモード */
.mini-team-view.mode-4parties .team-slots-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    transform-origin: top right;
}

.mini-team-view.mode-4parties .party-label {
    display: none;
}

/* --- メインビューのモード別レイアウト --- */
/* Limboモード (2パーティー) のレイアウト */
.team-slots-container.mode-limbo {
    flex-direction: row; /* パーティーを横に並べる */
    justify-content: center;
    align-items: flex-start; /* 上揃えにする */
}

/* 4 Partiesモードのチームスロットコンテナ */
.team-slots-container.mode-4parties {
    display: grid;
    grid-template-columns: repeat(2, auto); /* 2列のグリッドを作成 */
    justify-content: center;
    gap: 15px 30px; /* 縦と横の隙間を調整 */
}

/* 4 Partiesモードでは、パーティーラベルをスロットの上に配置 */
.team-slots-container.mode-4parties .party-row {
    flex-direction: column; /* ラベルとスロットを縦に並べる */
    gap: 8px;
}

.team-slots-container.mode-4parties .party-label {
    width: auto; /* 幅の固定を解除 */
    text-align: center; /* 中央揃えに */
    font-size: 14px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
}

/* 表示切替ボタンのスタイル */
.view-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}
.view-btn {
    padding: 10px 25px;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #ddd;
    background-color: #f9f9f9;
    color: #888;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.view-btn:hover {
    background-color: #eee;
}
.view-btn.active {
    background-color: #4a69bd;
    color: white;
    border-color: #4a69bd;
}

.mini-card-content { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #333; }
.mini-card-content img { height: 20px; width: 20px; border-radius: 4px; object-fit: cover; }


/* style.css の末尾に追加 */

/* --- キャラクター詳細モーダル --- */
#character-detail-modal .modal-content {
    background-image: url(images/assets/background.png);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    
    max-width: 600px; /* 横幅を少し広げる */
    text-align: left; /* テキストを左揃えに */
}

#modal-character-content img {
    /*width: 150px;
    height: 225px;*/
    width: 150px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
#modal-character-content h3 {
    color: white;
    margin-top: 0;
    font-size: 24px;
}
#modal-character-content p {
    color: white;
    margin: 8px 0;
}
#modal-character-content .tags-container {
    color: white;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}
#modal-character-content .tag {
    /*background-color: #e2e8f0;*/
    background-color: #333;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 12px;
}
#modal-character-content .arcanum-container {
    color: white;
}



/* --- スロット内カードの削除ボタン --- */
.slot-filled {
    position: relative; /* ボタンを配置するための基準 */
}

.remove-button {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 3; /* カード情報より手前に表示 */
    background-color: rgba(192, 57, 43, 0.85); /* 半透明の赤 */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    opacity: 0; /* 通常は非表示 */
    transition: opacity 0.2s, transform 0.2s;
    transform: scale(0.8);
}

.slot-filled:hover .remove-button {
    opacity: 1; /* ホバー時に表示 */
    transform: scale(1);
}

/* SortableJS用のスタイル */
.sortable-ghost {
  opacity: 0.4;
  background-color: #e0eaff;
}

.sortable-drag {
  opacity: 1 !important;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}


/* レスポンシブ対応 */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }
    .filter-row .filter-group {
        max-width: 100%;
        width: 100%;
        margin-bottom: 20px;
    }
    .filter-group-separator {
        display: none;
    }
    .filter-row .filter-label {
        border-bottom: 1px solid #eee;
    }
    .team-layout-container {
        flex-direction: column;
        align-items: center;
    }
}