/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: #333;
    background: url('bg.png') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
.header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    gap: 2rem;
}

.header .search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
    margin: 0 1.5rem;
    align-items: center;
}

.header .search-box .search-input {
    height: 32px;
    padding: 0.4rem 2.5rem 0.4rem 0.8rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.7rem;
    transition: border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.header .search-box .search-input:focus {
    outline: none;
    border-color: #667eea;
}

.header .search-box .search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    transition: color 0.3s ease;
}

.header .search-box .search-btn:hover {
    color: #5a67d8;
}

.header .search-box .search-btn i {
    font-size: 14px;
}

/* クイックフィルター */
.quick-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 0.75rem;
}

.quick-filters-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
}

.quick-filter-group {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.quick-filter-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.quick-filter-checkboxes {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.quick-filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-filter-btn {
    width: 40px;
    height: 24px;
    padding: 0;
    border: 2px solid #e2e8f0;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-width: 40px;
}

.quick-filter-btn:hover {
    background: transparent;
    color: inherit;
    border-color: #667eea;
}

.quick-filter-btn.active {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
    color: #333;
}

/* ヘッダー色フィルターボタン専用のスタイル（個別の色ボタンのみ） */
.quick-filter-btn[data-filter="headerColor"][data-value]:not([data-value=""]) {
    width: 40px;
    height: 24px;
    padding: 0;
    border: 2px solid;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quick-filter-btn[data-filter="headerColor"][data-value]:not([data-value=""]):hover {
    background: transparent;
    color: inherit;
}

.quick-filter-btn[data-filter="headerColor"][data-value]:not([data-value=""]).active {
    border-color: transparent;
    color: white;
    font-weight: 700;
}

.quick-filter-btn[data-filter="headerColor"][data-value]:not([data-value=""]).active:hover {
    color: white;
    font-weight: 700;
}

/* ヘッダー色別のフィルターボタンスタイル（個別の色ボタンのみ） */
/* 赤 */
.quick-filter-btn[data-filter="headerColor"][data-value="赤"] {
    border-color: #e53e3e;
    color: #e53e3e;
}

.quick-filter-btn[data-filter="headerColor"][data-value="赤"].active {
    background-color: #e53e3e;
    border-color: #e53e3e;
}

/* 青 */
.quick-filter-btn[data-filter="headerColor"][data-value="青"] {
    border-color: #3182ce;
    color: #3182ce;
}

.quick-filter-btn[data-filter="headerColor"][data-value="青"].active {
    background-color: #3182ce;
    border-color: #3182ce;
}

/* 緑 */
.quick-filter-btn[data-filter="headerColor"][data-value="緑"] {
    border-color: #38a169;
    color: #38a169;
}

.quick-filter-btn[data-filter="headerColor"][data-value="緑"].active {
    background-color: #38a169;
    border-color: #38a169;
}

/* 黄 */
.quick-filter-btn[data-filter="headerColor"][data-value="黄"] {
    border-color: #d69e2e;
    color: #d69e2e;
}

.quick-filter-btn[data-filter="headerColor"][data-value="黄"].active {
    background-color: #d69e2e;
    border-color: #d69e2e;
}

/* 紫 */
.quick-filter-btn[data-filter="headerColor"][data-value="紫"] {
    border-color: #805ad5;
    color: #805ad5;
}

.quick-filter-btn[data-filter="headerColor"][data-value="紫"].active {
    background-color: #805ad5;
    border-color: #805ad5;
}

/* 白 */
.quick-filter-btn[data-filter="headerColor"][data-value="-"] {
    border-color: #a0aec0;
    color: #a0aec0;
}

.quick-filter-btn[data-filter="headerColor"][data-value="-"].active {
    background-color: #a0aec0;
    border-color: #a0aec0;
}

/* 赤黄 */
.quick-filter-btn[data-filter="headerColor"][data-value="赤黄"] {
    border-color: #dd6b20;
    color: #dd6b20;
}

.quick-filter-btn[data-filter="headerColor"][data-value="赤黄"].active {
    background-color: #dd6b20;
    border-color: #dd6b20;
}

/* 青黄 */
.quick-filter-btn[data-filter="headerColor"][data-value="青黄"] {
    border-color: #4299e1;
    color: #4299e1;
}

.quick-filter-btn[data-filter="headerColor"][data-value="青黄"].active {
    background-color: #4299e1;
    border-color: #4299e1;
}

/* 緑黄 */
.quick-filter-btn[data-filter="headerColor"][data-value="緑黄"] {
    border-color: #68d391;
    color: #68d391;
}

.quick-filter-btn[data-filter="headerColor"][data-value="緑黄"].active {
    background-color: #68d391;
    border-color: #68d391;
}

.quick-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.quick-filter-checkbox:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

/* 色チェックボックス専用のボタンスタイル */
.quick-filter-checkbox[data-color] {
    width: 40px;
    height: 24px;
    padding: 0;
    border: 2px solid;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quick-filter-checkbox[data-color] input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.quick-filter-checkbox[data-color] label {
    pointer-events: none;
    z-index: 1;
    transition: color 0.3s ease;
    font-weight: 700;
}

/* 色チェックボックスの選択状態 */
.quick-filter-checkbox[data-color].checked {
    border-color: transparent;
    color: white;
    font-weight: 700;
}

.quick-filter-checkbox[data-color].checked label {
    color: white;
}

/* レアリティチェックボックスもボタンスタイルに変更 */
.quick-filter-checkbox[data-rarity] {
    width: 40px;
    height: 24px;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: #e2e8f0;
}

.quick-filter-checkbox[data-rarity] input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.quick-filter-checkbox[data-rarity] label {
    pointer-events: none;
    z-index: 1;
    transition: color 0.3s ease;
    font-weight: 700;
}

.quick-filter-checkbox[data-rarity].checked {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
    color: #333;
}

.quick-filter-checkbox[data-rarity].checked label {
    color: #333;
}

/* 色別のチェックボックススタイル */
/* 赤 */
.quick-filter-checkbox[data-color="赤"] {
    border-color: #e53e3e;
    color: #e53e3e;
}

.quick-filter-checkbox[data-color="赤"].checked {
    background-color: #e53e3e;
    border-color: #e53e3e;
}

/* 青 */
.quick-filter-checkbox[data-color="青"] {
    border-color: #3182ce;
    color: #3182ce;
}

.quick-filter-checkbox[data-color="青"].checked {
    background-color: #3182ce;
    border-color: #3182ce;
}

/* 緑 */
.quick-filter-checkbox[data-color="緑"] {
    border-color: #38a169;
    color: #38a169;
}

.quick-filter-checkbox[data-color="緑"].checked {
    background-color: #38a169;
    border-color: #38a169;
}

/* 黄 */
.quick-filter-checkbox[data-color="黄"] {
    border-color: #d69e2e;
    color: #d69e2e;
}

.quick-filter-checkbox[data-color="黄"].checked {
    background-color: #d69e2e;
    border-color: #d69e2e;
}

/* 紫 */
.quick-filter-checkbox[data-color="紫"] {
    border-color: #805ad5;
    color: #805ad5;
}

.quick-filter-checkbox[data-color="紫"].checked {
    background-color: #805ad5;
    border-color: #805ad5;
}

/* 白 */
.quick-filter-checkbox[data-color="白"] {
    border-color: #e2e8f0;
    color: #e2e8f0;
}

.quick-filter-checkbox[data-color="白"].checked {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
    color: #333;
}

/* 分類チェックボックスもボタンスタイルに変更 */
.quick-filter-checkbox[data-type] {
    width: 40px;
    height: 24px;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: #e2e8f0;
}

.quick-filter-checkbox[data-type] input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.quick-filter-checkbox[data-type] label {
    pointer-events: none;
    z-index: 1;
    transition: color 0.3s ease;
    font-weight: 700;
}

.quick-filter-checkbox[data-type].checked {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
    color: #333;
}

.quick-filter-checkbox[data-type].checked label {
    color: #333;
}

/* 赤黄 */
.quick-filter-checkbox[data-color="赤黄"] {
    border-color: #e53e3e;
    color: #e53e3e;
}

.quick-filter-checkbox[data-color="赤黄"].checked {
    background: linear-gradient(45deg, #e53e3e 50%, #d69e2e 50%);
    border-color: #e53e3e;
}

/* 青黄 */
.quick-filter-checkbox[data-color="青黄"] {
    border-color: #3182ce;
    color: #3182ce;
}

.quick-filter-checkbox[data-color="青黄"].checked {
    background: linear-gradient(45deg, #3182ce 50%, #d69e2e 50%);
    border-color: #3182ce;
}

/* 緑黄 */
.quick-filter-checkbox[data-color="緑黄"] {
    border-color: #38a169;
    color: #38a169;
}

.quick-filter-checkbox[data-color="緑黄"].checked {
    background: linear-gradient(45deg, #38a169 50%, #d69e2e 50%);
    border-color: #38a169;
}

/* レアリティ別のチェックボックススタイル */
.quick-filter-checkbox[data-rarity="C"] input[type="checkbox"]:checked {
    --checkbox-color: #718096;
}

.quick-filter-checkbox[data-rarity="U"] input[type="checkbox"]:checked {
    --checkbox-color: #38a169;
}

.quick-filter-checkbox[data-rarity="R"] input[type="checkbox"]:checked {
    --checkbox-color: #3182ce;
}

.quick-filter-checkbox[data-rarity="SR"] input[type="checkbox"]:checked {
    --checkbox-color: #d69e2e;
}

.quick-filter-checkbox[data-rarity="UR"] input[type="checkbox"]:checked {
    --checkbox-color: #e53e3e;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.nav-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

/* ナビゲーションボタンのホバー吹き出し */
.nav-btn {
    position: relative;
}

.nav-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.nav-btn::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.nav-btn:hover::after,
.nav-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

/* デッキ枚数バッジ */
.deck-count-badge {
    background: #ff4757;
    color: white;
    border-radius: 50%;
    padding: 0;
    font-size: 0.65rem;
    font-weight: bold;
    margin-left: 0;
    width: 22px;
    height: 22px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    min-width: 22px;
    min-height: 22px;
    position: relative;
}

.deck-count-badge::after {
    content: attr(data-count);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    font-weight: bold;
    color: white;
    line-height: 1;
}

/* カード画像上のデッキ枚数バッジ */
.card-deck-count-badge {
    position: absolute;
    bottom: 10%;
    right: 12%;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 15px 10px 5px rgba(0, 0, 0, 0.8);
    font-size: 0.6rem;
    font-weight: bold;
    z-index: 100;
    box-sizing: border-box;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid white;
}

/* モーダル内のカード画像上のデッキ枚数バッジ（大きいサイズ） */
.modal-card-image .card-deck-count-badge {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    font-size: 0.9rem;
    border: 3px solid white;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.card-deck-count-badge::after {
    content: attr(data-count);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.6rem;
    font-weight: bold;
    color: white;
    line-height: 1;
}

/* モーダル内のバッジの疑似要素も大きくする */
.modal-card-image .card-deck-count-badge::after {
    font-size: 0.9rem;
}

/* メインコンテンツ */
.main {
    padding: 2rem 0;
}

/* フィルターセクション */
.search-section {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}



.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    padding: 1rem 2rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.filter-btn {
    width: 40px;
    height: 24px;
    padding: 0;
    border: 2px solid #e2e8f0;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    background: transparent;
    color: inherit;
    border-color: #667eea;
}

.filter-btn.active {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
    color: #333;
}

/* 色フィルターボタン専用のスタイル（上部ナビと同じ） */
.filter-btn[data-filter="color"] {
    width: 40px;
    height: 24px;
    padding: 0;
    border: 2px solid;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn[data-filter="color"]:hover {
    background: transparent;
    color: inherit;
}

.filter-btn[data-filter="color"].active {
    border-color: transparent;
    color: white;
    font-weight: 700;
    background: none;
}

/* 色別のフィルターボタンスタイル */
/* 赤 */
.filter-btn[data-filter="color"][data-value="赤"] {
    border-color: #e53e3e;
    color: #e53e3e;
}

.filter-btn[data-filter="color"][data-value="赤"].active {
    background-color: #e53e3e;
    border-color: #e53e3e;
}

/* 青 */
.filter-btn[data-filter="color"][data-value="青"] {
    border-color: #3182ce;
    color: #3182ce;
}

.filter-btn[data-filter="color"][data-value="青"].active {
    background-color: #3182ce;
    border-color: #3182ce;
}

/* 緑 */
.filter-btn[data-filter="color"][data-value="緑"] {
    border-color: #38a169;
    color: #38a169;
}

.filter-btn[data-filter="color"][data-value="緑"].active {
    background-color: #38a169;
    border-color: #38a169;
}

/* 黄 */
.filter-btn[data-filter="color"][data-value="黄"] {
    border-color: #d69e2e;
    color: #d69e2e;
}

.filter-btn[data-filter="color"][data-value="黄"].active {
    background-color: #d69e2e;
    border-color: #d69e2e;
}

/* 紫 */
.filter-btn[data-filter="color"][data-value="紫"] {
    border-color: #805ad5;
    color: #805ad5;
}

.filter-btn[data-filter="color"][data-value="紫"].active {
    background-color: #805ad5;
    border-color: #805ad5;
}

/* 白 */
.filter-btn[data-filter="color"][data-value="白"] {
    border-color: #e2e8f0;
    color: #e2e8f0;
}

.filter-btn[data-filter="color"][data-value="白"].active {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
    color: #333;
}

/* 色ボタンの選択時は文字を白に */
.filter-btn[data-filter="color"].active {
    color: white !important;
}

/* 赤黄 */
.filter-btn[data-filter="color"][data-value="赤黄"] {
    border-color: #e53e3e;
    color: #e53e3e;
}

.filter-btn[data-filter="color"][data-value="赤黄"].active {
    background: linear-gradient(45deg, #e53e3e 50%, #d69e2e 50%);
    border-color: #e53e3e;
}

/* 青黄 */
.filter-btn[data-filter="color"][data-value="青黄"] {
    border-color: #3182ce;
    color: #3182ce;
}

.filter-btn[data-filter="color"][data-value="青黄"].active {
    background: linear-gradient(45deg, #3182ce 50%, #d69e2e 50%);
    border-color: #3182ce;
}

/* 緑黄 */
.filter-btn[data-filter="color"][data-value="緑黄"] {
    border-color: #38a169;
    color: #38a169;
}

.filter-btn[data-filter="color"][data-value="緑黄"].active {
    background: linear-gradient(45deg, #38a169 50%, #d69e2e 50%);
    border-color: #38a169;
}

/* レアリティフィルターボタン専用のスタイル（上部ナビと同じ） */
.filter-btn[data-filter="rarity"] {
    width: 40px;
    height: 24px;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: #e2e8f0;
}

.filter-btn[data-filter="rarity"]:hover {
    background: transparent;
    color: inherit;
}

.filter-btn[data-filter="rarity"].active {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
    color: #333;
}

/* 分類フィルターボタン専用のスタイル（上部ナビと同じ） */
.filter-btn[data-filter="type"] {
    width: 40px;
    height: 24px;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: #e2e8f0;
}

.filter-btn[data-filter="type"]:hover {
    background: transparent;
    color: inherit;
}

.filter-btn[data-filter="type"].active {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
    color: #333;
}

/* レベルフィルターボタン専用のスタイル */
.filter-btn[data-filter="level"] {
    border-color: #4a5568;
    color: #4a5568;
}

.filter-btn[data-filter="level"]:hover {
    border-color: #2d3748;
    color: #2d3748;
}

.filter-btn[data-filter="level"].active {
    background-color: #4a5568;
    border-color: #4a5568;
    color: white;
}

/* 特性フィルターボタン専用のスタイル */
.filter-btn[data-filter="trait"] {
    border-color: #805ad5;
    color: #805ad5;
}

.filter-btn[data-filter="trait"]:hover {
    border-color: #6b46c1;
    color: #6b46c1;
}

.filter-btn[data-filter="trait"].active {
    background-color: #805ad5;
    border-color: #805ad5;
    color: white;
}

/* アクションフィルターボタン専用のスタイル */
.filter-btn[data-filter="action"] {
    border-color: #38a169;
    color: #38a169;
}

.filter-btn[data-filter="action"]:hover {
    border-color: #2f855a;
    color: #2f855a;
}

.filter-btn[data-filter="action"].active {
    background-color: #38a169;
    border-color: #38a169;
    color: white;
}

/* 収録フィルターボタン専用のスタイル */
.filter-btn[data-filter="set"] {
    border-color: #d69e2e;
    color: #d69e2e;
}

.filter-btn[data-filter="set"]:hover {
    border-color: #b7791f;
    color: #b7791f;
}

.filter-btn[data-filter="set"].active {
    background-color: #d69e2e;
    border-color: #d69e2e;
    color: white;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.sort-controls label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    white-space: nowrap;
}

.sort-select {
    padding: 0.4rem 0.8rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    min-width: 120px;
    flex: 1;
}

/* ビューセクション */
.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

/* カード一覧 */
.cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.cards-header h2 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.view-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.cards-info {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* カードコンテナ */
.cards-container {
    display: grid;
    gap: 1.5rem;
}

/* カード一覧のグリッドを4列に */
.cards-container.grid-view {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 0.05rem;
    row-gap: 0.02rem;
}

.cards-container.list-view {
    grid-template-columns: 1fr;
}

/* カード要素の背景を透明に */
.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    cursor: default;
    position: relative;
    min-height: 0;
    pointer-events: none;
}

/* カード要素全体のホバー効果を完全に無効化 */
.card:hover {
    transform: none;
}

.card:hover .card-image {
    transform: none;
}

/* カード要素全体のホバー効果を無効化（画像部分以外） */
.card:hover .card-image img {
    transform: none;
    box-shadow: none;
}
.card > *:not(.card-image) {
    display: none;
}
.card .card-image {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}
.card .card-image {
    pointer-events: auto;
}

.card .card-image img {
    width: 80%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 10% auto;
    transition: all 0.3s ease;
    cursor: pointer;
    transform: translateY(0) scale(1);
}

/* 画像部分のみにホバー効果を適用 */
.card .card-image img:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-number {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.card-rarity {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.card-rarity.SR {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #8b6914;
}

.card-rarity.R {
    background: linear-gradient(45deg, #c0c0c0, #e5e5e5);
    color: #666;
}

.card-rarity.C {
    background: linear-gradient(45deg, #cd7f32, #daa520);
    color: white;
}

.card-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

.card-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.card-color.red { background: #ff4757; }
.card-color.blue { background: #3742fa; }
.card-color.green { background: #2ed573; }
.card-color.yellow { background: #ffd700; }
.card-color.purple { background: #a259e6; }
.card-color.colorless { background: #b0b0b0; }
.card-color.red-yellow { background: linear-gradient(90deg, #ff4757 50%, #ffd700 50%); }
.card-color.red-blue { background: linear-gradient(90deg, #ff4757 50%, #3742fa 50%); }
.card-color.red-green { background: linear-gradient(90deg, #ff4757 50%, #2ed573 50%); }
.card-color.red-purple { background: linear-gradient(90deg, #ff4757 50%, #a259e6 50%); }
.card-color.blue-yellow { background: linear-gradient(90deg, #3742fa 50%, #ffd700 50%); }
.card-color.blue-green { background: linear-gradient(90deg, #3742fa 50%, #2ed573 50%); }
.card-color.blue-purple { background: linear-gradient(90deg, #3742fa 50%, #a259e6 50%); }
.card-color.green-yellow { background: linear-gradient(90deg, #2ed573 50%, #ffd700 50%); }
.card-color.green-purple { background: linear-gradient(90deg, #2ed573 50%, #a259e6 50%); }
.card-color.yellow-purple { background: linear-gradient(90deg, #ffd700 50%, #a259e6 50%); }

.card-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.card-trait {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.card-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 0.5rem;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

.card-legacy {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.card-set {
    font-size: 0.8rem;
    color: #666;
}

.add-to-deck {
    padding: 0.5rem 1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.add-to-deck:hover {
    transform: scale(1.05);
}

/* リストビュー用カード */
.list-view .card {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.list-view .card-image {
    width: 100px;
    height: 140px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.8rem;
}

.list-view .card-content {
    flex: 1;
}

.list-view .card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 統計セクション */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.stat-chart {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* デッキ構築セクション */
.deck-builder {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.deck-info h3 {
    color: #333;
    margin-bottom: 1rem;
}

.deck-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.deck-stats span {
    color: #666;
}

.deck-stats span span {
    font-weight: 700;
    color: #667eea;
}

.deck-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    min-height: 200px;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    border: 2px dashed rgba(102, 126, 234, 0.3);
}

.deck-cards:empty::after {
    content: "デッキにカードを追加してください";
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
    height: 100%;
}

/* デッキカード用スタイル */
.deck-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
}

.deck-card:hover {
    transform: translateY(-2px) scale(1.02);
}

.deck-card-image {
    width: 100%;
    text-align: center;
}

.deck-card-image img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.deck-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 8px;
}

.deck-card:hover .deck-card-overlay {
    opacity: 1;
}

.remove-from-deck {
    padding: 0.5rem 1rem;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.remove-from-deck:hover {
    background: #ff3742;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 16px;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* モーダル内のカードレイアウト */
.modal-card-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.modal-card-image {
    position: relative;
    flex: 0 0 300px;
    text-align: center;
}

.modal-card-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.modal-card-details {
    flex: 1;
    min-width: 0;
}

/* モーダル内のカードテキスト表示改善 */
.modal-content .card-text,
.modal-content .card-legacy {
    white-space: pre-line;
    line-height: 1.6;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 0.95rem;
    max-height: none;
    overflow: visible;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: block;
    clear: both;
}

.modal-content .card-legacy {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
}

.modal-content .card-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
    color: #333;
}

.modal-content .card-stats {
    font-size: 1.1rem;
    margin: 1rem 0;
}

.modal-content .card-trait {
    font-size: 1rem;
    margin: 1rem 0;
}

.modal-content .card-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.modal-content .card-footer > div {
    margin-bottom: 1rem;
}

.modal-content .card-footer > div > div {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .filters {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .filter-group {
        margin-bottom: 0.5rem;
    }
    
    .cards-container.grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .list-view .card {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .list-view .card-image {
        width: 100%;
        height: 120px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .deck-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 98%;
        padding: 1rem;
        max-height: 85vh;
    }
    
    /* モバイルでは縦並びレイアウトに */
    .modal-card-layout {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-card-image {
        flex: none;
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .modal-card-image img {
        max-height: 350px;
    }
    
    .modal-content .card-text,
    .modal-content .card-legacy {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .search-section {
        padding: 1.5rem;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .cards-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* デッキ保存・読み込み機能のスタイル */
.deck-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
    align-items: center;
}

.deck-actions input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.deck-actions input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.deck-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.deck-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#saveDeckBtn {
    background: #28a745;
    color: white;
}

#saveDeckBtn:hover {
    background: #218838;
}

#loadDeckBtn {
    background: #007bff;
    color: white;
}

#loadDeckBtn:hover {
    background: #0056b3;
}

#clearDeckBtn {
    background: #dc3545;
    color: white;
}

#clearDeckBtn:hover {
    background: #c82333;
}

#manageDeckBtn {
    background: #6c757d;
    color: white;
}

#manageDeckBtn:hover {
    background: #5a6268;
}

/* デッキ一覧・管理モーダルのスタイル */
.deck-list-modal,
.deck-manager-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

/* 手札テストモーダル */
.hand-test-modal {
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

.hand-test-info {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

.hand-test-info p {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #333;
}

.hand-test-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.hand-test-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hand-test-card:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.hand-test-card-image {
    width: 100%;
    text-align: center;
}

.hand-test-card-image img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
}

.deck-list,
.deck-manager-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.deck-item,
.deck-manager-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.deck-item:hover,
.deck-manager-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.deck-item-info,
.deck-manager-info {
    flex: 1;
}

.deck-item-info h4,
.deck-manager-info h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

.deck-item-info p,
.deck-manager-info p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

.deck-item-actions,
.deck-manager-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.load-btn,
.delete-btn,
.export-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-btn {
    background: #007bff;
    color: white;
}

.load-btn:hover {
    background: #0056b3;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

.export-btn {
    background: #28a745;
    color: white;
}

.export-btn:hover {
    background: #218838;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .deck-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .deck-actions input[type="text"] {
        min-width: auto;
    }
    
    .deck-actions button {
        width: 100%;
    }
    
    .deck-item,
    .deck-manager-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .deck-item-actions,
    .deck-manager-actions {
        justify-content: center;
    }
    
    .deck-list-modal,
    .deck-manager-modal {
        margin: 5% auto;
        width: 95%;
    }
} 