body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 100%;
    padding: 15px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

.screen {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

.btn {
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.btn-photo {
    background-color: #FF9800;
}

.btn-primary {
    background-color: #4CAF50;
}

.btn-start {
    background-color: #2196F3;
}

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

.photo-preview-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 10px auto;
    display: none;
    border: 2px solid #ddd;
    position: relative;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.error-message {
    color: #f44336;
    font-size: 14px;
    text-align: center;
    margin: 5px 0;
    display: none;
}

.players-list {
    margin: 20px 0;
}

.player-card {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 10px;
}

.player-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

#game-container {
    position: relative;
    width: 100%;
    height: 80vh;
}

#balls-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.ball {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 24px;
    color: white;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    pointer-events: auto;
    animation: appear 0.3s ease-out;
    z-index: 100;
}

@keyframes appear {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.ball:hover {
    transform: scale(1.1);
}

.ball-1 { background-color: #FF5252; }
.ball-2 { background-color: #4CAF50; }
.ball-3 { background-color: #2196F3; }

.race-track {
    position: relative;
    height: 500px;
    background-color: #f9f9f9;
    border: 2px dashed #ccc;
    border-radius: 5px;
    margin-top: 20px;
}

.camel-container {
    position: absolute;
    width: 100px;
    height: 80px;
    transition: left 0.3s ease;
    z-index: 2;
    cursor: pointer;
}

.camel-body {
    position: relative;
    width: 100%;
    height: 100%;
}

.camel-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-on-camel {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    top: 10px;
    left: 30px;
    border: 2px solid white;
    z-index: 3;
}

.camel-stripe {
    position: absolute;
    width: 100%;
    height: 10px;
    bottom: 15px;
    left: 0;
    z-index: 2;
}

.camel-name {
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    text-shadow: 0 0 2px white;
}

.finish-line {
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: red;
    z-index: 1;
}

.selected-camel {
    border: 3px solid gold !important;
    box-shadow: 0 0 15px gold;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px gold; }
    50% { box-shadow: 0 0 20px gold; }
    100% { box-shadow: 0 0 5px gold; }
}

.results-list {
    margin-top: 20px;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
}

.position {
    font-weight: bold;
    margin-right: 15px;
    font-size: 20px;
}

.race-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.race-controls .btn {
    margin-bottom: 0;
}

.finished {
    animation: celebrate 0.5s infinite alternate;
}

@keyframes celebrate {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.my-player {
    background-color: #e3f2fd;
    border: 2px solid #2196F3;
}

.player-you {
    color: #2196F3;
    font-weight: bold;
    margin-left: 5px;
}

.my-camel {
    border: 3px solid #2196F3 !important;
}

.player-on-camel {
    border: 2px solid white;
}

.position-counter {
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    z-index: 5;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin: 30px 0;
    height: 250px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.first-place {
    height: 200px;
    width: 120px;
    background: linear-gradient(to bottom, #ffd700, #e6c200);
    border-radius: 10px 10px 0 0;
    order: 2;
}

.second-place {
    height: 150px;
    width: 120px;
    background: linear-gradient(to bottom, #c0c0c0, #a0a0a0);
    border-radius: 10px 10px 0 0;
    order: 1;
}

.third-place {
    height: 100px;
    width: 120px;
    background: linear-gradient(to bottom, #cd7f32, #b87333);
    border-radius: 10px 10px 0 0;
    order: 3;
}

.podium-position {
    font-size: 40px;
    margin-top: -50px;
    margin-bottom: 10px;
}

.podium-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    margin-bottom: 10px;
}

.podium-name {
    font-weight: bold;
    margin-top: 10px;
}

.others-list {
    margin-top: 40px;
}

.other-player {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.other-position {
    font-weight: bold;
    margin-right: 15px;
    min-width: 40px;
}

.other-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

.other-name {
    flex-grow: 1;
}

#enable-sound-btn {
    background-color: #9C27B0;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .player-card {
        flex-direction: column;
        text-align: center;
    }
    
    .player-photo {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .camel-container {
        width: 60px;
        height: 48px;
    }
    
    .player-on-camel {
        width: 24px;
        height: 24px;
        top: 6px;
        left: 18px;
    }
    
    .camel-stripe {
        height: 8px;
        bottom: 10px;
    }
    
    .camel-name {
        font-size: 10px;
        top: -15px;
    }
    
    .ball {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .race-controls {
        flex-direction: column;
    }
    
    #game-container {
        height: 70vh;
    }
    
    #enable-sound-btn {
        font-size: 14px;
        padding: 8px 12px;
    }
}
/* Añadir estos estilos al final del archivo */

.race-timer {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 24px;
    font-weight: bold;
    z-index: 1000;
    text-align: center;
}

#top-races-container {
    margin-top: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
}

.top-race-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.top-race-position {
    font-weight: bold;
    font-size: 18px;
    margin-right: 15px;
    min-width: 30px;
    text-align: center;
}

.top-race-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

.top-race-info {
    flex-grow: 1;
}

.top-race-name {
    font-weight: bold;
}

.top-race-time {
    color: #2196F3;
    font-size: 14px;
}

.top-race-date {
    color: #666;
    font-size: 12px;
}

@media (max-width: 768px) {
    .race-timer {
        font-size: 18px;
        padding: 8px 15px;
    }
    
    .top-race-item {
        padding: 8px;
    }
    
    .top-race-photo {
        width: 30px;
        height: 30px;
    }
}
/* Añade estos estilos al final de tu archivo CSS */

.race-timer {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 24px;
    font-weight: bold;
    z-index: 1000;
    text-align: center;
}

.podium-time, .other-time {
    color: #2196F3;
    font-size: 14px;
    font-weight: bold;
    margin-top: 5px;
}

.other-time {
    color: #666;
}

.top-race-time {
    color: #2196F3;
    font-weight: bold;
}

.top-race-date {
    color: #666;
    font-size: 12px;
}

@media (max-width: 768px) {
    .race-timer {
        font-size: 18px;
        padding: 8px 15px;
    }
    
    .podium-time, .other-time {
        font-size: 12px;
    }
}

/* Añadir al final del archivo */

/* Estilos para el podio mejorado */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin: 30px 0;
    height: 250px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 120px;
    border-radius: 10px 10px 0 0;
}

.first-place {
    height: 200px;
    background: linear-gradient(to bottom, #ffd700, #e6c200);
}

.second-place {
    height: 150px;
    background: linear-gradient(to bottom, #c0c0c0, #a0a0a0);
}

.third-place {
    height: 100px;
    background: linear-gradient(to bottom, #cd7f32, #b87333);
}

.podium-points {
    font-weight: bold;
    margin-top: 5px;
    color: #333;
}

.other-points {
    color: #666;
    font-size: 14px;
}

/* Botón de sonido */
.btn-sound-on {
    background-color: #4CAF50;
}

.btn-sound-off {
    background-color: #f44336;
}

#toggle-sound-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    padding: 8px 12px;
    font-size: 14px;
}

/* Asegurar que las fotos del top se muestren correctamente */
.top-race-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

@media (max-width: 768px) {
    .podium-container {
        height: auto;
        flex-direction: column;
        align-items: center;
    }
    
    .podium-place {
        width: 80%;
        height: auto !important;
        padding: 10px;
        margin-bottom: 10px;
        border-radius: 10px;
    }
    
    #toggle-sound-btn {
        top: 5px;
        right: 5px;
        padding: 6px 10px;
    }
}
