/* ================================
   Base wrapper
   ================================ */

.df-ranking {
    margin: 2rem 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.df-ranking-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
}

/* ================================
   A CLASS cards (1〜4位, 5〜10位)
   ================================ */

/* 1〜4位：縦並びの大きめカードを複数縦に並べる */
.df-top5-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* 5〜10位：小さめカードをグリッドで並べる */
.df-top10-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* 基本のカードレイアウト（Aクラス中心） */
.df-card {
    display: flex;
    flex-direction: column;      /* 画像 → テキストの縦レイアウト */
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;          /* 擬似要素・バッジ・炎のため */
    overflow: hidden;
    z-index: 0;                  /* 炎の下地基準 */
}

/* カード内の全コンテンツを炎より前面に配置 */
.df-card > * {
    position: relative;
    z-index: 2;
}

/* 上位カードの追加クラス */
.df-card--top {
    align-items: center;
}

/* ================================
   Rank badge
   ================================ */

.df-card-rank-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.6rem 0.6rem;
    border-radius: 999px;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(to bottom, #0066cc 60%, #ffffff);
    color: #fff;
    z-index: 3;
}

/* スマホ時は少し小さく */
@media (max-width: 768px) {
    .df-card-rank-badge {
        font-size: 1rem;
        padding: 0.4rem 0.4rem;
    }
}

/* ================================
   Card photo (16:9, 768x431ベース)
   ================================ */

.df-card-photo {
    width: 100%;
    max-width: 768px;
    aspect-ratio: 768 / 431;
    overflow: hidden;
    border-radius: 12px;
}

.df-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    border: none;
    display: block;
}

/* ================================
   Card body & text
   ================================ */

.df-card-body {
    width: 100%;
    flex: 1;
    text-align: center;
}

.df-card-player-alias {
    font-size: 1.25rem;
    font-weight: 700;
}

.df-card-catchphrase {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.df-card-venue {
    font-size: 0.85rem;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.8;
}

/* ポイントの行 */
.df-card-points {
    display: flex;
    justify-content: center;
    width: 100%;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.df-card-points span {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(0,0,0,0.03);
}

/* 5〜10位のコンパクト表示用 */
.df-card-points--compact {
    font-size: 0.85rem;
}

/* ================================
   Tables (B/Cクラス & Aクラス11位〜)
   ================================ */

.df-ranking-table-wrapper {
    overflow-x: auto;
}

.df-ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.df-ranking-table th,
.df-ranking-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(0,0,0,0.1);
    text-align: center;
    white-space: nowrap;
}

/* 列の情報量が多いので少し小さめに */
.df-ranking-table th,
.df-ranking-table td {
    font-size: 11px;
    padding: 0.3rem 0.35rem;
}

/* Player / Catchphrase / Venue の複合セル */
.df-player-cell {
    text-align: left;
    white-space: normal;        /* 複数行OK */
    max-width: 220px;           /* スマホでも収まりやすくする */
}

.df-player-alias {
    font-weight: 700;
    font-size: 11px;
}

.df-player-catchphrase {
    font-size: 10px;
    opacity: 0.8;
}

.df-player-venue {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.8;
}

/* Total / Boom / BIGBANG の数値セル */
.df-total-cell,
.df-boomerang-cell,
.df-bigbang-cell {
    font-size: 11px;
}

/* ランク数字セル（共通） */
.df-rank-cell {
    width: 42px;
    min-width: 42px;
    text-align: center;
}

/* テーブルヘッダー色 */
.df-ranking-table th {
    background: #fff7d6;
    font-weight: 700;
}

/* クラス別色 */
.df-ranking--class-a .df-ranking-title {
    color: #d4af37;
}
.df-ranking--class-b .df-ranking-title {
    color: #1e88e5;
}
.df-ranking--class-c .df-ranking-title {
    color: #2e7d32;
}

.df-ranking--class-b .df-ranking-table th {
    background: #e3f2fd;
}
.df-ranking--class-c .df-ranking-table th {
    background: #e8f5e9;
}

/* ================================
   Top3 animations (Aクラス)
   ================================ */

.df-card--top3 {
    animation-name: dfFadeUp, dfFloat;
    animation-duration: 0.8s, 4s;
    animation-timing-function: ease-out, ease-in-out;
    animation-fill-mode: forwards, both;
    animation-iteration-count: 1, infinite;
}

/* Delay per rank */
.df-card--rank-1 {
    animation-delay: 0s, 0s;
}
.df-card--rank-2 {
    animation-delay: 0.1s, 0s;
}
.df-card--rank-3 {
    animation-delay: 0.2s, 0s;
}

/* 1位のゴールド感 */
.df-card--rank-1 {
    box-shadow: 0 0 0 2px rgba(218, 165, 32, 0.4);
}
.df-card--rank-1::before {
    /* 下の炎アニメーションと競合しないよう、ゴールド枠は別の影響を抑える */
}

/* Keyframes */
@keyframes dfFadeUp {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes dfFloat {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Hover effect (desktop) */
@media (hover:hover) {
    .df-card--top3:hover {
        transform: translateY(-6px) scale(1.02);
        box-shadow: 0 10px 20px rgba(0,0,0,0.18);
    }
}

/* ================================
   炎エフェクト（カード背景）
   ================================ */

@keyframes flameAnimation {
    0%   { background-position: 0 0; }
    100% { background-position: 0 -1000px; }
}

/* 炎のベース（::before） */
.df-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 50% 120%, rgba(255, 10, 0, 0.2) 0%, rgba(255, 0, 0, 0) 50%),
        radial-gradient(circle at 20% 110%, rgba(255, 15, 0, 0.2) 0%, rgba(255, 0, 0, 0) 60%),
        radial-gradient(circle at 80% 130%, rgba(255, 12, 0, 0.3) 0%, rgba(255, 0, 0, 0) 55%);
    background-size: 1000% 100%;
    background-repeat: repeat-x;
    animation: flameAnimation 13s linear infinite;
    opacity: 0.8;
    z-index: 0; /* カードコンテンツの下 */
    filter: brightness(1.2) contrast(1.5);
}

/* 炎の上に薄いオーバーレイ（明るさ調整） */
.df-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    z-index: 1; /* 炎の上、テキストの下 */
    border-radius: 12px;
}

/* ================================
   Responsive tweaks
   ================================ */

@media (max-width: 768px) {
    .df-ranking-table th,
    .df-ranking-table td {
        font-size: 10px;
        padding: 0.25rem 0.25rem;
    }

    .df-player-cell {
        max-width: 160px;
    }

    .df-rank-cell {
        width: 36px;
        min-width: 36px;
    }
}
/* ===== Season switcher ===== */

.df-season-switcher {
    margin-bottom: 1rem;
    text-align: right;
    font-size: 0.9rem;
}

.df-season-label {
    margin-right: 0.5rem;
    font-weight: 600;
}

.df-season-link {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #333;
    background: #fff;
}

.df-season-link--active {
    background: #333;
    color: #fff;
    border-color: #333;
}

@media (max-width: 600px) {
    .df-season-switcher {
        text-align: center;
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
    }

    .df-season-link {
        margin-top: 0.25rem;
    }
}
/* ランキングテーブルの縦スクロール */
/* B / C クラスのランキングテーブルを縦スクロールにする */
.df-ranking-table-wrapper--scroll {
    max-height: 500px;      /* 表の高さ（10人前後のイメージ） */
    overflow-y: auto;       /* 縦スクロールを有効化 */
    overflow-x: auto;       /* 既存の横スクロールも残す */
    display: block;
    position: relative;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 4px;
    background: #fff;
}

/* 念のためテーブルは普通のテーブル表示に固定 */
.df-ranking-table-wrapper--scroll .df-ranking-table {
    width: 100%;
    border-collapse: collapse;
    display: table;
}

