/* ---------------- Pódio (scripts/podio.js) ----------------
   Usado no topo do modal "Resultados dessa etapa" (Etapas) e na aba da rodada (Tabela).
   Os três primeiros sobre a foto da pista (a classe da pista dá o background-image).
   Degraus 2 · 1 · 3 nas cores das medalhas; o número da posição é grande e a base
   do degrau o corta, como placa de box. Texto em <b>: o tema pinta todo <span>. */

.podio {
    --podio-ouro: linear-gradient(160deg, #f6dd7a 0%, #e5c25f 38%, #b98d24 100%);
    --podio-prata: linear-gradient(160deg, #f1f3f6 0%, #c9ced6 40%, #8d949e 100%);
    --podio-bronze: linear-gradient(160deg, #e2a978 0%, #b67a4a 42%, #7a4a26 100%);
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    padding: 14px 14px 0;
    border-radius: 12px;
    background-color: #0b0f14;
    background-size: cover;
    background-position: center;
    isolation: isolate;
}

/* A foto escurece para baixo até sumir no fundo dos degraus */
.podio::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(8, 11, 15, .55) 0%, rgba(8, 11, 15, .72) 45%, rgba(8, 11, 15, .96) 100%);
}

.podio__titulo {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 10px;
    margin-bottom: 12px;
}

.podio__eyebrow {
    flex-basis: 100%;
    font-family: Rajdhani, sans-serif;
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
}

.podio__grid {
    font-family: Rajdhani, sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.05;
    color: #fff;
}

.podio__pista {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, .7);
}

.podio__degraus {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 6px;
}

.podio__lugar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: center;
}

button.podio__lugar {
    cursor: pointer;
}

button.podio__lugar:focus-visible {
    outline: 2px solid #ffe500;
    outline-offset: 3px;
    border-radius: 6px;
}

.podio__piloto {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0 2px 8px;
    min-width: 0;
}

.podio__flag {
    width: 26px;
    height: 17px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), 0 1px 3px rgba(0, 0, 0, .5);
}

.podio__nome {
    max-width: 100%;
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.15;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podio__pts {
    font-family: Rajdhani, sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    color: #ffe500;
    font-variant-numeric: tabular-nums;
}

.podio__pts small {
    margin-left: 2px;
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 229, 0, .7);
}

.podio__lugar--1 .podio__nome {
    font-size: 15px;
}

.podio__lugar--1 .podio__pts {
    font-size: 22px;
}

/* O degrau: metal da medalha, com o número grande cortado pela base */
.podio__degrau {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 -6px 18px rgba(0, 0, 0, .35);
    transform-origin: bottom;
}

.podio__num {
    font-family: Rajdhani, sans-serif;
    font-weight: 700;
    line-height: .8;
    margin-top: 6px;
    color: rgba(20, 16, 6, .78);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}

.podio__lugar--1 .podio__degrau {
    height: 104px;
    background: var(--podio-ouro);
}

.podio__lugar--2 .podio__degrau {
    height: 78px;
    background: var(--podio-prata);
}

.podio__lugar--3 .podio__degrau {
    height: 60px;
    background: var(--podio-bronze);
}

.podio__lugar--1 .podio__num {
    font-size: 104px;
}

.podio__lugar--2 .podio__num {
    font-size: 84px;
}

.podio__lugar--3 .podio__num {
    font-size: 70px;
    color: rgba(40, 20, 6, .75);
}

.podio__lugar--vazio .podio__degrau {
    opacity: .35;
}

/* Os degraus sobem na abertura: 3º, 2º e por último o 1º */
@media (prefers-reduced-motion: no-preference) {
    .podio__degrau {
        animation: podio-sobe 520ms cubic-bezier(.2, .8, .2, 1) both;
    }

    .podio__piloto {
        animation: podio-aparece 360ms ease-out both;
    }

    .podio__lugar--3 .podio__degrau { animation-delay: 60ms; }
    .podio__lugar--2 .podio__degrau { animation-delay: 180ms; }
    .podio__lugar--1 .podio__degrau { animation-delay: 300ms; }
    .podio__lugar--3 .podio__piloto { animation-delay: 380ms; }
    .podio__lugar--2 .podio__piloto { animation-delay: 480ms; }
    .podio__lugar--1 .podio__piloto { animation-delay: 600ms; }
}

@keyframes podio-sobe {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes podio-aparece {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 380px) {
    .podio__nome { font-size: 12px; }
    .podio__lugar--1 .podio__nome { font-size: 13.5px; }
    .podio__lugar--1 .podio__degrau { height: 92px; }
    .podio__lugar--2 .podio__degrau { height: 70px; }
    .podio__lugar--3 .podio__degrau { height: 54px; }
}

/* Na Tabela: o pódio fica entre as abas das rodadas e a tabela */
.podio-rodada[hidden] {
    display: none;
}

.podio-rodada {
    margin: 0 5px 14px;
}

.podio-rodada .podio {
    margin-bottom: 0;
}

/* ---------------- Pole e volta mais rápida (abaixo dos degraus) ----------------
   Azul da pole e roxo da volta mais rápida: as mesmas cores das colunas
   Pole e VMR do painel admin (o roxo é o da volta mais rápida na F1). */

.podio {
    --podio-pole: #2f7bff;
    --podio-vmr: #9b5cff;
}

.podio__destaques {
    display: flex;
    gap: 6px;
    margin: 0 -14px;
    padding: 10px 14px 12px;
    background: #0b0f14;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.podio__destaque {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .045);
}

.podio__destaque--pole { --podio-cor: var(--podio-pole); }
.podio__destaque--vmr { --podio-cor: var(--podio-vmr); }

.podio__marca {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--podio-cor);
    color: #fff;
    font-family: Rajdhani, sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
}

.podio__marca svg {
    width: 16px;
    height: 16px;
}

.podio__destaque-txt {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.podio__destaque-rotulo {
    font-family: Rajdhani, sans-serif;
    font-weight: 700;
    font-size: 9.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
    white-space: nowrap;
}

.podio__destaque-nome {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, .78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podio__tempo {
    margin: 3px 0 2px;
    font-family: Rajdhani, sans-serif;
    font-weight: 700;
    font-size: 21px;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

.podio__tempo--vazio {
    color: rgba(255, 255, 255, .28);
}

/* Tela estreita: os dois destaques um embaixo do outro */
@media (max-width: 340px) {
    .podio__destaques {
        flex-direction: column;
    }
}

/* O "1" das colunas P e W nas tabelas de resultado, nas mesmas cores */
.marca-pole,
.marca-vmr {
    font-weight: 700;
}

.marca-pole { color: #1d5fd6; }
.marca-vmr { color: #7b3fe4; }
.theme-dark .marca-pole { color: #6ea4ff; }
.theme-dark .marca-vmr { color: #b98cff; }
