/* =========================================================
   owner.css
   馬主ページ
   ========================================================= */

.owner-content {
    max-width: 780px;
    margin: 0 auto;
}


/* =========================================================
   馬主名
   ========================================================= */

.owner-identity {
    margin-bottom: 12px;
    padding: 10px 4px 12px;
    border-bottom: 1px solid var(--color-border);
}

.owner-name {
    margin: 0;
    font-size: 2rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}


/* =========================================================
   シーズン選択
   ========================================================= */

.owner-season-control {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.owner-season-select {
    min-width: 132px;
    min-height: 38px;
    padding: 5px 34px 5px 12px;
    background-color: #ffffff;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
}

.owner-season-select:focus {
    border-color: var(--color-main);
    box-shadow: 0 0 0 3px rgba(12, 96, 64, .12);
    outline: 0;
}


/* =========================================================
   プロフィール
   ========================================================= */

.owner-profile-card,
.owner-season-card {
    padding: 0;
    overflow: hidden;
}

.owner-profile-list,
.owner-season-stats {
    margin: 0;
}

.owner-profile-row,
.owner-season-stat {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--color-border);
}

.owner-profile-row:last-child,
.owner-season-stat:last-child {
    border-bottom: 0;
}

.owner-profile-row dt,
.owner-season-stat dt {
    font-weight: 700;
}

.owner-profile-row dd,
.owner-season-stat dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.owner-record {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 10px;
}

.owner-record-summary,
.owner-number {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.owner-record-breakdown {
    color: var(--color-text-light);
    font-size: .82rem;
    white-space: nowrap;
}

.owner-major-wins {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
}

.owner-major-wins li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.owner-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    flex-shrink: 0;
    padding: 1px 5px;
    color: #ffffff;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.5;
}

.owner-grade-1 {
    background: #2f5d8c;
}

.owner-grade-2 {
    background: #a53a3a;
}

.owner-grade-3 {
    background: #527a2b;
}


/* =========================================================
   Season成績
   ========================================================= */

.owner-season-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.owner-season-primary-number {
    color: var(--color-main-dark);
    font-weight: 700;
}


/* =========================================================
   登録馬一覧
   ========================================================= */

.owner-horse-list-card {
    padding: 0;
    overflow: hidden;
}

.owner-horse-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: .85rem;
}

.owner-horse-name-column {
    width: 44%;
}

.owner-horse-total-point-column {
    width: 17%;
}

.owner-horse-earnings-column {
    width: 19%;
}

.owner-horse-class-column {
    width: 20%;
}

.owner-horse-table th,
.owner-horse-table td {
    padding: 9px 8px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    vertical-align: middle;
}

.owner-horse-table th:last-child,
.owner-horse-table td:last-child {
    border-right: 0;
}

.owner-horse-table tbody tr:last-child td {
    border-bottom: 0;
}

.owner-horse-table thead th {
    background: var(--color-section);
    color: var(--color-text);
    font-weight: 700;
    white-space: nowrap;
}

.owner-horse-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.owner-horse-table tbody tr:hover {
    background: #f2f8f5;
}

.owner-horse-table .owner-horse-information {
    text-align: left;
}

.owner-horse-name {
    display: inline-block;
    max-width: 100%;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.owner-horse-name:hover {
    text-decoration: underline;
}

.owner-horse-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px 6px;
    margin-top: 3px;
}

.owner-horse-sex-age {
    color: var(--color-text-light);
    font-size: .76rem;
    white-space: nowrap;
}

.owner-horse-fatigue-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: #f2f3f4;
    color: var(--color-text-light);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: .7rem;
    line-height: 1.3;
    white-space: nowrap;
}

.owner-horse-fatigue-icons {
    line-height: 1;
}

.owner-horse-number,
.owner-horse-class {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.owner-horse-more {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.owner-horse-more-button {
    min-width: 140px;
    min-height: 38px;
    padding: 6px 18px;
    background: #ffffff;
    color: var(--color-main-dark);
    border: 1px solid var(--color-main);
    border-radius: 6px;
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
}

.owner-horse-more-button:hover {
    background: rgba(12, 96, 64, .06);
}

.owner-horse-more-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(12, 96, 64, .12);
    outline: 0;
}

.owner-horse-more-button:disabled {
    cursor: wait;
    opacity: .65;
}


/* =========================================================
   レース結果
   ========================================================= */

.owner-race-results-card {
    padding: 0;
    overflow: hidden;
}

.owner-race-results-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: .82rem;
}

.owner-race-column {
    width: 43%;
}

.owner-race-rank-column {
    width: 9%;
}

.owner-race-horse-column {
    width: 38%;
}

.owner-race-video-column {
    width: 10%;
}

.owner-race-results-table th,
.owner-race-results-table td {
    padding: 9px 7px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.owner-race-results-table th:last-child,
.owner-race-results-table td:last-child {
    border-right: 0;
}

.owner-race-results-table tbody tr:last-child td {
    border-bottom: 0;
}

.owner-race-results-table thead th {
    background: var(--color-section);
    color: var(--color-text);
    text-align: center;
    font-weight: 700;
    white-space: nowrap;
}

.owner-race-results-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.owner-race-results-table tbody tr:hover {
    background: #f2f8f5;
}

.owner-race-information,
.owner-race-horse-information {
    text-align: left;
}

.owner-race-title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px 5px;
    min-width: 0;
}

.owner-race-title-row .owner-grade {
    min-width: 30px;
    padding: 1px 4px;
    font-size: .5rem;
    line-height: 1.4;
}

.owner-race-name,
.owner-race-horse-name {
    min-width: 0;
    font-weight: 700;
    line-height: 1.35;
}

.owner-race-name {
    overflow-wrap: anywhere;
}

.owner-race-horse-name {
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.owner-race-name:hover,
.owner-race-horse-name:hover {
    text-decoration: underline;
}

.owner-race-meta,
.owner-race-horse-meta {
    margin-top: 3px;
    color: var(--color-text-light);
    font-size: .72rem;
    line-height: 1.4;
}

.owner-race-horse-meta {
    white-space: nowrap;
}

.owner-race-rank-cell,
.owner-race-video-cell {
    text-align: center;
}

.owner-race-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 24px;
    padding: 1px 4px;
    background: #f5f5f5;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.owner-race-rank-1 {
    background: #ffd700;
    color: #ffffff;
    border-color: #ffd700;
}

.owner-race-rank-2 {
    background: #c0c0c0;
    color: #ffffff;
    border-color: #c0c0c0;
}

.owner-race-rank-3 {
    background: #ac6b25;
    color: #ffffff;
    border-color: #ac6b25;
}

.owner-race-video {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(211, 47, 47, .08);
    color: #b3261e;
    border: 1px solid rgba(211, 47, 47, .24);
    border-radius: 6px;
}

.owner-race-video:hover {
    background: #c62828;
    color: #ffffff;
    border-color: #c62828;
}

.owner-race-video i {
    font-size: 1.2rem;
    line-height: 1;
}

.owner-race-pagination {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 1fr);
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.owner-race-page-button {
    min-width: 90px;
    min-height: 38px;
    padding: 6px 14px;
    background: #ffffff;
    color: var(--color-main-dark);
    border: 1px solid var(--color-main);
    border-radius: 6px;
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
}

.owner-race-page-button:first-child {
    justify-self: end;
}

.owner-race-page-button:last-child {
    justify-self: start;
}

.owner-race-page-button:hover:not(:disabled) {
    background: rgba(12, 96, 64, .06);
}

.owner-race-page-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(12, 96, 64, .12);
    outline: 0;
}

.owner-race-page-button:disabled {
    background: #f5f5f5;
    color: var(--color-text-light);
    border-color: var(--color-border);
    cursor: default;
    opacity: .65;
}

.owner-race-page-button[aria-busy="true"] {
    cursor: wait;
}

.owner-race-page-status {
    min-width: 54px;
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}


/* =========================================================
   レスポンシブ
   ========================================================= */

@media (max-width: 767.98px) {
    .owner-identity {
        padding: 6px 2px 10px;
    }

    .owner-name {
        font-size: 1.55rem;
    }

    .owner-season-select {
        min-width: 124px;
        min-height: 36px;
        font-size: .85rem;
    }

    .owner-profile-row,
    .owner-season-stat {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px;
        font-size: .9rem;
    }

    .owner-major-wins {
        gap: 6px;
    }

    .owner-major-wins li {
        gap: 6px;
    }

    .owner-season-header {
        gap: 8px;
    }

    .owner-season-header .section-title {
        font-size: 1.1rem;
    }

    .owner-horse-table {
        font-size: .72rem;
    }

    .owner-horse-table th,
    .owner-horse-table td {
        padding: 7px 4px;
    }

    .owner-horse-name {
        font-size: .82rem;
    }

    .owner-horse-status-row {
        gap: 2px 4px;
        margin-top: 2px;
    }

    .owner-horse-sex-age {
        font-size: .68rem;
    }

    .owner-horse-fatigue-status {
        gap: 3px;
        padding: 1px 4px;
        font-size: .62rem;
    }

    .owner-race-results-table {
        font-size: .7rem;
    }

    .owner-race-results-table th,
    .owner-race-results-table td {
        padding: 6px 3px;
    }

    .owner-race-title-row {
        gap: 2px 3px;
    }

    .owner-race-title-row .owner-grade {
        min-width: 28px;
        padding: 1px 3px;
        font-size: .46rem;
    }

    .owner-race-name,
    .owner-race-horse-name {
        font-size: .76rem;
    }

    .owner-race-meta,
    .owner-race-horse-meta {
        margin-top: 2px;
        font-size: .62rem;
    }

    .owner-race-rank {
        min-width: 24px;
        min-height: 22px;
        padding: 1px 3px;
        font-size: .7rem;
    }

    .owner-race-video {
        width: 30px;
        height: 30px;
    }

    .owner-race-video i {
        font-size: 1.1rem;
    }

    .owner-race-pagination {
        grid-template-columns: minmax(80px, 1fr) auto minmax(80px, 1fr);
        gap: 8px;
    }

    .owner-race-page-button {
        min-width: 80px;
        min-height: 36px;
        padding: 5px 10px;
        font-size: .78rem;
    }

    .owner-race-page-status {
        min-width: 48px;
        font-size: .78rem;
    }
}
