* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    overflow: hidden;
    background-color: #000;
}

canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Loading Screen */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.loading-container {
    text-align: center;
    color: #fff;
}

.loading-container h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: #f2a365;
    text-shadow: 0 0 10px rgba(242, 163, 101, 0.7);
}

.progress-bar {
    width: 300px;
    height: 20px;
    background-color: #16213e;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: #f2a365;
    transition: width 0.3s ease;
}

.loading-text {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: #e9e9e9;
}

/* Game UI */
#game-ui {
    position: absolute;
    width: 100%;
    padding: 20px;
    color: #fff;
    font-size: 24px;
    display: none;
    z-index: 100;
}

#score {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

#gems {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

#timer {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

#fps-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    transform: rotate(-2deg);
}

/* Estilo para el contador de puntos */
#score-counter {
    position: fixed;
    top: 70px;
    left: 10px;
    color: #ffcc00;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 2px solid rgba(255, 204, 0, 0.5);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.7);
    transform: rotate(-1deg);
}

/* Estilos para el contador de jugadores */
#players-counter {
    position: fixed;
    top: 40px;
    left: 10px;
    color: #66ccff; /* Azul claro para jugadores */
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 2px solid rgba(102, 204, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(102, 204, 255, 0.7);
    transform: rotate(-1deg);
}

/* Start Screen */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.start-container {
    text-align: center;
    color: #fff;
}

.start-container h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #f2a365;
    text-shadow: 0 0 15px rgba(242, 163, 101, 0.7);
}

.start-container p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #e9e9e9;
}

#start-button, #restart-button {
    padding: 15px 40px;
    font-size: 1.5rem;
    background-color: #f2a365;
    color: #1a1a2e;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#start-button:hover, #restart-button:hover {
    background-color: #e94560;
    transform: scale(1.05);
}

/* Game Over Screen */
#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.game-over-container {
    text-align: center;
    color: #fff;
}

.game-over-container h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #e94560;
    text-shadow: 0 0 15px rgba(233, 69, 96, 0.7);
}

.game-over-container p {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #e9e9e9;
}

.hidden {
    display: none !important;
}

#touch-controls {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
}

#touch-controls button:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0.95);
}

@media (hover: hover) {
    #touch-controls {
        display: none !important;
    }
}

/* Add this to your CSS file */
#sound-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

#mute-button {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    transform: rotate(2deg);
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

#mute-button:hover {
    background-color: rgba(50, 50, 50, 0.9);
    transform: scale(1.1) rotate(0deg);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#mute-button:active {
    transform: scale(0.95);
}

/* Estilos para la flecha de brújula */
.compass-arrow {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px; /* Aumentado de 30px a 40px para mayor visibilidad */
    color: #ffffff;
    text-shadow: 0 0 8px #000000, 0 0 15px #ff9900; /* Sombra más pronunciada y con brillo naranja */
    transition: transform 0.3s ease;
    z-index: 1000; /* Aumentado para asegurar que esté por encima de otros elementos */
    pointer-events: none; /* Para que no interfiera con los clics */
    animation: pulse 1.5s infinite alternate; /* Animación pulsante para llamar la atención */
}

@keyframes pulse {
    from { transform: translateX(-50%) scale(1); }
    to { transform: translateX(-50%) scale(1.2); }
}

/* Estilos para el campo de nombre del jugador */
.player-name-container {
    margin-bottom: 20px;
}

#player-name {
    padding: 12px 20px;
    font-size: 1.2rem;
    background-color: rgba(26, 26, 46, 0.8);
    color: #fff;
    border: 2px solid #f2a365;
    border-radius: 20px;
    width: 300px;
    text-align: center;
    transition: all 0.3s ease;
}

#player-name:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(242, 163, 101, 0.7);
    border-color: #e94560;
}

#player-name::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Estilos para el contenedor de mensajes del servidor */
#server-messages {
    position: fixed;
    top: 100px;
    left: 10px;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    max-height: 150px;
    overflow-y: auto;
    width: 300px;
    font-size: 14px;
    border: 2px solid rgba(100, 149, 237, 0.5);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Estilos para los mensajes individuales */
.server-message {
    margin-bottom: 5px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.server-message.connect {
    color: #90ee90; /* Verde claro para conexiones */
}

.server-message.egg {
    color: #ffa500; /* Naranja para huevos recolectados */
}

.server-message.disconnect {
    color: #ff6347; /* Rojo claro para desconexiones */
}

/* Estilos específicos para iPad */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
    .joystick-container {
        width: 150px !important;
        height: 150px !important;
    }
    
    .joystick-inner {
        width: 75px !important;
        height: 75px !important;
    }
    
    .mobile-button {
        width: 100px !important;
        height: 100px !important;
        font-size: 40px !important;
    }
    
    #boost-button, #sound-button {
        bottom: 40px !important;
    }
    
    #sound-button {
        right: 160px !important;
    }
}

/* Estilos para el botón de feedback */
#feedback-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

#ideas-bugs-button {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    font-family: 'Arial', sans-serif;
}

#ideas-bugs-button:hover {
    background-color: rgba(50, 50, 50, 0.9);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#ideas-bugs-button:active {
    transform: scale(0.95);
}