@charset "utf-8";

/* --- 基本スタイル --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #222;
    line-height: 1.6;
}
.main {
    max-width: 1300px;
    width: 96%;
    margin: 20px auto;
}
h1, h2 {
    border-bottom: 1px solid #222;
    padding-bottom: 10px;
    margin-top: 1.5em;
    margin-bottom: 1em;
}
h1 { font-size: 1.8em; }
h2 { font-size: 1.4em; margin-top: 0; }

a { color: #222; text-decoration: none; }
a:hover { color: #111; text-decoration: underline; }

/* --- レイアウト（PC: 1:1分割） --- */
.layout-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.layout-main {
    flex: 1 1 50%;
    max-width: 50%;
    min-width: 0; 
}
.layout-sidebar {
    flex: 1 1 50%;
    max-width: 50%;
    min-width: 0;
}

/* --- コンテンツブロック --- */
.content-block {
    background-color: #fdfdfd;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* --- テーブル共通 --- */
table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #bfbfbf;
    width: 100%;
    table-layout: fixed;
}
th, td {
    padding: 8px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #ddd;
    box-sizing: border-box;
}
thead th {
    background-color: #222;
    color: #f5f5f5;
    border-bottom: 1px solid #222;
}

/* --- レース一覧テーブル --- */
.race-list-table { width: 100%; }
.race-row { position: relative; cursor: pointer; } 
.race-row:hover { background-color: #f0f8ff; }

.race-num-cell { width: 50px; padding: 0 !important; }
.race-num-block {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    background-color: #333;
    color: white;
    padding: 10px 2px;
    height: 100%;
    min-height: 50px;
}
.race-num-val { font-size: 1.4em; font-weight: bold; line-height: 1; }
.race-num-unit { font-size: 0.8em; font-weight: bold; }

.race-info-cell { width: auto; }
.race-info-row1 {
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.race-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #0033AB;
    line-height: 1.3;
}
.race-class-badge {
    font-size: 0.75em;
    padding: 2px 8px; 
    border-radius: 10px; 
    white-space: nowrap;
    display: inline-block;
}
.race-info-row2 { font-size: 0.85em; color: #555; }

.race-action-cell { width: 60px; text-align: center; }
.btn-action {
    display: inline-block;
    padding: 4px 8px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    font-size: 0.8em;
    text-decoration: none;
    font-weight: bold;
}
.btn-action:hover { background-color: #45a049; }

/* --- 注目レース（横長カード） --- */
.horizontal-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* ★変更: 比率を 4:6 に変更 (flex: 4 と flex: 6) */
.fr-section-info { 
    flex: 4; /* 比率4 */
    min-width: 150px; 
}
.fr-header { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.fr-num { background: #333; color: #fff; padding: 2px 8px; border-radius: 4px; font-weight: bold; }
.fr-class { padding: 2px 8px; border-radius: 10px; color: #fff; font-weight: bold; font-size: 0.8em; }

.fr-name-lg { font-size: 1.4em; font-weight: bold; line-height: 1.2; display: block; }
.fr-name-link { color: #0033AB; text-decoration: none; }
.fr-name-link:hover { text-decoration: underline; color: #0033AB; }

.fr-meta-lg { color: #555; font-size: 0.95em; }
.fr-prize { font-size: 0.9em; color: #444; margin-left: 5px; }

/* ★変更: 比率を 4:6 に変更 */
.fr-section-horses { 
    flex: 6; /* 比率6 */
    min-width: 200px; 
    border-left: 1px solid #eee; 
    padding-left: 20px; 
}
.fr-label { display: block; font-size: 0.85em; color: #777; margin-bottom: 5px; font-weight: bold; }
.fr-horse-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 15px; }
.fr-horse-item { color: #222; font-size: 0.95em; text-decoration: underline; text-decoration-color: #ccc; }
.fr-horse-item:hover { color: #0033AB; text-decoration-color: #0033AB; }

/* --- 開催リーディング --- */
.leading-text {
    font-size: 1.1em;
    font-weight: bold;
    padding: 15px;
    border: 1px solid #222;
    border-radius: 4px;
    background-color: #f8f9fa;
    margin: 0;
}

/* ★変更: 騎手名リンクを1行固定 */
.jockey-link { 
    color: #0033AB; 
    font-weight: bold; 
    white-space: nowrap; /* 折り返し禁止 */
}
/* セル幅を自動にして名前の長さに合わせる */
.jockey-table td:first-child {
    white-space: nowrap;
    width: auto;
}

/* --- PC/SP 切り替え --- */
.sp-only, .sp-only-block { display: none; }
.pc-only, .pc-only-block { display: block; }

/* --- スマートフォン対応 --- */
@media (max-width: 768px) {
    .main { width: 96%; margin: 10px auto; }
    
    .layout-wrapper { display: block; }
    .layout-main { max-width: 100%; width: 100%; flex: none; }
    .layout-sidebar { display: none; }

    .pc-only, .pc-only-block { display: none !important; }
    .sp-only { display: inline-block !important; }
    .sp-only-block { display: block !important; }

    .race-action-cell { display: none; }
    
    .race-name { font-size: 1.1em; }
    .race-info-row1 { flex-direction: row; }
}