@charset "utf-8";

/* 全体基本設定 */
body {
    background-color: #f5f5f5;
    color: #222222;
    font-family: sans-serif;
    margin: 0;
    padding: 0;
}

/* メインコンテナ */
.main {
    width: 96%;
    max-width: 1000px; 
    margin: 0 auto;
    background-color: #fdfdfd;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

/* --- ヘッダーUI --- */
.race-header-container {
    padding: 10px 0 15px;
    border-bottom: 2px solid #333;
    margin-bottom: 10px;
}

.race-header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.race-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.race-number-block {
    background-color: #222;
    color: #fff;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    padding: 5px 15px;
    border-radius: 4px;
    min-width: 60px;
    line-height: 1;
    gap: 4px;
}

.race-number-digit { font-size: 2.4rem; font-weight: bold; }
.race-number-char { font-size: 1.2rem; font-weight: bold; }

.race-header-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.race-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.race-name-title {
    font-size: 1.6rem;
    margin: 0;
    font-weight: bold;
    line-height: 1.1;
    border: none;
    padding: 0;
}

.race-class-badge {
    font-size: 0.9rem;
    padding: 3px 8px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    white-space: nowrap;
}

.race-meta-row {
    font-size: 0.95rem;
    color: #444;
    font-weight: bold;
}
.race-meta-row span {
    margin-right: 15px;
}

/* ボタンエリア */
.race-header-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-nav {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    text-align: center;
    transition: opacity 0.2s;
    white-space: nowrap;
    border: none; 
}
.btn-nav:hover { opacity: 0.8; }
.btn-blue { background-color: #2196F3; color: #fff; }
.btn-gray { background-color: #ccc; color: #000; }

/* --- タイム表示 --- */
.race-time-info {
    text-align: right;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #333;
}

/* --- テーブルスタイル --- */
table.result-table {
    border-collapse: collapse;
    width: 100%;
    border: 1px solid #bfbfbf;
    font-size: 0.95rem;
}

.result-table thead {
    background-color: #444;
    color: white;
}

.result-table th {
    padding: 10px;
    border: 1px solid #bfbfbf;
    font-weight: bold;
    white-space: nowrap;
}

.result-table td {
    padding: 10px 8px;
    border: 1px solid #bfbfbf;
    vertical-align: middle;
}

.result-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* リンク色 */
a { color: #0033AB; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 馬番号色設定 */
.horse-number-1 { background-color: white; color: black; }
.horse-number-2 { background-color: #393939; color: white; }
.horse-number-3 { background-color: #ff4d4d; color: white; }
.horse-number-4 { background-color: #0075c8; color: white; }
.horse-number-5 { background-color: #ffef00; color: black; }
.horse-number-6 { background-color: #009e25; color: white; }
.horse-number-7 { background-color: #ffaa00; color: white; }
.horse-number-8 { background-color: #ffa8ce; color: white; }
.horse-number-9 { background-color: #ffaa00; color: white; }

/* 人気色（PC版） */
.popularity-1 { background-color: #FFEE80; }
.popularity-2 { background-color: #CCDFFF; }
.popularity-3 { background-color: #F0C8A0; }

/* 列ごとのスタイル調整 */
.col-pos { text-align: center; width: 40px; font-weight: bold; }
.col-num { text-align: center; width: 40px; font-weight: bold; }
.col-horse { font-weight: bold; }
.col-weight { text-align: center; }
.col-pop { text-align: center; }
.col-odds { text-align: center; } 

/* SP表示制御用クラス */
.sp-only { display: none; }
.pc-only { display: table-cell; }

/* --- モバイル対応 --- */
@media (max-width: 768px) {
    .main {
        padding: 10px;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }

    /* ヘッダーモバイル調整 */
    .race-header-top-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .race-header-left {
        width: 100%;
    }
    .race-header-buttons {
        width: 100%;
        justify-content: space-between;
    }
    .btn-nav {
        flex: 1; 
        padding: 10px 0;
    }
    
    .race-number-digit { font-size: 2.0rem; }
    .race-name-title { font-size: 1.3rem; }

    /* タイム表示モバイル調整 */
    .race-time-info {
        font-size: 1.0rem;
        text-align: right;
    }

    /* テーブルモバイル調整 */
    .result-table {
        font-size: 0.85rem;
    }
    
    .result-table th, .result-table td {
        padding: 8px 4px;
    }

    /* 表示切り替え */
    .pc-only { display: none; }
    .sp-only { display: table-cell; } 
    div.sp-only { display: block; }

    /* 列幅調整 */
    .col-pos { width: 30px; }
    .col-num { width: 30px; }
    
    /* 馬名セル内のレイアウト */
    .col-horse {
        line-height: 1.5;
    }
    .horse-name-main {
        font-size: 1.0rem;
        margin-bottom: 2px;
    }
    .sp-meta {
        font-size: 0.75rem;
        color: #555;
        font-weight: normal;
    }
    .sp-meta a {
        color: #0033AB; 
    }

    /* 人気・オッズセル */
    .col-pop-odds {
        text-align: center;
        width: 70px; 
        font-size: 0.8rem;
        white-space: nowrap;
    }
    /* 人気：太字 */
    .pop-val {
        font-weight: bold;
    }
    /* オッズ：細字(標準) */
    .odds-val {
        font-weight: normal;
    }
}