@charset "utf-8";

/* メインコンテナ */
.main {
    width: 96%;
    max-width: 1350px;
    margin: 0 auto;
    font-size: 80%;
}

/* ヘッダー全体 */
.race-header-container {
    padding: 10px 0 15px; /* ★変更：下側の余白を詰める (15px -> 5px) */
    border-bottom: 2px solid #333;
    margin-bottom: 15px;
    margin-top:15px;
}

/* 上段全体 */
.race-header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 5;
    margin-top: 5; 
}

/* 左側エリア（R番号＋レース情報） */
.race-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* R番号のボックス（デスクトップ・モバイル共に横並び） */
.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: 80px;
    line-height: 1;
    gap: 4px;
}

/* 数字（デスクトップ） */
.race-number-digit {
    font-size: 2.8rem;
    font-weight: bold;
}

/* 'R'（デスクトップ） */
.race-number-char {
    font-size: 1.4rem;
    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;
}

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

/* メタ情報 */
.race-meta-row {
    font-size: 1.0rem;
    color: #444;
    font-weight: bold;
}
.race-meta-row span {
    margin-right: 15px;
}

/* ボタンエリア（PC版は右寄せ） */
.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;
}
.btn-nav:hover { opacity: 0.8; }
.btn-blue { background-color: #2196F3; color: #fff; }
.btn-gray { background-color: #ccc; color: #000; }
.btn-green { background-color: #4CAF50; color: #fff; }

/* テーブルスクロール用 */
.table-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
    transition: zoom 0.2s ease;
}

table {
    border-collapse: collapse;
    border: 1px solid #333;
    min-width: 1350px;
}

.zoom-controls {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

/* 拡大縮小ボタン */
.zoom-btn {
    font-size: 1.2rem;
    padding: 10px 20px;
    margin: 0 10px;
    cursor: pointer;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
}

.col-horse-number { width: 20px; text-align: center; }
.col-horse-name { width: 150px; }
.col-jockey { width: 120px; }
.col-odds-popularity { width: 40px; text-align: center; }

/* モバイル用レイアウト調整 */
@media (max-width: 768px) {
    .race-header-top-row {
        flex-direction: column; 
        align-items: stretch;
        gap: 10px; /* 余白を少し調整 */
    }

    .race-header-left {
        width: 100%;
    }

    .race-number-block {
        padding: 5px 10px;
        min-width: auto;
        gap: 2px;
    }

    .race-number-digit {
        font-size: 2.0rem;
    }

    .race-number-char {
        font-size: 1.0rem;
    }

    .race-header-buttons {
        justify-content: flex-start;
        margin-top: 0; /* マージン削除 */
        width: 100%;
    }

    .race-name-title { font-size: 1.3rem; }
    
    .zoom-btn {
        font-size: 0.9rem;
        padding: 8px 12px;
        margin: 0 5px;
    }
}