* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fontdiner Swanky', serif;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

.pista {
    width: 100vw;
    height: 100vh;
    background-image: url('pista.png');
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}


.cavalos {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: flex-start;

    transform: translateY(0px);

    gap: 20px;
}

.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    min-width: 220px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 2px solid #FDD134;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    font-size: 0.95rem;
    display: none;
}

.hud-visible {
    display: block;
}

.hud-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 11;
    width: 72px;
    height: 72px;
    padding: 0;
    border: none;
    background: transparent;
    color: #FDD134;
    text-shadow: 2px 2px 0 #000;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    font-size: 4rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.hud-toggle:hover,
.hud-toggle:focus {
    transform: scale(1.1);
    color: #fff;
    outline: none;
}

.hud-toggle:focus-visible {
    outline: 2px solid #ffd966;
    outline-offset: 3px;
}

.hud-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.hud-item:last-child {
    margin-bottom: 0;
}

.hud-name {
    font-weight: 700;
    color: #ffd966;
}

.hud-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.88rem;
}

.hud-label {
    opacity: 0.85;
}

.hud-value {
    font-weight: 600;
}

.cavalo {
    --tamanho: 16rem;

    position: relative;
    left: 30px;

    width: var(--tamanho);
    height: var(--tamanho);

    margin-bottom: -200px;
    /* aproxima um do outro */

    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    transition: left 0.05s linear;

    display: flex;
    align-items: center;
    justify-content: center;
}

.cavalo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


.cavalo.correndo {
    animation: correr 0.5s infinite;
}

@keyframes correr {
    33% {
        transform: rotate(5deg);
    }

    66% {
        transform: rotate(-5deg);
    }
}



/* =========================================
   TELA DE PÓDIO - FINALIZADA (5 LUGARES)
   ========================================= */

.podium-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    /* Fundo preto transparente */
    display: none;
    /* Fica escondido até o JS chamar */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'Fontdiner Swanky', cursive;
}

.podium-content {
    text-align: center;
    background: rgba(30, 30, 30, 0.95);
    padding: 30px;
    border: 5px solid #FDD134;
    border-radius: 40px;
    box-shadow: 0 0 50px rgba(253, 209, 52, 0.2);
    max-width: 95%;
}

.titulo-podio {
    color: #FDD134;
    font-size: 3.5rem;
    text-shadow: 4px 4px 0 #000;
    margin-bottom: 20px;
}

.podium-container {
    display: flex;
    align-items: flex-end;
    /* Alinha os blocos na base */
    justify-content: center;
    gap: 15px;
    margin: 40px 0;
    height: 350px;
    /* Altura total do gráfico do pódio */
}

.podium-step {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-block {
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #000;
    font-weight: bold;
    border: 3px solid #000;
    border-radius: 15px 15px 0 0;
}

/* --- Alturas e Cores por Colocação --- */
.first .step-block {
    height: 180px;
    background: #FDD134;
    /* Ouro */
}

.second .step-block {
    height: 140px;
    background: #C0C0C0;
    /* Prata */
}

.third .step-block {
    height: 100px;
    background: #CD7F32;
    /* Bronze */
}

.fourth .step-block {
    height: 70px;
    background: #7a7a7a;
    /* Cinza Escuro */
    color: #fff;
}

.fifth .step-block {
    height: 45px;
    background: #444;
    /* Quase Preto */
    color: #fff;
}

/* --- Imagens e Nomes --- */
.char-img img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(4px 4px 0px rgba(0, 0, 0, 0.8));
}

.name {
    margin-top: 10px;
    color: #fff;
    font-size: 1rem;
    text-shadow: 2px 2px 0 #000;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botão de Jogar Novamente */
.btn-jogar {
    margin-top: 20px;
    padding: 15px 40px;
    background-color: #1fa64a;
    border: 3px solid #000000;
    border-radius: 999px;
    font-family: 'Fontdiner Swanky', cursive;
    font-size: 24px;
    color: #FDD134;
    cursor: pointer;
    transition: 0.2s ease-in-out;
    text-shadow: 1px 1px 0 #000;
}

.btn-jogar:hover {
    background-color: #209942;
    transform: scale(1.05);
}