/* Global Styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    color: #ece9e9;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* Main layout elements */
main {
    width: 100%;
    padding: 0 10%;
}

header {
    background-color: #1a1a1a;
    color: #fff;
    padding: 15px;
    text-align: center;
}

/* Navigation styles */
nav {
    margin: 1px;
}

nav a {
    display: inline-block;
    color: #fff;
    font-size: 1.2em;
    margin: 0 10px;
    text-decoration: none;
    position: relative;
}

nav a::before, nav a::after {
    content: attr(data-text);
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s ease;
}

nav a:hover::before, nav a:hover::after {
    opacity: 1;
}

/* Glitch effect */
.glitch, .glitch-text {
    position: relative;
    color: #fff;
    animation: glitch 1s infinite;
}

.glitch {
    font-size: 2em;
}

.glitch-text {
    font-family: 'Courier New', Courier, monospace;
    color: #f5f5f5;
    font-size: 18px;
    display: inline-block;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    text-shadow: -2px 0 #f00;
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.glitch::after {
    text-shadow: -2px 0 #0ff;
    animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    padding-top: 60px;
    animation: glitch-animation 0.6s ease-out;
}

.modal-content {
    background-color: #1e1e1e;
    color: #f5f5f5;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
}

.close {
    color: #888;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 38px;
    cursor: pointer;
}

.close:hover {
    color: #f5f5f5;
}

/* Board and game container */
.board {
    position: relative;
    width: 95vw;
    height: 95vh;
    background-color: #2f3e43;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

/* Target value styles */
.objetivo-container {
    text-align: center;
    margin-bottom: 20px;
}

.objetivo-text {
    font-size: 3vw;
    margin-bottom: 10px;
    text-shadow: 0 0 4px #33a28b;
}

.valor-objetivo {
    font-size: 7vw;
    padding: 10px 40px;
    display: inline-block;
    position: relative;
}

.valor-objetivo::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 6px solid #33a28b;
    border-radius: 10px;
}

/* Pots container */
.pots-container {
    display: flex;
    justify-content: space-around;
    margin-top: 30px; /* Reduced from 50px to move 20px higher */
}

/* Potentiometer styles */
.pot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.pot {
    width: 270px; /* Reduced by 10% from 300px */
    height: 270px; /* Reduced by 10% from 300px */
    background-color: #444;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), inset 0 -2px 5px rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: box-shadow 0.3s;
    border: 5px solid transparent;
    background-image: linear-gradient(45deg, #222, #666);
    border-color: #33a28b;
	
}

.pot:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7), inset 0 -2px 5px rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.8);
    border-color: #11a28b;
}

.knob {
    position: absolute;
    width: 14px; /* Slightly reduced from 16px */
    height: 108px; /* Reduced by 10% from 120px */
    background-color: #ece9e9;
    top: 18px; /* Adjusted from 20px */
    left: 50%;
    transform-origin: bottom center;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Player styles */
.player-title {
    font-family: 'Tauri', sans-serif;
    font-size: 24px;
    color: #ece9e9;
    margin-bottom: 15px;
    text-shadow: 0 0 2px #2f3e43;
}

.player1, .player2 {
    font-size: 20px;
    font-weight: bold;
}

.player1 {
    color: #3498db; /* Blue */
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.player2 {
    color: #e74c3c; /* Red */
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

/* Value display */
.valor {
    font-size: 5.4vw; /* Reduced by 10% from 6vw */
    margin-top: 25px; /* Reduced from 30px */
    background-color: rgba(0, 0, 0, 0.6);
    width: auto;
    min-width: 225px; /* Reduced by 10% from 250px */
    height: auto;
    padding: 18px 36px; /* Reduced by 10% from 20px 40px */
    border-radius: 12px;
    transition: opacity 0.3s;
    opacity: 0;
}

.valor.revealed {
    opacity: 1;
}

#valor1 {
    color: #3498db;
}

#valor2 {
    color: #e74c3c;
}

/* Buttons */
.check-button, .reset-button {
    background-color: #33a28b;
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.5vw;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.check-button:hover, .reset-button:hover {
    background-color: #2a8871;
    transform: translateY(-2px);
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.4);
}

.check-button {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.check-button:hover {
    transform: translateX(-50%) translateY(-2px);
}

.reset-button {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background-color: #95a5a6;
    padding: 12px 25px;
    font-size: 1vw;
    border-radius: 5px;
}

.reset-button:hover {
    background-color: #7f8c8d;
}

/* Game elements and UI */
.result {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2vw;
    text-align: center;
    padding: 15px 30px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.5s;
    width: auto;
}

.game-round, .score-board {
    font-size: 1.2vw;
    color: #ece9e9;
    position: absolute;
    top: 20px;
}

.game-round {
    right: 30px;
}

.score-board {
    left: 30px;
}

.mystery {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5vw;
    font-weight: bold;
    opacity: 0.3;
}

#connect, #disconnect {
    position: absolute;
    top: 80px;
    right: 30px;
    padding: 10px 20px;
    font-size: 1vw;
    margin-top: 10px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
}

/* iframe styles */
iframe {
    width: 100%;
    height: 100vh;
    border: none;
}

#aboutModal iframe, #contactModal iframe {
    width: 100%;
    height: 640px;
    border-radius: 8px;
}

/* Visibility helpers */
.visible {
    opacity: 1;
}

/* Animations */
@keyframes glitch {
    0% { transform: translate(0); text-shadow: 2px 2px #ff00c1; }
    20% { transform: translate(-2px, 2px); }
    33% { text-shadow: -2px -2px #00ffea; }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    66% { text-shadow: 2px -2px #00ffea, -2px 2px #ff00c1; }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); text-shadow: 2px 2px #ff00c1; }
}

@keyframes glitch-anim-1, @keyframes glitch-anim-2 {
    0%, 50% { clip: rect(42px, 9999px, 44px, 0); transform: skew(0.3deg); }
    5%, 10%, 15%, 20%, 25%, 30%, 35%, 40%, 45% { clip: rect(24px, 9999px, 90px, 0); transform: skew(0.3deg); }
}

@keyframes glitch-animation {
    0%, 100% { transform: translate(0); }
    20%, 80% { transform: translate(-5px, 5px); }
    40%, 60% { transform: translate(5px, -5px); }
}

/* Media Queries */
@media (max-width: 768px) {
body {
            font-family: Arial, sans-serif;
            background-color: #1a1a1a;
            color: #ece9e9;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        
        .board {
            position: relative;
            width: 800px;
            height: 550px;
            background-color: #2f3e43;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
        }
        
        .objetivo-container {
            text-align: center;
            margin-bottom: 10px;
				 margin-top: 40px;
        }
        
        .objetivo-text {
            font-family: 'Tauri', sans-serif;
            font-size: 24px;
            color: #ece9e9;
            margin-bottom: 10px;
            text-shadow: 0 0 2px #33a28b;
        }
        
        .valor-objetivo {
            font-family: 'Tauri', sans-serif;
            font-size: 36px;
            color: #ece9e9;
            padding: 10px 20px;
            display: inline-block;
            position: relative;
        }
        
        .valor-objetivo::after {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            border: 4px solid #33a28b;
            border-radius: 5px;
        }
        
        .pots-container {
            display: flex;
            justify-content: space-around;
            margin-top: 50px;
        }
        
        .pot-container {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        .pot {
            width: 150px;
            height: 150px;
            background-color: #444;
            border-radius: 50%;
            position: relative;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), inset 0 -2px 5px rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.8);
            cursor: pointer;
            transition: box-shadow 0.3s;
        }
        
        .pot:hover {
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7), inset 0 -2px 5px rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.8);
        }
        
        .knob {
            position: absolute;
            width: 8px;
            height: 60px;
            background-color: #ece9e9;
            top: 15px;
            left: 50%;
            transform-origin: bottom center;
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
        }
        
        .player-title {
            font-family: 'Tauri', sans-serif;
            font-size: 24px;
            color: #ece9e9;
            margin-bottom: 15px;
            text-shadow: 0 0 2px #2f3e43;
        }
        
        .player1 {
            color: #3498db;
        }
        
        .player2 {
            color: #e74c3c;
        }
        
        .valor {
            font-family: 'Tauri', sans-serif;
            font-size: 36px;
            margin-top: 20px;
            text-shadow: 0 0 2px #2f3e43;
            background-color: rgba(0, 0, 0, 0.5);
            width: 120px;
            height: 50px;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: 8px;
            transition: opacity 0.3s;
            opacity: 0;
        }
        
        .valor.revealed {
            opacity: 1;
        }
        
        #valor1 {
            color: #3498db;
        }
        
        #valor2 {
            color: #e74c3c;
        }
        
        .check-button {
            position: absolute;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            background-color: #33a28b;
            color: white;
            border: none;
            padding: 12px 25px;
            font-size: 18px;
            border-radius: 8px;
            cursor: pointer;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
            transition: all 0.3s;
        }
        
        .check-button:hover {
            background-color: #2a8871;
            transform: translateX(-50%) translateY(-2px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
        }
        
        .check-button:active {
            transform: translateX(-50%) translateY(0);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        
        .result {
            position: absolute;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 20px;
            text-align: center;
            padding: 10px 20px;
            background-color: rgba(0, 0, 0, 0.3);
            border-radius: 10px;
            opacity: 0;
            transition: opacity 0.5s;
            width: 80%;
        }
        
        .visible {
            opacity: 1;
        }
        
        .game-round {
            position: absolute;
            top: 20px;
            right: 20px;
            font-size: 18px;
            color: #ece9e9;
        }
        
        .score-board {
            position: absolute;
            top: 20px;
            left: 20px;
            font-size: 18px;
            color: #ece9e9;
        }
        
        .reset-button {
            position: absolute;
            bottom: 30px;
            right: 30px;
            background-color: #95a5a6;
            color: white;
            border: none;
            padding: 8px 15px;
            font-size: 14px;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .reset-button:hover {
            background-color: #7f8c8d;
        }
        
        .mystery {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 48px;
            font-weight: bold;
            opacity: 0.4;
        }
}

@media (max-width: 480px) {
    /* Estilo general para la pantalla más pequeña */
    body {
        font-family: Arial, sans-serif;
        background-color: #1a1a1a;
        color: #ece9e9;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .board {
        position: relative;
        width: 90vw;
        max-width: 800px;
        height: 80vh;
        max-height: 550px;
        background-color: #2f3e43;
        border-radius: 15px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        overflow: hidden;
    }

    /* Contenedor de los encabezados */
    .headers-container {
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }

    .game-round,
    .score-board {
        font-size: 16px;
        margin: 0;
        padding: 10px 0;
    }



    /* Contenedor de los potenciómetros alineados horizontalmente */
    .pots-container {
        display: flex;
        justify-content: space-around; /* Cambio de space-evenly a space-around para ajustar el espaciado */
        width: 100%;
        margin-bottom: 20px;
        padding: 0 10px; /* Espaciado adicional para evitar que los pots lleguen a los bordes */
        box-sizing: border-box; /* Asegura que el padding no afecte el ancho total */
    }

    .pot-container {

        display: flex;
        flex-direction: column;
        align-items: center;
        width: 33%; /* Ajusta el ancho de cada pot para que no se apilen */
			margin-bottom: 40px;

    }

    .pot {
        width: 120px; /* Ajuste de tamaño para pantallas pequeñas */
        height: 120px; /* Ajuste de tamaño para pantallas pequeñas */
        background-color: #444;
        border-radius: 50%;
        position: relative;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), inset 0 -2px 5px rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.8);
        cursor: pointer;
        transition: box-shadow 0.3s;
    }

    .pot:hover {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7), inset 0 -2px 5px rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.8);
    }

    .knob {
        position: absolute;
        width: 8px;
        height: 40px; /* Ajustado para que sea más pequeño */
        background-color: #ece9e9;
        top: 15px;
        left: 50%;
        transform-origin: bottom center;
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    }

    .player-title {
        font-family: 'Tauri', sans-serif;
        font-size: 18px; /* Ajustado para pantallas pequeñas */
        color: #ece9e9;
        margin-bottom: 10px;
        text-shadow: 0 0 2px #2f3e43;
    }

    .player1 {
        color: #3498db;
    }

    .player2 {
        color: #e74c3c;
    }

          .valor {
            font-family: 'Tauri', sans-serif;
            font-size: 36px;
            margin-top: 20px;
				margin-bottom: 40px;
            text-shadow: 0 0 2px #2f3e43;
            background-color: rgba(0, 0, 0, 0.5);
            width: 400px;
            height: 50px;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: 8px;
            transition: opacity 0.3s;
            opacity: 0;
        }

	#connect, #disconnect {
			opacity: 0;
	} 
        
        .valor.revealed {
            opacity: 1;
        }
        
        #valor1 {
            color: #3498db;
        }
        
        #valor2 {
            color: #e74c3c;
        }
} 

@media (max-height: 800px) {
  
    .check-button {
       margin-top: 60px;
        position: absolute;
        bottom:  350px;
        left: 50%;
        transform: translateX(-50%);
        background-color: #33a28b;
        color: white;
        border: none;
        padding: 12px 25px;
        font-size: 12px;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        transition: all 0.3s;
    }

    .check-button:hover {
        background-color: #2a8871;
        transform: translateX(-50%) translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    }

    .check-button:active {
        transform: translateX(-50%) translateY(0);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .reset-button {
        margin-top: 40px;
        position: absolute;
        bottom:  350px;
        right: 30px;
        background-color: #95a5a6;
        color: white;
        border: none;
        padding: 8px 15px;
        font-size: 8px;
        border-radius: 5px;
        cursor: pointer;
        transition: all 0.3s;
    }

    .reset-button:hover {
        background-color: #7f8c8d;
    }



    .mystery {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 48px;
        font-weight: bold;
        opacity: 0.4;
    }


        .result {
            position: absolute;
            bottom: 200px;
            width: 80%;
     	 		font-size: 18px;
      		margin-top: 15px;
      		 text-align: center;
	    }


        


}

    


@media (max-height: 630px) {
  
    .check-button {
       margin-top: 80px;
        position: absolute;
        bottom:  300px;
        left: 50%;
        transform: translateX(-50%);
        background-color: #33a28b;
        color: white;
        border: none;
        padding: 12px 25px;
        font-size: 12px;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        transition: all 0.3s;
    }

    .check-button:hover {
        background-color: #2a8871;
        transform: translateX(-50%) translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    }

    .check-button:active {
        transform: translateX(-50%) translateY(0);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .reset-button {
        margin-top: 40px;
        position: absolute;
        bottom:  300px;
        right: 30px;
        background-color: #95a5a6;
        color: white;
        border: none;
        padding: 8px 15px;
        font-size: 8px;
        border-radius: 5px;
        cursor: pointer;
        transition: all 0.3s;
    }

    .reset-button:hover {
        background-color: #7f8c8d;
    }



    .mystery {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 48px;
        font-weight: bold;
        opacity: 0.4;
    }


        .result {
            position: absolute;
            bottom: 200px;
            width: 80%;
     	 		font-size: 18px;
      		margin-top: 15px;
      		 text-align: center;
	    }


        


}

    
.knob:focus {
  outline: none;
}

 {
  touch-action: manipulation; /* Desactiva doble toque para zoom */
  -webkit-tap-highlight-color: transparent; /* En móviles, evita el highlight azul */
}