@charset "utf-8";

body {
    font-family: sans-serif;
    background-color: #fff; 
    color: #333;
}

.main {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
}

.horse-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid #c0bfbf;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.horse-header h1 {
    margin: 0;
    font-size: 2.5em;
}

/* 現役/引退ステータスバッジ */
.horse-status {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
    color: #fff;
}
.status-現役 { background-color: #4CAF50; }
.status-引退 { background-color: #757575; }
.status-休養 { background-color: #2196F3; }


.horse-profile-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.horse-profile-card {
    background-color: #fff;
    border: 1px solid #c0bfbf;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 15px; 
}

.info-grid {
    display: flex;
    flex-wrap: wrap; 
    gap: 10px;
}

.info-item {
    flex: 1 1 calc(33.333% - 10px); 
    background-color: #f9f9f9;
    padding: 8px; 
    border-radius: 5px;
    min-width: 200px; 
}

.info-item-full {
    margin-top: 10px;
    background-color: #f9f9f9;
    padding: 8px;
    border-radius: 5px;
}

.info-label {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 3px;
}

.info-value {
    display: block;
    font-size: 1.1em;
    font-weight: 500;
}

.info-value a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}
.info-value a:hover {
    text-decoration: underline;
}

.next-race-value {
    font-weight: bold;
}

.details-box {
    font-size: 1em;
    font-weight: normal;
    line-height: 1.7;
}


/* 戦績 */
.horse-history {
    background-color: #fff;
    border: 1px solid #c0bfbf;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 20px;
}

.horse-history h2 {
    margin-top: 0;
}

.horse-history table {
    width: 100%;
    border-collapse: collapse;
}

.horse-history th, .horse-history td {
    border: 1px solid #afafaf;
    padding: 3px;
    text-align: left;
}

.horse-history th {
    text-align: center;
}

.horse-history tr:nth-child(even) {
    background-color: #f8f8f8;
}

.horse-history th {
    background-color: #e9e9e9;
}

/* 着順・人気・クラスの色分け */
td.position-1 { background-color: #FFEE80; }
td.position-2 { background-color: #CCDFFF; }
td.position-3 { background-color: #F0C8A0; }

td.popularity-1 { background-color: #FFEE80; }
td.popularity-2 { background-color: #CCDFFF; }
td.popularity-3 { background-color: #F0C8A0; }

.class-s3 { background-color: #F0C8A0; }
.class-s2 { background-color: #CCDFFF; }
.class-s1, .class-jpn2, .class-jpn3 { background-color: #FFEE80; }
.class-jpn1 { background-color: #FFEE80; }

/* スマートフォン対応 */
@media (max-width: 768px) {
    .main {
        margin: 10px;
        padding: 10px;
    }

    .horse-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        text-align: center;
    }

    .horse-header h1 {
        font-size: 1.8em;
        width: 100%;
    }

    .horse-status {
        align-self: center;
    }

    .horse-profile-container {
        gap: 20px;
    }

    .horse-profile-card {
        padding: 10px;
    }

    .info-grid {
        flex-direction: column;
        gap: 8px;
    }

    .info-item {
        flex: none;
        min-width: auto;
        width: 100%;
    }

    .info-item-full {
        margin-top: 8px;
    }

    .info-label {
        font-size: 0.9em;
    }

    .info-value {
        font-size: 1em;
    }

    .horse-history {
        padding: 10px;
        overflow-x: auto;
    }

    .horse-history table {
        min-width: 600px;
        font-size: 0.85em;
    }

    .horse-history th, .horse-history td {
        padding: 4px 2px;
        font-size: 0.8em;
    }

    .horse-history th {
        white-space: nowrap;
    }
}

/* さらに小さな画面（320px以下）に対応 */
@media (max-width: 480px) {
    .main {
        margin: 5px;
        padding: 5px;
    }

    .horse-header h1 {
        font-size: 1.5em;
    }

    .horse-status {
        font-size: 0.8em;
        padding: 3px 8px;
    }

    .horse-profile-card {
        padding: 8px;
    }

    .info-item {
        padding: 6px;
    }

    .info-item-full {
        padding: 6px;
    }

    .info-label {
        font-size: 0.8em;
    }

    .info-value {
        font-size: 0.9em;
    }

    .horse-history {
        padding: 8px;
    }

    .horse-history table {
        font-size: 0.75em;
    }

    .horse-history th, .horse-history td {
        padding: 2px 1px;
    }
}