@charset "UTF-8";

/* =========================================
   One Day Match (Light Mode) 固有スタイル
   ========================================= */

:root {
    /* --- ベースカラー定義 (Light) --- */
    --body-bg-light: #3a3d67;   /* 全体背景 */
    --text-main-brown: #a9b0be; /* メイン文字色 (brand-brown) */
    --text-main-dark: #737774;
    --text-accent-brown: #a8b2b7; /* アクセント文字色 (順位、MVPタイトル等) */
    --text-accent-violet: #3a3d67;
    --bg-accent-white:#e3e6ec;
    
    /* --- スコア色定義 --- */
    --score-plus: #19b2a1;   /* 落ち着いた青 */
    --score-minus: #fc02e5;  /* 落ち着いた赤 */
    --score-zero: #aaa;

    /* --- 順位バッジ色 --- */
    --rank-1-gold: #FFD700;
    --rank-2-silver: #19b2a1;
    --rank-3-bronze: #cb2d93;
    --rank-4-red: #da3248;

    /* --- カード背景色パレット (JSで使用する色もCSS変数化推奨) --- */
    --bg-rank-1: #f5f7f6;
    --bg-card-1: #f5f7f6;
    --bg-card-2: #f5f7f6;
    --bg-card-3: #f5f7f6;
    --bg-card-4: #f5f7f6;
    --bg-card-5: #f5f7f6;
    --bg-card-6: #f5f7f6;
    --bg-card-7: #f5f7f6;
    
    /* MVPカード背景 */
    --mvp-card-bg: #656f91;
    --mvp-text-highlight: #9cb5da;
}

/* =========================================
   基本設定 (Common.cssの上書き)
   ========================================= */
body {
    background: linear-gradient(
        to bottom right,
        #e6e9ff 0%,   /* 左上（白っぽい） */
        #7b80b6 40%,  /* 中間の淡い紫 */
        #4c4f79 75%,  /* 少し濃い紫 */
        #3a3d67 100%  /* 右下（濃い紫） */
    );
}
/* =========================================
   ヘッダー・タイトル周り
   ========================================= */
.ranking-header {
    text-align: center;
    margin-bottom: 24px;
}
.ranking-header h2 {
    /* font-family は common.css の h1, h2 定義を継承 */
    color: var(--bg-accent-white); /* common.css由来 */
    font-size: 1.8rem;
    margin: 0;
    letter-spacing: 0.05em;
}
.ranking-meta {
    font-size: 0.85rem;
    color: var(--text-accent-violet);
    margin-top: 4px;
}

/* =========================================
   MVPハイライト & バナー
   ========================================= */
.highlight-section {
    padding: 16px 20px;
    margin-top: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    background-color:var(--bg-accent-white);
    
}
.highlight-section legend {
    color: var(--text-accent-violet);
    font-weight: bold;
    font-family: 'Playfair Display', serif;
    padding: 0 8px;
}

/* 総合優勝 */
.champion-winner {
    text-align: center;
    border-bottom: 1px dashed var(--text-main-brown); /* 背景に合わせて調整 */
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.highlight-label {
    display: block;
    font-size: 0.9rem;
    color: var(--bg-accent-brown);
    margin-bottom: 4px;
}
.highlight-value {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--mvp-card-bg);
    letter-spacing: 0.05em;
}

/* MVPカード */
.mvp-card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    
}
.mvp-card {
    background: var(--mvp-card-bg);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 12px;
    flex: 1 1 calc(33% - 12px);
    min-width: 100px;
    text-align: center;
    color: var(--text-main-brown);
}
.mvp-title {
    display: block;
    font-size: 0.75rem;
    color: var(--bg-accent-white); /* 統一色を使用 */
    margin-bottom: 4px;
}
.mvp-data {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--mvp-text-highlight);
    line-height: 1.1;
}
.mvp-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--bg-accent-white);
    opacity: 0.8;
    margin-top: 4px;
}

/* =========================================
   ランキングリスト
   ========================================= */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.1s;
    background: #fff; /* デフォルト白（JSで上書き） */
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(88, 66, 50, 0.15); /* 茶色系の影 */
    border: 1px solid transparent;
    color: var(--text-main-brown);
    position: relative;
    overflow: hidden;
}

.ranking-card:active {
    transform: scale(0.98);
}

/* 1位の特別装飾 */
.ranking-card.rank-1 {
    border: 2px solid var(--rank-1-gold);
    background: var(--bg-rank-1) !important; /* JSより優先したい場合 */
    box-shadow: 0 4px 15px rgba(239, 183, 77, 0.4);
}

/* カード内レイアウト (Main Content) */
.card-main-content {
    display: flex;
    width: 100%;
    position: relative;
    z-index: 2;
    background: inherit;
}

/* 左側固定エリア */
.card-fixed {
    flex: 0 0 180px;
    display: flex;
    align-items: center;
    padding: 12px 0 12px 12px;
    background: inherit;
    position: relative;
    z-index: 2;
    box-shadow: 4px 0 12px -4px rgba(0,0,0,0.08);
}

.rank-badge {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    width: 40px;
    text-align: center;
    color: var(--text-accent-brown); /* 統一色を使用 */
    line-height: 1;
}
.rank-1 .rank-badge { color: var(--text-main-brown); /* 1位は濃い茶色で見やすく */ }

.user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 8px;
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-main-dark);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rank-1 .user-name { color: var(--text-main-brown); }

.total-score {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Helvetica Neue', sans-serif;
    line-height: 1;
}

/* 右側スクロールエリア */
.card-scroll {
    flex: 1;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    padding: 8px 16px 8px 8px;
    scrollbar-width: none;
}
.card-scroll::-webkit-scrollbar { display: none; }

/* 各半荘セル */
.round-cell {
    flex: 0 0 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-left: 1px dashed rgba(0,0,0,0.1);
}
.round-label {
    font-size: 0.65rem;
    color: var(--brand-orange); /* common.css由来 */
    margin-bottom: 2px;
}
.round-point {
    font-size: 0.95rem;
    font-weight: bold;
}
.round-rank {
    font-size: 0.7rem;
    color: #fff;
    border-radius: 4px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    margin-top: 2px;
}

/* 順位バッジ適用 */
.r-rank-1 { background-color: var(--rank-1-gold); }
.r-rank-2 { background-color: var(--rank-2-silver); }
.r-rank-3 { background-color: var(--rank-3-bronze); }
.r-rank-4 { background-color: var(--rank-4-red); }

/* スコア色分け */
.score-plus { color: var(--score-plus); }
.score-minus { color: var(--score-minus); }
.score-zero { color: var(--score-zero); }

/* =========================================
   背景色クラス (JSから付与)
   ========================================= */
/* 2位〜8位...の背景色パターン */
.ranking-card.rank-bg-1 { background-color: var(--bg-card-1); }
.ranking-card.rank-bg-2 { background-color: var(--bg-card-2); }
.ranking-card.rank-bg-3 { background-color: var(--bg-card-3); }
.ranking-card.rank-bg-4 { background-color: var(--bg-card-4); }
.ranking-card.rank-bg-5 { background-color: var(--bg-card-5); }
.ranking-card.rank-bg-6 { background-color: var(--bg-card-6); }
.ranking-card.rank-bg-7 { background-color: var(--bg-card-7); }


/* =========================================
   詳細エリア (アコーディオン)
   ========================================= */
.card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease;
    opacity: 0;
    background-color: rgba(255,255,255,0.4); /* 背景色を少し透過で明るく */
    border-top: 1px dashed rgba(0,0,0,0.1);
}

.ranking-card.open .card-details {
    max-height: 500px;
    opacity: 1;
    padding-bottom: 12px;
    overflow-y: auto;
}

.match-list {
    list-style: none;
    padding: 0 16px;
    margin: 12px 0 0 0;
}
.match-item {
    display: flex;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.85rem;
}
.match-item:last-child { border-bottom: none; }

.match-round {
    font-weight: bold;
    color: var(--text-accent-violet);
    width: 40px;
    flex-shrink: 0;
}
.match-opponents {
    color: var(--text-main-dark);
    opacity: 0.8;
}

/* 開閉インジケーター */
.accordion-icon {
    position: absolute;
    bottom: 4px;
    right: 50%;
    transform: translateX(50%);
    font-size: 0.6rem;
    color: rgba(0,0,0,0.3);
    transition: transform 0.3s;
}
.ranking-card.open .accordion-icon {
    transform: translateX(50%) rotate(180deg);
}

/* =========================================
   次回開催バナー
   ========================================= */
.next-event-banner {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-top: 24px;
    color: var(--text-main-brown);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.banner-text {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
}
.next-date {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 16px;
}


