/* Fondo animado oscuro y moderno */
body {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  background-size: 300% 300%;
  animation: gradientBG 15s ease infinite;
  color: white;
  font-family: 'Segoe UI', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Título centrado */
.mero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mero h1 {
  margin-bottom: 30px;
  font-size: 2.5rem;
  letter-spacing: 2px;
  text-shadow: 0 0 10px #00ffcc;
}

/* Diseño de rejilla moderno */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
  padding: 40px;
  max-width: 1200px;
  width: 100%;
}

/* Contenedor individual de cada compuerta */
.gate-wrapper {
  width: 180px;
  height: 160px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s;
}

.gate-wrapper:hover {
  transform: scale(1.05);
}

.label {
  margin-top: 10px;
  font-size: 1.1rem;
  font-weight: bold;
}

/* SVG y líneas */
svg {
  width: 130px;
  height: 90px;
}

.input-line,
.output-line {
  stroke: white;
  stroke-width: 3;
}

.circle {
  fill: white;
  stroke: white;
  stroke-width: 1;
}

/* LEDs */
.led {
  cursor: pointer;
  stroke: black;
  stroke-width: 1;
  transition: fill 0.2s ease-in-out;
}

.led.off {
  fill: #333;
}

.led.on {
  fill: #00ff66;
  filter: drop-shadow(0 0 5px #00ff66);
}