/*
 * JouteTrack — theme-pages-joutes-resultats.css
 * Podium visuel (animateur), scores pondérés, classement plateau.
 */

#jt-joute-detail .jt-joute-podium-line {
    margin: 0 0 1rem;
    line-height: 1.55;
    color: var(--text-primary);
    font-size: 1rem;
}

#jt-joute-detail .jt-joute-result-plateau {
    margin-top: 1.15rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--border-color);
}

#jt-joute-detail .jt-joute-result-plateau:first-of-type {
    margin-top: 0.35rem;
    padding-top: 0;
    border-top: none;
}

#jt-joute-detail .jt-joute-bc-totaux-h {
    margin: 1.5rem 0 0.65rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

#jt-joute-detail .jt-joute-bc-totaux-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 28rem;
}

#jt-joute-detail .jt-joute-bc-totaux-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.98rem;
}

#jt-joute-detail .jt-joute-bc-totaux-list li:last-child {
    border-bottom: none;
}

#jt-joute-detail .jt-bc-eq {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
}

#jt-joute-detail .jt-bc-num {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    flex-shrink: 0;
}

#jt-joute-detail .jt-joute-resultats-intro {
    margin: -0.35rem 0 1rem;
}

#jt-joute-detail .jt-joute-res-rank {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

#jt-joute-detail .jt-joute-res-medal {
    display: inline-block;
    font-size: 1.75rem;
    line-height: 1;
}

#jt-joute-detail .jt-joute-res-sol {
    text-align: right;
    white-space: nowrap;
}

#jt-joute-detail .jt-joute-bc-totaux-list li {
    align-items: center;
}

#jt-joute-detail .jt-joute-bc-totaux-chip {
    flex: 1 1 auto;
    min-width: 0;
}

/* —— Animateur : podium visuel (maquette docs/design/podium.html) —— */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;900&display=swap');

#jt-animer .jt-animer-results-mid {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    justify-content: stretch;
}

.jt-animer-podium-root {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.jt-animer-podium-panel {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.jt-animer-podium-panel[hidden] {
    display: none;
}

.jt-animer-podium-root > .jt-animer-podium-panel:not([hidden]) {
    flex: 1 1 auto;
    min-height: 0;
}

.jt-animer-plateau-tabs--results {
    flex: 0 0 auto;
}

.jt-animer-podium-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: clamp(0.25rem, 0.8cqh, 0.5rem) clamp(0.25rem, 1vw, 0.65rem)
        clamp(0.25rem, 0.8cqh, 0.5rem);
    box-sizing: border-box;
    background: linear-gradient(180deg, #0d1530 0%, #0a0f25 40%, #0d1530 100%);
    border: 2px solid rgba(0, 180, 255, 0.25);
    border-radius: clamp(10px, 1.5vw, 16px);
    overflow: hidden;
    container-type: size;
    container-name: jt-podium-stage;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: clamp(0.15rem, 0.8cqh, 0.45rem);
    /* Socle : hauteur max × facteur de rang (ex-aequo = même rang → même hauteur) */
    --jt-p-box-h-max: min(52cqh, 17.5rem);
    --jt-p-box-scale-r1: 1;
    --jt-p-box-scale-r2: 0.72;
    --jt-p-box-scale-r3: 0.52;
    --jt-p-circle-23: min(16cqh, 14cqi, 6.75rem);
    --jt-p-circle-1: min(18cqh, 16cqi, 7.75rem);
    --jt-p-overlap: min(3cqh, 2.8cqi, 1.35rem);
    --jt-p-name: min(2.8cqh, 3cqi, 1.15rem);
    --jt-p-score: min(6.5cqh, 7.5cqi, 2.85rem);
    --jt-p-score-lg: min(7.2cqh, 8.2cqi, 3.2rem);
    --jt-p-score-unit: min(3.2cqh, 3.8cqi, 1.35rem);
    --jt-p-score-unit-lg: min(3.5cqh, 4.1cqi, 1.5rem);
    --jt-p-box-pad-y: min(1.5cqh, 1.8cqi, 0.85rem);
}

@container jt-podium-stage (min-height: 22rem) {
    .jt-animer-podium-stage {
        --jt-p-box-h-max: min(56cqh, 19rem);
        --jt-p-circle-23: min(17cqh, 15cqi, 7.25rem);
        --jt-p-circle-1: min(19.5cqh, 17cqi, 8.25rem);
    }
}

.jt-animer-podium-stage-title {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    margin: 0;
    padding: clamp(0.35rem, 1.4cqh, 0.9rem) clamp(0.5rem, 2cqi, 1rem) clamp(0.15rem, 0.6cqh, 0.35rem);
    text-align: center;
}

.jt-animer-podium-plateau-name {
    margin: 0;
    font-family: 'Montserrat', 'Barlow', sans-serif;
    font-weight: 900;
    font-size: clamp(0.8rem, 3.8cqh, 1.45rem);
    line-height: 1.2;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #e8faff;
    text-shadow:
        0 0 24px color-mix(in srgb, #22d3ee 45%, transparent),
        0 0 48px color-mix(in srgb, #22d3ee 18%, transparent);
}

.jt-animer-podium-plateau-name-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.65rem, 3cqi, 1.25rem);
    max-width: 100%;
}

.jt-animer-podium-plateau-name-text::before,
.jt-animer-podium-plateau-name-text::after {
    content: '';
    flex: 0 1 auto;
    width: clamp(1.5rem, 8cqi, 4.5rem);
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.65));
    opacity: 0.85;
}

.jt-animer-podium-plateau-name-text::after {
    background: linear-gradient(90deg, rgba(0, 200, 255, 0.65), transparent);
}

.jt-animer-podium-stage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 60%, rgba(0, 200, 255, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.jt-animer-podium-fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.jt-animer-podium-streaks {
    position: absolute;
    inset: 0;
}

.jt-animer-podium-streak {
    position: absolute;
    height: 2px;
    opacity: 0.1;
}

.jt-animer-podium-streak--bleu {
    background: linear-gradient(90deg, transparent, #00aaff, transparent);
    top: 50%;
    left: -10%;
    width: 50%;
    transform: rotate(-15deg);
}

.jt-animer-podium-streak--bleu2 {
    background: linear-gradient(90deg, transparent, #00aaff, transparent);
    top: 55%;
    left: -10%;
    width: 55%;
    transform: rotate(-20deg);
}

.jt-animer-podium-streak--vert {
    background: linear-gradient(90deg, transparent, #00ff70, transparent);
    top: 40%;
    left: 30%;
    width: 40%;
    transform: rotate(-5deg);
}

.jt-animer-podium-streak--rouge {
    background: linear-gradient(90deg, transparent, #ff3050, transparent);
    top: 50%;
    right: -10%;
    width: 50%;
    transform: rotate(15deg);
}

.jt-animer-podium-streak--rouge2 {
    background: linear-gradient(90deg, transparent, #ff3050, transparent);
    top: 55%;
    right: -10%;
    width: 55%;
    transform: rotate(20deg);
}

.jt-animer-podium-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(0.35rem, 2.2cqi, 1.35rem);
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    max-height: 100%;
    min-height: 0;
    margin: 0;
    align-self: stretch;
    box-sizing: border-box;
    font-family: 'Montserrat', 'Barlow', sans-serif;
}

.jt-animer-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: auto;
    max-height: 100%;
    max-width: min(100%, 20rem);
    opacity: 0;
    transform: translateY(1.25rem);
    animation: jt-podium-item-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.jt-animer-podium-item--place-2 {
    order: 1;
    animation-delay: 0.15s;
}

.jt-animer-podium-item--place-1 {
    order: 2;
    animation-delay: 0.35s;
}

.jt-animer-podium-item--place-3 {
    order: 3;
    animation-delay: 0.55s;
}

.jt-animer-podium-item--rang-1 {
    --jt-p-box-scale: var(--jt-p-box-scale-r1);
}

.jt-animer-podium-item--rang-2 {
    --jt-p-box-scale: var(--jt-p-box-scale-r2);
}

.jt-animer-podium-item--rang-3 {
    --jt-p-box-scale: var(--jt-p-box-scale-r3);
}

@keyframes jt-podium-item-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jt-animer-podium-item--couleur-vert {
    --jt-podium-rays: radial-gradient(
        ellipse at center,
        rgba(0, 220, 80, 0.25) 0%,
        rgba(0, 220, 80, 0.08) 30%,
        transparent 60%
    );
    --jt-podium-circle-bg: radial-gradient(circle at 40% 35%, #2ecc40 0%, #1a8a28 50%, #0e6018 100%);
    --jt-podium-circle-border: #3aff5a;
    --jt-podium-circle-glow: 0 0 30px rgba(0, 255, 70, 0.5), 0 0 60px rgba(0, 255, 70, 0.2),
        inset 0 0 20px rgba(0, 255, 70, 0.15);
    --jt-podium-box-bg: linear-gradient(180deg, #1a9a30 0%, #0e7020 50%, #0a5518 100%);
    --jt-podium-box-border: rgba(60, 255, 100, 0.5);
    --jt-podium-box-shadow: 0 0 20px rgba(0, 255, 70, 0.15);
}

.jt-animer-podium-item--couleur-bleu {
    --jt-podium-rays: radial-gradient(
        ellipse at center,
        rgba(0, 120, 255, 0.25) 0%,
        rgba(0, 120, 255, 0.08) 30%,
        transparent 60%
    );
    --jt-podium-circle-bg: radial-gradient(circle at 40% 35%, #1a7aff 0%, #0050cc 50%, #003599 100%);
    --jt-podium-circle-border: #4da6ff;
    --jt-podium-circle-glow: 0 0 30px rgba(0, 150, 255, 0.5), 0 0 60px rgba(0, 150, 255, 0.2),
        inset 0 0 20px rgba(0, 150, 255, 0.15);
    --jt-podium-box-bg: linear-gradient(180deg, #0a5acc 0%, #0044aa 50%, #003388 100%);
    --jt-podium-box-border: rgba(70, 160, 255, 0.5);
    --jt-podium-box-shadow: 0 0 20px rgba(0, 100, 255, 0.15);
}

.jt-animer-podium-item--couleur-rouge {
    --jt-podium-rays: radial-gradient(
        ellipse at center,
        rgba(255, 30, 60, 0.25) 0%,
        rgba(255, 30, 60, 0.08) 30%,
        transparent 60%
    );
    --jt-podium-circle-bg: radial-gradient(circle at 40% 35%, #ff2040 0%, #cc0020 50%, #990018 100%);
    --jt-podium-circle-border: #ff4060;
    --jt-podium-circle-glow: 0 0 30px rgba(255, 30, 60, 0.5), 0 0 60px rgba(255, 30, 60, 0.2),
        inset 0 0 20px rgba(255, 30, 60, 0.15);
    --jt-podium-box-bg: linear-gradient(180deg, #cc1030 0%, #aa0820 50%, #880518 100%);
    --jt-podium-box-border: rgba(255, 70, 100, 0.5);
    --jt-podium-box-shadow: 0 0 20px rgba(255, 30, 60, 0.15);
}

.jt-animer-podium-circle-wrap {
    position: relative;
    margin-bottom: calc(-1 * var(--jt-p-overlap));
    z-index: 2;
    flex: 0 0 auto;
}

.jt-animer-podium-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(140%, 12rem);
    height: min(140%, 12rem);
    background: var(--jt-podium-rays);
    pointer-events: none;
}

.jt-animer-podium-circle {
    width: var(--jt-p-circle-23);
    height: var(--jt-p-circle-23);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--jt-p-circle-23) * 0.52);
    font-weight: 900;
    color: #fff;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    background: var(--jt-podium-circle-bg);
    border: max(2px, calc(var(--jt-p-circle-23) * 0.04)) solid var(--jt-podium-circle-border);
    box-shadow: var(--jt-podium-circle-glow);
}

.jt-animer-podium-item--rang-1 .jt-animer-podium-circle {
    width: var(--jt-p-circle-1);
    height: var(--jt-p-circle-1);
    font-size: calc(var(--jt-p-circle-1) * 0.52);
}

.jt-animer-podium-score-box {
    width: 100%;
    max-width: 100%;
    height: calc(var(--jt-p-box-h-max) * var(--jt-p-box-scale, 1));
    min-height: 0;
    padding: var(--jt-p-box-pad-y) clamp(0.35rem, 1.5cqi, 0.75rem) var(--jt-p-box-pad-y);
    border-radius: 10px;
    text-align: center;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    background: var(--jt-podium-box-bg);
    border: 2px solid var(--jt-podium-box-border);
    box-shadow: var(--jt-podium-box-shadow);
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.jt-animer-podium-team-name {
    margin: min(0.35rem, 1cqh) 0 0;
    color: #fff;
    font-size: var(--jt-p-name);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.jt-animer-podium-score {
    margin: 0;
    color: #fff;
    font-size: var(--jt-p-score);
    font-weight: 900;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.jt-animer-podium-item--rang-1 .jt-animer-podium-score {
    font-size: var(--jt-p-score-lg);
}

.jt-animer-podium-score span {
    font-size: var(--jt-p-score-unit);
    font-weight: 700;
}

.jt-animer-podium-item--rang-1 .jt-animer-podium-score span {
    font-size: var(--jt-p-score-unit-lg);
}

.jt-animer-terminer-card {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

@supports not (height: 1cqh) {
    .jt-animer-podium-stage {
        min-height: clamp(12rem, 38vh, 20rem);
        --jt-p-box-h-max: min(42vw, 14rem);
        --jt-p-circle-23: min(20vw, 6rem);
        --jt-p-circle-1: min(22vw, 6.75rem);
        --jt-p-overlap: 1.1rem;
    }
}

@media (max-width: 640px) {
    .jt-animer-results-mid {
        overflow-y: auto;
    }

    .jt-animer-podium-stage {
        height: auto;
        min-height: min(70vh, 28rem);
        max-height: none;
    }

    .jt-animer-podium-wrapper {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 0.85rem;
        height: auto;
        padding-top: 0.35rem;
    }

    .jt-animer-podium-item,
    .jt-animer-podium-item--place-1,
    .jt-animer-podium-item--place-2,
    .jt-animer-podium-item--place-3 {
        order: unset;
        flex: 0 0 auto;
        width: min(100%, 16rem);
        max-width: 16rem;
        max-height: none;
    }

    .jt-animer-podium-item--place-1 {
        order: 1;
    }

    .jt-animer-podium-item--place-2 {
        order: 2;
    }

    .jt-animer-podium-item--place-3 {
        order: 3;
    }

    .jt-animer-podium-score-box {
        min-height: 5.5rem;
    }

    .jt-animer-podium-item--rang-1 .jt-animer-podium-score-box,
    .jt-animer-podium-item--rang-2 .jt-animer-podium-score-box,
    .jt-animer-podium-item--rang-3 .jt-animer-podium-score-box {
        height: auto;
        min-height: 5.25rem;
    }

    .jt-animer-podium-item--rang-1 .jt-animer-podium-score-box {
        min-height: 6.25rem;
    }

    .jt-animer-podium-item--rang-2 .jt-animer-podium-score-box {
        min-height: 5.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jt-animer-podium-item {
        opacity: 1;
        transform: none;
        animation: none;
    }
}
