/* VTA Compte à rebours - site
 * Couleurs du club : bleu VTA (#164c65 / #1e6080), orange (#c97c48) pour les accents.
 */

.vta-car {
    --car-c1: #164c65;
    --car-c2: #1e6080;
    --car-dark: #0f3a4d;
    --car-btn: #0f3a4d;
    --car-accent: #c97c48;
    --car-accent-2: #e09a62;
    --car-accent-text: #fff;
    position: relative;
    overflow: hidden;
    overflow: clip;
    max-width: 720px;
    margin: 24px auto;
    padding: 24px 24px 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--car-c1) 0%, var(--car-c2) 100%);
    color: #fff;
    font-size: 15px;
    line-height: 1.45;
    box-shadow: 0 10px 28px rgba(22, 76, 101, .25);
    isolation: isolate;
}

.vta-car--orange {
    --car-c1: #a85d2e;
    --car-c2: #d08a55;
    --car-dark: #7d431f;
    --car-btn: #164c65;
    --car-accent: #164c65;
    --car-accent-2: #1e6080;
    box-shadow: 0 10px 28px rgba(168, 93, 46, .28);
}

.vta-car *,
.vta-car *::before,
.vta-car *::after {
    box-sizing: border-box;
}

.vta-car [hidden] {
    display: none !important;
}

/* ---------- Décor : cercles et montagnes ---------- */

.vta-car::before,
.vta-car::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}
.vta-car::before {
    width: 220px;
    height: 220px;
    right: -70px;
    top: -90px;
    border: 2px solid rgba(255, 255, 255, .13);
}
.vta-car::after {
    width: 120px;
    height: 120px;
    left: -40px;
    top: 38%;
    border: 2px solid rgba(201, 124, 72, .4);
}
.vta-car--orange::after { border-color: rgba(22, 76, 101, .35); }

.vta-car-sky {
    position: absolute;
    z-index: -1;
    left: 0;
    right: 0;
    bottom: 0;
    height: 130px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 130' preserveAspectRatio='none'%3E%3Cpath d='M0 130V82l80-34 70 30 95-58 90 52 85-38 80 46 95-52 85 36 60-24 60 30v60z' fill='%23fff' fill-opacity='.06'/%3E%3Cpath d='M0 130v-24l110-34 95 28 115-40 100 40 120-36 115 32 145-26v60z' fill='%23fff' fill-opacity='.08'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
    pointer-events: none;
}

/* ---------- En-tête ---------- */

.vta-car-head {
    position: relative;
    min-height: 70px; /* place pour la pastille J-n, même sans titre */
    padding-right: 92px;
    margin-bottom: 20px;
}

.vta-car .vta-car-title {
    margin: 0 0 6px;
    color: #fff;
    font-size: clamp(22px, 4.2vw, 30px);
    font-weight: 800;
    line-height: 1.15;
}

.vta-car-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 14px;
    opacity: .9;
}

.vta-car-sticker {
    position: absolute;
    top: -4px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: var(--car-accent);
    color: var(--car-accent-text);
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -.02em;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .22), inset 0 0 0 3px rgba(255, 255, 255, .35);
    transform: rotate(-10deg);
    transition: transform .3s;
}
.vta-car-sticker:hover { transform: rotate(6deg) scale(1.08); }
.vta-car.is-soon .vta-car-sticker { animation: vta-car-pulse 1.6s ease-in-out infinite; }
.vta-car-sticker.is-long { font-size: 17px; }

/* ---------- Horloge ---------- */

.vta-car-clock {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
}

.vta-car-unit {
    flex: 1 1 0;
    max-width: 140px;
    padding: 12px 6px 10px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 14px;
    background: rgba(255, 255, 255, .12);
    text-align: center;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12);
    overflow: hidden;
}

.vta-car-unit--seconds {
    background: var(--car-accent);
    border-color: transparent;
}

.vta-car-num {
    display: block;
    font-size: clamp(32px, 7.5vw, 56px);
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .15);
}
.vta-car-num.is-tick { animation: vta-car-tick .45s cubic-bezier(.2, .9, .3, 1.2); }

.vta-car-label {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .85;
}

.vta-car-colon {
    align-self: center;
    margin-top: -18px;
    font-size: 32px;
    font-weight: 800;
    opacity: .5;
    animation: vta-car-blink 1s steps(1) infinite;
}

/* ---------- C'est parti ! ---------- */

.vta-car-go {
    padding: 14px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .12);
    text-align: center;
}
.vta-car-go-title {
    font-size: clamp(30px, 7vw, 48px);
    font-weight: 900;
    line-height: 1.1;
    animation: vta-car-bounce 1.2s ease-in-out infinite;
}
.vta-car-go-text {
    margin-top: 6px;
    font-size: 17px;
    font-weight: 600;
}

/* ---------- Route vers l'arrivée ---------- */

.vta-car-track {
    position: relative;
    margin: 30px 34px 4px 14px;
    height: 34px;
}

.vta-car-road {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 8px;
    border-radius: 8px;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .28) 0 10px, rgba(255, 255, 255, .12) 10px 18px);
    overflow: hidden;
}

.vta-car-progress {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--car-accent-2), var(--car-accent));
    transition: width 1s linear;
}
.vta-car--orange .vta-car-progress { background: linear-gradient(90deg, #4f8fac, var(--car-accent)); }

.vta-car .vta-car-runner {
    position: absolute;
    bottom: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    /* L'émoji regarde vers la gauche : on le retourne pour qu'il coure vers l'arrivée */
    transform: translateX(-50%) scaleX(-1);
    transition: left 1s linear;
}
.vta-car-runner { animation: vta-car-run .5s ease-in-out infinite alternate; }
.vta-car-runner.is-jump { animation: vta-car-jump .6s ease-out; }

.vta-car-flag {
    position: absolute;
    right: -30px;
    bottom: 2px;
    font-size: 26px;
    line-height: 1;
}

.vta-car-message {
    margin-top: 10px;
    min-height: 1.45em;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

/* ---------- Bouton « Accès événement » (pilule bleu foncé, texte blanc) ---------- */

.vta-car-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.vta-car .vta-car-btn {
    display: inline-block;
    margin: 0;
    padding: 13px 30px;
    border: 0;
    border-radius: 40px;
    background: var(--car-btn);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
    transition: transform .15s, box-shadow .15s, filter .15s;
}
.vta-car .vta-car-btn:hover,
.vta-car .vta-car-btn:focus-visible {
    color: #fff;
    text-decoration: none;
    filter: brightness(1.18);
    transform: translateY(-2px);
    box-shadow: 0 7px 16px rgba(0, 0, 0, .3);
}

/* ---------- États ---------- */

.vta-car.is-go .vta-car-clock,
.vta-car.is-past .vta-car-clock,
.vta-car.is-past .vta-car-track { display: none; }

.vta-car.is-go .vta-car-sticker { font-size: 15px; }

.vta-car.is-past {
    background: linear-gradient(135deg, #3e5866 0%, #5d7682 100%);
    box-shadow: 0 6px 18px rgba(22, 76, 101, .15);
}
.vta-car.is-past .vta-car-go-title { animation: none; font-size: clamp(24px, 5vw, 34px); }
.vta-car.is-past .vta-car-sticker { background: #8a9ba5; transform: rotate(-4deg); }

/* ---------- Transparent : sans fond ni décor, textes aux couleurs du club (pour une page claire) ---------- */

.vta-car--transparent,
.vta-car--transparent.is-past {
    --car-text: #164c65;
    --car-btn: #164c65;
    background: transparent;
    box-shadow: none;
    color: var(--car-text);
}
.vta-car.vta-car--transparent { padding-left: 0; padding-right: 0; }
.vta-car--transparent::before,
.vta-car--transparent::after,
.vta-car--transparent .vta-car-sky { display: none; }

.vta-car--transparent .vta-car-title { color: var(--car-text); }
.vta-car--transparent .vta-car-meta { color: #1f2d36; opacity: .8; }

.vta-car--transparent .vta-car-unit {
    border-color: rgba(22, 76, 101, .2);
    background: rgba(22, 76, 101, .06);
    box-shadow: inset 0 -4px 0 rgba(22, 76, 101, .1);
}
.vta-car--transparent .vta-car-num { text-shadow: none; }
.vta-car--transparent .vta-car-unit--seconds {
    border-color: transparent;
    background: var(--car-accent);
    color: #fff;
}

.vta-car--transparent .vta-car-road {
    background: repeating-linear-gradient(90deg, rgba(22, 76, 101, .25) 0 10px, rgba(22, 76, 101, .08) 10px 18px);
}

.vta-car--transparent .vta-car-go { background: rgba(22, 76, 101, .06); }

.vta-car--transparent.is-past { color: #5d7682; }
.vta-car--transparent.is-past .vta-car-title { color: #5d7682; }

/* ---------- Taille compacte ---------- */

.vta-car--compact {
    padding: 16px 16px 14px;
    border-radius: 14px;
    font-size: 14px;
}
.vta-car--compact .vta-car-head { min-height: 50px; padding-right: 64px; margin-bottom: 12px; }
.vta-car--compact .vta-car-title { font-size: 20px; margin: 0 0 4px; }
.vta-car--compact .vta-car-meta { font-size: 13px; }
.vta-car--compact .vta-car-sticker { width: 56px; height: 56px; font-size: 15px; }
.vta-car--compact .vta-car-num { font-size: 28px; }
.vta-car--compact .vta-car-unit { padding: 8px 4px 7px; border-radius: 10px; }
.vta-car--compact .vta-car-label { font-size: 10px; }
.vta-car--compact .vta-car-colon { display: none; }
.vta-car--compact .vta-car-actions { margin-top: 12px; }
.vta-car--compact .vta-car-btn { padding: 10px 22px; font-size: 14px; }

/* ---------- Confettis ---------- */

.vta-car-confetti {
    position: absolute;
    top: -14px;
    z-index: 5;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    pointer-events: none;
    animation: vta-car-fall var(--d, 2.6s) cubic-bezier(.25, .6, .4, 1) forwards;
}

/* ---------- Animations ---------- */

@keyframes vta-car-tick {
    /* Pas d'opacité : si le navigateur fige l'animation (onglet en arrière-plan), le chiffre reste lisible */
    0%   { transform: translateY(-30%) scale(.85); }
    100% { transform: none; }
}
@keyframes vta-car-blink {
    50% { opacity: .15; }
}
@keyframes vta-car-pulse {
    0%, 100% { transform: rotate(-10deg) scale(1); }
    50%      { transform: rotate(-10deg) scale(1.1); }
}
@keyframes vta-car-run {
    from { transform: translateX(-50%) translateY(0) scaleX(-1); }
    to   { transform: translateX(-50%) translateY(-4px) scaleX(-1); }
}
@keyframes vta-car-jump {
    0%   { transform: translateX(-50%) translateY(0) scaleX(-1) rotate(0); }
    50%  { transform: translateX(-50%) translateY(-34px) scaleX(-1) rotate(-25deg); }
    100% { transform: translateX(-50%) translateY(0) scaleX(-1) rotate(-360deg); }
}
@keyframes vta-car-bounce {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}
@keyframes vta-car-fall {
    0%   { transform: translate(0, 0) rotate(0); opacity: 1; }
    100% { transform: translate(var(--x, 0), var(--h, 420px)) rotate(var(--r, 540deg)); opacity: 0; }
}

/* ---------- Petits écrans ---------- */

@media (max-width: 540px) {
    .vta-car { padding: 18px 14px 16px; border-radius: 14px; }
    .vta-car-head { min-height: 54px; padding-right: 66px; }
    .vta-car-sticker { width: 60px; height: 60px; font-size: 16px; }
    .vta-car-clock { gap: 6px; }
    .vta-car-colon { display: none; }
    .vta-car-unit { padding: 10px 2px 8px; border-radius: 10px; }
    .vta-car-label { font-size: 9px; letter-spacing: .04em; }
}

@media (prefers-reduced-motion: reduce) {
    .vta-car *,
    .vta-car { animation: none !important; transition: none !important; }
}
