/* =========================================================
   RACE CARDS / TOP 5 - patch lisibilité
   À ajouter à la fin de assets/css/style.css
   ========================================================= */

.race-card,
.home-race-card,
.result-race-card {
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 14px 28px rgba(0,0,0,.08);
    border: 1px solid rgba(0,0,0,.05);
    height: 100%;
}

.race-card-header,
.home-race-card-header,
.result-race-card-header {
    padding: 18px 20px 16px;
    color: #fff;
}

.race-card-header h3,
.home-race-card-header h3,
.result-race-card-header h3 {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1.05;
    font-weight: 900;
    text-transform: uppercase;
}

.race-card-subtitle,
.race-card-meta,
.home-race-card-meta,
.result-race-card-meta {
    margin-top: 6px;
    opacity: .95;
    font-size: .95rem;
    font-weight: 600;
}

.race-card-body,
.home-race-card-body,
.result-race-card-body {
    padding: 18px;
}

.podium-grid,
.race-podium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.podium-card,
.race-podium-card {
    background: #f8f9fb;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 18px;
    padding: 12px 10px;
    text-align: center;
    min-height: 126px;
}

.podium-medal {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.podium-name,
.runner-short-name {
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.05;
    font-size: 1rem;
    margin-bottom: 4px;
    word-break: break-word;
}

.podium-firstname,
.runner-first-name {
    display: block;
    font-size: .95rem;
    font-weight: 700;
    text-transform: none;
}

.podium-nation,
.runner-nation-line {
    font-size: .85rem;
    color: #5f6472;
    margin-bottom: 3px;
}

.podium-time,
.runner-time-line {
    font-size: .95rem;
    font-weight: 700;
    color: #4b5563;
}

.top5-grid,
.race-top5-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.top5-box,
.race-top5-box {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 18px;
    padding: 14px 14px 10px;
    background: #fcfcfd;
    min-width: 0;
}

.top5-title,
.race-top5-title {
    font-size: 1.1rem;
    font-weight: 900;
    margin: 0 0 10px;
}

.top5-list,
.race-top5-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.top5-list li,
.race-top5-list li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.top5-list li:last-child,
.race-top5-list li:last-child {
    border-bottom: none;
}

.top5-rank {
    font-weight: 900;
    color: #2563eb;
    line-height: 1.1;
}

.top5-runner {
    min-width: 0;
}

.top5-runner-name {
    font-weight: 900;
    color: #2563eb;
    font-size: 1rem;
    line-height: 1.05;
    text-transform: uppercase;
    word-break: break-word;
}

.top5-runner-sub {
    margin-top: 3px;
    font-size: .82rem;
    color: #6b7280;
    line-height: 1.2;
}

.top5-time {
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
    font-size: .98rem;
}

.race-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.race-card-actions .btn {
    border-radius: 12px;
    font-weight: 700;
    padding: 10px 14px;
}

@media (max-width: 1200px) {
    .top5-grid,
    .race-top5-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .podium-grid,
    .race-podium-grid {
        grid-template-columns: 1fr;
    }

    .top5-list li,
    .race-top5-list li {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .top5-time {
        grid-column: 2;
        margin-top: 2px;
    }

    .race-card-header h3,
    .home-race-card-header h3,
    .result-race-card-header h3 {
        font-size: 1.45rem;
    }
}

/* amélioration tableaux classement */
.table-results th,
.table-results td,
.results-table th,
.results-table td {
    white-space: nowrap;
    vertical-align: middle;
}

.table-results .runner-name,
.results-table .runner-name {
    white-space: normal;
    min-width: 180px;
}

.table-results .nation-cell,
.results-table .nation-cell {
    min-width: 92px;
}

.table-results .time-cell,
.results-table .time-cell {
    min-width: 95px;
    font-weight: 700;
}

.table-results .rank-cell,
.results-table .rank-cell {
    min-width: 60px;
    font-weight: 800;
}

.share-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:18px 22px;
    border-radius:999px;
    background:linear-gradient(135deg,var(--race-dark),var(--race-primary));
    color:white;
    text-decoration:none;
    font-weight:800;
    box-shadow:0 10px 24px rgba(0,0,0,.12);
    border:0;
    transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.share-btn:hover{
    color:white;
    transform:translateY(-1px);
    box-shadow:0 14px 28px rgba(0,0,0,.16);
}
.share-modal{
    border:1px solid var(--border-soft);
    border-radius:24px;
    background:var(--card-bg);
    box-shadow:0 20px 40px rgba(17,17,17,.12);
}
.share-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}
.share-icon-btn{
    border:1px solid var(--border-soft);
    background:white;
    border-radius:18px;
    padding:14px 10px;
    min-height:92px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:8px;
    font-weight:700;
    color:var(--text-main);
    transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.share-icon-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 20px rgba(17,17,17,.08);
    border-color:color-mix(in srgb, var(--race-primary) 35%, var(--border-soft));
}
.share-icon{
    width:42px;
    height:42px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--race-soft);
    color:var(--race-dark);
    font-size:1.1rem;
    font-weight:900;
}
.wechat-box{
    border-top:1px solid var(--border-soft);
    padding-top:18px;
}
@media (max-width: 560px){
    .share-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
