/* Estilos para el coche en el canvas */
#car {
    position: absolute;
    bottom: 20px; 
    left: 50px;
    width: 50px;
    height: 20px;
    --car-body: #00bfff; 
    --window: #f0f8ff;   
    --wheel: #111;       
    background-color: var(--car-body);
    box-shadow: 
        -2px -2px 0 var(--window),
        2px -2px 0 var(--window),
        -2px 2px 0 var(--wheel),
        2px 2px 0 var(--wheel);
}

#car::before,
#car::after {
    content: '';
    position: absolute;
    bottom: -5px;
    width: 10px;
    height: 10px;
    background-color: var(--wheel);
    border-radius: 50%;
}

#car::before { left: 5px; }
#car::after { right: 5px; }

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--dark-grey);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    margin-top: 20px;
}

.game-container h2 {
    color: var(--electric-blue);
    font-size: 2.5em;
    margin-bottom: 20px;
}

.game-info-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 600px;
    margin-bottom: 10px;
    color: #fff;
    font-size: 1.2em;
}

#game-area {
    position: relative;
    width: 100%;
    max-width: 600px;
    border-radius: 5px;
    overflow: hidden;
}

#game-canvas {
    background-color: #f0f0f0;
    border: 5px solid #333;
}

.controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.game-btn {
    background-color: var(--electric-blue);
    color: var(--white);
    padding: 12px 25px;
    font-size: 1.1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.game-btn:hover {
    background-color: var(--dark-blue);
    transform: translateY(-2px);
}

/* ==== Estilos Ranking ==== */
.ranking-list {
    list-style: none;
    padding: 0;
    width: 100%;
    max-width: 400px;
    margin-top: 15px;
    font-size: 1.2em;
    color: #fff;
}

.ranking-list li {
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 8px;
    font-weight: 500;
    transition: transform 0.2s;
}

.ranking-list li:hover {
    transform: scale(1.03);
}

.ranking-list li.top-1 {
    background: linear-gradient(90deg, #ffd700, #ffea00);
}
.ranking-list li.top-2 {
    background: linear-gradient(90deg, #c0c0c0, #dcdcdc);
}
.ranking-list li.top-3 {
    background: linear-gradient(90deg, #cd7f32, #e1a95f);
}

.ranking-text {
    color: #fff !important;
    font-weight: bold;
}
