body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Cambiado de height a min-height */
    margin: 0;
    background-color: #f0f0f0;
    overflow-x: auto; /* Permitir desplazamiento horizontal si es necesario */
}

.game-container {
    text-align: center;
    background-color: white;
    padding: 0px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 1960px; /* Aumentado para acomodar la pista más ancha */
    width: 100%;
    overflow-x: auto; /* Permitir desplazamiento dentro del contenedor */
}

.screen {
    display: block;
}

.hidden {
    display: none;
}

/* Estilos para el lobby */
.join-form {
    margin: 20px 0;
}

.join-form input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.lobby-info {
    margin-top: 30px;
}

#player-list {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
}

#player-list li {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

#player-list li:last-child {
    border-bottom: none;
}

/* Estilos para el juego */
.instructions {
    margin-bottom: 20px;
}

.instructions span {
    font-weight: bold;
    background-color: #eee;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 0 3px;
}

.race-track {
    position: relative;
    width: 1920px; /* Nuevo ancho específico */
    height: 820px; /* Nuevo alto específico */
    background-color: #ddd;
    background-image: url('images/background.png');
    background-size: cover;
    background-position: center;
    margin: 20px auto; /* Centrado horizontal */
    border-radius: 5px;
    overflow: hidden;
}

.start-line {
    left: 100px; /* Ajustado para la pista más ancha */
}

.finish-line {
    right: 100px; /* Ajustado para la pista más ancha */
}

.player-ball {
    position: absolute;
    width: 60px; /* Ajustado para las imágenes de corredores */
    height: 100px; /* Ajustado para las imágenes de corredores */
    transition: left 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5; /* Asegurar que esté por encima del fondo */
}

.player-name {
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: bold;
}

.runner-sprite {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
}
.countdown {
    font-size: 100px;
    font-weight: bold;
    color: #ff5722;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Estilos para los resultados */
.results-container {
    margin: 20px 0;
}

#rankings-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

#rankings-table th, #rankings-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
}

#rankings-table th {
    background-color: #f2f2f2;
}

#rankings-table tr:first-child td {
    background-color: #ffd700; /* Oro para el primer lugar */
}

#rankings-table tr:nth-child(2) td {
    background-color: #c0c0c0; /* Plata para el segundo lugar */
}

#rankings-table tr:nth-child(3) td {
    background-color: #cd7f32; /* Bronce para el tercer lugar */
}

button {
    padding: 10px 20px;
    margin: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}