/* =========================================
   ポケカランキング
   ========================================= */

.pokeca-ranking-container {
    width: 100%;
    margin: 30px 0 !important;
    box-sizing: border-box;
}

.pokeca-card-item {
    display: block;
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    text-decoration: none !important;
    color: #333 !important;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #f0f0f0;
}

.pokeca-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12) !important;
}

.rank-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    background: #333;
    color: #fff;
    font-family: 'DIN Alternate', 'Roboto', 'Arial', sans-serif;
    font-weight: 700;
    font-size: 14px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    border-top-left-radius: 8px;
    border-bottom-right-radius: 12px;
    
    z-index: 10;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5); 
}

.pokeca-card-item.rank-num-1 .rank-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 60%, #d4af37 100%);
    width: 48px;
    height: 48px;
    font-size: 24px;
    border-bottom-right-radius: 18px;
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.6);
    z-index: 11;
}

.pokeca-card-item.rank-num-2 .rank-badge {
    background: linear-gradient(135deg, #F0F0F0 0%, #B0B0B0 100%);
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-bottom-right-radius: 14px;
    color: #444; 
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

.pokeca-card-item.rank-num-3 .rank-badge {
    background: linear-gradient(135deg, #f4a460 0%, #cd853f 100%);
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-bottom-right-radius: 14px;
}

.pokeca-card-item.rank-num-4 .rank-badge,
.pokeca-card-item.rank-num-5 .rank-badge {
    background: #555; 
}

.card-thumb {
    width: 100%;
    aspect-ratio: 63 / 88;
    position: relative;
    overflow: hidden;
    background: #fafafa;
}
.card-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top center !important;
    transform: scale(1.08);
    transition: transform 0.3s ease;
}
.pokeca-card-item:hover .card-thumb img {
    transform: scale(1.15);
}

.card-info {
    padding: 8px;
    background: #fff;
}

.rarity-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    color: #888;
    background: #f5f5f5;
    padding: 1px 5px;
    border-radius: 3px;
    margin-bottom: 2px;
    line-height: 1;
}

.rarity-badge.rarity-empty {
    background: transparent;
    color: transparent;
    pointer-events: none;
}

.card-title {
    all: unset; 
    display: block;
    box-sizing: border-box;
    font-size: 13px !important;
    font-weight: 700 !important;
    margin: 2px 0 0 0 !important; 
    padding: 0 !important;
    line-height: 1.3 !important;
    color: #333 !important;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pack-name {
    font-size: 10px;
    color: #999;
    margin-top: 0px; 
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.card-price-area {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
}

.current-price {
    font-size: 16px;
    font-weight: 800;
    color: #222;
    line-height: 1;
    margin-bottom: 2px;
}

.diff-area {
    font-size: 10px;
    font-weight: bold;
    line-height: 1.2;
	margin-top: 0.3em;
}
.price-diff.text-up { color: #00BFFF; }
.price-diff.text-down { color: #FF4081; }
.price-diff.text-none { color: #aaa; }
.price-diff.text-even { color: #aaa; }

.pokeca-view-list .pokeca-ranking-wrapper {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .pokeca-view-list .pokeca-ranking-wrapper {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .card-info { padding: 6px; }
    .card-title { font-size: 11px !important; margin-bottom: 0 !important; }
    .current-price { font-size: 13px; }
    .diff-area { font-size: 9px; }
    .rarity-badge { font-size: 9px; padding: 1px 3px; }
    .rank-badge { width: 24px; height: 24px; font-size: 11px; border-bottom-right-radius: 6px; }
    .pack-name { font-size: 9px; margin-bottom: 2px; }
}

/* =========================================
   カルーセル表示
   ========================================= */

.pokeca-view-carousel .pokeca-ranking-wrapper {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    
    padding: 10px 5px 25px 5px; 
    
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    
    scrollbar-width: thin;
    scrollbar-color: #ccc #f9f9f9;
}

.pokeca-view-carousel .pokeca-card-item {
    flex: 0 0 160px;
    scroll-snap-align: start;
}

@media (max-width: 768px) {
    .pokeca-view-carousel .pokeca-card-item {
        flex: 0 0 120px;
    }
}

.pokeca-view-carousel .pokeca-ranking-wrapper::-webkit-scrollbar {
    height: 8px; 
}

.pokeca-view-carousel .pokeca-ranking-wrapper::-webkit-scrollbar-track {
    background: #f9f9f9;
    border-radius: 10px;
    margin: 0 10px;
}

.pokeca-view-carousel .pokeca-ranking-wrapper::-webkit-scrollbar-thumb {
    background: #d0d0d0; 
    border-radius: 10px; 
    transition: background 0.3s ease;
}

.pokeca-view-carousel .pokeca-ranking-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0; 
}

.pokeca-more-btn-area {
    text-align: center;
    margin-top: 20px;
    display: none;
}
.pokeca-more-btn {
    display: inline-block;
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 40px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.pokeca-more-btn:hover {
    background-color: #f9f9f9;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.pokeca-card-item.is-hidden {
    display: none !important;
}

/* =========================================
   テーブル表示
   ========================================= */

.pokeca-view-table .pokeca-ranking-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pokeca-view-table .pokeca-card-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 15px;
    height: auto;
}

.pokeca-view-table .rank-badge {
    position: static;
    flex-shrink: 0;
    margin-right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: none;
}

.pokeca-view-table .pokeca-card-item.rank-num-1 .rank-badge { width: 40px; height: 40px; font-size: 20px; }

.pokeca-view-table .card-thumb {
    width: 50px;
    height: 70px;
    aspect-ratio: auto;
    margin-right: 15px;
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid #eee;
}
.pokeca-view-table .card-thumb img {
    transform: scale(1.0) !important;
    object-fit: contain !important;
}

.pokeca-view-table .card-info {
    flex-grow: 1;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    background: transparent;
}

.pokeca-view-table .card-meta-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 10px;
}

.pokeca-view-table .card-title {
    font-size: 14px !important;
    margin: 2px 0 !important;
    height: auto;
    -webkit-line-clamp: 2;
}

.pokeca-view-table .card-price-area {
    margin: 0;
    padding: 0;
    border: none;
    align-items: flex-end;
    min-width: 90px;
    flex-shrink: 0;
}

.pokeca-view-table .current-price {
    font-size: 16px;
}

/* =========================================
   テーブル表示 (1列レイアウト) 
   ========================================= */

.pokeca-view-table .pokeca-ranking-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pokeca-view-table .pokeca-card-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 15px;
    height: auto;
}

/* ランクバッジ (テーブル用) */
.pokeca-view-table .rank-badge {
    position: static;
    flex-shrink: 0;
    margin-right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: none;
}
.pokeca-view-table .pokeca-card-item.rank-num-1 .rank-badge { width: 40px; height: 40px; font-size: 20px; }

.pokeca-view-table .card-thumb {
    width: 50px; 
    height: 70px;
    aspect-ratio: auto;
    margin-right: 15px;
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid #eee;
    overflow: hidden;
}

.pokeca-view-table .card-thumb img {
    width: 100% !important;
    height: 100% !important;
    
    object-fit: cover !important; 
    object-position: top center !important;
    
    transform: scale(1.1) !important; 
}

.pokeca-view-table .card-info {
    flex-grow: 1;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    background: transparent;
}

.pokeca-view-table .card-meta-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 10px;
}

.pokeca-view-table .card-title {
    font-size: 14px !important;
    margin: 2px 0 !important;
    height: auto;
    -webkit-line-clamp: 2;
}

.pokeca-view-table .card-price-area {
    margin: 0;
    padding: 0;
    border: none;
    align-items: flex-end;
    min-width: 90px; 
    flex-shrink: 0;
}

.pokeca-view-table .current-price {
    font-size: 16px;
}

@media (max-width: 600px) {
    .pokeca-view-table .pokeca-card-item {
        padding: 10px;
    }
    .pokeca-view-table .rank-badge {
        margin-right: 10px;
        width: 24px; 
        height: 24px; 
        font-size: 12px;
    }
    .pokeca-view-table .pokeca-card-item.rank-num-1 .rank-badge {
        width: 30px; height: 30px; font-size: 16px;
    }
    .pokeca-view-table .card-thumb {
        width: 40px; 
        height: 56px; 
        margin-right: 10px;
    }
    .pokeca-view-table .card-title {
        font-size: 12px !important;
    }
    .pokeca-view-table .current-price {
        font-size: 14px;
    }
    .pokeca-view-table .diff-area {
        font-size: 9px;
    }
}